text
stringlengths
4
1.02M
meta
dict
from django.conf.urls import patterns, include, url from dashboard import views urlpatterns = patterns('', url(r'^get/travis$', views.get_travis_builds), url(r'^put/travis$', views.put_travis_build), url(r'^put/clear_travis$', views.clear_travis), url(r'^get/nightly$', views.get_nightly_builds), ur...
{ "content_hash": "4cefa0c5b961ebb549808b7d341fbf87", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 67, "avg_line_length": 41.529411764705884, "alnum_prop": 0.6742209631728046, "repo_name": "staticfloat/status.julialang.org", "id": "5374f816fad55709f103ce1b1ea357f98b299d53"...
"""Handling configuration files.""" #Copyright (C) 2010 Sebastian Heinlein <sevel@glatzor.de> # #Licensed under the GNU General Public License Version 2 # #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Founda...
{ "content_hash": "e5f8bb4fa30592b0c4988abd0bb938bb", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 78, "avg_line_length": 37.876543209876544, "alnum_prop": 0.4780530204259018, "repo_name": "yasoob/PythonRSSReader", "id": "3d7f76c9e574dc83c55e99e0d171d612aba3f5a3", "size...
"""reqwire: wire up Python requirements with pip-tools.""" from __future__ import absolute_import import io import sys import setuptools __all__ = ('setup',) def readme(): with io.open('README.rst') as fp: return fp.read() def setup(): """Package setup entrypoint.""" extra_requirements = { ...
{ "content_hash": "9b870d901c18b53f2c83e7d083140219", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 75, "avg_line_length": 29.2183908045977, "alnum_prop": 0.5310778914240756, "repo_name": "darvid/reqwire", "id": "80b424373af7133d7b8d967c2862317c62d67525", "size": "2564", ...
import sys import os import os.path import glob import shutil import logging import optparse from PIL import Image import pickle from tiler_functions import * class mergeOptions: def __init__(self, src_list): self.tms = None self.add_src_ext = None self.src_list = src_list self.re...
{ "content_hash": "627b7a32cc56c400be41ab9f6cde3e7f", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 151, "avg_line_length": 37.41754385964912, "alnum_prop": 0.5541072768192048, "repo_name": "manimaul/MX-Cart", "id": "45355897c22f59bc58cc1c572b11928cfd0abc8c", "size": "12...
import re from webob import exc as w_exc from midonetclient import exc from neutron.api.v2 import base from neutron.common import exceptions as n_exc from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) PLURAL_NAME_MAP = {} def handle_api_error(fn): """Wrapper for methods that...
{ "content_hash": "4c3f710a2d9ab4874dbc4f64b0c16f0e", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 78, "avg_line_length": 34.02803738317757, "alnum_prop": 0.5781378742103818, "repo_name": "midokura/python-neutron-plugin-midonet", "id": "9b88933f2dfc15c114025b061398d86671b...
import django.contrib.auth.models import django.core.validators from django.db import migrations, models import django.utils.timezone import re class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0011_update_proxy_permissions'), ] operations = [ migratio...
{ "content_hash": "d6dd93153674eb65d5232d39ad96d90a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 322, "avg_line_length": 65.34883720930233, "alnum_prop": 0.6377224199288256, "repo_name": "SPARLab/BikeMaps", "id": "d7fc97fa90b363f0c04838d8a6ac23de6d4998e8", "size": "285...
from cswaExtras import getConfig, getCSID form = {'webapp': 'checkfilenamesProd'} config = getConfig(form) objectnumber = '5-1758' print getCSID('approxobjectnumbers', objectnumber, config)
{ "content_hash": "7089ac4023aff3010acd2968b443b5dd", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 58, "avg_line_length": 31.833333333333332, "alnum_prop": 0.7801047120418848, "repo_name": "itsdavidbaxter/Tools", "id": "51724e63f25c64aed474ee63550e58db654afa50", "size": "...
class Group: def __init__(self, name, header, footer): self.name = name self.header = header self.footer = footer
{ "content_hash": "e190ecb2f6759ef1e4133a225c7e21a6", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 45, "avg_line_length": 24.5, "alnum_prop": 0.5510204081632653, "repo_name": "eugence/python_training", "id": "677dea9918e60ab21e15df6e3b22efe8f56969e5", "size": "147", "bi...
from google.cloud import compute_v1 # <INGREDIENT is_preemptible> def is_preemptible(project_id: str, zone: str, instance_name: str) -> bool: """ Check if a given instance is preemptible or not. Args: project_id: project ID or project number of the Cloud project you want to use. zone: name...
{ "content_hash": "209d09a6607dc350f73f97d68a9e3e29", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 86, "avg_line_length": 36, "alnum_prop": 0.6847222222222222, "repo_name": "googleapis/python-compute", "id": "7ff9fc860e668b11182b8dfa2de5149c2fd27dd6", "size": "1567", "...
from feincms_markup.parsers.base import MarkupBaseParser class TextileParser(MarkupBaseParser): pass
{ "content_hash": "5058af19ddca10ed3a8b41626baad626", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 56, "avg_line_length": 21.4, "alnum_prop": 0.822429906542056, "repo_name": "indexofire/feincms-markup", "id": "5bcaae108c08a2f53d504c2c15644c0d22320f32", "size": "131", "b...
import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype from pandas import Categorical, CategoricalIndex, Index, Series, Timestamp import pandas.util.testing as tm class TestCategoricalDtypes: def test_is_equal_dtype(self): # test dtype comparisons between cats ...
{ "content_hash": "2f219bbac079aacad26b0de6552a3c2f", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 78, "avg_line_length": 38.630057803468205, "alnum_prop": 0.5653149783031572, "repo_name": "cbertinato/pandas", "id": "b8c223ab3b04e2623c5a398e4f9248b2c660c9f4", "size": "6...
""" Gathers a set of related title given an input list of titles. Usage: ./subsample_similar_titles <n> Options: -h --help Show this documentation """ import random import sys import traceback import docopt import requests from menagerie.formatting import tsv from menagerie.iteration import ...
{ "content_hash": "44dcbd5bd935b6d183b513818c3fe536", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 65, "avg_line_length": 21.19607843137255, "alnum_prop": 0.6114708603145236, "repo_name": "halfak/Newcomer-task-suggestions", "id": "537a6b47bd1084d1f6842743b2e35c52d9e1d87d",...
import datetime import pathlib import platform import plistlib import re import subprocess from distutils.version import StrictVersion import sal __version__ = "1.1.0" def main(): sus_submission = {} sus_submission["facts"] = get_sus_facts() # Process managed items and update histories. sus_submis...
{ "content_hash": "9a4729cb719dea3f0846c3d37f5e9aaf", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 129, "avg_line_length": 37.75806451612903, "alnum_prop": 0.586928662964545, "repo_name": "salopensource/sal-scripts", "id": "a778d5d99e2b7248760b1c7a7255aee812ef09db", "si...
""" RF2 Concept File access routines """ from rf2db.parsers.RF2BaseParser import RF2Concept from rf2db.parsers.RF2Iterator import RF2ConceptList, iter_parms from rf2db.db.RF2FileCommon import RF2FileWrapper, global_rf2_parms, rf2_values from rf2db.db.RF2DBConnection import cp_values from rf2db.utils.lfu_cache import l...
{ "content_hash": "90ec659356b7d4aa91c470cbf0c161c3", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 114, "avg_line_length": 42.765799256505574, "alnum_prop": 0.6071801112656467, "repo_name": "cts2/rf2db", "id": "fca293b08cefb28ad9dbf80a12c01d7b30d030c8", "size": "13066",...
try: from setuptools import setup except ImportError: from distutils.core import setup import sys with open('README.rst') as f: readme = f.read() svem_flag = '--single-version-externally-managed' if svem_flag in sys.argv: sys.argv.remove(svem_flag) setup(name='saspy', version='1.2.1', des...
{ "content_hash": "1394fe6da5796fe57ba3ada5541751c0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 61, "avg_line_length": 27.517241379310345, "alnum_prop": 0.6203007518796992, "repo_name": "spljaa/saspy", "id": "71ce05e1c167bf9124ff473c150fdc73936acfd1", "size": "1404", ...
import pytest from hpe_test_utils import OneViewBaseFactsTest from oneview_module_loader import SasLogicalJbodAttachmentFactsModule ERROR_MSG = 'Fake message error' PARAMS_GET_ALL = dict( config='config.json', name=None ) PARAMS_GET_BY_NAME = dict( config='config.json', name="SAS Logical JBOD Attach...
{ "content_hash": "9e6d268fabcf97b78a333aca0a213933", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 33.583333333333336, "alnum_prop": 0.6929280397022333, "repo_name": "HewlettPackard/oneview-ansible", "id": "4687f3f01cdd300c09d8b4c5df3416ed6988a6dc", ...
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache....
{ "content_hash": "86f9f49e90b1f6d3ad892bd620ab0f96", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 134, "avg_line_length": 36.492753623188406, "alnum_prop": 0.53445194598888, "repo_name": "Multiscale-Genomics/mg-process-fastq", "id": "f0f16695ff2d8d6c24244052226011547f92c...
""" Default Django settings. Override these with settings in the module pointed to by the DJANGO_SETTINGS_MODULE environment variable. """ # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. def gettext_noop(s): return s ####...
{ "content_hash": "5c117bd642bc303545b7b45048f1c6f6", "timestamp": "", "source": "github", "line_count": 642, "max_line_length": 101, "avg_line_length": 34.58255451713396, "alnum_prop": 0.6886316548058733, "repo_name": "simonw/django", "id": "09c9b95d26d5c02e2d69c94c3d65dad0e3cb7bf6", "size": "22203...
from django.apps import AppConfig class ImagesConfig(AppConfig): name = 'imagetagger.images'
{ "content_hash": "8ffe8046a348710b77f022f3e7db61b1", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 19.8, "alnum_prop": 0.7676767676767676, "repo_name": "bit-bots/imagetagger", "id": "fbaf036fb4d737ccf850834879a96544ef3f04bb", "size": "99", "binary...
"""Imports for Python API. This file is MACHINE GENERATED! Do not edit. Generated by: tensorflow/tools/api/generator/create_python_api.py script. """ from tensorflow.tools.api.generator.api.contrib import stat_summarizer
{ "content_hash": "9116c9ffcf4c8f564bd9fa588f127dda", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 73, "avg_line_length": 36.833333333333336, "alnum_prop": 0.7963800904977375, "repo_name": "ryfeus/lambda-packs", "id": "7e28ef92d8adf87af0035c3570b480ff525f216f", "size": "2...
import functools import hashlib from django import http from django.conf import settings from django.core.cache import cache from django.core.exceptions import PermissionDenied from django.db.models import Q from django.db.transaction import non_atomic_requests from django.shortcuts import get_object_or_404 from djang...
{ "content_hash": "f56e2db712839f280315026a48365478", "timestamp": "", "source": "github", "line_count": 608, "max_line_length": 79, "avg_line_length": 36.57236842105263, "alnum_prop": 0.6383792048929664, "repo_name": "aviarypl/mozilla-l10n-addons-server", "id": "9ce0ff53d847f7f43c4452ac3aab98fad1db5c...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', 'flag=sblk'], [TestAction.create_volume, 'volume1', 'flag=ceph,scsi'], [TestAction.attach_volume, 'vm1...
{ "content_hash": "827fa732972ef7fa0683699e5e87afdf", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 169, "avg_line_length": 37.4390243902439, "alnum_prop": 0.6990228013029316, "repo_name": "zstackio/zstack-woodpecker", "id": "5f2076b6a34849627d766078bffa9fb4ba1cbea1", "si...
import os # Parse the readme, and add new script info # based on the flags used for tampermonkey. # Default section. intro = """ #tampermonkey My ongoing TamperMonkey scripts for Chrome. ## modules """ def _markdown_param(line, name): return line.replace( '// @{}'.format(name), '\n**@{}**: '.format(...
{ "content_hash": "4f950c8c8b347d971e132c3d5a5cd66d", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 26.39622641509434, "alnum_prop": 0.5589706933523946, "repo_name": "christabor/tampermonkey", "id": "1c88f71d680a5adc4d9b8373b58079c9a4d52db9", "size"...
from util.hook import * import praw red = praw.Reddit('reddit code module ported by apollojustice''fetches stuff from leddit') __author__ = "apollojustice" # ported from newellworldorder's self-made bot into Code by apollojustice @hook(cmds=["reddit"], args=False, rate=10) def redditgb(code, input): noargs = False...
{ "content_hash": "bd3da5586f9d3b0fecd3d0897be82ede", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 137, "avg_line_length": 43.53968253968254, "alnum_prop": 0.5391906671527524, "repo_name": "ApolloJustice/codemodules", "id": "3340416f332d1af8190871ee22b2f22dd96ded24", "si...
""" listDiff.py Kyle McChesney Compare two sorted lists """ import logging, argparse, os, time def main(): # args parser = argparse.ArgumentParser( description = (" Compare two txt file lists "), ) time_stamp = str(time.time()).replace(".","") log_file = os.path.join("./","{}.{}.{}".for...
{ "content_hash": "06849c6375c26dc7f3ba035ce612e142", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 91, "avg_line_length": 31.66176470588235, "alnum_prop": 0.6196005573618207, "repo_name": "mbiokyle29/bioinformatics", "id": "2999cf1e6a71b58cf561eceb24cafa7ee51abfc0", "siz...
"""Linear QL agent""" import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import framework import utils DEBUG = False GAMMA = 0.5 # discounted factor TRAINING_EP = 0.5 # epsilon-greedy parameter for training TESTING_EP = 0.05 # epsilon-greedy parameter for testing NUM_RUNS = 5 NUM_EPOCHS = 60...
{ "content_hash": "3f93e27666590b834cf47fe0ec588495", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 106, "avg_line_length": 32.020833333333336, "alnum_prop": 0.6441119063109955, "repo_name": "xunilrj/sandbox", "id": "4c5d8599e4c10cb8e492219bc4ba650423f5059a", "size": "61...
from bitmessage.bitmessage import Bitmessage import unittest import base64 import time class TestBitmessage(unittest.TestCase): def setUp(self): try: self.bitmessage = Bitmessage() except: self.fail("An exception was raised establishing a Bitmessage connection") def te...
{ "content_hash": "2087283e9c34b65efa9075ac9cf59326", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 85, "avg_line_length": 31.477777777777778, "alnum_prop": 0.5979527003176844, "repo_name": "FreeJournal/freejournal", "id": "c0f91e35adfd87de3d13d2bfeba4d171e6efef4c", "size...
""" Copyright 2014 Sotera Defense Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
{ "content_hash": "db742cd90499f5b1dd18f979bd5a62d2", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 131, "avg_line_length": 37.005102040816325, "alnum_prop": 0.666758582655453, "repo_name": "Sotera/Datawake", "id": "cefae9d8b41b193aacb8df15cd2e4098fc1e51a1", "size": "725...
import os import logging from django.core.urlresolvers import reverse from django.contrib.sites.models import RequestSite from django.db.models import F from django.http import Http404, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.template....
{ "content_hash": "96a2614d40e94bb58a68331bf4b4c37f", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 107, "avg_line_length": 38.80482897384306, "alnum_prop": 0.5973244840817173, "repo_name": "cloudcopy/seahub", "id": "2ceaf3529bec977d461f44d4ec7ee38da5ff54bc", "size": "19...
from flask import render_template, flash, redirect, g, url_for, request from app import * from models import * from form import FlyForm, ITAForm, NonStopForm ##GLOBALS HIDDEN_PAIRS_D = pkl.load(open('app/static/OrigDest_HiddenCity_Targets.pkl', 'rb')) DEST_RANK_D = pkl.load(open('app/static/OrigDest_Ranking.pkl', 'rb'...
{ "content_hash": "803932f2d9d82c8b4ec44c156650b080", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 107, "avg_line_length": 38.13636363636363, "alnum_prop": 0.5527142702351284, "repo_name": "BradAJ/zipflights", "id": "b94408842b9b4cfcb88cb1c66d939c42fe777833", "size": "9...
import math def is_prime(num): if num < 2: return False for i in range(num): if i < 2: continue if num % i == 0: return False return True def get_largest_prime_factor(num): upper = int(math.ceil(math.sqrt(num))) prime_factor = -1 # using ceil, coz range will bump it down by 1 for...
{ "content_hash": "9f12d07d6edfefafb4bcfe64a7f8a8bb", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 48, "avg_line_length": 22.233333333333334, "alnum_prop": 0.6146926536731634, "repo_name": "birdchan/project_euler", "id": "5b61d5a426ed9d35fee21bba3ec5acc7c7543a5e", "size"...
from baseparser import BaseParser from BeautifulSoup import BeautifulSoup, Tag class BBCParser(BaseParser): SUFFIX = '?print=true' domains = ['www.bbc.co.uk'] feeder_pat = '^http://www.bbc.co.uk/news/' feeder_pages = ['http://www.bbc.co.uk/news/'] def _parse(self, html): soup = Beautiful...
{ "content_hash": "8143cb987a52ebd55e35ee4d39b44e03", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 33.75757575757576, "alnum_prop": 0.5448833034111311, "repo_name": "amandabee/newsdiffs", "id": "0a0e25bf6590a5ab1007fdd950ca5bbce8a237ba", "size": "1...
""" Interface documentation. Maintainer: Itamar Shtull-Trauring """ from zope.interface import Interface, Attribute from twisted.python.deprecate import deprecatedModuleAttribute from twisted.python.versions import Version class IAddress(Interface): """ An address, e.g. a TCP C{(host, port)}. Default i...
{ "content_hash": "cdfddd0b6cbcb97d5bdd405c892baabf", "timestamp": "", "source": "github", "line_count": 2046, "max_line_length": 96, "avg_line_length": 30.71065493646139, "alnum_prop": 0.619123404526212, "repo_name": "Varriount/Colliberation", "id": "aac634fe40a8584578295a542fe5830d6246b71a", "size...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('bookmarks', '0002_auto_20170714_1111'), ] operations = [ migrations.AddField( ...
{ "content_hash": "0515a8ebd1803817f0b3807d2decccf2", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 136, "avg_line_length": 28.04, "alnum_prop": 0.6276747503566333, "repo_name": "kennethlove/django_bookmarks", "id": "0c658857db6a7b5fac68c42fde8cf25f917beb60", "size": "774...
import os import sys from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from pyramid.scripts.common import parse_vars from ..models import ( DBSession, Base, ) def usage(argv): cmd = os.path.basename(argv[0]) print('usage: %s <c...
{ "content_hash": "e79387cf2ac3a1dffe97c17c57fd767d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 59, "avg_line_length": 23.07894736842105, "alnum_prop": 0.645381984036488, "repo_name": "demophoon/sams", "id": "ace097bcd6fca6de4bd0df36190533c779a374db", "size": "877", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cellsamples', '0004'), ] operations = [ migrations.AlterModelOptions( name='celltype', options={'ordering': ('species', 'cell_type'), 'verbose_name': 'Cell Type'}, ...
{ "content_hash": "899cb48f29a5fac68221479cc7e320f8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 88, "avg_line_length": 26.25925925925926, "alnum_prop": 0.5317348377997179, "repo_name": "UPDDI/mps-database-server", "id": "8c9ab6efe6a758130a4bd4e831d3fc089ad57f61", "siz...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Logit'] , ['PolyTrend'] , ['Seasonal_Minute'] , ['MLP'] );
{ "content_hash": "77cacec92104ddc61f6dd0a544c098bf", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 81, "avg_line_length": 38.5, "alnum_prop": 0.7012987012987013, "repo_name": "antoinecarme/pyaf", "id": "f189d7e2a2f09e54417bf8a8e500cf3343011b1d", "size": "154", "binary":...
try: from httplib import BAD_REQUEST, FORBIDDEN, \ INTERNAL_SERVER_ERROR, ACCEPTED except: from http.client import BAD_REQUEST, FORBIDDEN, \ INTERNAL_SERVER_ERROR, ACCEPTED from routes import route from api import APIBaseHandler, EntityBuilder import random import time from importlib import impo...
{ "content_hash": "5459c45c03d4499b86aa48a61690a5d4", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 121, "avg_line_length": 47.87769784172662, "alnum_prop": 0.5619834710743802, "repo_name": "imolainformatica/airnotifier", "id": "0df1bb73e7a71ce3c43142577b6f33ac04c96cb7", ...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "574e89fad049bee094cbd29b954b0f52", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 214, "avg_line_length": 31.71232876712329, "alnum_prop": 0.7235421166306696, "repo_name": "bellowsj/aiopogo", "id": "fa1a9399c906a26a77fc998431e88df5312e3359", "size": "242...
import logging import urllib2 import socket import time import re import lighter.util as util class Graphite(object): def __init__(self, address, url, tags=[]): """ @param address hostname:port where the Graphite listens for the plaintext protocol, usually port 2003 @param url ...
{ "content_hash": "7109899a7770e417a6da5b2e70ea2496", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 113, "avg_line_length": 34.21739130434783, "alnum_prop": 0.5565438373570522, "repo_name": "meltwater/lighter", "id": "1353c5a844fab0ff21697dc7a0227b87bb7a9d64", "size": "23...
"""TensorFlow Lite tooling helper functionality. EXPERIMENTAL: APIs here are unstable and likely to change without notice. @@TocoConverter @@toco_convert @@toco_convert_protos @@Interpreter @@OpHint @@convert_op_hints_to_stubs @@build_toco_convert_protos @@FLOAT @@QUANTIZED_UINT8 @@TFLITE @@GRAPHVIZ_DOT """ from __...
{ "content_hash": "ec7074a030fc69150c09859c3daf320b", "timestamp": "", "source": "github", "line_count": 527, "max_line_length": 126, "avg_line_length": 41.15370018975332, "alnum_prop": 0.6711084470675027, "repo_name": "xodus7/tensorflow", "id": "2be24455d83e2ee9ac0f005ce5d4316d456b12a4", "size": "2...
from __future__ import absolute_import, unicode_literals from google.appengine.api.users import create_logout_url, get_current_user from gaecookie.decorator import no_csrf from gaepermission import facade from gaepermission.decorator import login_required from tekton.gae.middleware.redirect import RedirectResponse from...
{ "content_hash": "a999f8f5e44ae1bfd381c9838cba5f1b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 35.05555555555556, "alnum_prop": 0.7765451664025357, "repo_name": "erikabarros/naguil", "id": "00b3c7b4dc3d72b7517278da20241d0a90fcfbb7", "size": "65...
""" Script to generate a json file containing book names """ import json import urllib.request import re RESULT_JSON_NAME = "books.json" # Get catalog.json URL_CAT = "https://api.unfoldingword.org/uw/txt/2/catalog.json" response_cat = urllib.request.urlopen(URL_CAT) DATA = json.loads(response_cat.read().decode('utf...
{ "content_hash": "6fd51ed83f78f5cd91d7f8b681eb6c33", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 112, "avg_line_length": 32.6, "alnum_prop": 0.664249860568879, "repo_name": "WycliffeAssociates/translationRecorder", "id": "4633d774098c3e90aeba87073acd04e2911857e7", "siz...
from src.utility import HTTPClient,HmcHeaders,HMCClientLogger import xml.etree.ElementTree as etree import os log = HMCClientLogger.HMCClientLogger(__name__) from src.common.JobStatus import * ROOT = 'ManagedSystem' CONTENT_TYPE ='application/vnd.ibm.powervm.web+xml; type=JobRequest' class PowerOnManagedSystem(JobSta...
{ "content_hash": "00ab3b0f442e5d0f39971f70beb4004a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 107, "avg_line_length": 38.225, "alnum_prop": 0.6664486592544147, "repo_name": "PowerHMC/HmcRestClient", "id": "fecbe7a473bcd65b5c2f163186e090812329133b", "size": "2162", ...
from __future__ import print_function from six.moves import xrange try: from lmfit import Parameters, Parameter LMFIT_PARAMETERS_INSTALLED = True except ImportError: LMFIT_PARAMETERS_INSTALLED = False class ParinfoList(list): """ Store a list of model parameter values and their associated metadata ...
{ "content_hash": "3f450d265940b0ca600200367ece0d50", "timestamp": "", "source": "github", "line_count": 588, "max_line_length": 115, "avg_line_length": 36.064625850340136, "alnum_prop": 0.535980382910497, "repo_name": "low-sky/pyspeckit", "id": "3403eb29b60d57483ecd434fa007fbbd685aa1a9", "size": "2...
from django.contrib import admin from ionyweb.page_app.page_text.models import * admin.site.register(PageApp_Text)
{ "content_hash": "4c3cb46a5b8b8ce9a21c8f17d6868746", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 47, "avg_line_length": 29, "alnum_prop": 0.8103448275862069, "repo_name": "makinacorpus/ionyweb", "id": "36f197969e2461b7be91e01689d0b944439cd893", "size": "140", "binary"...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('ref', '0009_auto_20221002_1238'), ] operations = [ migrations.AlterField( model_name='componentinstance', name='project', ...
{ "content_hash": "283210e095dc6277b79503c3f8ee1f32", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 159, "avg_line_length": 28.647058823529413, "alnum_prop": 0.6447638603696099, "repo_name": "marcanpilami/MAGE", "id": "0d8ff35e3378ce8b3d2692c0744605d56cceded1", "size": "5...
from ..base.utils.common import *
{ "content_hash": "636cef6c99113a6988bda2039ff395cd", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 33, "avg_line_length": 34, "alnum_prop": 0.7352941176470589, "repo_name": "DataDog/integrations-core", "id": "df1dd22b711d23d6daf07aaab855493034642b70", "size": "164", "bi...
import os from kokki import Package, File, Template, Service env.include_recipe("postgresql9") Service("postgresql", supports_restart = True, supports_reload = True, supports_status = True, action = "nothing") Package("postgresql-" + env.config.postgresql9.version, notifies = [("stop", env.resour...
{ "content_hash": "1e5cbc50e9696ab6008f89fe5855201d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 32.37931034482759, "alnum_prop": 0.6645367412140575, "repo_name": "samuel/kokki", "id": "dfe761478fce8f30ce05751bb4b118380735fc9d", "size": "940", ...
""" Download views for editorial app. """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect, get_object_or_404 from django.conf import settings from django.core.mail import send_mail from django.http import HttpResponse from django.utils import timezo...
{ "content_hash": "bea93d90e1e3353af5204b97f97f7247", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 111, "avg_line_length": 47.68529411764706, "alnum_prop": 0.5129834083759945, "repo_name": "ProjectFacet/facet", "id": "563a0f6a8a520d5c627631d208fc653a11d49f34", "size": "...
""" The script identifies new items in the website inventory and saves them to the database. Items already in the database will be ignored. In-depth details for items will be scrapped with another script. Information captured about items: - name - imageUrl - productUrl @author: eriel marimon @created: july 1, 2017 @u...
{ "content_hash": "819cd549748015136292eb0118ce13ee", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 108, "avg_line_length": 32.97826086956522, "alnum_prop": 0.6557350032959789, "repo_name": "aldeano19/databucket", "id": "76c23dc162425bc74c086c525de408a1ffa382d4", "size":...
""" The MIT License (MIT) Copyright (c) 2013 Jeremy Gillick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
{ "content_hash": "05d08f64c5a741d3e1a68b84fa1e9832", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 231, "avg_line_length": 37.87596899224806, "alnum_prop": 0.5402510574430345, "repo_name": "jgillick/LendingClubAutoInvestor", "id": "3725b931ff677ffed05450550fa5db5d31c5857f...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0012_remove_appuser_name'), ] operations = [ migrations.AddField( model_name='appuser', name='name', fi...
{ "content_hash": "1d926451149b79669fdacb49e955e2a9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 21.72222222222222, "alnum_prop": 0.5907928388746803, "repo_name": "cffls/SmartTrainnerServer", "id": "d6a65440a3ecd74fc227d89b4b8bdc56f567986a", "siz...
from __future__ import unicode_literals import datetime from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible # Create your models here. @python_2_unicode_compatible class Question(models.Model): question_text = models.CharField(max_length=2...
{ "content_hash": "24bad23b10f7deb988e950f8dfcb456f", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 72, "avg_line_length": 30.066666666666666, "alnum_prop": 0.6984478935698448, "repo_name": "youkidearitai/health_graph", "id": "8e032fc69069f09d7ee1d05dfe4832de6732f5e7", "s...
from distutils.core import setup setup(name='anthill', version='0.2.0-dev', description='Django apps for running a community website, developed for sunlightlabs.com', author='James Turk', author_email='jturk@sunlightfoundation.com', license='BSD', url='http://github.com/sunlightlabs...
{ "content_hash": "54924a157372a5a67b371292d403fba0", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 96, "avg_line_length": 44.07142857142857, "alnum_prop": 0.6628849270664505, "repo_name": "robbie/anthill", "id": "d246ea22ce8622417a38a5c8cfb0aaf885845387", "size": "640", ...
from parse import parse_line, convert_dms_to_float # NATFIX is defined with many 1 column wide blank separator. We roll them in to a data field and rely on strip() to clean it up NATFIX_RECORDS = ((None, 2), ("id", 6), ("latitude_string", 8), ("longitude_st...
{ "content_hash": "4127931a699a6d2e2036dc9c5122dbb1", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 127, "avg_line_length": 40.05555555555556, "alnum_prop": 0.5256588072122053, "repo_name": "adamfast/faddsdata", "id": "cc9b4f7df8d2f1dfae84487cbd8e316e8b96164a", "size": "2...
from flask import Flask, render_template app = Flask(__name__) from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Base, Restaurant, MenuItem engine = create_engine('sqlite:///restaurantmenu.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) ses...
{ "content_hash": "55ed37818d83e6d607e2930dae3469b2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 76, "avg_line_length": 35.8974358974359, "alnum_prop": 0.7357142857142858, "repo_name": "tuanvu216/udacity-course", "id": "04b6342d1f97c4976d71ec2cf700653398d14b60", "size"...
import time from app.models import WeixinTextResponse class AccessToken: def __init__(self,wx): self.weixin=wx self._load_token() def _load_token(self): fp=open('token','r') line=fp.readline() token,expires_at=line.split('|') if token=='' or time.time(expires_at)>time.time(): access_token=self.weixi...
{ "content_hash": "8bbb03928eabd78874cb2792c6d2fc77", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 96, "avg_line_length": 21.33823529411765, "alnum_prop": 0.6492074431426602, "repo_name": "colaftc/webtool", "id": "85f5a055127df47e7fe964e6e4b406cbefe81964", "size": "1518"...
import numpy as np import xgboost as xgb import random from itertools import izip def evalerror(preds, dtrain): labels = dtrain.get_label() # return a pair metric_name, result # since preds are margin(before logistic transformation, cutoff at 0) return 'error', float(sum(labels != (preds > 0.0))) / ...
{ "content_hash": "423c9681f705343a931403c817682155", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 125, "avg_line_length": 42.98924731182796, "alnum_prop": 0.5182591295647824, "repo_name": "jasonwbw/JustAPlaceholder", "id": "bc7e67ce05e3c39523a333c047377b6536b4aff1", "s...
from .aws import Action as BaseAction from .aws import BaseARN service_name = "AWS Sustainability" prefix = "sustainability" class Action(BaseAction): def __init__(self, action: str = None) -> None: super().__init__(prefix, action) class ARN(BaseARN): def __init__(self, resource: str = "", region: ...
{ "content_hash": "135bb044c92292e8ba6d80d0b940838d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 88, "avg_line_length": 26.9, "alnum_prop": 0.6486988847583643, "repo_name": "cloudtools/awacs", "id": "8c0e29d6eebc6727b4155bd12cd080d7ad1ba929", "size": "654", "binary":...
import os import pytest import core.config @pytest.fixture def defaultConfig(): return core.config.Config([]) def test_module(): modules = ["module-1", "module-2", "module-3"] cfg = core.config.Config(["-m"] + modules) assert cfg.modules() == modules def test_module_ordering_maintained(): m...
{ "content_hash": "978cb27843209517b72938bc7c5aa2a4", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 83, "avg_line_length": 23.28813559322034, "alnum_prop": 0.6102620087336245, "repo_name": "tobi-wan-kenobi/bumblebee-status", "id": "762c674f5eac70f3083d3ba3c154ef2c584f3de7"...
import sys from twisted.internet import reactor from pysnmp.carrier.twisted.dgram.base import DgramTwistedTransport from pysnmp.carrier import error domainName = snmpLocalDomain = (1, 3, 6, 1, 2, 1, 100, 1, 13) class UnixTwistedTransport(DgramTwistedTransport): # AbstractTwistedTransport API def openClie...
{ "content_hash": "02cf37f27f8f8b79afbaee85a704a685", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 67, "avg_line_length": 30.653846153846153, "alnum_prop": 0.6737766624843162, "repo_name": "xfguo/pysnmp", "id": "57d73eb60a6e89faa6585f45fd9c03e37d27e947", "size": "853", ...
""" pyexcel_io.plugins ~~~~~~~~~~~~~~~~~~~ factory for getting readers and writers :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pyexcel_io.utils as ioutils import pyexcel_io.manager as manager import pyexcel_io.constants as cons...
{ "content_hash": "445c226c8313e8c2889f6e4cf5df7775", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 79, "avg_line_length": 32.41984732824427, "alnum_prop": 0.6003060984224158, "repo_name": "chfw/pyexcel-io", "id": "495283aff408996ec3e43f65f1bdb4da3b5ae305", "size": "8494...
import datetime from django.utils import timezone from django.test import TestCase from .models import User def create_user(time=timezone.now()): user = User.objects.create_user( email='example_user_mail@gmail.com', password="example_password", name='Jan', surname='Kowalski', ...
{ "content_hash": "43cc678b792a11a8a088ed9e2ce655f5", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 78, "avg_line_length": 33.02739726027397, "alnum_prop": 0.6204894234757362, "repo_name": "piemar1/Schedule_django", "id": "0109d3827557aa8b9901826ae23f835b54f3032c", "size...
''' Utility script used to determine which CPython tests IronPython can run correctly. USAGE: ipy cmodule.py C:\Python25 OUTPUT: %CD%\IPY_PASSES.log (tests which IP can run) %CD%\IPY_FAILS.log (tests which IP cannot run) ''' import sys import nt from clr_helpers import Process #--------------------...
{ "content_hash": "15926a786bbae4bb1af621499a86c189", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 133, "avg_line_length": 28.723076923076924, "alnum_prop": 0.5731119442956615, "repo_name": "IronLanguages/ironpython3", "id": "08c1aa38a15a0bc174a5c19ee8a3ceafeb0f722f", "s...
import threading import collections import zephyr class EventStream: def __init__(self): self.events = [] self.events_cleaned_up = 0 self.lock = threading.RLock() def __iter__(self): with self.lock: return iter(self.events[:]) def __...
{ "content_hash": "007a06673b4774607316ad301143b8f3", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 119, "avg_line_length": 37.3921568627451, "alnum_prop": 0.569349764027268, "repo_name": "jpaalasm/zephyr-bt", "id": "610d660ba1ce2ad6f2f026d7236f468a5e3cdbcf", "size": "76...
from __future__ import absolute_import from __future__ import print_function # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration co...
{ "content_hash": "42a8dca6d354c2b3f55e261a9fe063f9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 28.333333333333332, "alnum_prop": 0.6843137254901961, "repo_name": "alexis-roche/nipy", "id": "b0cce0828d0c8340e7e9f005c423bbcf99679c79", "size": "51...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from copy import deepcopy import json import logging import itertools import collections import numpy as np from matplotlib.colors import LinearSegmentedColormap as colormap from matplotlib.colors import rgb2hex, hex...
{ "content_hash": "119817ee299297688077a2a83cd579b9", "timestamp": "", "source": "github", "line_count": 697, "max_line_length": 79, "avg_line_length": 42.50215208034433, "alnum_prop": 0.507460167431812, "repo_name": "jmuhlich/indra", "id": "63a8431c3011c20eb6f862fb8651b69d289bd639", "size": "29624"...
from django.contrib import admin from article.models import Article #enabloidaan auto admin admin.site.register(Article)
{ "content_hash": "311f19be5cbc85271df754127481923e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 24.2, "alnum_prop": 0.8429752066115702, "repo_name": "puuparta/django_bootcamp", "id": "1be095e9f22f7ca03fb8513d1f853d4aebcf1efd", "size": "121", "b...
import requests_mock import pytest from tidypy import get_extenders, DoesNotExistError def test_can_handle(): extender = get_extenders()['pastebin'] assert extender.can_handle('pastebin:abc123') == True assert extender.can_handle('pastebin:') == False RESP_BASIC = ''' [tidypy] test = 'extended' extens...
{ "content_hash": "edd233d010d4b93196f3c9649d721e91", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 119, "avg_line_length": 27.342105263157894, "alnum_prop": 0.6390760346487007, "repo_name": "jayclassless/tidypy", "id": "a0d0a226baa7887e04e3744104b5dc37623a9f34", "size": ...
""" Dumps data from the main database, but only dumps a subset of the items To ensure we can load them on the development server We use this because the production database became too heavy to load even with optimized tools like pg_dump This script follows relations to ensure referential integrity so if you load blog...
{ "content_hash": "c013a325afcdb3a3960f26e9d1aceab0", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 101, "avg_line_length": 41.93258426966292, "alnum_prop": 0.6414790996784566, "repo_name": "tschellenbach/dev_db", "id": "965e1873b707f712a254312324256fd798d5336e", "size": ...
"""Tests for haiku.examples.impala_lite.""" from absl.testing import absltest from examples import impala_lite class ImpalaLiteTest(absltest.TestCase): def test_impala_integration(self): impala_lite.run(trajectories_per_actor=2, num_actors=2, unroll_len=20) if __name__ == '__main__': absltest.main()
{ "content_hash": "0291254943628e68e686718ad7d36b5f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 74, "avg_line_length": 22.5, "alnum_prop": 0.7238095238095238, "repo_name": "deepmind/dm-haiku", "id": "8e12bc0308af278b605c2071a7bb119e2b8f6633", "size": "1011", "binary...
print( '\n' """|----------------------------------------------------------| | ____ __ ___ __ | | / __ )__ ____ __/ |/ /___ ______/ /____ _____ | | / __ / / / / / / / /|_/ / __ `/ ___/ __/ _ \/ ___/ | | / /_/ / /_/ / /_/ / / / / /_/ (__ ) /_/ __/ / | ...
{ "content_hash": "712c8d1166a4aa1de8f3c5e000a005ad", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 172, "avg_line_length": 30.948051948051948, "alnum_prop": 0.5765841376416282, "repo_name": "brianannis/buymaster", "id": "52e31cdb513155e5e70e70642684dfe968117218", "size":...
from django import template from django.utils import timezone from ..models import Category, Post register = template.Library() @register.assignment_tag def get_news_categories(): return Category.objects.all() @register.assignment_tag def get_news_months(): return Post.objects.filter(published=True, date_...
{ "content_hash": "96d5acccb0ab5b4106b75d02bc69f573", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 99, "avg_line_length": 25.51851851851852, "alnum_prop": 0.7314949201741655, "repo_name": "blancltd/blanc-basic-news", "id": "2ba2d6d77470e6dd839133c0abe39fac6336408a", "siz...
from __future__ import absolute_import, division, print_function, \ with_statement import os import sys import hashlib import logging from shadowsocks import common from shadowsocks.crypto import rc4_md5, openssl, sodium, table method_supported = {} method_supported.update(rc4_md5.ciphers) method_supported.upda...
{ "content_hash": "741b38d0410ca3680964213f387812cb", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 78, "avg_line_length": 27.359116022099446, "alnum_prop": 0.5632067851373183, "repo_name": "ukoinobita/shadowsocks", "id": "249439576abf176607ecf99edf488639385a5f4d", "size...
from actions_lib import * user = "someone@example.com" passwords = ["test123"] set_wait_timeout(60) for (cur,new) in [ (passwords[i],passwords[i+1]) for i in range(len(passwords)-1) ]: go_to('https://rally1.rallydev.com') wait_for(assert_title_contains, 'Rally Login') assert_title_c...
{ "content_hash": "89c71bd474764f1d24030c73be87cfbb", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 84, "avg_line_length": 27.114942528735632, "alnum_prop": 0.6189063162356931, "repo_name": "ktan2020/legacy-automation", "id": "11064309c71d2af322f343f43892a13af4a55f6f", "s...
from pylab import * # ########################################### # Analysis functions # ########################################### def rate_from_spiketrain(spiket,spikei,fulltime,sigma,dt,nrnidx=None): """ Returns a rate series of spiketimes convolved with a Gaussian kernel; all times must be in SI unit...
{ "content_hash": "99c56f16a38fa0239dd5cd16c48a1061", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 73, "avg_line_length": 37.18, "alnum_prop": 0.6272189349112426, "repo_name": "h-mayorquin/camp_india_2016", "id": "053e816bc61ab22acafe40dddbfae01c80beebb1", "size": "1859"...
import os.path from ginga.gw import Widgets from ginga.misc import Bunch from ginga import GingaPlugin class Toolbar(GingaPlugin.GlobalPlugin): def __init__(self, fv): # superclass defines some variables for us, like logger super(Toolbar, self).__init__(fv) # active view self.ac...
{ "content_hash": "f353faa5ad563c0a6f374928dfa8e70f", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 79, "avg_line_length": 35.07598784194529, "alnum_prop": 0.5376949740034662, "repo_name": "eteq/ginga", "id": "47b5197509ee9a790eaf89a0a0cdfeb5982424c5", "size": "11800", ...
from setuptools import setup, find_packages # Always prefer setuptools over distutils from os import path import io from trainsimulator.version import __version__, __url__, __license__, __author__, __email__ here = path.abspath(path.dirname(__file__)) try: import pypandoc long_description = pypandoc.conver...
{ "content_hash": "745e40538085344c671ad3c4f4f1e6d8", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 91, "avg_line_length": 28.741935483870968, "alnum_prop": 0.6666666666666666, "repo_name": "arturosolutions/trainsimulator", "id": "66bb0937f2a5d775cd36b5585c5983eeddb2d79e", ...
import os.path as op from bakery_lint.base import BakeryTestCase as TestCase from bakery_lint.metadata import Metadata from bakery_cli.ttfont import Font weights = { 'Thin': 100, 'ThinItalic': 100, 'ExtraLight': 200, 'ExtraLightItalic': 200, 'Light': 300, 'LightItalic': 300, 'Regular': 40...
{ "content_hash": "136efe46470317ea0b9a216332630e24", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 84, "avg_line_length": 32.296052631578945, "alnum_prop": 0.568547565695661, "repo_name": "lowks/fontbakery-cli", "id": "b5bf807a7cf11f347add1f1e4f161bbef5ba4118", "size": ...
from copy import copy from django.conf import settings from django.forms import fields, models, ValidationError from django.forms.util import ValidationError from django.template.defaultfilters import slugify from django.utils.formats import get_format from django.utils.translation import ugettext_lazy as _ from limbo ...
{ "content_hash": "e9042406df1809e7a623c1b316982a57", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 114, "avg_line_length": 37.045307443365694, "alnum_prop": 0.6171922774526076, "repo_name": "gdoermann/django-limbo", "id": "ec9398e3106730a3fa830043776b5e8d388c4b83", "siz...
import sys import os import tempfile import getpass import simplejson as json f = open("bootconf.json", "r") vals_dict = json.load(f) f.close() (osf, fname) = tempfile.mkstemp() print vals_dict['message'] os.write(osf, vals_dict['message']) os.close(osf) sudo = "" if getpass.getuser() != "root": sudo = "sudo" cmd...
{ "content_hash": "f54e2705bca0c8a476a8e25287de0f28", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 90, "avg_line_length": 20, "alnum_prop": 0.6586206896551724, "repo_name": "nimbusproject/cloudinit.d", "id": "f5a8a3166a61e09c4b09200a113b8b0425a582e7", "size": "603", "b...
from ..errors import StopValidation, ValidationError __all__ = ["AnyValueType", "TypedValueType"] class AnyValueType: """An instance of ValueType describes for some type of value (int, "int between 0 and 10", list, "list with elements of value type int-between-0-and-10", dict, namedtuple, whathaveyou): ...
{ "content_hash": "b951529a19b0026fac122f7c72ecb5fa", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 38.14525139664804, "alnum_prop": 0.616871704745167, "repo_name": "lars-tiede/aiorethink", "id": "eb39e8d07685cd810f6f8b7caeab20641ee546ec", "size": ...
""" Represents a property, i.e. property definition and value. """ from datafinder.core.error import PropertyError __version__ = "$Revision-Id:$" class Property(object): """ Represents a property, i.e. property definition and value. """ def __init__(self, propertyDefinition,...
{ "content_hash": "31641a6e025ce4080c1c2bd6dcf2138f", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 136, "avg_line_length": 35, "alnum_prop": 0.6253968253968254, "repo_name": "DLR-SC/DataFinder", "id": "465c899b3c6e0a22c162fe145106338152a0f231", "size": "4844", "binary"...
class defaultlist(list): def __init__(self, *args, factory=None, **kwargs): super().__init__(*args, **kwargs) self.factory = factory def __getitem__(self, index): if index >= len(self): diff = index - len(self) + 1 for i in range(diff): self.appen...
{ "content_hash": "d9a9941936be49fa8d3d4be2b86f7071", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 34.54545454545455, "alnum_prop": 0.5210526315789473, "repo_name": "cdgriffith/Reusables", "id": "a3b3366b7a256b1e95a32ca757284ca46d1b26d9", "size": "...
import os import pytest import pandas as pd from toolz import pipe from ..data import limit_rows, MaxRowsError, sample, to_values, to_json, to_csv def _create_dataframe(N): data = pd.DataFrame({"x": range(N), "y": range(N)}) return data def _create_data_with_values(N): data = {"values": [{"x": i, "y":...
{ "content_hash": "860097084ea7bd54ef4cea77af878f07", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 27.776978417266186, "alnum_prop": 0.6293706293706294, "repo_name": "altair-viz/altair", "id": "b4b4196ffc2d3f6215be3d3706a668cb96f9c544", "size": "3...
"""Contains generic table-writing functions. Data is expected to be a list of namedtuples. kwargs (kws): 'title': First row will contain user-provided title string 'prt_if': Only print a line if user-specfied test returns True. prt_if is a lambda function with the data item'...
{ "content_hash": "543575ed48d582bf03b140499c148147", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 97, "avg_line_length": 45.27014218009479, "alnum_prop": 0.6002931323283082, "repo_name": "lileiting/goatools", "id": "383701896a17b13eec24a46d4c87a28a172e3a8b", "size": "9...
from django.db import models from django.utils.translation import ugettext_lazy as _ from cms.models.pluginmodel import CMSPlugin from filer.fields.image import FilerImageField from djangocms_social.models import likes from djangocms_social import defaults class Like(CMSPlugin): facebook = models.BooleanField(_...
{ "content_hash": "ceb0099003e1450f3a3c48a3a4567701", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 111, "avg_line_length": 38.04838709677419, "alnum_prop": 0.6511233573548114, "repo_name": "pascalmouret/djangocms-social", "id": "c368fb92b517d373dbe5de04010c1f9fdefa4e60", ...
from gevent import pool import requests import npyscreen import pickle import os.path import time class RebMaControl: def __init__(self, repoListUrl): self.dumpFileName_repo = "./.repoList.bin" self.repoListUrl = repoListUrl try: if (os.path.isfile(self.dumpFileName_repo) and time.time() - os.path.getmtime(...
{ "content_hash": "28ec1044011d632f6405b621c54ec127", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 113, "avg_line_length": 28.75409836065574, "alnum_prop": 0.6984036488027366, "repo_name": "Mr-Pi/rebma", "id": "31d55baad647ca09c39b957e49a19666c7237bdf", "size": "1773", ...
import asyncio import atexit import json import logging import os import re import signal import subprocess import sys import tempfile import threading from typing import Any import tornado.iostream import tornado.queues import tornado.websocket from tornado import gen from tornado.ioloop import IOLoop from tornado.pr...
{ "content_hash": "39830319c24e4aab458e0baffc9a883c", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 100, "avg_line_length": 37.41284403669725, "alnum_prop": 0.5720941638057871, "repo_name": "openatx/weditor", "id": "a234005015557166e135970574714467f1414bf0", "size": "817...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Labelfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "parcats" _path_str = "parcats.labelfont" _valid_props = {"color", "family", "size"} ...
{ "content_hash": "3a9f01a416a967bd13b6d78e1b9f24f6", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 82, "avg_line_length": 37.12334801762115, "alnum_prop": 0.5587990981369407, "repo_name": "plotly/plotly.py", "id": "31427079fb73b85a7f33d80bb77d98d6cf1fa9cb", "size": "842...
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ...
{ "content_hash": "dfb0d2cef44c4cdea6362425dc97dc11", "timestamp": "", "source": "github", "line_count": 698, "max_line_length": 204, "avg_line_length": 44.83810888252149, "alnum_prop": 0.6309869955586798, "repo_name": "Azure/azure-sdk-for-python", "id": "ba172ec6e8a482a5b068639234823ad206d1da33", "...
from decimal import Decimal from datetime import datetime import dateutil.parser class BaseModel(object): """ Base class for other models. """ def __init__(self, **kwargs): self._default_params = {} @classmethod def _NewFromJsonDict(cls, data, **kwargs): if kwargs: f...
{ "content_hash": "af3019edecf575791d40b83311a704b9", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 165, "avg_line_length": 34.076422764227644, "alnum_prop": 0.5401059311924417, "repo_name": "mariorz/python-bitso", "id": "70ffc46786b357cadcda740ddee6ec0a1db79784", "size"...
''' Simple FreeSurfer ASCII surface file I/O functions Reads and writes surface anatomy files as understood by AFNI SUMA (and maybe other programs) The format for a surface with NV vertices and NF faces is: NV NF x_0 y_0 z_0 0 x_1 y_1 z_1 0 ... x_[NV-1] y_[NV-1] z_[NV-1] 0 f_00 f01 f02 0 f_10 f11 f12 0 ... f_[NF-1]0 ...
{ "content_hash": "43b7465ea2116becb447a33f5fac43a5", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 92, "avg_line_length": 23.503937007874015, "alnum_prop": 0.5658291457286432, "repo_name": "nno/surfing", "id": "6083adaf54f1c326419097dbc3a08e78188e56fd", "size": "3365", ...
import threading import eventlet from eventlet import greenpool from openstack.common import log as logging from openstack.common import loopingcall LOG = logging.getLogger(__name__) def _thread_done(gt, *args, **kwargs): """Callback function to be passed to GreenThread.link() when we spawn() Calls the :c...
{ "content_hash": "2c0ad2b7534965adfa32ee0a0a3da2f1", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 79, "avg_line_length": 31.21641791044776, "alnum_prop": 0.5825962228065982, "repo_name": "biirdy/monasca-anomaly", "id": "83df8b386f019e159090a81d7b637de822fce323", "size"...
from base import PacfmObjectBase, PacfmContainerBase from pacfm.model import file_provider class Highlight(PacfmObjectBase): def __init__(self, name, pathways, level, color, checked=True): PacfmObjectBase.__init__(self, name= name, level=level, color=color) self.pathways= pathways self.che...
{ "content_hash": "a2eba990e8e50fd775ec75fd0c0dd631", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 96, "avg_line_length": 30.88372093023256, "alnum_prop": 0.6212349397590361, "repo_name": "ecotox/pacfm", "id": "64ac9f2f66fdb7a580a8644b257a0dffc151a79b", "size": "1328", ...
""" aspen.configuration +++++++++++++++++++ Define configuration objects. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import mimetypes import os import sys from collections import defaultdict imp...
{ "content_hash": "294c67c82b5ef6e7d6e65bd011b3f1ce", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 89, "avg_line_length": 39.11155378486056, "alnum_prop": 0.5318325353977794, "repo_name": "jaraco/aspen", "id": "67e590cb11e37c8af72e1ebf8958cc542427cb3d", "size": "9817", ...
''' Connection module for Amazon S3 :configuration: This module is not usable until the following are specified either in a pillar or in the minion's config file:: s3.keyid: GKTADJGHEIQSXMKKRBJ08H s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A service_url may also be specified in the con...
{ "content_hash": "cc5b9147a09d1bee2414314f001c9cb7", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 78, "avg_line_length": 28.845, "alnum_prop": 0.5689027561102444, "repo_name": "victorywang80/Maintenance", "id": "e93ee95cde5319b2f37b0c33a0b5865058ab2345", "size": "5793"...
from django.test import SimpleTestCase from ..utils import setup class TruncatecharsTests(SimpleTestCase): @setup({'truncatechars01': '{{ a|truncatechars:5 }}'}) def test_truncatechars01(self): output = self.engine.render_to_string('truncatechars01', {'a': 'Testing, testing'}) self...
{ "content_hash": "6c2cea52d264fcfddee3d265a37c1433", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 91, "avg_line_length": 36.1875, "alnum_prop": 0.6511226252158895, "repo_name": "yephper/django", "id": "6e62457bd281a8bb46bd9249a65ea8dea8f81331", "size": "579", "binary"...
from flask import Blueprint navbar_blueprint = Blueprint("navbar", __name__, static_folder="static", template_folder="templates")
{ "content_hash": "167dd99d913a7c1729a2572842d1cda1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 101, "avg_line_length": 43.666666666666664, "alnum_prop": 0.7557251908396947, "repo_name": "marcoprado17/flask-bone", "id": "3af8b455982c1f0d9091ecc8e5660fb1e3acfac8", "size...