text
stringlengths
4
1.02M
meta
dict
from __future__ import absolute_import import weakref from defcon.objects.base import BaseDictCompareObject from defcon.objects.color import Color from defcon.tools.identifiers import makeRandomIdentifier class Guideline(BaseDictCompareObject): """ This object represents a guideline. **This object posts...
{ "content_hash": "b07c3b13a5eebe6eb256cbb8ba94e113", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 279, "avg_line_length": 32.520446096654275, "alnum_prop": 0.5983081847279378, "repo_name": "moyogo/defcon", "id": "2caa18c7fdd78a9bc2ef9eb4a17b34c3ac5f8753", "size": "8748...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General conf...
{ "content_hash": "f8db084e7f7c40e4b141cc60e6f11f52", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 31.602459016393443, "alnum_prop": 0.7039294514330178, "repo_name": "zsims/dic", "id": "e9e7bded838e062533a632c1a339419453d578d5", "size": "8127", ...
from axiom.test.historic import stubloader from xquotient.test.historic.stub_message1to2 import attrs from xquotient.exmess import Message, EVER_DEFERRED_STATUS from xquotient.mimestorage import Part ignored = object() class MessageUpgradeTest(stubloader.StubbedTest): def testUpgrade(self): m = self.store...
{ "content_hash": "b80a99aef5d7073b41e4d9b50e80379f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 39, "alnum_prop": 0.7035256410256411, "repo_name": "twisted/quotient", "id": "223b0cdd95bfacd2e88d23da11a153565f1d3cbd", "size": "624", "binary": f...
from networkapiclient.ApiGenericClient import ApiGenericClient from networkapiclient.utils import build_uri_with_ids class ApiEquipment(ApiGenericClient): def __init__(self, networkapi_url, user, password, user_ldap=None, log_level='INFO', request_context=None): """Class constructor receives parameters t...
{ "content_hash": "5724d88fe24883fcb9a99344c90305b2", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 111, "avg_line_length": 35.797872340425535, "alnum_prop": 0.6127786032689451, "repo_name": "globocom/GloboNetworkAPI-client-python", "id": "1980227b5c58eb327c8b42ea4f12c3961a...
import unittest from command import check_parent_request from command import check_child_id_request from command import CheckType import config import mac802154 import message import mle import node LEADER = 1 REED = 2 SED = 3 class Cert_6_1_2_REEDAttach_SED(unittest.TestCase): def setUp(self): self.simu...
{ "content_hash": "982b32e0b5dead1e67186544fc816e6a", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 131, "avg_line_length": 38.24742268041237, "alnum_prop": 0.6539083557951483, "repo_name": "erja-gp/openthread", "id": "9ddedb1042102801b55c52339955ba8d56ccbe95", "size": "5...
import logging from getgauge.python import Messages from kylin_utils import util _array_types = (list, tuple, set) _object_types = (dict, ) def api_response_equals(actual, expected, ignore=None): if ignore is None: ignore = [] def _get_value(ignore): def get_value(key, container): ...
{ "content_hash": "007562836be9b3b77e0fcdbd9482af45", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 360, "avg_line_length": 43.729166666666664, "alnum_prop": 0.5940924249642687, "repo_name": "apache/kylin", "id": "e352736d95498eda7670d4ef35c8a7e1cd467880", "size": "11296...
from setuptools import setup, find_packages setup( name = "parallelpandas", version = "0.1", packages = find_packages(), scripts = [], install_requires=['dill>=0.2', 'pandas>=0.14'], # metadata for upload to PyPI author = "Philipp Metzner", author_email = "philipp....
{ "content_hash": "b47c65a73272eacfd4d4ccf894c39597", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 61, "avg_line_length": 31.470588235294116, "alnum_prop": 0.6317757009345795, "repo_name": "gameduell/parallelpandas", "id": "4a0a87ce73525dc27ce39c2c7848b0da6fa2e080", "siz...
"""Resource Open Service Interface Definitions resource version 3.0.0 The Resource OSID defines a service to access and manage a directory of objects. Resources ``Resources`` may represent people, places or a set or arbitrary entities that are used throughout the OSIDs as references to indirect objects. In core OSID...
{ "content_hash": "583b5bca61ae3a0efef56966a64845c2", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 72, "avg_line_length": 45.148648648648646, "alnum_prop": 0.7818018557318168, "repo_name": "birdland/dlkit-doc", "id": "ae642c533fa3800b06a8e9529f4ce1f2b1656232", "size": "3...
import abc import numpy as np from scipy._lib._util import check_random_state from ..utils import (_chol, _chol_downdate, _chol_update, _chol_logdet, _chol_solve, _normal_rvs, _normal_logpdf, _wishart_rvs, _wishart_logpdf, _t_logpdf) class GenericMixture(object): """ Class which encapsulates ...
{ "content_hash": "632b46aa06455be0e5d4a1a27a5c29dd", "timestamp": "", "source": "github", "line_count": 1515, "max_line_length": 78, "avg_line_length": 30.51815181518152, "alnum_prop": 0.4742727371039256, "repo_name": "tscholak/imm", "id": "7da7cea2181083791f1c14ef59d84e636e0fa423", "size": "46272"...
from api.decorators import api_view, request_data_defaultdc from api.permissions import IsSuperAdmin from api.utils.db import get_object from api.node.image.api_views import NodeImageView from vms.models import NodeStorage, Image __all__ = ('node_image_list', 'node_image') @api_view(('GET', 'DELETE')) @request_data_...
{ "content_hash": "71416c9582e27f4372381ade6553d314", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 116, "avg_line_length": 36.36842105263158, "alnum_prop": 0.5965991316931982, "repo_name": "erigones/esdc-ce", "id": "9d8c5e21c199519f9dfd63a5257111e6de6d0947", "size": "55...
from pg8000 import DBAPI class dbManager(): ''' Postgresql driver for jxgpy dbManager for pg8000 ''' driver="pg8000Driver" def __init__(self,host,port,user,password,database): self.host=host self.port=port self.user=user ...
{ "content_hash": "c4b35f5e1424a3693887466792b8af29", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 134, "avg_line_length": 24.146341463414632, "alnum_prop": 0.6377104377104377, "repo_name": "julianariasquijano/jxgpy", "id": "6b3f101715c3d714c8e5355d6a9e286c7df4c86b", "s...
import errno import os __author__ = '[email protected]' def create_directory(directory): """Creates a directory if it does not exist (in a thread-safe way) @param directory: The directory to create @return: The directory specified """ try: os.makedirs(directory) except OSError, e:...
{ "content_hash": "1cf01e716b68c5fea7ced06f35c6d678", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 22.31578947368421, "alnum_prop": 0.6533018867924528, "repo_name": "Shapeways/coyote_framework", "id": "3d257f123b539089ba912417ac16a292b6a5ab8e", "si...
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class MembersApphook(CMSApp): name = _("Members Apphook") app_name = 'members' def get_urls(self, page=None, language=None, **kwargs): return ['allink_apps.members.url...
{ "content_hash": "3aa887b00b23e412bb135f654e08423d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 26, "alnum_prop": 0.7252747252747253, "repo_name": "allink/allink-apps", "id": "42b850c10a70cfc827daaf62fdbe03c6fa133824", "size": "388", "binary":...
import os from distutils.core import setup # Figure out the version; this could be done by importing the # module, though that requires Django to be already installed, # which may not be the case when processing a pip requirements # file, for example. import re here = os.path.dirname(os.path.abspath(__file__)) versi...
{ "content_hash": "549c1e7a81cadd1304550dac491f3bc8", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 67, "avg_line_length": 30.925925925925927, "alnum_prop": 0.6407185628742516, "repo_name": "PolicyStat/django-tables", "id": "d70f0ecbe5d6b3a3caa130485b1e9878b5b87426", "siz...
import random import numpy as np from sklearn.base import BaseEstimator, clone from tqdm import tqdm class BaggedModel(BaseEstimator): def __init__(self, estimator, n_models, random_state, verbose=True): self.estimator = estimator self.n_models = n_models self.random_state = random_state ...
{ "content_hash": "e91350a66dce9624e4169b645c2cc382", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 34.4375, "alnum_prop": 0.6116152450090744, "repo_name": "rladeira/mltils", "id": "e1c4d38d622a0233f826759f9bbc6c2317b02ca2", "size": "1104", "binar...
__revision__ = "test/MSVS/vs-8.0-clean.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify the -c option's ability to clean generated Visual Studio 8.0 project (.vcproj) and solution (.sln) files. """ import TestSConsMSVS test = TestSConsMSVS.TestSConsMSVS() host_arch = test.get_vs_host_arch() ...
{ "content_hash": "cf25558d576d67547c3d239f4e61af0a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 99, "avg_line_length": 28.247311827956988, "alnum_prop": 0.6372287780738485, "repo_name": "EmanueleCannizzaro/scons", "id": "259d0b3c87763d72da83d0d831089f0096462835", "siz...
import _plotly_utils.basevalidators class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__( self, plotly_name="ticktext", parent_name="choroplethmapbox.colorbar", **kwargs ): super(TicktextValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "9acbe738892e08fd49e9b17112c6d468", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 87, "avg_line_length": 34.57142857142857, "alnum_prop": 0.6115702479338843, "repo_name": "plotly/python-api", "id": "cb9744392d03a406fd7184b516f72959f79de9ea", "size": "484...
""" rentabot.controllers ~~~~~~~~~~~~~~~~~~~~ This module contains rent-a-bot functions related to database manipulation. """ from rentabot.models import Resource, db from rentabot.exceptions import ResourceException, ResourceNotFound from rentabot.exceptions import ResourceAlreadyLocked, ResourceAlreadyUnlocked, In...
{ "content_hash": "e2bafc94c62d667276e882df8adcbd6c", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 116, "avg_line_length": 31.721238938053098, "alnum_prop": 0.6005021620867624, "repo_name": "cpoisson/rent-a-bot", "id": "72a8affefaecb371581993cba7c94eb42a991f6d", "size":...
import requests import yaml response = requests.get( 'https://raw.githubusercontent.com/Lens10/datatrue-whitelist/master/' 'whitelist.yml') regions = yaml.load(response.text) all_addresses = [item for sublist in regions.values() for item in sublist] for address in sorted(all_addresses): print(address)
{ "content_hash": "4050a77dbc1a6979a9b09aaf63d89215", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 74, "avg_line_length": 28.818181818181817, "alnum_prop": 0.750788643533123, "repo_name": "Lens10/datatrue-whitelist", "id": "68fe36b26ddac62435899ef53945636837f8fc66", "siz...
bind = '127.0.0.1:1710' threads = 3 workers = 6 loglevel = "debug" # debug, info, warning, error and critical errorlog = '/tmp/grader-edx.log'
{ "content_hash": "db565a3a7d728e99fb567e0dcae0364f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 62, "avg_line_length": 28.8, "alnum_prop": 0.6805555555555556, "repo_name": "brnomendes/grader-edx", "id": "c555fe184a3ad90aabbac8ccef5e9729084a4237", "size": "144", "bina...
import datetime from keystoneclient.openstack.common import timeutils # gap, in seconds, to determine whether the given token is about to expire STALE_TOKEN_DURATION = 30 class AccessInfo(dict): """An object for encapsulating a raw authentication token from keystone and helper methods for extracting useful...
{ "content_hash": "5cf1cf084f3b8cf0cf919bde25ed58fb", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 31.58783783783784, "alnum_prop": 0.6055614973262032, "repo_name": "ioram7/keystone-federado-pgid2013", "id": "1dc86705af962e439ef87b1c82cd76f6b6ed2c38...
class Logger(object): def __init__(self, header, stream): self._header = header self._stream = stream def __call__(self, message): if self._stream: self._stream.write(' %-8s | %s\n' % (self._header, message))
{ "content_hash": "05ad7bc48882268288253f8d8e79d51c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 28.444444444444443, "alnum_prop": 0.5390625, "repo_name": "Tallisado/pyrofactory", "id": "24dd0dcf916fcb54676c0ab5efc33dacb6340d68", "size": "256", ...
import os print(os.getcwd()) fd = open("kant.txt") content = fd.read() print(content) fout = open("file1.txt", "w") content = fout.write("Alles neu mächt der Mai!") fout.close() fapp = open("file2.txt", "a") content = fapp.write("Alles neu mächt der Mai!\n") fapp.close() print(content)
{ "content_hash": "1d18ffd78722fa8cb28389b37dffeab1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 50, "avg_line_length": 18.1875, "alnum_prop": 0.6666666666666666, "repo_name": "kantel/python-schulung", "id": "486bd83d6161c9473466c1c790f875705dea1413", "size": "293", ...
from .chownref import main main()
{ "content_hash": "8e1acfdce2343e8454eed4207b2479ec", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 17, "alnum_prop": 0.7647058823529411, "repo_name": "amr/chownref", "id": "b04b3278d79c81cabae8a57ecca3128217f77291", "size": "59", "binary": false, ...
from pyraat import PraatAnalysisFunction as PyraatFunction from .functions import BaseAnalysisFunction class PraatAnalysisFunction(BaseAnalysisFunction): def __init__(self, praat_script_path, praat_path=None, arguments=None): super(PraatAnalysisFunction, self).__init__() self._function = PyraatFun...
{ "content_hash": "a90a0ecbdcb268332f7b53988d8db005", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 80, "avg_line_length": 45.5, "alnum_prop": 0.7450549450549451, "repo_name": "mmcauliffe/python-acoustic-similarity", "id": "eece6814362606dfb647471ecca404cf2f8df068", "size...
from MyPy.pdu.base import Packet class EofPacket(Packet): def from_data(self, data): self.data = data return self
{ "content_hash": "965990a05b9bfa0bbb98ac86dfcabe18", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 32, "avg_line_length": 19.857142857142858, "alnum_prop": 0.6330935251798561, "repo_name": "nasi/MyPy", "id": "2eac1d6aa4122493d0a3b61c6ac6574b3e6f6d5f", "size": "139", "bi...
""" CartoDB Spatial Analysis Python Library See: https://github.com/CartoDB/crankshaft """ from setuptools import setup, find_packages setup( name='crankshaft', version='0.0.0', description='CartoDB Spatial Analysis Python Library', url='https://github.com/CartoDB/crankshaft', author='Data Ser...
{ "content_hash": "e3497f0de95913c3c32cae6650a183d1", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 114, "avg_line_length": 28.020408163265305, "alnum_prop": 0.6438455935906774, "repo_name": "CartoDB/crankshaft", "id": "d1a2175b3ede717adffec852722c392d4673920b", "size": "...
from __future__ import division from future import standard_library standard_library.install_aliases() import logging import re import fnmatch import configparser import math import os from urllib.parse import urlparse import warnings import boto from boto.s3.connection import S3Connection, NoHostProvided from boto.s...
{ "content_hash": "5362ee14b62a9a5871b3b58701d65a40", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 82, "avg_line_length": 39.682870370370374, "alnum_prop": 0.559820334830543, "repo_name": "brandsoulmates/incubator-airflow", "id": "661f8d58f9feecfc6ff70bf96d506af5f096c3b8"...
''' If something inherits from Talker, then we can print text to the terminal in a relatively standard way. ''' import textwrap, numpy as np, pprint import sys if sys.version_info[0] < 3: input = raw_input shortcuts = None class Talker(object): ''' Objects the inherit from Talker have "mute" and "pithy" a...
{ "content_hash": "0d167e96baca2981f2f3546cf6e22985", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 142, "avg_line_length": 40.83076923076923, "alnum_prop": 0.591183119819141, "repo_name": "zkbt/exopop", "id": "74d7f9858865f12a61359ed16e11f2101f2cda81", "size": "2654", ...
import collections import errno import json import time import importlib # from utils.utilfuncs import safeprint from ..hubs import HubInitError import websocket from typing import Callable, Union import config import debug from . import haremote as ha import historybuffer import logsupport from utils import threadm...
{ "content_hash": "361c08abf981ba53c1b7b0c9d0ea6854", "timestamp": "", "source": "github", "line_count": 1060, "max_line_length": 172, "avg_line_length": 37.64905660377359, "alnum_prop": 0.6520998296080986, "repo_name": "kevinkahn/softconsole", "id": "19a0dcf0740bcfa8d5ab05a1f32ccb5d3a28dda3", "size...
from __future__ import absolute_import from webassets.filter import Filter __all__ = ('Jinja2',) class Jinja2(Filter): """Process a file through the Jinja2 templating engine. Requires the ``jinja2`` package (https://github.com/mitsuhiko/jinja2). """ name = 'jinja2' options = { 'context...
{ "content_hash": "37c23edb967510e6bc01cf1ce2893787", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 24.620689655172413, "alnum_prop": 0.5980392156862745, "repo_name": "torchbox/webassets", "id": "b80d259fd16052014449490ad6e7bcad4a32badd", "size": "7...
from __future__ import print_function, absolute_import import bacula_tools import logging import optparse class Job(bacula_tools.DbDict): '''This actually covers both Jobs and JobDefs, EXCEPT during parsing, when the JobDef subclass is used because it has different default values. ''' SETUP_KEYS = [b...
{ "content_hash": "5bcb9be0626ee7f32c7b67ceee8ae054", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 124, "avg_line_length": 42.37328767123287, "alnum_prop": 0.5761739270993291, "repo_name": "BrianGallew/bacula_configuration", "id": "39f45e720ffbd95b902dedc274ad55292c5a68ca...
import csv import operator import datetime import itertools import json EVENTS_FILE = "../data/events.csv" PROJECTS_FILE = "../data/projects.csv" EVENTS_JSON_FILE = "events.json" projects = list() # Helper functions def index(a, x): 'Locate the leftmost value exactly equal to x' i = bisect.bisect_left(a, x) ...
{ "content_hash": "fb858a9611a747c67d620471bb5421cd", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 107, "avg_line_length": 26.476190476190474, "alnum_prop": 0.6660671462829736, "repo_name": "kiberpipa/pipa-visualizations", "id": "3ad2b78cf01a7c8b5ef38e8f2a038433b1d3be28", ...
from stoq.data_classes import StoqResponse from stoq.plugins import DecoratorPlugin class DummyDecorator(DecoratorPlugin): async def decorate(self, response: StoqResponse) -> None: pass
{ "content_hash": "898434e85a185e604c1b9b987f1f9585", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 61, "avg_line_length": 28.571428571428573, "alnum_prop": 0.775, "repo_name": "PUNCH-Cyber/stoq", "id": "321b3dd2af3e0874dd430b0df38947c97dd1633e", "size": "841", "binary":...
"""Finds CrOS browsers that can be controlled by telemetry.""" import logging import sys from telemetry.core import browser from telemetry.core import possible_browser from telemetry.core.chrome import cros_platform_backend from telemetry.core.chrome import cros_browser_backend from telemetry.core.chrome import cros_...
{ "content_hash": "11368f5d201e5503797b4d74d9d388d3", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 77, "avg_line_length": 38.02272727272727, "alnum_prop": 0.6586969515839809, "repo_name": "timopulkkinen/BubbleFish", "id": "908df4403e8efd05d8485a885f0a01bda2e670be", "size...
import oslo_messaging as messaging from murano.common import config from murano.common import uuidutils from murano.dsl import murano_class from murano.openstack.common import log as logging LOG = logging.getLogger(__name__) @murano_class.classname('io.murano.system.StatusReporter') class StatusReporter(object): ...
{ "content_hash": "431541c24c38897b8751ac40841a39d2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 67, "avg_line_length": 31, "alnum_prop": 0.6370967741935484, "repo_name": "chenyujie/hybrid-murano", "id": "fcf5cb8550cf07023388f772042f08786c99795d", "size": "1823", "bi...
import sys from random import choice as randchoice from itertools import cycle from pygame import * from pygame import gfxdraw from board import PygameBoard, Loc, black, white, gray, center_square from utils import * """ which version to use? hl/move should be in Board when capturing, piece moves a 2nd time """ game...
{ "content_hash": "d35def8c1faa41d4f4f58e034c2b5c98", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 108, "avg_line_length": 29.683060109289617, "alnum_prop": 0.5506259204712813, "repo_name": "akulakov/pygame-games", "id": "538bf769d2707389f3a5f27d79d70bebf6a7fab6", "size...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Database.backup_path' db.add_column(u'logical_database', 'backup_path', ...
{ "content_hash": "35d609c1be03e97f46460dbd8fa8d1d5", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 205, "avg_line_length": 84.07272727272728, "alnum_prop": 0.5568771626297578, "repo_name": "globocom/database-as-a-service", "id": "8e86e894747109779447b9fd8a8087c7369546dc",...
from test_framework import generic_test def snake_string(s: str) -> str: # TODO - you fill in here. return '' if __name__ == '__main__': exit( generic_test.generic_test_main('snake_string.py', 'snake_string.tsv', snake_string))
{ "content_hash": "8b28f665648db4e364a8635a1050a812", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 77, "avg_line_length": 24.25, "alnum_prop": 0.5360824742268041, "repo_name": "shobhitmishra/CodingProblems", "id": "e367f2aed0d029d67b0a2e52b069eec8fdb21ee2", "size": "291"...
""" A client for AWS batch services .. seealso:: - http://boto3.readthedocs.io/en/latest/guide/configuration.html - http://boto3.readthedocs.io/en/latest/reference/services/batch.html - https://docs.aws.amazon.com/batch/latest/APIReference/Welcome.html """ from random import uniform from time import slee...
{ "content_hash": "f34952de8950613b7f4ac19755378db0", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 103, "avg_line_length": 33.9124513618677, "alnum_prop": 0.5967529114795479, "repo_name": "mrkm4ntr/incubator-airflow", "id": "84ff4c4644ae9af9f568dafb583ca879d428f949", "s...
""" A simple scribble program in Python which can draw on the canvas along mouse drags. Author: Semih Onay """ import sys from tkinter import * x,y=None,None def quit(event): sys.exit() def drag(event): global x,y newx,newy=event.x,event.y if x is None: x,y=newx,newy return print("d...
{ "content_hash": "2214649d41fc9a3ccd52abfeffe56bb3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 83, "avg_line_length": 19, "alnum_prop": 0.6411483253588517, "repo_name": "Semyonic/Study", "id": "683e59c05aea89847faf90767741925609c96e39", "size": "646", "binary": fal...
import re hand = open('mbox-short.txt') for line in hand: line = line.rstrip() if re.search('From:', line) : print line
{ "content_hash": "e904dc6deda976c094667c5b3cd67c6f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 34, "avg_line_length": 19.714285714285715, "alnum_prop": 0.5942028985507246, "repo_name": "lastralab/Statistics", "id": "965ecd2dc1feac19fb384cb442130f752b0dc217", "size": "...
"""check for new / old style related problems """ from logilab import astng from pylint.interfaces import IASTNGChecker from pylint.checkers import BaseChecker from pylint.checkers.utils import check_messages MSGS = { 'E1001': ('Use of __slots__ on an old style class', 'slots-on-old-class', ...
{ "content_hash": "44006933d8aadeeb626a4c1a3c5e23fc", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 79, "avg_line_length": 37.91752577319588, "alnum_prop": 0.5402392604676455, "repo_name": "yongshengwang/hue", "id": "edadad88d3f76ac644e378ece2e371755fb7df34", "size": "448...
from .sub_resource import SubResource class ApplicationGatewayRedirectConfiguration(SubResource): """Redirect configuration of an application gateway. :param id: Resource ID. :type id: str :param redirect_type: Supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible va...
{ "content_hash": "cb17fa7519cc339d8a8a3470a3da0cba", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 235, "avg_line_length": 48.785714285714285, "alnum_prop": 0.6667642752562225, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "42ac21c6e15df6c71017064606b3f7199cba10f2"...
from copy import deepcopy import numpy as np class History(object): # save s,a,r,s',d def __init__(self, length_buffer, time_window=2): # make some kind of ring buffer with certain length self.length_buffer = length_buffer self.time_window = time_window self.buffer = [None] * s...
{ "content_hash": "ba24fe7ec5c5873c72bdb6cf31495959", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 91, "avg_line_length": 38.53846153846154, "alnum_prop": 0.5718562874251497, "repo_name": "BerlinUnited/NaoTH", "id": "ee5f0b6bf7889fa46f2f1c6cfe26e344899694db", "size": "20...
import uuid import django.db.models.deletion import jsonfield.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( ...
{ "content_hash": "25aae3b37359d663f1c0a06beb52dbc7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 128, "avg_line_length": 38.794117647058826, "alnum_prop": 0.599696739954511, "repo_name": "rtfd/readthedocs.org", "id": "c1ee6c0b7140b658d8ec88a606a1ccbab9e59967", "size": ...
""" A collection of higher-level Twisted Web resources, suitable for use with any existing ``IResource`` implementations. `SpinneretResource` adapts an `ISpinneretResource` to `IResource`. `ContentTypeNegotiator` will negotiate a resource based on the ``Accept`` header. """ from twisted.internet.defer import Deferred...
{ "content_hash": "c6f73cb3ca6c7e25ab193863b43bdeea", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 79, "avg_line_length": 32.36078431372549, "alnum_prop": 0.6439650993698497, "repo_name": "jonathanj/txspinneret", "id": "273fd923cbae7b4092090434cca451db93066347", "size":...
from django.apps import AppConfig class AccountsConfig(AppConfig): name = "{{ cookiecutter.project_slug }}.accounts"
{ "content_hash": "12e2b0384a8e05fb7a1715defe43c12a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 53, "avg_line_length": 24.6, "alnum_prop": 0.7479674796747967, "repo_name": "r0x73/django-template", "id": "d724c0ce1ecbe8505d1c653bd3a5df20eac2a32a", "size": "123", "bina...
from yambopy import * import os # # by Henrique Miranda # def pack_files_in_folder(folder,save_folder=None,mask='',verbose=True): """ Pack the output files in a folder to json files """ if not save_folder: save_folder = folder #pack the files in .json files for dirpath,dirnames,filenames in os....
{ "content_hash": "171e7df76e83f5a801378bbffaaac8ed", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 119, "avg_line_length": 34.67704280155642, "alnum_prop": 0.5966674147217235, "repo_name": "alexmoratalla/yambo-py", "id": "56e0e2b861245c729004cc30bc37c435b52e546a", "size...
def decorate(func): print("in decorate function, decorating", func.__name__) def wrapper_func(*args): print("Executing", func.__name__) return func(*args) return wrapper_func def myfunction(parameter): print(parameter) if __name__ == "__main__": myfunction = decorate(myfunction) ...
{ "content_hash": "e90fd7e310d5724da29010fe48a2ff18", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 60, "avg_line_length": 21.72222222222222, "alnum_prop": 0.6035805626598465, "repo_name": "mishka28/NYU-Python", "id": "98d1c83051d36ce8778953b7e611a5705d51b0a1", "size": "4...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('discussion', '0009_auto_20160623_1800'), ] operations = [ migrations.AlterField( model_name='attachment', name='size', ...
{ "content_hash": "0c83c28d1d7d3ea196e1599419b53d0e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 59, "avg_line_length": 21.77777777777778, "alnum_prop": 0.5994897959183674, "repo_name": "BuildmLearn/University-Campus-Portal-UCP", "id": "93c24982bb79c17f7f8acf3ee0d167aca8...
"""Test some model methods""" import pytest from tracked_model.defs import REQUEST_CACHE_FIELD from tracked_model.models import RequestInfo, History from tests.models import BasicModel pytestmark = pytest.mark.django_db def test_history_str_and_get_object_current_instance(): """Test ``History.get_object_curre...
{ "content_hash": "b4b9c06075373df8cbd6d102f5155efb", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 69, "avg_line_length": 29.71951219512195, "alnum_prop": 0.6836274107509233, "repo_name": "ojake/django-tracked-model", "id": "ce42613f4d4b9224fd52b9831e73a64ddce86f78", "si...
""" Create plugin manifest file will proper WordPress headings. """ import os, datetime def create_manifest( config ): """ Create plugin manifest file will proper WordPress headings. """ cf = config['configuration'] pl = config['plugin'] f = open(cf['folder_name'] + "/" + cf['folder_name'] + ".php", 'w') ...
{ "content_hash": "9c5a9bc985dce283d60482d7351f35d3", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 146, "avg_line_length": 34.992537313432834, "alnum_prop": 0.5738963531669866, "repo_name": "richardroyal/wp-plugin-generator", "id": "353bd41c161940fbff599dfd3937fd0f4b40ed4...
"""Utilities for identifying local IP addresses.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import os import re import socket from subprocess import Popen, PIPE from warnings import warn LOCAL_IPS = [] PUBLIC_IPS = [] LOCALHOST = '' def _uniq_stable(e...
{ "content_hash": "614d8bc0474931d639450ddcf8dbd70c", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 97, "avg_line_length": 28.520446096654275, "alnum_prop": 0.5901981230448383, "repo_name": "bdh1011/wau", "id": "488650b5347d87bcb9a844503aabf2c07846c1c8", "size": "7672", ...
from ConfigParser import SafeConfigParser import errno import logging import os import urllib2 class Config(object): # S3 settings AWS_ACCESS_KEY_CONFIG = ('aws', 'access_key', 'AWS_ACCESS_KEY') AWS_SECRET_KEY_CONFIG = ('aws', 'secret_key', 'AWS_SECRET_KEY') AWS_TEST_RESULT_BUCKET_CONFIG = ('aws', 'test_result...
{ "content_hash": "cedb9f1bace01594b7b795d0460f93e5", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 98, "avg_line_length": 41.55625, "alnum_prop": 0.6632576327267258, "repo_name": "cloudera/dist_test", "id": "f7111f05c84ed4cfc811daaea97b7ff27f4879ce", "size": "6649", "...
from django.conf import settings from watchman.constants import DEFAULT_CHECKS, PAID_CHECKS # TODO: these should not be module level (https://github.com/mwarkentin/django-watchman/issues/13) WATCHMAN_ENABLE_PAID_CHECKS = getattr(settings, "WATCHMAN_ENABLE_PAID_CHECKS", False) WATCHMAN_AUTH_DECORATOR = getattr( se...
{ "content_hash": "dc1c5f836afef375459e7ff713dc78b5", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 98, "avg_line_length": 43.51428571428571, "alnum_prop": 0.7708470124753776, "repo_name": "mwarkentin/django-watchman", "id": "35938d2b59dd9b1757db6a0d6cf1de8441e8f128", "si...
""" This script computes smatch score between two AMRs. For detailed description of smatch, see http://www.isi.edu/natural-language/amr/smatch-13.pdf """ import amr import os import random import sys import time # total number of iteration in smatch computation iteration_num = 5 # verbose output switch. # Default f...
{ "content_hash": "50f17f9680adafa797ef66dbec4120f3", "timestamp": "", "source": "github", "line_count": 843, "max_line_length": 118, "avg_line_length": 42.852906287069985, "alnum_prop": 0.5673910034602077, "repo_name": "masterkeywikz/seq2graph", "id": "1d22f9df5dfed5b0f3f0ed64531b232f0b294e05", "si...
import logging from tornado import web from tornado import gen from urllib2 import URLError from UtilityLayer import * from concurrent.futures import ThreadPoolExecutor class RequestHandler(web.RequestHandler): INPUT = INPUT() OUTPUT = OUTPUT() RUNTIME = RUNTIME() BFLY_CONFIG = BFLY_CONFIG def in...
{ "content_hash": "895d235f00bf6260fd7b36a04fe0d797", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 62, "avg_line_length": 30.487179487179485, "alnum_prop": 0.5685449957947856, "repo_name": "Rhoana/butterfly2", "id": "d4a04298c70683db05b5a30fad9d42235672b836", "size": "23...
import inspect import os import runpy import specs # ------------------------------------------------------------------------------------------------- def fixpath(_path, _opts): return os.path.normpath(os.path.join(_opts.pathPrefix, _path)) # -----------------------------------------------------------------------...
{ "content_hash": "4065790e238af3d853a6256bd3e65271", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 99, "avg_line_length": 30.805555555555557, "alnum_prop": 0.47520288548241657, "repo_name": "daVinci1980/antebuild", "id": "ec553188d7f5cd2ed76b9ae7ebd1d430c90d65a3", "size"...
from enum import Enum class RouteNextHopType(Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" internet = "Internet" virtual_appliance = "VirtualAppliance" none = "None" class SecurityRuleProtocol(Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" class...
{ "content_hash": "c08ea686c3cfa0c356e997d202a3cba9", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 66, "avg_line_length": 17.523219814241486, "alnum_prop": 0.6786219081272085, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "4f5a411a8288cb184e7596c4334ff0cb8f973cd0"...
import dragon.updaters as updaters import dragon.vm.theano as theano import dragon.vm.theano.tensor as T from dragon.vm.tensorflow.framework import ops from dragon.vm.tensorflow.ops import variables class Optimizer(object): def __init__(self, use_locking, name): if not name: raise ValueError(...
{ "content_hash": "fb266154d97dc7acf749ae3fe0edf47d", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 81, "avg_line_length": 39.13978494623656, "alnum_prop": 0.6211538461538462, "repo_name": "neopenx/Dragon", "id": "7d232c80d6bfecd6f66996e8308474b2a0dfb21f", "size": "3833",...
from getpass import getpass import time import paramiko def main(): ip_addr = '50.76.53.27' username = 'pyclass' password = getpass() ssh_port = 8022 remote_conn_pre = paramiko.SSHClient() remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy()) remote_conn_pre.connect(ip_addr...
{ "content_hash": "ff9239f5e9043804b11fc8bd17e4ee15", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 129, "avg_line_length": 26.21951219512195, "alnum_prop": 0.6632558139534884, "repo_name": "linkdebian/pynet_course", "id": "9b58b1869c17cec9db18891a93470037a772ff83", "size...
import os import avro.ipc import avro.protocol import tornavro.transceiver proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr')).read() proto = avro.protocol.parse(proto) # Blocking client client = tornavro.transceiver.SocketTransceiver('localhost', 8888) requestor = avro.ipc.Requestor(proto, client) ...
{ "content_hash": "92e30aa337521fdfdf279d1a530a4a9b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 74, "avg_line_length": 24.375, "alnum_prop": 0.7589743589743589, "repo_name": "richid/tornavro", "id": "9ca2a35daf6aea4c6682550fb1c2e96cdc522c02", "size": "390", "binary"...
"""General demo data for Lino Avanti. - Course providers and courses """ # from django.conf import settings # from lino.utils import mti from lino.utils import Cycler # join_words from lino.utils.mldbc import babel_named as named from lino.api import rt, dd, _ from lino.modlib.users.choicelists import UserTypes fr...
{ "content_hash": "03407375f71c7d417b2cb1fb9571ac4d", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 72, "avg_line_length": 32.237864077669904, "alnum_prop": 0.6291221201626261, "repo_name": "lino-framework/book", "id": "17cb8142b962cf2f3838147ce64dada88b7590a1", "size": ...
from django import forms from .models import Categoria class PerguntaForm(forms.Form): pergunta = forms.SlugField(label="Pergunta") resposta = forms.CharField(label="Resposta", max_length=100) alternativa = forms.CharField(label="Resposta Alternativa", max_length=100) categoria = forms.ModelChoiceFie...
{ "content_hash": "3c9e6b1c0b28c01878c2df82c199eab4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 79, "avg_line_length": 32.42857142857143, "alnum_prop": 0.7555066079295154, "repo_name": "vss-moraes/dcn_quizz", "id": "397c7ef338f044473e73af9ba9f81e38adf3b867", "size": "...
from rest_framework import permissions from bluebottle.tasks.models import Task, TaskMember class IsTaskAuthorOrReadOnly(permissions.BasePermission): """ Allows access only to task author. """ def _get_task_from_request(self, request): if request.data: task_id = request.data.get(...
{ "content_hash": "0ea083331fad8e3440588d6160c50926", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 107, "avg_line_length": 34.56, "alnum_prop": 0.6331018518518519, "repo_name": "jfterpstra/bluebottle", "id": "43f547118e7c1af38329e7997cb08bcbf34020ee", "size": "2592", "...
import rospy import tensorflow as tf import numpy as np import scipy.spatial.distance import errno from os import listdir from os.path import join from os.path import basename from shutil import copyfile from scipy.misc import imread, imresize from math import* import heapq import time import cv2 import csv class vg...
{ "content_hash": "4f8c5d424e4ccc873b53a8a1dccdfc65", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 142, "avg_line_length": 45.53932584269663, "alnum_prop": 0.5321490254132741, "repo_name": "HassanAmr/Visio-based-Object-Placement", "id": "e018858d9594dcbfccd8a5ed5c0bbae2f4...
import abc import gtimer as gt from rlkit.core.rl_algorithm import BaseRLAlgorithm from rlkit.data_management.replay_buffer import ReplayBuffer from rlkit.samplers.data_collector import PathCollector class BatchRLAlgorithm(BaseRLAlgorithm, metaclass=abc.ABCMeta): def __init__( self, train...
{ "content_hash": "a5e235a6298f5c5d5b7ae9143839996e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 76, "avg_line_length": 37.892857142857146, "alnum_prop": 0.5673892554194157, "repo_name": "vitchyr/rlkit", "id": "848c5eb806ff23b19d9ef8611ea17b1ab5f9f876", "size": "3183",...
""" C code printer The CCodePrinter converts single sympy expressions into single C expressions, using the functions defined in math.h where possible. A complete code generator, which uses ccode extensively, can be found in sympy.utilities.codegen. The codegen module can be used to generate complete source code files...
{ "content_hash": "f8da52823d90561347192d9d8f8762a1", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 82, "avg_line_length": 35.96969696969697, "alnum_prop": 0.5474936815501263, "repo_name": "hrashk/sympy", "id": "2d62e844f5c9f4abfa5c2a678b36569fa2bfe930", "size": "9496", ...
from django.conf.urls import include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.core.urlresolvers import reverse_lazy from django.views.generic import RedirectView admin.autodiscover() import logging # set up logger, for debugging logg...
{ "content_hash": "4fe624ea4214c85d2fd70db4cac38a00", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 33.03846153846154, "alnum_prop": 0.7112922002328289, "repo_name": "unt-libraries/catalog-api", "id": "dfd3d8355a1713f18b7c9eed8acf125fcf1dcd23", "siz...
import math import copy import string class BBox(): def __init__(self, minx, miny, maxx, maxy): self.minx = min(minx, maxx) self.miny = min(miny, maxy) self.maxx = max(minx, maxx) self.maxy = max(miny, maxy) def __str__(self): return 'BBox[' + str(self.minx) + \ ...
{ "content_hash": "a836318249af6f216751c36990848c16", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 106, "avg_line_length": 30.00943396226415, "alnum_prop": 0.48077124593943205, "repo_name": "opengeogroep/geobo3", "id": "1fb6baa5bd1e6751a7c6aa836ff144b137bf4ba4", "size":...
import sys import json props = ['depth', 'height', 'italic', 'skew'] if len(sys.argv) > 1: if sys.argv[1] == '--width': props.append('width') data = json.load(sys.stdin) sep = "export default {\n " for font in sorted(data): sys.stdout.write(sep + json.dumps(font)) sep = ": {\n " for...
{ "content_hash": "c21ea3cb52f6c32d57f2ac557a7e1330", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 28.166666666666668, "alnum_prop": 0.5310650887573964, "repo_name": "kwangkim/KaTeX", "id": "e659257f40981c35532456a8bce76b3c5755bd3b", "size": "699",...
from itsdangerous import Serializer, BadSignature from itsdangerous import SignatureExpired from sqlalchemy.orm import sessionmaker import AppConfig from dbmodels.Models import User, Post class BaseService(): __dbEngine = None __session = None def __init__(self, dbEngine=None): if dbEngine is Non...
{ "content_hash": "14090a15f7528c82afe6852e7155db0d", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 84, "avg_line_length": 27.673076923076923, "alnum_prop": 0.645587213342599, "repo_name": "mandrive/FlaskTest", "id": "d3b60b2ced7c44866343e701fb4627fdd70e9e71", "size": "14...
"""Rename table for TimeEntry model Revision ID: 1b91f4c7c1b Revises: 28b17a6c5cf Create Date: 2015-03-25 00:59:41.396413 """ # revision identifiers, used by Alembic. revision = '1b91f4c7c1b' down_revision = '28b17a6c5cf' from alembic import op import sqlalchemy as sa def upgrade(): op.rename_table('times_ent...
{ "content_hash": "069b646bff9ce3b1e5ecda5bc0251d86", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 52, "avg_line_length": 18.863636363636363, "alnum_prop": 0.7325301204819277, "repo_name": "xuhcc/airy", "id": "dc02db497551e22716562a0b04adb007c1d4d6dc", "size": "415", "...
"""Testcases for cssutils.css.cssproperties.""" import xml.dom import basetest import cssutils.css import cssutils.profiles class CSSPropertiesTestCase(basetest.BaseTestCase): # def test_cssvalues(self): # "cssproperties cssvalues" # # does actually return match object, so a very simplified test... ...
{ "content_hash": "8e45bb087211255f7a515b2222b310d7", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 86, "avg_line_length": 40.23809523809524, "alnum_prop": 0.6473372781065089, "repo_name": "hackatbrown/2015.hackatbrown.org", "id": "ce6ec4df0d6429d09826c888c0db21ff0b0d5c6c",...
""" A collection of tests covering user management in DC/OS. Assume that access control is activated in Master Admin Router (could be disabled with `oauth_enabled`) and therefore authenticate individual HTTP requests. One aspect of DC/OS user management is that once authenticated a user can add other users. Unauthent...
{ "content_hash": "530c426705128b1dfa6291f9fd7633ed", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 80, "avg_line_length": 32.54320987654321, "alnum_prop": 0.6760242792109257, "repo_name": "surdy/dcos", "id": "8a8504de4aa3563345f1a9a066d9b7951825f104", "size": "5272", ...
import weather weather.cli()
{ "content_hash": "aab65d502e36fbec7ad061212af6030b", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 14, "avg_line_length": 14.5, "alnum_prop": 0.7931034482758621, "repo_name": "faustocarrera/weather-cli", "id": "2acb0d40d6bb2ee531c0c63877c3c9ede1ab2056", "size": "29", "b...
from nose.tools import assert_equal from nose.tools import assert_true from proboscis import before_class from proboscis import test from trove.openstack.common import timeutils from trove.tests.util import create_dbaas_client from troveclient.compat import exceptions from datetime import datetime from trove.tests.ut...
{ "content_hash": "01ef86f0449c85d1c8c8f0da130df7a2", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 74, "avg_line_length": 31.762962962962963, "alnum_prop": 0.5573694029850746, "repo_name": "changsimon/trove", "id": "3ff56a86e13155dbda404cc0ba86cb71c04c58ea", "size": "50...
from __future__ import absolute_import, division, print_function import os import re import subprocess import sys import decimal from operator import attrgetter from itertools import chain from collections import Iterator from datetime import datetime, date from distutils.spawn import find_executable import pandas a...
{ "content_hash": "b273459f931f0a27d19149c33bc56110", "timestamp": "", "source": "github", "line_count": 747, "max_line_length": 113, "avg_line_length": 33.572958500669344, "alnum_prop": 0.6080385980302245, "repo_name": "cpcloud/odo", "id": "802d95c9712e754803773f466b2733d3a611e321", "size": "25079"...
from __future__ import print_function, division, unicode_literals, absolute_import from .base import MittensBaseInterface, IFLOGGER import os.path as op import numpy as np from nipype.interfaces.base import (traits, File, isdefined, BaseInterfaceInputSpec, TraitedSpec) from glob import glob class...
{ "content_hash": "c7aa1a48986136bcc887bdc0abe318bb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 99, "avg_line_length": 46.855555555555554, "alnum_prop": 0.6540194451031539, "repo_name": "mattcieslak/MITTENS", "id": "380b6c0b721f6a831ef92637bc2037b1116e4caf", "size": "...
""" The `mrs` package of pyDelphin contains classes and methods related to Minimal Recursion Semantics (Copestake et al. 2005). In addition to MRS, there are the related formalisms Robust Minimal Recursion Semantics (RMRS; Copestake, 2003) and Dependency Minimal Recursion Semantics (DMRS; Copestake, 2009). In pyDelphin...
{ "content_hash": "b49f971df4fd184b3cdbfa90c07f7304", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 78, "avg_line_length": 39.785714285714285, "alnum_prop": 0.6430879712746859, "repo_name": "dantiston/pydelphin", "id": "955852fb6d805ffba0bee00322ae7e92a4ac8154", "size": ...
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from muser.models import UserProfile import json import logging logger = logging.getLogger(__name__) #@login_required def ...
{ "content_hash": "b9e8a1a6def2107f82468d3fda69cbcb", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 74, "avg_line_length": 31.166666666666668, "alnum_prop": 0.7532467532467533, "repo_name": "youtaya/mothertree", "id": "7cd7ef61669f3619cb4df5f9c90a64ee2bf250ea", "size": "1...
"""Layers for Sparse Transformer models.""" import tensorflow.compat.v1 as tf from sgk.sparse import ops def preprocess_attention_component(x): shape = x.shape.as_list() assert len(shape) == 4 return tf.reshape(x, [-1] + shape[2:]) def sparse_dot_product_attention(q, k, v, topology, **_): q_3d, k_3d, v_3d ...
{ "content_hash": "6a125e040901b81a3ab0ce3b868169e9", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 33.34615384615385, "alnum_prop": 0.6943483275663207, "repo_name": "google-research/google-research", "id": "1057b38e839212ac3a14e3ff0e20f187e06244c8", ...
import atexit import fcntl import logging import os import signal import sys from types import FrameType, TracebackType from typing import NoReturn, Optional, Type def daemonize_process(pid_file: str, logger: logging.Logger, chdir: str = "/") -> None: """daemonize the current process This calls fork(), and h...
{ "content_hash": "7d35fbf24c02385c9dea8f4bc7bd52f1", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 88, "avg_line_length": 34.44094488188976, "alnum_prop": 0.6499771376314586, "repo_name": "matrix-org/synapse", "id": "031880ec39e13bce185872f16e770307b8b7ac00", "size": "5...
from django import forms from django.contrib.comments.forms import CommentForm from comments.models import CommentWithRating from comments.widgets import StarsRadioFieldRenderer RATING_CHOICES = ( (1,1), (2,2), (3,3), (4,4), (5,5), ) class CommentFormWithRating(CommentForm): rating = forms.Cha...
{ "content_hash": "4d190df9d7d7f700082380bacf538f22", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 136, "avg_line_length": 32.34615384615385, "alnum_prop": 0.6932223543400713, "repo_name": "copelco/Durham-Open-Data-Catalog", "id": "3e21d60523ebdceefa78eb9fe7fb9f313ce82ebd"...
import logging import asyncio import datetime import warnings from typing import Any, TYPE_CHECKING, Union, List, Optional, Mapping, cast import uamqp from uamqp import SendClientAsync, types from azure.core.credentials import AzureSasCredential, AzureNamedKeyCredential from .._common.message import ( ServiceBusM...
{ "content_hash": "e5c298e520587958ecfcb91a824af029", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 119, "avg_line_length": 44.51981351981352, "alnum_prop": 0.6376250065448453, "repo_name": "Azure/azure-sdk-for-python", "id": "ccbdd6e4ab20855afad70ec1e48359ac8e25f5cc", "...
__author__ = 'ajpina' from uffema.pockets import PMPocket from uffema.misc.constants import * class PMUPocket(PMPocket): @property def type(self): return self._type @type.setter def type(self, value): self._type = value def get_type(self): return 'U' def __init__(s...
{ "content_hash": "599bbb19d4197d76975aa98b28c62a9f", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 127, "avg_line_length": 42.38333333333333, "alnum_prop": 0.569799449469131, "repo_name": "ajpina/uffema", "id": "1436fd7c5b6f349948c8e1153551a6ae15890712", "size": "3341", ...
from django import forms from markymark.fields import MarkdownFormField class MarkdownForm(forms.Form): content = MarkdownFormField()
{ "content_hash": "c4b32725850acdd2d01c16219070ffaf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 46, "avg_line_length": 20.142857142857142, "alnum_prop": 0.8014184397163121, "repo_name": "moccu/django-markymark", "id": "32ec0cdd028f237e1e28fd1c75827c0e52d1b7c8", "size":...
from basic import Basic, S, C from operations import AssocOp from cache import cacheit from symbol import Symbol class Add(AssocOp): __slots__ = [] is_Add = True @classmethod def flatten(cls, seq): """ Takes the sequence "seq" of nested Adds and returns a flatten list. Retur...
{ "content_hash": "6c5558a18bf3de4486d7d29124fee1c4", "timestamp": "", "source": "github", "line_count": 489, "max_line_length": 103, "avg_line_length": 31.948875255623722, "alnum_prop": 0.4790373167765474, "repo_name": "hazelnusse/sympy-old", "id": "69ec47345bfb38a142124781b89b1b3258ad477a", "size"...
from django import forms from django.db import models from django.template import RequestContext from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ # portlets imports from lfs.catalog.settings import VARIANT from portlets.models import Portlet # lfs imports fro...
{ "content_hash": "8642014ae0e5fda234e884ee41f28fc2", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 98, "avg_line_length": 32.04054054054054, "alnum_prop": 0.6284268241248419, "repo_name": "lichong012245/django-lfs-0.7.8", "id": "ba5e3f35822c73aafc2114384e5efd25a00bcd26", ...
""" WSGI config for makegoalsdaily project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJAN...
{ "content_hash": "91e1e8b3ed830feb35d3422db665bc0a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 79, "avg_line_length": 25.6875, "alnum_prop": 0.7785888077858881, "repo_name": "sundeep-co-in/makegoalsdaily", "id": "2a5dddb0424e229561bf4af3e805ff323dd07739", "size": "41...
"""Classes for reading and writing VCF files. The VCF format is described at https://samtools.github.io/hts-specs/VCFv4.3.pdf API for reading: ```python from third_party.nucleus.io import vcf with vcf.VcfReader(input_path) as reader: for variant in reader: print(variant) ``` API for writing: ```python from ...
{ "content_hash": "47b5356ef4b1ab4ecf9b89b094295b72", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 80, "avg_line_length": 38.205555555555556, "alnum_prop": 0.696524647375309, "repo_name": "google/deepvariant", "id": "be3b38d364617fdc5281ec99579d8fe0ac31363d", "size": "1...
from distutils.core import setup setup(name='tvhc', version='0.1', description='Simple python implementation of HTSP-Protocol (tvheadend)', url='http://www.github.com/chwiede/tvhc', packages=['tvhc'] )
{ "content_hash": "a5ff552fabf33b3444f1512000f8e1e5", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 78, "avg_line_length": 28.375, "alnum_prop": 0.6696035242290749, "repo_name": "chwiede/tvhc", "id": "8ba873c5eac80585d1aadffb0b8e9cf4c7fc6a16", "size": "250", "binary": fa...
import colander from ichnaea.api.schema import ( InternalMappingSchema, InternalSchemaNode, InternalSequenceSchema, ) from ichnaea.api.locate.schema import ( BaseLocateSchema, FallbackSchema, ) RADIO_STRINGS = ['gsm', 'cdma', 'umts', 'wcdma', 'lte'] class CellsSchema(InternalSequenceSchema): ...
{ "content_hash": "8bcc34913aa2b4fd947e374efcbc9339", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 72, "avg_line_length": 32.83050847457627, "alnum_prop": 0.701600413009809, "repo_name": "therewillbecode/ichnaea", "id": "4a8ebf40af50eb791960e1ce65ee3c4c65b751bb", "size":...
""" ghostly.django.testcase ~~~~~~~~~~~~~~~~~~~~~~~ Module containing GhostlyDjangoTestCase. """ from __future__ import absolute_import, print_function, unicode_literals try: from django.contrib.staticfiles.testing import StaticLiveServerTestCase except ImportError: # Django < 1.7 from django...
{ "content_hash": "6e3c511a9fa4dba0194bebfe791d954a", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 81, "avg_line_length": 31.59036144578313, "alnum_prop": 0.6147978642257819, "repo_name": "alexhayes/ghostly", "id": "84b88c2cdb0a8297effffdbf7af24c5c32b6af76", "size": "264...
""" A module of handy plotting functions and shortcuts for Time-Distance diagrams """ from __future__ import absolute_import, division, print_function import os import glob import itertools import numpy as np from scipy.interpolate import interp1d import matplotlib as mpl import matplotlib.pyplot as plt from matplo...
{ "content_hash": "a0d5005f293867759d7850be3c9c104d", "timestamp": "", "source": "github", "line_count": 520, "max_line_length": 96, "avg_line_length": 33.11730769230769, "alnum_prop": 0.6003135706404971, "repo_name": "Cadair/Thesis", "id": "7d4ea2fae0a5733f76f60f9bcc6a18e75b692976", "size": "17245"...
from django.conf import settings PIWIK_TRACKING_API_URL = getattr(settings, 'PIWIK_TRACKING_API_URL', False) PIWIK_SITE_ID = getattr(settings, 'PIWIK_SITE_ID', False) PIWIK_TOKEN_AUTH = getattr(settings, 'PIWIK_TOKEN_AUTH', False)
{ "content_hash": "19bcd291278965ebeb84bae6bf4a88fc", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 75, "avg_line_length": 46.2, "alnum_prop": 0.7619047619047619, "repo_name": "daddz/django-piwik-middleware", "id": "8d6f097ab18f8ae16ce0ed119aa225014ffce1d5", "size": "231",...
import requests BASE_URL = 'http://api.soundcloud.com' CLIENT_ID = 'ce8f07daeb00017dc254362a3f083b22' def get_comments(tracks): comment_dict = {} for track in tracks: url = '{}/comments?'.format(BASE_URL) params = { 'client_id': CLIENT_ID, 'track_id': track['id'], ...
{ "content_hash": "cc6d07ad7e9a8d8a034b197b25bab6d7", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 58, "avg_line_length": 26.574468085106382, "alnum_prop": 0.5724579663730984, "repo_name": "MIR-focus/sampletime", "id": "0803ee880495567d8c94c55b606582e0a897fbf2", "size": ...
from setuptools import setup, find_packages f = open('README.rst') long_description = f.read().strip() long_description = long_description.split('split here', 1)[1] f.close() # Requirements to install buffet plugins and engines _extra_genshi = ["Genshi >= 0.3.5"] _extra_mako = ["Mako >= 0.1.1"] setup( name='tw2....
{ "content_hash": "167fba2dc73b334b970d2ad258ee3f31", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 31.641509433962263, "alnum_prop": 0.616577221228384, "repo_name": "toscawidgets/tw2.jqplugins.gritter", "id": "612b27ca0bd449df4f357877c5f32eccf951c278...
"""Simple report that displays a graph of the CDF of the given distribution.""" from matplotlib import pyplot from model import node_plot # Number of samples from distribution to be plotted, pre-interpolation. NUM_SAMPLES = 100 # Number of interpolated values in plot. GRAPH_RESOLUTION = 1000 def report(node, args...
{ "content_hash": "f1cde9edfab1b979b87a95490026670b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 23.555555555555557, "alnum_prop": 0.7358490566037735, "repo_name": "ggould256/libpmp", "id": "64af6d4c90e5f695fbdc138e2fc5e43de4e0d857", "size": "101...