text
stringlengths
4
1.02M
meta
dict
"""Driver sets up the algorithm and problem space, sets up an interactive loop for user input and provides output. """ import sys import time import resource # TODO import random #from algorithms.bfs import Bfs from problems.tictactoe import TicTacToe """Handle user input and return the selected algorithm and problem...
{ "content_hash": "dc712434b084852c3f559775479bee7e", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 78, "avg_line_length": 24.903225806451612, "alnum_prop": 0.5993091537132987, "repo_name": "PhilipCastiglione/learning-machines", "id": "76eb9289001f001dd2e4011b66c2ff318523bb...
import sys import re from .product import Product class ProductCreator(object): __lady_blouse_regex = re.compile('http:\/\/(i[12]\.ztat\.net[a-zA-Z\/0-9-@]*\.?[a-zA-Z0-9]*?\.jpg) (?:([a-zA-Z&\u00fc\. ]*) - ([a-zA-Z ]*)|([a-zA-Z&\u00fc\.\s]*) (Bluse))\s-\s([a-zA-Z\u00df\-\/ ]*) ([0-9, ]*) \u20ac ? (?:[0-9]{2}(?: ...
{ "content_hash": "58cbc3a4e8c65ad2412a7658fe2c4b09", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 359, "avg_line_length": 35.27777777777778, "alnum_prop": 0.5785826771653543, "repo_name": "dustywind/bachelor-thesis", "id": "f4f580ede5eb74cb48def7113f7605f0f883b8b2", "s...
""" binder.models.user ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 by Ananth Bhaskararaman :license: MIT, see LICENSE for more details """ from ..database import db class User(db.Model): UUID = db.Column(db.CHAR(36), primary_key=True) Name = db.Column(db.String(50)) Email = db.Column(db.Stri...
{ "content_hash": "0023be6b38038939611b0cc70cbcf79d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 53, "avg_line_length": 21.676470588235293, "alnum_prop": 0.587516960651289, "repo_name": "ananthb/binder", "id": "da21f24fa31c26b89017dd5a6eebcd8828f06134", "size": "737", ...
""" Predict from snapshot file. Usage: run_predict.py snapshot Where snapshot was saved by `run_train.py`. Model type and folders are as defined in `config.py`. """ from argparse import ArgumentParser import cPickle import gzip import logging import os import theano.tensor as T from config import config from ...
{ "content_hash": "882c399ff624899dd2284d4e37b3f25c", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 25.307692307692307, "alnum_prop": 0.6425531914893617, "repo_name": "rmunoz12/sfddd", "id": "8a15e6d4c74dbd6e14ee5eaff5730ac23e2e47c7", "size": "1645"...
from django_ical.views import ICalFeed from .models import Event class EventFeed(ICalFeed): #product_id = '-//example.com//Example//EN' timezone = 'UTC' def items(self): return Event.objects.all().order_by('-event_start') def item_title(self, item): return item.event_name def i...
{ "content_hash": "9f0d833abfc24a09b5c844c1a986fe69", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 59, "avg_line_length": 21.692307692307693, "alnum_prop": 0.6312056737588653, "repo_name": "bable5/schdlr", "id": "87b33472bd18780959d3b3b335db974b753b6b07", "size": "564", ...
from importlib import import_module # Django from django.conf import settings from django.db.models.signals import post_syncdb # External try: from south.signals import post_migrate South = True except ImportError: South = False # User import notifier from notifier.models import Backend from notifier imp...
{ "content_hash": "70a4ba4a18bc40afb511d494362ad19a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 27.56179775280899, "alnum_prop": 0.6049735018344884, "repo_name": "flc/django-notifier", "id": "fb7a74e8a835573ff11f1e3b178c593daa1549e9", "size": "2...
"""Generic Node base class for all workers that run on hosts.""" from oslo_config import cfg from oslo_utils import importutils from report.openstack.common import service from report import wsgi from report import rpc from report import utils from report import exception from report import context from report.i18n i...
{ "content_hash": "32c80e1fc5b0c470df57a3c63760ddea", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 80, "avg_line_length": 36.04347826086956, "alnum_prop": 0.5656664656212304, "repo_name": "Aaron-DH/report", "id": "d37b42baca37166bec1edbb98e243f235298d381", "size": "1403...
""" Exception raised when a body request could be parsed normally, but it's contents doesn't satisfies the specified values by the app """ from rinzler.exceptions import RinzlerHttpException __author__ = ["Rinzler<github.com/feliphebueno>", "4ndr<github.com/4ndr>"] class UnacceptableInputException(RinzlerHttpExcepti...
{ "content_hash": "ddc4685d4a6e68d1baca3eb7dd79433f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 112, "avg_line_length": 28.8, "alnum_prop": 0.7430555555555556, "repo_name": "feliphebueno/Rinzler", "id": "14f9d0cf04dbef200ce56fa71a24c212cf89155e", "size": "432", "bin...
from google.cloud import aiplatform_v1beta1 def sample_list_model_deployment_monitoring_jobs(): # Create a client client = aiplatform_v1beta1.JobServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.ListModelDeploymentMonitoringJobsRequest( parent="parent_value", )...
{ "content_hash": "944820a5a2decd4d9f4555e961c09efd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 97, "avg_line_length": 30.4, "alnum_prop": 0.7483552631578947, "repo_name": "googleapis/python-aiplatform", "id": "9533d98066f693c78e878e36437c3dd76ba0ad69", "size": "1666"...
from .r_base import r_base # r modules from .r_anova import r_anova from .r_dataNormalization import r_dataNormalization from .r_missingValues import r_missingValues from .r_pca import r_pca from .r_svd import r_svd from .r_pls import r_pls from .r_spls import r_spls from .r_statistics import r_statistics from .r_enric...
{ "content_hash": "1ca9bd6f1ad1e533a605b50f438f7a41", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 52, "avg_line_length": 25.125, "alnum_prop": 0.6666666666666666, "repo_name": "dmccloskey/r_statistics", "id": "b52275e9ee1272d4a82dc142081de4f542f99f3c", "size": "603", ...
from django.db import models from django.utils.translation import ugettext_lazy as _ from filer.models import Image from cms.models import CMSPlugin class Product(models.Model): title = models.CharField(_('title'), max_length=255) description = models.TextField(_('description')) price = models.FloatField(...
{ "content_hash": "244fc1945671aade9649a1f149b5f5b0", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 70, "avg_line_length": 33.388888888888886, "alnum_prop": 0.6589018302828619, "repo_name": "amaozhao/basecms", "id": "e39f564b681b3dc492b934f78993d6bc07728b3d", "size": "120...
from datetime import datetime from decimal import Decimal from django.conf import settings from django.contrib.contenttypes import generic from django.db import models, transaction from etc import cache from etc.entities import EntityTypes, type_to_class, obj_to_type from etc.func import crc32, salted_hash import json ...
{ "content_hash": "e2c57851ec222d8c4d6b22cfaf45ef1f", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 240, "avg_line_length": 37.54857142857143, "alnum_prop": 0.6352153401308781, "repo_name": "jumoconnect/openjumo", "id": "92d92e47a83889fea0c3edc8785d6a09c0d03cf8", "size":...
"""Utility functions for parsing and building Ethernet packet/contents.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2017 The ...
{ "content_hash": "9eae9f6d931ab0403071176021cae148", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 34.00763358778626, "alnum_prop": 0.6482603815937149, "repo_name": "isomer/faucet", "id": "ccf5ec54e37ab697462615c587c075fbe78b2ad0", "size": "8910",...
from asyncio import CancelledError import vedro.core as core import vedro.plugins.artifacted as artifacted import vedro.plugins.assert_rewriter as assert_rewriter import vedro.plugins.deferrer as deferrer import vedro.plugins.director as director import vedro.plugins.interrupter as interrupter import vedro.plugins.ord...
{ "content_hash": "fc444e3ad922b6c4fc36e42e9730d099", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 92, "avg_line_length": 29.550847457627118, "alnum_prop": 0.6891310582162318, "repo_name": "nikitanovosibirsk/vedro", "id": "f1182c9bf61b094caa4f49f93c4a2c22430a7870", "siz...
import csv import os import pymongo fips_code = '013' # Connect to database client = pymongo.MongoClient(os.environ['DISTRICT_DB']) db = client.va_district_court_cases cases = db.cases.find({ 'FIPSCode': fips_code, 'date_collected': {'$exists': True} }, projection = { '_id': False, 'error': False, ...
{ "content_hash": "6db232264db2177b251808ebe1b21a90", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 35.054054054054056, "alnum_prop": 0.6445643793369313, "repo_name": "bschoenfeld/va-court-scraper", "id": "f2ee072775d45b2e099a5f4d3b680d7f77602ef3", ...
import os import time import socket import random import threading from libfuzz.proxy import UdpProxy, TcpProxy from libfuzz.fuzzer import Fuzzer # TODO # 1. Session per saved packet stream # 2. Use MODE based separation of functionality # 3. Input module on a separate thread for constant generation in # 4. Separate ...
{ "content_hash": "16a4a2842a30c313bdd7a72c84c90d32", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 98, "avg_line_length": 35.60126582278481, "alnum_prop": 0.6040888888888889, "repo_name": "anhusa/pyfuzz", "id": "03962a25ce72116b90f5625a816b342006df2467", "size": "11251"...
from . import pos_order
{ "content_hash": "89c0c65ad6b4a55b9fe57abfb38a8ad8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 23, "avg_line_length": 24, "alnum_prop": 0.75, "repo_name": "it-projects-llc/pos-addons", "id": "8e9c9c4c75c17230312b468b3c6a03218481fe15", "size": "77", "binary": false, ...
from .create_backup import CreateBackup assert CreateBackup
{ "content_hash": "735ee9b97e31076967897c3966ecb42a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 20.333333333333332, "alnum_prop": 0.8524590163934426, "repo_name": "rmyers/trove-dashboard", "id": "f8f57b274dc9ec3dfee4593ae786d1ca1b7bf071", "size":...
from datetime import datetime from lux.models import Schema, fields from lux.ext.rest import RestRouter, route from lux.ext.odm import Model class TokenSchema(Schema): user = fields.Nested('UserSchema') class Meta: model = 'tokens' class TokenCreateSchema(TokenSchema): """Create a new Authoriz...
{ "content_hash": "e07935aecf530a72b2092e4959452b43", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 75, "avg_line_length": 25.116666666666667, "alnum_prop": 0.6098208360982084, "repo_name": "quantmind/lux", "id": "0ff774e6e31122b8712c6fc71857b23bd24573fd", "size": "1507",...
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin from django.views.generic import TemplateView admin.autodiscover() # Examples: # url(r'^$', 'simcon.views.home', name='home'), # url(r'^blog/', include('blog.urls')), urlpatterns = patterns('s...
{ "content_hash": "f64905fd90094c9ec72590e021b932ff", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 108, "avg_line_length": 53.47222222222222, "alnum_prop": 0.6612987012987013, "repo_name": "djorda9/Simulated-Conversations", "id": "b21c78fa8263df233a8c56b952d088d79cd14f17",...
from __future__ import unicode_literals import logging import os from mopidy import config, ext __version__ = '0.1.0' logger = logging.getLogger(__name__) class Extension(ext.Extension): dist_name = 'Mopidy-NFCread' ext_name = 'nfcread' version = __version__ def get_default_config(self): ...
{ "content_hash": "aa4360fbb8cc6ccbd4149d7cc0c0c6b6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 22.548387096774192, "alnum_prop": 0.642346208869814, "repo_name": "gefangenimnetz/mopidy-nfcread", "id": "d8fd06f77802f9abf9598c7a9605e292a1ddfbdd", ...
import matplotlib.pyplot as plt import matplotlib.image as mplimage import matplotlib as mpl import os class ImageViewer(object): def __init__(self, imfile): self._load_image(imfile) self._configure() self.figure = plt.gcf() t = "Image: {0}".format(os.path.basename(imfile)) ...
{ "content_hash": "a5ae16b5126f400b8cc85d615c7117ea", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 70, "avg_line_length": 29.15714285714286, "alnum_prop": 0.5658990690837825, "repo_name": "pletisan/python-data-viz-cookbook", "id": "ddd6d231d7d311ff3f9c6e85936fcb889feefb86"...
from django.conf.urls import url, include from whippedcream.tests.urls import v1_api, noname_api urlpatterns = [ url(r'^api/', include(v1_api.urls)), url(r'^apinoname/', include(noname_api.urls)) ]
{ "content_hash": "9ac8fdeaa3feef05b310b9325a4c3f58", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 54, "avg_line_length": 26, "alnum_prop": 0.7019230769230769, "repo_name": "paulcwatts/django-whippedcream", "id": "0f6aeb4c90050597ea7eeb6954573c8bd8e67bce", "size": "208", ...
from .fetchers import NUMetadatasFetcher from .fetchers import NUGlobalMetadatasFetcher from .fetchers import NUUsersFetcher from .fetchers import NUEventLogsFetcher from bambou import NURESTObject class NUGroup(NURESTObject): """ Represents a Group in the VSD Notes: Identifies a group...
{ "content_hash": "1fb8d7f3d604e159aa820996462c6ffe", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 364, "avg_line_length": 27.327710843373495, "alnum_prop": 0.5600035270258354, "repo_name": "nuagenetworks/vspk-python", "id": "8c29a30d76d38b8a4721b8551da297dba88e459c", "...
from __future__ import division from auto_gen_objects import Object, Property, Choice SQL_TYPE = 'sql' class SQLObject(Object): @staticmethod def convert(obj): if SQL_TYPE in obj.layouts: obj.__class__ = SQLObject for prop in obj.properties: prop.__class__ = SQ...
{ "content_hash": "9ac7dacdb02ca624b6502748c8737085", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 77, "avg_line_length": 31.129186602870814, "alnum_prop": 0.5431909007070397, "repo_name": "hjanime/VisTrails", "id": "ed472410070ef4b6672cd17722dbe3e176183091", "size": "8...
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer from sqlalchemy import MetaData, String, Table from nova import log as logging meta = MetaData() LOG = logging.getLogger(__name__) # Just for the ForeignKey and column creation to succeed, these are not the # actual definitions of instances or se...
{ "content_hash": "d2fc86826b448016e285aa3a6eccbc0d", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 31.65573770491803, "alnum_prop": 0.6343863283272916, "repo_name": "russellb/nova", "id": "a5c25b876ad536b36916a2234738be521330968a", "size": "2612", ...
from collections import Counter from typing import List import torch def align_bpe_to_words(roberta, bpe_tokens: torch.LongTensor, other_tokens: List[str]): """ Helper to align GPT-2 BPE to other tokenization formats (e.g., spaCy). Args: roberta (RobertaHubInterface): RoBERTa instance bp...
{ "content_hash": "931db5fc4d653b1575d31ed20521b1b3", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 98, "avg_line_length": 35.41818181818182, "alnum_prop": 0.606776180698152, "repo_name": "hfp/libxsmm", "id": "45d2e37194c0f66e2b063884d7f3291ae48ece0f", "size": "4074", ...
from distutils import cygwinccompiler from distutils import extension from distutils import util import errno import os import os.path import pkg_resources import platform import re import shlex import shutil import sys import sysconfig import setuptools from setuptools.command import build_ext # TODO(atash) add flag...
{ "content_hash": "182b27c179b170b92b5721688a1c5fd1", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 118, "avg_line_length": 38.857142857142854, "alnum_prop": 0.6497821350762527, "repo_name": "thinkerou/grpc", "id": "c13dfe9ade589aa2cf4fc11ec256eee87cace511", "size": "792...
import os from cabot.cabotapp.alert import AlertPlugin from cabot.plugin_test_utils import PluginTestCase from mock import patch, call from cabot.cabotapp.models import Service, UserProfile from cabot_alert_pagerduty import models class TestPagerdutyAlerts(PluginTestCase): def setUp(self): super(TestPage...
{ "content_hash": "34bc02a709c629f01f8fee8e52c16c25", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 116, "avg_line_length": 47.70454545454545, "alnum_prop": 0.6986660314435446, "repo_name": "Affirm/cabot-alert-pagerduty", "id": "5f2a68ca55ca6c06dcd9fa3c5478066a8ec9d4c4", ...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "572613846fb400c5fb7c94ee3ba45ff0", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 21.05, "alnum_prop": 0.6912114014251781, "repo_name": "skuda/client-python", "id": "50bc07885ce1feea14be3d07840dd417ca788ee3", "size": "859", "bin...
""" Purpose Demonstrate basic message operations in Amazon Simple Queue Service (Amazon SQS). """ # snippet-start:[python.example_code.sqs.message_wrapper_imports] import logging import sys import boto3 from botocore.exceptions import ClientError import queue_wrapper logger = logging.getLogger(__name__) sqs = boto...
{ "content_hash": "dac253bd607b081be96c1d23b4502dd2", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 87, "avg_line_length": 35.87755102040816, "alnum_prop": 0.6237770193401593, "repo_name": "awsdocs/aws-doc-sdk-examples", "id": "035b204d6d2fede0e0af4261fece4617c327350d", ...
import collections from .. import converters from .. import namespace from .. import option #------------------------------------------------------------------------------ def setup_definitions(source, destination): for key, val in source.items(): if key.startswith('__'): continue # ignore th...
{ "content_hash": "08cb97b5b5dcf8d48b2ca469729e4f7f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 40.42857142857143, "alnum_prop": 0.48197879858657244, "repo_name": "twobraids/configman_orginal", "id": "9428577c4968a7302a6533dc5f34999345b9612e", "...
from termcolor import colored from time import strftime, localtime class OutputResult: OK = ('+', 'green', ['bold']) Fail = ('-', 'red', ['bold']) Info = ('i', 'blue', ['bold']) Warn = ('WRN', 'yellow', ['bold']) Error = ('ERR', 'red', ['bold']) Log = ('LOG', None, ['bold']) class Output: ...
{ "content_hash": "7ba42fbfaf3d5ee36a2115b94a021494", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 103, "avg_line_length": 28, "alnum_prop": 0.5791925465838509, "repo_name": "vdjagilev/desefu", "id": "59b38e76931e1011528abca220acaa9370c33282", "size": "1932", "binary":...
import argparse import sys class AtomicMutation(object): """Base class for mutations that focus on one thing.""" def __init__(self, action="forward"): self.action = action def __call__(self, arguments=sys.argv[1:], program=sys.argv[0]): parser = argparse.ArgumentParser(prog=program, ...
{ "content_hash": "08c80d06b8e37e3653bdcc166e6f7daf", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 28.90909090909091, "alnum_prop": 0.5859538784067087, "repo_name": "mozilla-services/transmutator", "id": "2118aecf4c38a5c85f0c7dd5c8ff346a19b31005", ...
""" dbspatial.py: SQLite-SpatiaLite support for db.py Copyright (c) 2017 Garin Wally MIT License; see LICENSE Forked from dslw in November 2017 """ import fnmatch import inspect import os import re import sys import urllib2 from sqlite3 import IntegrityError, OperationalError import numpy as np import pandas as pd i...
{ "content_hash": "8590885cb1050e2297f4fd37eafcf024", "timestamp": "", "source": "github", "line_count": 908, "max_line_length": 85, "avg_line_length": 37.62775330396476, "alnum_prop": 0.5490838845636012, "repo_name": "WindfallLabs/dslw", "id": "b0493ba82829b5271e5beb9e7c46a7c3d54cc1c7", "size": "34...
from __future__ import absolute_import import pytest from copy import deepcopy from .forms import SimpleForm from webob.multidict import MultiDict from wtforms import TextField from wtforms.validators import InputRequired from wtforms_dynamic_fields import WTFormsDynamicFields """ This test module uses PyTest (py.test...
{ "content_hash": "638481637739f2b889b567db04a848d8", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 159, "avg_line_length": 44.828828828828826, "alnum_prop": 0.645096463022508, "repo_name": "Timusan/wtforms-dynamic-fields", "id": "94f63392cde55c8874d921f8cffae779648a86a0",...
from LSFEventScraper import LSFEventScraper from LSFEventType import LSFEventType __author__ = 'pascal' scraper = LSFEventScraper(event_type=LSFEventType.normal_event, logging=False) # FIRST SCENARIO #=============== # - Fetches all events from HTW-Berlin.de and stores them to memory. scraper.scrape_events() # - ...
{ "content_hash": "94294a1cf89fcf4727420185222c6511", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 90, "avg_line_length": 29.441176470588236, "alnum_prop": 0.7262737262737263, "repo_name": "pascalweiss/LSFEventScraper", "id": "05964731b61ffa7d7e34dc6ffe230308d9253f0c", "...
import yaml from infcommon.info_container.info_container import InfoContainer class YamlReaderNotValidFileError(BaseException): pass class YamlReader(object): def __init__(self, path): self._path = path def get(self, key): return self._load_file().get(key) def get_info_container(...
{ "content_hash": "772fc3c6e13dfc5a24da53d079385b97", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 65, "avg_line_length": 25.5, "alnum_prop": 0.5985552115583075, "repo_name": "aleasoluciones/infcommon", "id": "c142dd7643976b1974a4fb2f03c7dd7d2c6bf9b9", "size": "994", "...
import click @click.group() def cli(): pass @click.command() def create(): print "create command!" def main(): cli.add_command(create) cli() if __name__ == '__main__': main()
{ "content_hash": "12e5b951eb4f40292319cfba92ab323d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 27, "avg_line_length": 11.941176470588236, "alnum_prop": 0.5566502463054187, "repo_name": "bdastur/utils", "id": "39af5edd040a0bf8359a737633d3d99c92d29998", "size": "250", ...
from django.core.management.base import BaseCommand, CommandError from annotations.models import Language, Tense, Annotation, Fragment, LabelKey, Label from selections.models import Selection class Command(BaseCommand): help = 'Imports Tenses/Labels for Annotations, Selections, and Fragments' def add_argume...
{ "content_hash": "9b3f15b847ddcb66327b371c11ab72e3", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 103, "avg_line_length": 33.70338983050848, "alnum_prop": 0.5803369373899925, "repo_name": "UUDigitalHumanitieslab/timealign", "id": "4854b39b239c32252ea60df34550e65bc82cc17d...
import numpy as np import re import itertools from collections import Counter from utility import build_vocab, clean_str def load_data_and_labels(pos, neg): """ Loads MR polarity data from files, splits the data into words and generates labels. Returns split sentences and labels. """ # Load data fr...
{ "content_hash": "46e1b18ff07802db2aab2b43e55c6541", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 100, "avg_line_length": 35.64102564102564, "alnum_prop": 0.6633093525179856, "repo_name": "3rduncle/knowledgeflow", "id": "0df3b08ac6c97318a893040d27227bd3d63fabef", "size"...
"""This file runs subsampled value iteration using metrics. It estimates the value function for a set of points using a pre-defined state metric to obtain the approximant from the nearest known neighbour. This module will run a number of trials on a set of possible metrics and compile the results in a plot. """ impor...
{ "content_hash": "4c72fc6403a16d112bb9e6f7d6b01a7f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 80, "avg_line_length": 36.516949152542374, "alnum_prop": 0.6368066836853098, "repo_name": "google-research/google-research", "id": "9dc1624f342bb97bb78b245c2523088996d3c2ea"...
__author__ = 'paul' from google.appengine.ext import ndb class QuoteGroup(ndb.Model): quote_count = ndb.IntegerProperty() creation_timestamp = ndb.DateTimeProperty(auto_now_add=True) last_modified_timestamp = ndb.DateTimeProperty(auto_now=True)
{ "content_hash": "ff0e052253f4869c53c1b81ef7f0bd39", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 65, "avg_line_length": 32.25, "alnum_prop": 0.748062015503876, "repo_name": "marshalllaw18/quotechu", "id": "61bf037eb0af0e4739d193943e9e4b4483467ac9", "size": "258", "bin...
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage', 'sphinx.ext.viewcode'] templates_path = ['_templates'] master_doc = 'index' source_suffix = '.txt' project = u'OmMongo' copyright = u'2017, Bapakode Open Source' ve...
{ "content_hash": "e521539c4c3f43c63c7df54ad73573fd", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 116, "avg_line_length": 41.54716981132076, "alnum_prop": 0.5408719346049047, "repo_name": "bapakode/OmMongo", "id": "3b97707c84dfa6ad4ef71884652195e7bef599ac", "size": "234...
"""The volumes extension.""" import webob from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import compute from nova import exception from nova.objects import block_device as block_...
{ "content_hash": "ace703985d8d98f35b02b0db9977ab7d", "timestamp": "", "source": "github", "line_count": 730, "max_line_length": 79, "avg_line_length": 34.321917808219176, "alnum_prop": 0.5944522051486729, "repo_name": "CiscoSystems/nova", "id": "757bd76c0e86150c79277669b11674ec1039dae8", "size": "2...
from sentry.web.urls import *
{ "content_hash": "a16e6a14e9e9236c631d4b9597bcdadc", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.7666666666666667, "repo_name": "chroto/sentry-xmpp", "id": "94a930744be1fc7516066ec0a94178cb25ac2825", "size": "30", "binary": f...
import argparse import arrow import cmd import datetime import json import math import os import re import shlex import sys from tabulate import tabulate import textwrap import time from talus_client.cmds import TalusCmdBase import talus_client.api import talus_client.errors as errors import talus_client.utils as util...
{ "content_hash": "61485efddace193060e86adb33169063", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 103, "avg_line_length": 29.248031496062993, "alnum_prop": 0.628819491183201, "repo_name": "optiv-labs/talus_client", "id": "29b0ecb1148e7ece5a15bad12ae841a68537b7a7", "siz...
TAG_FORMAT = '###{bound}_{block}###' # The template for tag variables that is used to generate the context # variables for storing the actual email part tags. TAG_VAR_FORMAT = 'TAG_{BOUND}_{BLOCK}'
{ "content_hash": "de38d115a0ba73a4fc6c72325c40319e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 69, "avg_line_length": 39.8, "alnum_prop": 0.7085427135678392, "repo_name": "artemrizhov/django-mail-templated", "id": "9238962f1e24b2948ca5571bdb1be4700c407fac", "size": "3...
from __future__ import (absolute_import, division, print_function, unicode_literals) from keras.datasets import mnist from hyperemble.neural_net import VanillaNeuralNet def test_vanilla_neural_net(): (X_train, y_train), (X_test, y_test) = mnist.load_data() X_train = X_train.reshape(6...
{ "content_hash": "e5d65be17c8353ba263ea9608e4e6b50", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 69, "avg_line_length": 33.04347826086956, "alnum_prop": 0.6026315789473684, "repo_name": "hduongtrong/hyperemble", "id": "37d6711658275f1d07977aeff4273891c7394311", "size":...
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base from geoalchemy2 import * import os, subprocess import yaml import initialize_environment config = yaml.load(open('config.yaml', 'r')) postgis_extensions_dir = config['database']['postgis_extensions_dir'] data...
{ "content_hash": "7a04b0596a7d471f63589947a761da09", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 32.56363636363636, "alnum_prop": 0.68285873813512, "repo_name": "colorado-code-for-communities/denver_streets", "id": "3c212b0bb8325f8395c6932824bb933...
""" tray_data provides the data for the tray GUI. It handles the XML data and provides the neccessary interfaces. """ import logging, os import xml.etree.cElementTree as ET from util.ordereddict import oDict from util.trayErrors import PropertyNotFoundError import tray_item log = logging.getLogger("xml...
{ "content_hash": "363253ab3281802697ef6d2ba53a7bde", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 130, "avg_line_length": 32.02312138728324, "alnum_prop": 0.5494584837545127, "repo_name": "tschalch/pyTray", "id": "39ef770bd007d4f758be310879b2a3d3173cebaa", "size": "556...
def lazy(func): def wrapper(self, *args): if not self.data: self.load() return func(self, *args) return wrapper
{ "content_hash": "db14bb21ef32d21a5332d1b4a1b9662b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 32, "avg_line_length": 24.666666666666668, "alnum_prop": 0.5472972972972973, "repo_name": "diegor2/redditbot", "id": "2e7b38ea92a7ce601c72e70aaf3f798dce6931c8", "size": "148...
import context # our own packages from base import TestSystemCalcBase # Monkey patching for unit tests import patches # tested classes from delegates import BatteryData class MockBatteryConfiguration(object): def __init__(self, service, name, enabled): self.service = str(service) self.name = None if name is No...
{ "content_hash": "cfc90e5ae97c6588fdff865731477e39", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 95, "avg_line_length": 30.869565217391305, "alnum_prop": 0.6785211267605634, "repo_name": "victronenergy/dbus-systemcalc-py", "id": "5a36024061008120824b081d0f779bc67af864ee"...
import os import sys import tempfile path = os.path.abspath(os.path.join(os.path.dirname(__file__))) sys.path.append(os.path.join(path, '..')) import carpet #### Accessory functions #### # This is an example of a core function, which takes a file and produces # an output file. def puts_hello_into_file(file_in, file_...
{ "content_hash": "666c678a5bdee176fcc684e344fbe126", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 74, "avg_line_length": 29.96153846153846, "alnum_prop": 0.6598202824133504, "repo_name": "alvaroabascar/carpet", "id": "4f992fdeb8711a116509b4c49037d58bce2eed49", "size": "...
""" Written by Lucas Sinclair. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # # Internal modules # # First party modules # # Third party modules # from Bio import Entrez # Constants # Entrez.email = "I don't know who will be running this script" ################################################...
{ "content_hash": "b317726b51c6eaaaa378171af3365708", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 82, "avg_line_length": 37.401785714285715, "alnum_prop": 0.5294819766053951, "repo_name": "xapple/seqsearch", "id": "ad19449736a1d7a0c37dd6d3542edbe3525921af", "size": "42...
""" Instrumentation for Tornado """ import elasticapm from elasticapm.conf import constants from elasticapm.instrumentation.packages.asyncio.base import AbstractInstrumentedModule, AsyncAbstractInstrumentedModule from elasticapm.traces import capture_span from elasticapm.utils.disttracing import TraceParent class Tor...
{ "content_hash": "7bc15f7e638725263a57eb247e540255", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 120, "avg_line_length": 42.75247524752475, "alnum_prop": 0.667901806391848, "repo_name": "beniwohli/apm-agent-python", "id": "654deb3828e309f1a2f8459898d39d9442d75878", "s...
import sys from oslo.config import cfg r_opts = [ cfg.StrOpt( 'host', default='127.0.0.1', help='RabbitMQ host'), cfg.StrOpt( 'user', default='guest', help='RabbitMQ user'), cfg.StrOpt( 'passwd', default='guest', help='RabbitMQ passwo...
{ "content_hash": "aebf7e37502dada5b28fece028cbec22", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 64, "avg_line_length": 21.942028985507246, "alnum_prop": 0.5924702774108322, "repo_name": "gabriel-samfira/jrunner", "id": "87a9be43ccede794ff5fa531c0d011a8cb42baff", "size...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HUnitR06_CompleteLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HUnitR06_CompleteLHS """ # Flag this instance as compiled now self.is_compiled = True super...
{ "content_hash": "987d3616caf8841e41bba5b028ce802d", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 104, "avg_line_length": 37.525, "alnum_prop": 0.6620031090384189, "repo_name": "levilucio/SyVOLT", "id": "8e7d39cfee73508db419cd13deb5d4f0794adae4", "size": "4503", "bin...
import xml.etree.cElementTree as ET import Pyrex.Plex import StringIO import re import copy class QuillManual(object): def __init__(self, langDefFile): self.codeChars = 'abcdefghijklmnopqrstuvwxyz' if langDefFile != None: self.loadPrimaryDef(langDefFile) def codeGen(self): firstIndex = ...
{ "content_hash": "b47151dec462a1bf8b9d975eb5e6ac7d", "timestamp": "", "source": "github", "line_count": 694, "max_line_length": 145, "avg_line_length": 28.62680115273775, "alnum_prop": 0.6386470025670711, "repo_name": "teamtachyon/Quillpad-Server", "id": "66261a9a671e2232aacdb7a1c0b0ab637be90d69", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('share', '0012_auto_20161212_1555'), ] operations = [ migrations.CreateModel( name='Department', fields=[ ], ...
{ "content_hash": "b614962352d8697e18fc2766af02d7d4", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 535, "avg_line_length": 44.30337078651685, "alnum_prop": 0.5861019528277961, "repo_name": "laurenbarker/SHARE", "id": "94d36e49798c485fa79677211acf09208fe9ef9e", "size": "4...
""" ====================================== Searching and downloading from the VSO ====================================== How to download data from the VSO with Fido. """ import astropy.units as u from sunpy.net import Fido, attrs as a ############################################################################### # `...
{ "content_hash": "19084f201205a9a086eff4f005e16097", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 80, "avg_line_length": 43.8974358974359, "alnum_prop": 0.5589953271028038, "repo_name": "dpshelio/sunpy", "id": "b596a5d6dad25fbe4306fbdc32414fab0676adea", "size": "1736", ...
from text import nltkmgr from nltk.corpus import state_union from nltk.tokenize import PunktSentenceTokenizer r = nltkmgr.synset("ready") print(r)
{ "content_hash": "bb68f79365e8787c3b5d04c63f64210b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 48, "avg_line_length": 24.666666666666668, "alnum_prop": 0.8108108108108109, "repo_name": "deepakkumar1984/sia-cog", "id": "447befabad0cc7305f30e62b5fc3d25b166e7cce", "size"...
""" Definitions of tree structures. """ from typing import Dict, List, Tuple, Set, Mapping, Any, Iterator from penman.types import (Variable, Branch, Node) _Step = Tuple[Tuple[int, ...], Branch] # see Tree.walk() class Tree: """ A tree structure. A tree is essentially a node that contains other node...
{ "content_hash": "904099574535d64c69ff21831a70ed59", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 78, "avg_line_length": 28.98507462686567, "alnum_prop": 0.5298661174047374, "repo_name": "goodmami/penman", "id": "561650ec280c05a86ff87e82b82019ce3447cbc9", "size": "5827...
import os import platform import textwrap import unittest import pytest from parameterized import parameterized from conans.client.tools.apple import to_apple_arch from conans.test.assets.autotools import gen_makefile from conans.test.assets.sources import gen_function_cpp, gen_function_h from conans.test.utils.tools...
{ "content_hash": "b2e2320afcb7a4fea5525fc2351ccb2b", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 98, "avg_line_length": 35.542857142857144, "alnum_prop": 0.5295418006430869, "repo_name": "conan-io/conan", "id": "e68127762a8fe6d845b7a7890eb9ffa6debd22c7", "size": "4976...
""" This module implements a set of languages as collections of features that are language specific. feature collections +++++++++++++++++++ Languages implement a subset of feature collections (e.g. :class:`~revscoring.languages.features.Dictionary`, :class:`~revscoring.languages.features.Stopwords`, :class:`~revscori...
{ "content_hash": "bf43a6c40f732c83c9756a25d3f4ab2c", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 77, "avg_line_length": 16.975, "alnum_prop": 0.6765832106038292, "repo_name": "wiki-ai/revscoring", "id": "174f81bd0cbe7a43f07ba90bfcbc51eb5a7aca94", "size": "3395", "bi...
from __future__ import unicode_literals import logging import pytest from storops_comptest.utils import setup_fixture from storops_comptest.vnx import VNXGeneralFixtureManager, \ MultiVNXGeneralFixtureManager __author__ = 'Cedric Zhuang' log = logging.getLogger(__name__) @pytest.fixture(scope='session') def ...
{ "content_hash": "97cb2c67d5bc29614ff48599312ee344", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 64, "avg_line_length": 24.952380952380953, "alnum_prop": 0.6698473282442748, "repo_name": "emc-openstack/storops", "id": "8aa25ff80f7e23538661eaa4cfc31ce525d81fdd", "size":...
from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### endblock Header ### block ClassImplementation # NOTICE: Do not edit anything here, it is generated code class GX...
{ "content_hash": "fc86b3c003b4a7749cc5e84d5b024ae9", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 162, "avg_line_length": 28.286195286195287, "alnum_prop": 0.5946911082014046, "repo_name": "GeosoftInc/gxpy", "id": "b927a5dee193481c90d907f738cfa0f802d8e337", "size": "85...
"""A class to generate random BidRequest protocol buffers.""" import base64 import random import time import realtime_bidding_pb2 PROTOCOL_VERSION = 1 BID_REQUEST_ID_LENGTH = 16 # In bytes. COOKIE_LENGTH = 20 # In bytes. COOKIE_VERSION = 1 # Placement. CHANNELS = ['12345'] # Data describing branded publishers. ...
{ "content_hash": "9b175ba48e7d5080362fdb6e9cae6953", "timestamp": "", "source": "github", "line_count": 614, "max_line_length": 80, "avg_line_length": 38.48208469055375, "alnum_prop": 0.6634501438970712, "repo_name": "rickiepark/openbidder", "id": "f7767f87c3e54a6c1fc12469bc06623a66c43b45", "size":...
import math from pandac.PandaModules import * from direct.interval.MetaInterval import Sequence, Parallel from direct.interval.FunctionInterval import Func from direct.interval.LerpInterval import LerpScaleInterval, LerpColorScaleInterval from direct.showbase.PythonUtil import bound from toontown.toon import ToonHead f...
{ "content_hash": "044b7cac6537d1498b3525149dbc9ded", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 219, "avg_line_length": 36.048, "alnum_prop": 0.6525743453173546, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "a6c7fd1dc13aadaed627325d087b4ccb807ab74b", "...
""" find 3 numbers that add up to 1000 that are also a pythagorean triplet iterate through a list of sum sets checking with is_py_trip helper function return the product of a b & c """ def is_py_trip(a, b, c): if a**2 + b**2 == c**2: return True else: return False def find_py_trip(ptsum): ...
{ "content_hash": "2355011a82d6d46455b9e2b72ab9fd69", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 23.892857142857142, "alnum_prop": 0.5530642750373692, "repo_name": "chadhs/project-euler", "id": "0c45b7e1c387430037ffed315aa55eb1f0583137", "size": ...
from nussl import ml, datasets from nussl.core.constants import ALL_WINDOWS import nussl import pytest import torch import itertools from scipy.signal import check_COLA import numpy as np def test_filter_bank(one_item, monkeypatch): pytest.raises( NotImplementedError, ml.networks.modules.FilterBank, 2048) ...
{ "content_hash": "cce6a7d1b1841098f1990357814b04d1", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 92, "avg_line_length": 30.51048951048951, "alnum_prop": 0.6582626633050653, "repo_name": "interactiveaudiolab/nussl", "id": "88754b4f93df79a90b814cefaf148d32280d5d03", "si...
import temper def main(stats): th = temper.TemperHandler() device = th.get_devices()[0] c = device.get_temperature(format='celsius') stats.gauge('room.temperature', c) if __name__ == '__main__': main()
{ "content_hash": "bf424e48bc5500d4a9495e0221c50a35", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 18.833333333333332, "alnum_prop": 0.6106194690265486, "repo_name": "gak/mystats", "id": "c727619286cb9e1c0ccad224655687414da6f4ec", "size": "248", ...
"""Helper CGI for POST uploads. Utility library contains the main logic behind simulating the blobstore uploading mechanism. Contents: GenerateBlobKey: Function for generation unique blob-keys. UploadCGIHandler: Main CGI handler class for post uploads. """ import base64 import cStringIO import datetime import r...
{ "content_hash": "a6b729497db51bb22a45c19f296566f5", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 80, "avg_line_length": 33.46924829157175, "alnum_prop": 0.6294834274824747, "repo_name": "dcroc16/skunk_works", "id": "db53c5db017fcf979dfa2a04e40fef58246c00bd", "size": "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('authentication', '0003_auto_20150311_2105'), ] operations = [ migrations.AddField( model_name='onlineuser', name='online_mail', field=models.CharField(ma...
{ "content_hash": "1630d6af9cc5ad8673738bfd9a9b4118", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 102, "avg_line_length": 25.764705882352942, "alnum_prop": 0.6004566210045662, "repo_name": "dotKom/onlineweb4", "id": "39726a25aa188821436129da951ed899b3998f4c", "size": "4...
""" This module considers dictionaries as discrete functional mappings, and contains high-level interfaces for dealing with these mappings. """ from itertools import chain from six import iteritems def chain_mapping(*dictionaries): """ Say you have more than one dictionary, and the range of the first is ...
{ "content_hash": "e08c8c9d6a3541e93468da4efb1586db", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 83, "avg_line_length": 27.952879581151834, "alnum_prop": 0.6283948304926016, "repo_name": "larsyencken/cjktools", "id": "5c8adcd129896bdd4e4749a6c457d3cdb02ded2f", "size":...
""" Emulating the functionality of the Adafruit_DHT driver. This is required because the DHT22 driver utilizes native C code that will not run on hardware that is not an RPi. This stub class allows testing code that relies on the Adafruit_DHT driver, without running on an RPi """ from random import uniform DHT22 = 2...
{ "content_hash": "efd5ae5e4dce492e89be4a73f6e68214", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 93, "avg_line_length": 29.63157894736842, "alnum_prop": 0.7282415630550622, "repo_name": "arunderwood/BasilPi", "id": "03b33a97f8876a47cc7752e94ba010eb65bcf6e3", "size": "5...
from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview(alpha=200) sleep(10) camera.stop_preview()
{ "content_hash": "873775ebf8defec6db8801afa2e87c7e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 31, "avg_line_length": 17.25, "alnum_prop": 0.7898550724637681, "repo_name": "leea666/picamera", "id": "6b41386e70b2ecaadac4f524ace1c685c3fc45ad", "size": "138", "binary":...
from django.db import transaction from django.contrib import admin admin.site.index_title = 'Categories' admin.site.site_title = 'Citizenmatch Administration' admin.site.site_header = 'Citizenmatch Administration'
{ "content_hash": "86e35a64066917bdf836ab67a6455bd7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 54, "avg_line_length": 30.857142857142858, "alnum_prop": 0.8101851851851852, "repo_name": "kajala/citizenmatch-backend", "id": "0c119fc5ee3ab379b0afeb99473ae1425fecc59d", "s...
import sys from pyparsing import * class Opcode(object): def __init__(self, opcode): self._opcode = opcode def __repr__(self): return 'Opcode(' + self._opcode + ')' def to_das(self): return self._opcode class SETOpcode(Opcode): def __init__(self): super(SETOpcode, self).__init__('SET') de...
{ "content_hash": "282f938ca6624d17dab8bdef4dd730eb", "timestamp": "", "source": "github", "line_count": 898, "max_line_length": 135, "avg_line_length": 28.484409799554566, "alnum_prop": 0.6029555494741781, "repo_name": "sblom/dcpu16", "id": "da011b93a1fcedc3e76cb8c7dda3c3b046d62d94", "size": "25579...
from unittest import TestCase from pycrunchbase import Relationship PAST_TEAM_RELATIONSHIP = { "cardinality": "OneToMany", "paging": { "total_items": 3, "first_page_url": "https://api.crunchbase.com/v3.1/" "organization/example/past_team", "sort_order": "created_at DESC" },...
{ "content_hash": "b2aa78a3c8db4a5bb329087019792704", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 935, "avg_line_length": 42.51968503937008, "alnum_prop": 0.5296296296296297, "repo_name": "ngzhian/pycrunchbase", "id": "8c4b27091ee1d4428953e89bb6e19191121d7588", "size":...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "fc06d08d7848e92e087d018214be92d3", "timestamp": "", "source": "github", "line_count": 875, "max_line_length": 514, "avg_line_length": 40.990857142857145, "alnum_prop": 0.5647531156773636, "repo_name": "napalm-automation/napalm-yang", "id": "d30f3d3cd5a99c2c96f494772f97ecb8bab58cec",...
import discord import logging import time import datetime import youtube_dl from discord.ext import commands from settings import token logging.basicConfig(level=logging.INFO) startuptime = int(time.time()) class YoutubeSource(discord.FFmpegPCMAudio): def __init__(self, url): opts = { ...
{ "content_hash": "bfa69965d2bd0e805e607670f150fef3", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 112, "avg_line_length": 33.23943661971831, "alnum_prop": 0.5830508474576271, "repo_name": "Paarf/BoxBot", "id": "3541d02b7272fec54ed951067a63f01fd634f313", "size": "2360", ...
from provstore.bundle import Bundle class BundleManager(object): """ A document's bundle manager. This is an iterable and will iterate through all of a document's bundles. .. note:: Iteration is expensive, consider using :py:class:`provstore.document.Document.prov.bundles` instead! Examp...
{ "content_hash": "3decb338cbeb75c59686ac105cc6305d", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 107, "avg_line_length": 27.12121212121212, "alnum_prop": 0.587709497206704, "repo_name": "millar/provstore-api", "id": "308e9567608d33c0b6ae6736260ff0cff14e55c3", "size": "...
""" 'E1102': ('%s is not callable', 'Used when an object being called has been infered to a non \ callable object'), """ __revision__ = None __revision__() def correct(): """callable object""" return 1 __revision__ = correct() class Correct(object): """callable object"""...
{ "content_hash": "311830c956eeec36eed4a555527d0dbe", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 75, "avg_line_length": 18.99145299145299, "alnum_prop": 0.5999099909990999, "repo_name": "willemneal/Docky", "id": "832657d2444b944e5fe32e3a152049417d1ce1d0", "size": "227...
from typing import Dict, Optional, Sequence import libcst as cst from libcst._nodes.internal import CodegenState, visit_required def make_aref(name: str, idx: cst.BaseExpression) -> cst.Subscript: sub_elt = cst.SubscriptElement(slice=cst.Index(value=idx)) return cst.Subscript(value=cst.Name(name), slice=[sub...
{ "content_hash": "9e658bad0e41b75b4e4c47862672649c", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 79, "avg_line_length": 33.15510948905109, "alnum_prop": 0.5652485001926358, "repo_name": "lowRISC/opentitan", "id": "b26bcd8c556b8e9353e8adcc4b1fbd5b07823f1b", "size": "18...
import os.path from twisted.internet.protocol import Factory from twisted.logger import Logger import sqlite3 from .game import Game from .protocol import ServerProtocol from . import version from shared.card_database_manager import CardDatabaseManager from shared.path import getScriptDirectory class ServerFactory(Fa...
{ "content_hash": "72ceeb9bdb5743c65b82dd5dbdb87712", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 273, "avg_line_length": 33.52542372881356, "alnum_prop": 0.6799797775530839, "repo_name": "Timtam/cards-against-humanity", "id": "2ff7ea41f0b5345b8e6aaf04b853cf37eddeded5", ...
import abc import subprocess import jinja2 import tempfile import datetime import logging import typing import os import utils import browsers def GetTemplateFileForBrowser(browser_driver: browsers.BrowserDriver, template_file: str) -> str: if browser_driver.name == "safari": retu...
{ "content_hash": "7599f419783acfcec61d0e885361b314", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 104, "avg_line_length": 33.54435483870968, "alnum_prop": 0.6538045438153625, "repo_name": "ric2b/Vivaldi-browser", "id": "0b9f95f3acb203b06278fef3c60578365192b83b", "size"...
import httplib from flask import request from framework.exceptions import HTTPError from framework.auth.decorators import must_be_logged_in from website.addons.s3 import utils from website.project.decorators import must_have_addon from website.project.decorators import must_have_permission from website.project.decor...
{ "content_hash": "afbe4073a5cd5275e7ade156f000027d", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 85, "avg_line_length": 29.571428571428573, "alnum_prop": 0.6583850931677019, "repo_name": "bdyetton/prettychart", "id": "003e489a58654d3429eb7da3d9ed4c6a3fe897e2", "size":...
"""The spm module provides basic functions for interfacing with matlab and spm to access spm tools. Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'...
{ "content_hash": "cb9195ca5c6de6996b8aa3d212a2131b", "timestamp": "", "source": "github", "line_count": 906, "max_line_length": 198, "avg_line_length": 43.05077262693157, "alnum_prop": 0.5625833247872013, "repo_name": "christianbrodbeck/nipype", "id": "cd7ce07b2eaeb19768249052a8447d0c13f55361", "si...
import datetime import math import ibis.expr.types as ir def _set_literal_format(translator, expr): value_type = expr.type().value_type formatted = [ translator.translate(ir.literal(x, type=value_type)) for x in expr.op().value ] return '(' + ', '.join(formatted) + ')' def _boolea...
{ "content_hash": "19da27136ab24e315119494f644b67ea", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 60, "avg_line_length": 25.323529411764707, "alnum_prop": 0.6252419667053813, "repo_name": "cloudera/ibis", "id": "223c416770e6d6850169c78ffecb1efb12e303a7", "size": "2583"...
""" Una excepcion costumizada que es tirada por http_request_parser cuando se encuentra con un error """ #Es la excepcion que tira el http_request_parser en caso de error class HttpParseException(Exception): pass
{ "content_hash": "3ee715d71fdac089c82b413a8d18825b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 70, "avg_line_length": 27.25, "alnum_prop": 0.7752293577981652, "repo_name": "tupini07/StarLord", "id": "b7072e8cd42d6a63bb2c33c68282588afe7f8907", "size": "218", "binary"...
from __future__ import absolute_import import click from ....cliutils import out @click.group(help='Brands associated with your account') def brands(): pass @brands.command(help='List all brands') @click.pass_obj def list(state): out(state, state.client.brands()) @brands.command(help='Show details about a...
{ "content_hash": "16dcb5a4618a7240c8d923c94d39a075", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 60, "avg_line_length": 22.20689655172414, "alnum_prop": 0.7003105590062112, "repo_name": "PerformLine/python-performline-client", "id": "0d30c9fc42b0ff37d2ccac837df08750625a8...
import logging import sys logger = logging.getLogger('') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler(sys.stderr) handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(levelname)-8s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler)
{ "content_hash": "95baea6a591ca460c5b6f49c8cd7a360", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 23.916666666666668, "alnum_prop": 0.794425087108014, "repo_name": "brata-hsdc/brata.masterserver", "id": "7a55b33cec33a2552f007322164efb248a7b557f", ...
""" 处理数据库的同步信息 """ import urllib from .jsonfy import jsonify from sqlalchemy.sql import column, select, alias, join, and_ from sqlalchemy import func class DBSync(object): """ 同步数据库到 服务器 (Ledis) - 目前处理为输出 记录到 JSON 文件 - 后续处理为特殊的指令 PUT type values """ def __init__(sel...
{ "content_hash": "d9c676b1a335316ff358434a9d36b324", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 103, "avg_line_length": 33.36734693877551, "alnum_prop": 0.4975535168195719, "repo_name": "nzinfo/ElasticSphinx", "id": "e3daef8e45ca48da9ca0de1d40f267711d9791a7", "size": ...
import numpy as np import paddle import paddle.fluid as fluid import paddle.fluid.layers as layers import unittest import paddle def build_and_run_program(place, batch_size, beam_size, stop_gradient=False): fluid.default_startup_program().random_seed = 1 fluid.default_main_program().random_seed = 1 np.ran...
{ "content_hash": "c57440aec4660aff43d1ecdfc65253ee", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 80, "avg_line_length": 34.19047619047619, "alnum_prop": 0.6058495821727019, "repo_name": "luotao1/Paddle", "id": "f3f971b5778d8fbefe16891c33caeaf94cae4844", "size": "3483",...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "747a1144fda69a3afc218da8ef105821", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 168, "avg_line_length": 38.285714285714285, "alnum_prop": 0.7089552238805971, "repo_name": "antoinecarme/pyaf", "id": "728cc2faf127719952ecba99d9f146f5b012a276", "size": "26...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ShopDesign' db.create_table('stores_shopdesign', ( ('id', self.gf('django.db.models.fields.AutoF...
{ "content_hash": "9f2767a52343921af47c1ee797911517", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 182, "avg_line_length": 72.19852941176471, "alnum_prop": 0.5529076280680314, "repo_name": "softak/webfaction_demo", "id": "d44e04b60ed25f6ed3466fff0a95d89d2501485b", "size...
import random from string import ascii_letters from django.contrib.auth import get_user_model from tidings.compat import range from tidings.models import Watch, WatchFilter def user(save=False, **kwargs): defaults = {'password': 'sha1$d0fcb$661bd5197214051ed4de6da4ecdabe17f5549c7c'} if 'user...
{ "content_hash": "5e85d1e3b98dde913e7e17d5ff4978e0", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 70, "avg_line_length": 28.186046511627907, "alnum_prop": 0.6014851485148515, "repo_name": "mozilla/django-tidings", "id": "d95282bb046e9d2d0010355a7ad4c69b1274a5ba", "size"...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import collections from dashboard.pinpoint.models.compare import kolmogorov_smirnov from dashboard.pinpoint.models.compare import mann_whitney_u from dashboard.pinpoint.models.compare import thresholds DIFFER...
{ "content_hash": "d5b55ec573b0b8750b2e23f1438d68c7", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 80, "avg_line_length": 46.04651162790697, "alnum_prop": 0.681060606060606, "repo_name": "endlessm/chromium-browser", "id": "be7928a284cf4395aca01482430ad092ce65d3f6", "size...
from os import sys from data_gen import * from knn import * import random as rd import util as ut import scenario_util as su params = None try: params = ut.read_params(sys.argv[1], ignore_lines = '#') except: params = ut.read_params(sys.argv[1], ignore_lines = '#') # Get params when possible from the set of params,...
{ "content_hash": "08a50090ae1db771d8131df46a383557", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 96, "avg_line_length": 40.303030303030305, "alnum_prop": 0.706766917293233, "repo_name": "chrisgarcia001/Jepson-2014-2015", "id": "641af19aa742b0b263e6a050e15cbac771c8be43", ...