text
stringlengths
4
1.02M
meta
dict
import sys import time import copy as cp import asyncio import hashlib from unittest import mock import celery import pytest from waterbutler import tasks # noqa from waterbutler.core import remote_logging from waterbutler.core import utils as core_utils from waterbutler.core.path import WaterButlerPath import test...
{ "content_hash": "e2bf793a0d5e939d52bbcea614e21530", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 107, "avg_line_length": 28.665236051502145, "alnum_prop": 0.5958975894594999, "repo_name": "Johnetordoff/waterbutler", "id": "e2d655bd99a1e7152b8713171e401fae1727877e", "s...
from distutils.core import setup, Command from distutils.command.build import build as _build import os, sys import shutil import platform class build_server(_build): description = 'custom build command' sub_commands = [] def initialize_options(self): _build.initialize_options(self) self.cwd = None de...
{ "content_hash": "0dddaf5009e6cd71e1b0c409cd1d8bd9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 31.32075471698113, "alnum_prop": 0.6439759036144578, "repo_name": "niklasb/webkit-server", "id": "340e050825bfb21348a7342e79574bace2ccf365", "size": ...
import optparse import os import subprocess import sys def get_xwalk(): if ("XWALK_HOME" not in os.environ): print "Error: 'XWALK_HOME' has not been set to the crosswalk binary." sys.exit(2) else: return os.path.join( os.path.splitext(os.path.abspath(os.environ["XWALK_HOME"...
{ "content_hash": "112079113d62935d46e0e3ec3a1524e9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 23.023255813953487, "alnum_prop": 0.5767676767676768, "repo_name": "crosswalk-project/realsense-extensions-crosswalk", "id": "5df3e4a5f1fad12fdc8590558...
import json import codecs import logging from logging import config as _config import os import sys from pprint import pprint from scli import command, cli_parse, config_file, prompt from scli.constants import EbLogFile, EbLocalDir, OutputLevel, ParameterName, \ ParameterSource, ServiceDefault from scli.parameter ...
{ "content_hash": "d69bd3488bbcd560d5c00411debbf425", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 98, "avg_line_length": 31.510204081632654, "alnum_prop": 0.6364421416234888, "repo_name": "radlws/AWS-ElasticBeanstalk-CLI", "id": "01cc27ed9c767ce82ddbffddd8054c746ef575ce"...
from novaclient import client from novaclient.v3 import hosts class Client(object): """ Top-level object to access the OpenStack Compute API. Create an instance with your creds:: >>> client = Client(USERNAME, PASSWORD, PROJECT_ID, AUTH_URL) Then call methods on its managers:: >>> c...
{ "content_hash": "92c63f5fdd000414a38df2ea6967b5aa", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 38.758620689655174, "alnum_prop": 0.49644128113879005, "repo_name": "citrix-openstack-build/python-novaclient", "id": "091aa090185261a89c97797fa1ed5bcc...
from JumpScale import j from collections import OrderedDict # don't work with properties, this only happens when init is asked for so no big deal for performance class ActorTemplate(): def __init__(self, gitrepo, path, aysrepo=None): # path is path in gitrepo or absolute path self.logger = j.a...
{ "content_hash": "0d39502adeb8073d4a0b1a3772a2555a", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 126, "avg_line_length": 32.41304347826087, "alnum_prop": 0.5846188240554437, "repo_name": "Jumpscale/jumpscale_core8", "id": "c7f432e873c29172da68fbc513f2fee53b8ae71b", "s...
from google.cloud import documentai_v1beta3 async def sample_get_processor(): # Create a client client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.GetProcessorRequest( name="name_value", ) # Make the request...
{ "content_hash": "e678ea40985132a7ab500f9de3891295", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 80, "avg_line_length": 26.789473684210527, "alnum_prop": 0.7387033398821218, "repo_name": "googleapis/python-documentai", "id": "cc90dd2ee4454c254ed4c666a871bcff13827270", ...
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^demo_project/', include('demo_project.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.ad...
{ "content_hash": "85346ef877ad24e9d6b7e8028eed5139", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 75, "avg_line_length": 31.31578947368421, "alnum_prop": 0.6907563025210084, "repo_name": "uclastudentmedia/django-geotagging", "id": "4484e2ea2004c3bfc033002414f387b14b4d5d6a...
from pkg_resources import resource_filename from time import time from sanic import Sanic from sanic.response import html, json from jinja2 import Environment, PackageLoader, Markup from asyncpg import create_pool from monocle import sanitized as conf from monocle.bounds import center from monocle.names import DAMAGE...
{ "content_hash": "a406527cb555e2db08687e5435f1e911", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 142, "avg_line_length": 32.15544041450777, "alnum_prop": 0.603770544634225, "repo_name": "sebast1219/Monocle", "id": "fba1c6eac3eb4c2c02904ab8a5fac6f94b7c2489", "size": "6...
from setuptools import setup from social_login import VERSION packages = [ 'social_login', ] install_requires = [ 'socialoauth', ] setup( name='django-social-login', version = VERSION, license = 'BSD', description = 'A Django APP for Social account login via OAuth2 Service', long_descri...
{ "content_hash": "dfd7951d0735a2b27d32b0e968477ed0", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 24.735294117647058, "alnum_prop": 0.6278240190249703, "repo_name": "wangwanzhong/django-social-login", "id": "ef98ae9e82255f048124ba8ba81f0fd6669bb5de"...
from __future__ import print_function from contextlib import contextmanager import sys import time from reppy.robots import Robots content = ''' # /robots.txt for http://www.fict.org/ # comments to webmaster@fict.org User-agent: unhipbot Disallow: / User-agent: webcrawler User-agent: excite Disallow: User-agent: *...
{ "content_hash": "26b6bd20fd5b1db1a93e3b06ba06093e", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 63, "avg_line_length": 21.45098039215686, "alnum_prop": 0.6325411334552102, "repo_name": "seomoz/reppy", "id": "3a4486be2372e0e9520cc618866c5891551be920", "size": "1118", ...
import ast import re def get_decimal_or_variable_value(token, variables): if (token.isdecimal()): return int(token) assert(token in variables) return variables[token] def parse_freemarker_assign_expr(full_expr, variables): full_expr = full_expr.decode("ascii") pos_eq = full_ex...
{ "content_hash": "826b975261a70305f19329375e580ba8", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 73, "avg_line_length": 26.78301886792453, "alnum_prop": 0.4674181049665375, "repo_name": "kunyavskiy/polygon-cli", "id": "9996667de9664a0d88063fe9b0f6554399fd0bd0", "size"...
from bluebottle.time_based.tests.factories import DateActivityFactory, PeriodActivityFactory from bluebottle.initiatives.tests.factories import InitiativeFactory from django.urls.base import reverse from bluebottle.funding.tests.factories import FundingFactory, DonorFactory from bluebottle.test.factory_models.wallpos...
{ "content_hash": "88b4d40358b75314877605bced37c88e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 94, "avg_line_length": 47.30909090909091, "alnum_prop": 0.7352036894696388, "repo_name": "onepercentclub/bluebottle", "id": "60c5b37eb0c797340c22d628ffc7f943520cd687", "siz...
""" PyMF Simplex Volume Maximization [1] SIVM: class for SiVM [1] C. Thurau, K. Kersting, and C. Bauckhage. Yes We Can - Simplex Volume Maximization for Descriptive Web-Scale Matrix Factorization. In Proc. Int. Conf. on Information and Knowledge Management. ACM. 2010. """ import scipy.sparse import numpy as np ...
{ "content_hash": "5ae3017121dd88c886c05b0abf6f2a97", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 83, "avg_line_length": 33.11013215859031, "alnum_prop": 0.555880787653007, "repo_name": "guiquanz/msaf", "id": "2557a1b7981368637e19d081f327f2286b961503", "size": "7669", ...
the truth
{ "content_hash": "bc0d43a1c41a3680bd997996a7d1c180", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 9, "avg_line_length": 9, "alnum_prop": 0.8888888888888888, "repo_name": "cmdrflexo/humberto", "id": "95b5b562aeea290e45fc24ce03acc073037a44f7", "size": "9", "binary": fals...
from .parser import Parser from .renamer import * from .formatting import Formatting from tabulate import tabulate from fuzzywuzzy import fuzz
{ "content_hash": "9c8f51d574c1b8040687493a16bd0b48", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 28.6, "alnum_prop": 0.8321678321678322, "repo_name": "JonathanPetit/MovieSerieTorrent", "id": "8e69db8269acc0c88ad2c1abf295b28c22327f3c", "size": "143...
import os import sys import hashlib import argparse import itertools import logging from distutils.util import strtobool spinner = itertools.cycle(['-', '/', '|', '\\']) logger = logging.getLogger() class Dedupifier(object): block_size = 65536 def __init__(self, path, verbosity=0, use_hash=False, log_file=N...
{ "content_hash": "9d32079de48e8166329b8b9b80cad3f2", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 112, "avg_line_length": 32.646153846153844, "alnum_prop": 0.5254476908576814, "repo_name": "bne/dedupifier", "id": "6527fdee55470ff21b0b4c384aa1e9479d318f23", "size": "424...
import sys import time reload(sys) sys.setdefaultencoding('utf8') ########## FILESENDER ########## def fs_readChunk(): filename=sys.argv[2] offset=int(sys.argv[3]) length=int(sys.argv[4]) #data = readchunk from external sys.stdout.write(data) sys.stdout.flush() def...
{ "content_hash": "bc1079e011086e29bc8e08b4f85c2024", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 76, "avg_line_length": 19.471698113207548, "alnum_prop": 0.5959302325581395, "repo_name": "filesender/filesender", "id": "1f9c3771b56bc4967807db5b8823c0129e0cb7f3", "size":...
from nova import log as logging from nova.scheduler.filters import abstract_filter from nova import utils LOG = logging.getLogger('nova.scheduler.filter.compute_filter') class ComputeFilter(abstract_filter.AbstractHostFilter): """HostFilter hard-coded to work with InstanceType records.""" def _satisfies_ex...
{ "content_hash": "b815d9750be58c4e11ea258b174ae837", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 75, "avg_line_length": 39.925, "alnum_prop": 0.6643706950532248, "repo_name": "rcbops/nova-buildpackage", "id": "f576eace1a7556d024fca70f4deedcf4904e8301", "size": "2232", ...
''' @author: xiaowing @license: Apache Lincese 2.0 ''' from . import SsoToken, LoginUser
{ "content_hash": "80e16e952d86f98023ff963fadaf048a", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 17, "alnum_prop": 0.6176470588235294, "repo_name": "xiaowing/tinysso", "id": "5f23bbf533856fa687796810f13a0b85916beee7", "size": "102", "binary": fa...
import glob # Server's part. datasets = glob.glob("datasets/*") def get_file_content(filename): f = open(filename) try: return f.read() finally: f.close() source = dict((path, get_file_content(path)) for path in datasets) output = open("output/map_reduce_results", "w") def final(key, value): print key, v...
{ "content_hash": "cbaf205ed357579a64deecdcc82bae1a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 17.322580645161292, "alnum_prop": 0.6759776536312849, "repo_name": "afronski/playground-notes", "id": "53b414f834854db9c15c6755bcb3dd28292799b0", "si...
class GoogleAnalyticsClientError(Exception): """ General Google Analytics error (error accessing GA) """ def __init__(self, reason): self.reason = reason def __repr__(self): return 'GAError: %s' % self.reason def __str__(self): return 'GAError: %s' % self.reason
{ "content_hash": "aba1d85b1c9a25d649dbb126c2ee135d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 24.153846153846153, "alnum_prop": 0.589171974522293, "repo_name": "joshuajonah/python-googleanalytics", "id": "bc46d4b180721343e20921f93653da1a4ca4493b...
PREFIX = "/video/ardmediathek2016" REPO_BASE = 'https://raw.githubusercontent.com/rols1/Plex-Plugin-ARDMediathek2016/master' Plugin_FILE = '/Contents/Resources/update_single_files' ################################################################################ # Aufruf: wie Plugin-Update - bei Pluginstart oder...
{ "content_hash": "61c48a98fcb12a1422a57a0f0b6c31b2", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 103, "avg_line_length": 44.2312925170068, "alnum_prop": 0.6499538603506614, "repo_name": "rols1/Plex-Plugin-ARDMediathek2016", "id": "9565228e8ece13692e3771c7b4a414274494440...
""" OpenFlow 1.3 definitions. """ from ryu.lib import type_desc from ryu.ofproto import nx_match from ryu.ofproto import ofproto_utils from ryu.ofproto import oxm_fields from struct import calcsize # struct ofp_header OFP_HEADER_PACK_STR = '!BBHI' OFP_HEADER_SIZE = 8 assert calcsize(OFP_HEADER_PACK_STR) == OFP_HEADE...
{ "content_hash": "a2cc5aa67614f601f1b6716c5ac54e2d", "timestamp": "", "source": "github", "line_count": 1204, "max_line_length": 79, "avg_line_length": 40.958471760797345, "alnum_prop": 0.6656730340268484, "repo_name": "alanquillin/ryu", "id": "6b31ec2a4a0c054197ea8c7f65e1e813c70150a5", "size": "49...
import unittest import numpy as np import six from chainer import computational_graph as c from chainer import function from chainer import testing from chainer import variable class MockFunction(function.Function): def __init__(self, n_in, n_out): self.n_in = n_in self.n_out = n_out def f...
{ "content_hash": "e54237b6c14efae6c591d90c815aa2c2", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 79, "avg_line_length": 31.297101449275363, "alnum_prop": 0.576638110673767, "repo_name": "ronekko/chainer", "id": "71cfca4f2c64e41d3dbb92af1f871c25021b211b", "size": "8638...
from __future__ import unicode_literals """Constants and static functions to support protocol buffer wire format.""" __author__ = 'robinson@google.com (Will Robinson)' import struct from google.protobuf import descriptor from google.protobuf import message from google.protobuf.internal.utils import string_to_bytes ...
{ "content_hash": "11e42ffd0666b141a1a0b0cfdcdbe068", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 77, "avg_line_length": 28.70539419087137, "alnum_prop": 0.7263660017346054, "repo_name": "openx/python3-protobuf", "id": "8863c551462a37cfc9a291e244af7580b4df1597", "size"...
from PyQt4.QtGui import QStandardItem, QStandardItemModel, QIcon class BaseTreeItem(QStandardItem): def __init__(self, name): QStandardItem.__init__(self, name) self.setEditable(False) self.setColumnCount(1) self.setData(self) def getModel(self): item = self wh...
{ "content_hash": "b1f525d37456d6963b36acc8d35801c6", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 187, "avg_line_length": 28.78846153846154, "alnum_prop": 0.586372745490982, "repo_name": "mtorromeo/sqlantaresia", "id": "0720b8554007170f5c7ce199a004b1c11de68be4", "size"...
"""open_discussions constants""" from rest_framework import status PERMISSION_DENIED_ERROR_TYPE = "PermissionDenied" NOT_AUTHENTICATED_ERROR_TYPE = "NotAuthenticated" DJANGO_PERMISSION_ERROR_TYPES = ( status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, ) ISOFORMAT = "%Y-%m-%dT%H:%M:%SZ"
{ "content_hash": "2742453f8933231269b76d409b6b11af", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 49, "avg_line_length": 27.545454545454547, "alnum_prop": 0.7425742574257426, "repo_name": "mitodl/open-discussions", "id": "8f5fd3284ce0117aae3d1186713608859a01c17e", "size...
"""This module provides a base class for transports that provide asynchronous (non-blocking) transmit and receive functionality. """ from thespian.system.transport import (TransmitOnly, SendStatus, Thespian__UpdateWork) from thespian.system.utilis import thesplog, partition from...
{ "content_hash": "873102b962d205621aca015ced4ca163", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 93, "avg_line_length": 44.56609195402299, "alnum_prop": 0.614223998968341, "repo_name": "kquick/Thespian", "id": "46e321eeec18c754faefba0890c339d9a3cf68ca", "size": "15509...
import json import requests import urlparse import testresources import testtools from keystoneclient.v2_0 import Client as keystoneclient class CloneEnvTests(testtools.TestCase, testtools.testcase.WithAttributes, testresources.ResourcedTestCase): @classmethod def setUpClass(cls): ...
{ "content_hash": "34b7c501087808d5717017ca1a74fb1d", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 78, "avg_line_length": 39.062780269058294, "alnum_prop": 0.5486166915394329, "repo_name": "Mirantis/octane", "id": "349854088f18081708727bc0795ca64afde04f72", "size": "925...
""" Gmail Access Gmail mailboxes including sending user email. OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import gmail_client from gmail_client.rest import ApiExcepti...
{ "content_hash": "23c881ef3634461ea8c5aa9b617830f4", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 83, "avg_line_length": 20.3, "alnum_prop": 0.6945812807881774, "repo_name": "CanopyIQ/gmail_client", "id": "73f1ccf766534701dedd3b43b7e1228eb9b76abb", "size": "829", "bin...
import unittest from cmdlinetool import util class TestUtil(unittest.TestCase): def test_adder(self): self.assertEqual(util.adder(3, 5), 8) def test_adder2(self): self.assertEqual(util.adder(-3, -5), -8)
{ "content_hash": "8b5d4e10ea1d6db5e20753d53cf3ab9e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 48, "avg_line_length": 23.1, "alnum_prop": 0.670995670995671, "repo_name": "tobiajo/cmdlinetool", "id": "bbae527dbf03eaa350ec9bf2c3ba735accff1829", "size": "231", "binary...
import collections import itertools import unittest import dontasq class MethodsTest(unittest.TestCase): def test_builtins(self): actual = [1, 2, 4, 10, 20, 65] \ .where(lambda x: x % 2 == 0) \ .select(lambda x: x * 2) \ .to_list() expected = [4, 8, 20, 40] ...
{ "content_hash": "e747c53affab44c7df42f8b9c91fdf6e", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 77, "avg_line_length": 31.579234972677597, "alnum_prop": 0.504585568437446, "repo_name": "borzunov/dontasq", "id": "ff2f4f4c4b3e0be83041ff43dec541ee070fe81b", "size": "582...
""" Test Cases para datos de demanda energética """ from unittest import TestCase class TestsDemanda(TestCase): """Tests para el almacén local de datos de demanda energética.""" def test_create_db(self): """Test de `force_update` los datos de demanda energética.""" from esiosdata import Dato...
{ "content_hash": "13cc2010bfbe38d2559ca1377042c5c8", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 86, "avg_line_length": 29.192307692307693, "alnum_prop": 0.5972771190162495, "repo_name": "azogue/esiosdata", "id": "6cc73156cd80bcedb2740594ad8f7148a65a489b", "size": "230...
import os from flask import Flask application = Flask(__name__) route = application.route application.debug = True @route('/qps/caiyun-backend-wrapper-new') def index(): root_path = os.path.dirname(os.getcwd()) cmd = "%s/bin/perf-test" % os.path.join(root_path, 'caiyun-backend-wrapper-new') os.system("ss...
{ "content_hash": "561de9ea0e38af1effe7c640da8bd2f2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 84, "avg_line_length": 23.19047619047619, "alnum_prop": 0.6550308008213552, "repo_name": "caiyunapp/qa-badge", "id": "3bf549ada8cf7a793435e5398c2a90b2a177ec7d", "size": "51...
import zoo zoo.hours()
{ "content_hash": "6610439bdd3fc57066b027c63d5c6ed8", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 11, "avg_line_length": 6.25, "alnum_prop": 0.68, "repo_name": "sungkim-1029/coursework", "id": "0083473160df1089b4ca885548c33a74ca754670", "size": "49", "binary": false, ...
import os import logging import time from .env import env class Formatter(logging.Formatter): def __init__(self, fmt): logging.Formatter.__init__(self, fmt) self.last = time.time() def format(self, record): current = time.time() record.delta = '%sms' % int((current - self.las...
{ "content_hash": "84496ab7d37a438df12d3ae8bce35462", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 24.07894736842105, "alnum_prop": 0.614207650273224, "repo_name": "srossross/stable.world", "id": "8322ab95af5a16dc51c540ca784ff5be5f91b459", "size": ...
from conditions import * """Nodes for scons to gn Nodes class provides a means to store, explore and write out a tree describing the table generated by interating over the scons file. The tree is created in the form of: TopNode Condition Object Condition Property """ REMAP = { 'ar...
{ "content_hash": "7774f24fa22d98cb847dbe0b3674e0ef", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 75, "avg_line_length": 23.832558139534882, "alnum_prop": 0.5977751756440282, "repo_name": "yantrabuddhi/nativeclient", "id": "f103f09bc75b79ec8bb1515d643cf638b8d0aeb0", "s...
from multiverse.server.util import * from multiverse.simpleclient import * from java.lang import * # PlayerClient instance Log.debug("playerclient.py starting PlayerThread"); #playerClient = PlayerClient("--zero_y --position (63505,71222,300303) --polygon 54848,315218,53685,284092,-69679,284014,-69527,314322") playe...
{ "content_hash": "a76747d9ba05e56ad7de9fb3cfdddd02", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 136, "avg_line_length": 33.416666666666664, "alnum_prop": 0.7780548628428927, "repo_name": "longde123/MultiversePlatform", "id": "1f144e882cbebfa434c911807ffd6d28a35da1c1", ...
from __future__ import annotations import json import logging import warnings from json import JSONDecodeError from urllib.parse import parse_qsl, quote, unquote, urlencode, urlsplit from sqlalchemy import Boolean, Column, Integer, String, Text from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm ...
{ "content_hash": "73851a14a6f099a530c0288059fb93ae", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 105, "avg_line_length": 37.38425925925926, "alnum_prop": 0.5793808049535604, "repo_name": "apache/airflow", "id": "73a284be9e5ef05d62875110a7f478d0a883dfcc", "size": "1693...
c.InteractiveShellApp.exec_lines = [ # noqa 'from pathlib import Path; import sys; sys.path.append(str((Path(__file__).parent / "..").resolve()))' ]
{ "content_hash": "d113732b9f4c13d7939b5480106581bc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 106, "avg_line_length": 52.333333333333336, "alnum_prop": 0.6369426751592356, "repo_name": "nok/sklearn-porter", "id": "651007d6572dde7fc51a4f4c289f5492c9243d50", "size": "1...
from google.cloud.aiplatform.v1.schema.trainingjob.definition_v1.types.automl_image_classification import ( AutoMlImageClassification, ) from google.cloud.aiplatform.v1.schema.trainingjob.definition_v1.types.automl_image_classification import ( AutoMlImageClassificationInputs, ) from google.cloud.aiplatform.v1....
{ "content_hash": "d1882b260e414102cf84ce4d3e9e4a59", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 114, "avg_line_length": 42.62135922330097, "alnum_prop": 0.8136674259681094, "repo_name": "sasha-gitg/python-aiplatform", "id": "bd4624d83b2d2a584a7bf5612576ad741c5b01f5", ...
import os import shutil import sys import time from unittest.mock import Mock import pytest import requests from tornado import ioloop from sudospawner import SudoSpawner @pytest.fixture(scope="module") def io_loop(request): """Same as pytest-tornado.io_loop, but re-scoped to module-level""" io_loop = ioloo...
{ "content_hash": "40ee46986afeb0c59bb6883c86dc935c", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 81, "avg_line_length": 24.5625, "alnum_prop": 0.6393129770992366, "repo_name": "jupyter/sudospawner", "id": "0a98c8884a6c3b1e2bd9c389cab6e4dc16d6dd72", "size": "3144", "...
from django.db.models import Q from .choices import FHRPGroupProtocolChoices, IPAddressRoleChoices # BGP ASN bounds BGP_ASN_MIN = 1 BGP_ASN_MAX = 2**32 - 1 # # VRFs # # Per RFC 4364 section 4.2, a route distinguisher may be encoded as one of the following: # * Type 0 (16-bit AS number : 32-bit integer) # * Typ...
{ "content_hash": "ac93a29ce88a4a2cabe4fd3b53173601", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 98, "avg_line_length": 23.75, "alnum_prop": 0.7386727688787186, "repo_name": "digitalocean/netbox", "id": "ab88dfc1a963636f548c15e667ea8491a6833362", "size": "2185", "bin...
import hashlib import hmac import sys if sys.version_info[0] == 2: text_type = unicode else: text_type = str class Crypto: @staticmethod def sha1_hmac_hash(secret_key, content): if isinstance(secret_key, text_type): secret_key = secret_key.encode('ascii') if isinstance(cont...
{ "content_hash": "1cb81c20c31cf3430468ab60718a82a9", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 97, "avg_line_length": 31.390243902439025, "alnum_prop": 0.6130536130536131, "repo_name": "mapleoin/braintree_python", "id": "39672e399d86aa3e23be90f20a1ba51a45405775", "si...
import logging logger = logging.getLogger(__name__) class SchedulerPlugin(object): """ Interface to extend the Scheduler The scheduler operates by triggering and responding to events like ``task_finished``, ``update_graph``, ``task_erred``, etc.. A plugin enables custom code to run at each of those...
{ "content_hash": "1063d36eddc08bc38cb18f17ea269520", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 88, "avg_line_length": 36.03076923076923, "alnum_prop": 0.625533731853117, "repo_name": "mrocklin/distributed", "id": "cfe5fa42b4960d5a53d9e1c503e1078515dbedd5", "size": "2...
from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import Group, User from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.db.models ...
{ "content_hash": "881abde38c210e339c678bf58f1f4141", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 93, "avg_line_length": 39.46853146853147, "alnum_prop": 0.6211020552799433, "repo_name": "flamingspaz/remo", "id": "8ecabb5dc0a62487c2cfa3fe35f51f88bf754261", "size": "112...
"""A lexical analyzer class for simple shell-like syntaxes.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 # push_source() and pop_source() made explicit by ESR, January 2001. # Posix compliance, split(), string arguments, and # iterato...
{ "content_hash": "479e4f299c437484ab4122d53ffc96b5", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 78, "avg_line_length": 38.28115942028985, "alnum_prop": 0.4945862042856061, "repo_name": "batermj/algorithm-challenger", "id": "ae0f5ddec18716facde32ff586a141a5a7767a2f", ...
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 'Order.comment' db.add_column('products_order', 'comment', s...
{ "content_hash": "59a1a980165ce384207646dc23ffd786", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 202, "avg_line_length": 72.368, "alnum_prop": 0.5594738005748398, "repo_name": "drummonds/galleria", "id": "41dc5f8aee68ddfefcff90d52b725be8371b6a71", "size": "9070", "b...
from __future__ import unicode_literals from django.db import models class Plant(models.Model): name = models.CharField(max_length=100) # Humidity. LOW, MODERATE, HIGH ideal_humidity = models.CharField(max_length=100, choices=[('LOW', 'LOW'), ('MODERATE', 'MODERATE'), ('HIGH', 'HIGH')]) # How much s...
{ "content_hash": "e2a7f0deceefe5fb8ed4a27ae06ad647", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 123, "avg_line_length": 43.54237288135593, "alnum_prop": 0.6488906189178669, "repo_name": "mgnusl/herb-pi", "id": "28a8e12bd71f6fd567b966b536c2bb13a06828f6", "size": "2569"...
"""Module to re-distribute conversion-values of no-consent customers.""" import logging from typing import Any, Callable, List, Optional, Sequence, Tuple, Union import numpy as np import pandas as pd from scipy import sparse from scipy import special from sklearn import neighbors class NearestCustomerMatcher: """...
{ "content_hash": "d7b02f4b44462fe8fe074408369d3827", "timestamp": "", "source": "github", "line_count": 507, "max_line_length": 80, "avg_line_length": 43.226824457593686, "alnum_prop": 0.7027742288738821, "repo_name": "google/consent-based-conversion-adjustments", "id": "53f470099d08fecbd048fb5f6d453...
import re from collections import defaultdict import pkg_resources import sqlalchemy as sa from sqlalchemy import Column, exc, inspect, schema from sqlalchemy.dialects.postgresql.base import PGCompiler, PGDDLCompiler from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2 from sqlalchemy.engine import r...
{ "content_hash": "0ce7b100b97d61eb81c37003212aa3b7", "timestamp": "", "source": "github", "line_count": 835, "max_line_length": 79, "avg_line_length": 36.461077844311376, "alnum_prop": 0.5706355723435703, "repo_name": "solackerman/sqlalchemy-redshift", "id": "e2188ad73b90dac1a3a5d0ac91157604674bf99d"...
import itertools from .. import objtypes from ..mixin import ValueType array_supers = 'java/lang/Object','java/lang/Cloneable','java/io/Serializable' obj_fset = frozenset([objtypes.ObjectTT]) def isAnySubtype(env, x, seq): return any(objtypes.isSubtype(env,x,y) for y in seq) class TypeConstraint(ValueType): ...
{ "content_hash": "f2d8bc16546bce9b54668b1b4286840c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 141, "avg_line_length": 36.89430894308943, "alnum_prop": 0.6207580431908329, "repo_name": "orneryhippo/saturdays", "id": "8befcd19bf32c839097b0f20fd847520e743c4e3", "size"...
from typing import Iterable, List, Optional, Union from airflow.cli.cli_parser import ActionCommand, GroupCommand, airflow_commands from airflow.cli.simple_table import AirflowConsole, SimpleTable from airflow.utils.cli import suppress_logs_and_warning @suppress_logs_and_warning def cheat_sheet(args): """Display...
{ "content_hash": "e766a2b13e5c8d7d1f47085aaf593f26", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 94, "avg_line_length": 35.63636363636363, "alnum_prop": 0.6371173469387755, "repo_name": "Acehaidrey/incubator-airflow", "id": "001a8721330cb15d88b37d7058281b9ebdb1873b", "...
""" Functions dealing with execute commands. """ import argparse def execute_module_command(module, command='', command_line=[], *args, **kwargs): """ Executes the given command line in the given module. module the module command to execute command_line list of strings to be parse...
{ "content_hash": "f7087c17ae417dcfa56b15817097a531", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 97, "avg_line_length": 42.90909090909091, "alnum_prop": 0.6758474576271186, "repo_name": "robobrobro/coffer", "id": "c713f25cd0fc96b406e028a7e033ef55c2db8c1c", "size": "141...
"""Tests for packages info.""" import json import os import sys import unittest sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) import pynacl.working_directory import archive_info import error import package_info import packages_info import revision_info CURRENT_DIR = os.path.dirname(os.path.abspa...
{ "content_hash": "1d709992835ea1b36f550e9627df176d", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 78, "avg_line_length": 34.12442396313364, "alnum_prop": 0.6668467251856853, "repo_name": "mxOBS/deb-pkg_trusty_chromium-browser", "id": "8cbfd76491d28b141449f589e10d46669c20...
import psutil from uiBasicWidget import * from ctaAlgo.uiCtaWidget import CtaEngineManager from dataRecorder.uiDrWidget import DrEngineManager from riskManager.uiRmWidget import RmEngineManager ######################################################################## class MainWindow(QtGui.QMainWindow): """主窗口""" ...
{ "content_hash": "63d79b59858df75bde53140862ef4e35", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 112, "avg_line_length": 37.98365122615804, "alnum_prop": 0.5001434720229555, "repo_name": "lukesummer/vnpy", "id": "32de7b3367aef8e36bedfe751a4852d0eaed6440", "size": "146...
from __future__ import unicode_literals from django.db import models, migrations import botbot.core.fields class Migration(migrations.Migration): dependencies = [ ('bots', '0001_initial'), ] operations = [ migrations.CreateModel( name='ActivePlugin', fields=[ ...
{ "content_hash": "4b7dc74e1b4b56b42ff2649fd2a23be9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 182, "avg_line_length": 32.95238095238095, "alnum_prop": 0.5332369942196532, "repo_name": "Freso/botbot-web", "id": "f2ada209530e0e8228160a87207ca11fb81c3b1b", "size": "140...
from decimal import Decimal from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils import crypto, timezone from django_hosts.resolvers import reverse from sorl.thumbnail import ImageField, get_thumbnail DISPLAY_LOGO_AMOUNT = Decimal("200.00")...
{ "content_hash": "d577aa1b88d2aa630274a9404825067e", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 103, "avg_line_length": 35.285714285714285, "alnum_prop": 0.6874879506458453, "repo_name": "khkaminska/djangoproject.com", "id": "b5b5c11275c71300c2abff88ffd1d138b554a1de", ...
import _plotly_utils.basevalidators class LinecolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="linecolor", parent_name="layout.yaxis", **kwargs): super(LinecolorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "39a561c195116e0047b2eb55a800bee3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 86, "avg_line_length": 38.25, "alnum_prop": 0.6209150326797386, "repo_name": "plotly/python-api", "id": "7f93d055a914abdc16e6e54194f9f6b4c44da672", "size": "459", "binary...
"""Module implementing core cutting functionality.""" import json import ssl import urllib2 from core import search_tab_template class GlobeCutter(object): """Class implementing core cutting functionality.""" POI_SEARCH_SERVICE_URL = "POISearch" PLACES_SEARCH_SERVICE_URL = "/gesearch/PlacesSearch" SEARCH_T...
{ "content_hash": "bcd3542797b80d8f66ebec276c7ef9be", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 75, "avg_line_length": 27, "alnum_prop": 0.6455026455026455, "repo_name": "google/earthenterprise", "id": "1f895cfa0ddabc9b7031ab1b42097442737852ba", "size": "3857", "bi...
from enum import Enum from azure.core import CaseInsensitiveEnumMeta class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity that created the resource.""" USER = "User" APPLICATION = "Application" MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" class Template...
{ "content_hash": "1d1b4bb342d6d3a7d10a805d5fc4ce11", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 27.944444444444443, "alnum_prop": 0.7375745526838966, "repo_name": "Azure/azure-sdk-for-python", "id": "ec0f6b2bc39a47d1ca523ee0ca825e16eaed0f85", "s...
"""Unit test for smugmug.py""" import unittest import freezegun from smugcli import smugmug class MockNode(): """A mock version of `smugmug.Node`.""" def __init__(self): self._reset_count = 0 def reset_cache(self): """Override of `smugmug.Node.reset_cache`, tracking invocation count.""" self._r...
{ "content_hash": "8794dc28eb55532aca55720eeb7fb1a6", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 77, "avg_line_length": 31.393939393939394, "alnum_prop": 0.693050193050193, "repo_name": "graveljp/smugcli", "id": "0817dc5941463cc5767a18bf61a12de931666320", "size": "3108...
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 'Player' db.create_table(u'elections_player', ( (u'id', self.gf('django.db.models.fields.AutoField')(prim...
{ "content_hash": "046c95c8b48727ebfa68a15e294d12eb", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 142, "avg_line_length": 50.40506329113924, "alnum_prop": 0.5743345052737318, "repo_name": "jcderr/loot", "id": "3ac50db932fdfd5fc5e2c9bf63fc37d8786e6316", "size": "4006", ...
"""Utilities to create TensorProtos.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import six from tensorflow.core.framework import tensor_pb2 from tensorflow.core.framework import tensor_shape_pb2 from tensorflow.python.eager import...
{ "content_hash": "a266d91b08362f1a223935a20cbe9fbc", "timestamp": "", "source": "github", "line_count": 916, "max_line_length": 106, "avg_line_length": 36.4028384279476, "alnum_prop": 0.6783025940920677, "repo_name": "zasdfgbnm/tensorflow", "id": "27afaa074a6becd5c8b7db94be59e8da1611c13a", "size": ...
from django.templatetags.static import static from django.urls import reverse from django.db import models from django.utils.translation import gettext_lazy as _ from easy_thumbnails.exceptions import InvalidImageFormatError from easy_thumbnails.files import get_thumbnailer DEFAULT_COACH_PHOTO = static('img/global/c...
{ "content_hash": "cf529f66e8407b957bdeb3a0ffdbf66c", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 78, "avg_line_length": 29.784313725490197, "alnum_prop": 0.6175115207373272, "repo_name": "DjangoGirls/djangogirls", "id": "da721b818cef6264ccd6a188eecace6a8500f808", "size...
from __future__ import absolute_import, print_function, division import unittest import numpy import numpy.linalg from numpy.testing import assert_array_almost_equal from numpy.testing import dec, assert_array_equal, assert_allclose from numpy import inf import theano from theano import tensor, function from theano.t...
{ "content_hash": "e530ff14b936205854cc7bc15e9e19e2", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 87, "avg_line_length": 37.43561643835616, "alnum_prop": 0.5530591334894613, "repo_name": "JazzeYoung/VeryDeepAutoEncoder", "id": "3886271ff4d0e2b2cc959895c9662c282279261a", ...
class dataObject: """ Each of the data points in the database should be represented as one of these objects. The actual data is put in the attributes vector. """ def __init__(self, numberOfAttributes): self.attributes = [0.0]*numberOfAttributes def setAttributes(self, a...
{ "content_hash": "5c5a3b7d115cad454021d69dbd54c3c1", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 85, "avg_line_length": 34.121212121212125, "alnum_prop": 0.6376554174067496, "repo_name": "ViktorWase/Frank-the-Science-Bot", "id": "563fe1a802af88a2e8e692b0b893912a394d90c7"...
import tkinter as tk from tkinter import filedialog from tkinter import messagebox from ApplePie import * from Utils import * from ApplePieTk.subFrame.BaseFrame import * class Frame1(BaseFrame): btnPath = None entPath = None def __init__(self, parentFrame): super().__init__(parentF...
{ "content_hash": "51e73eb5f24ed9197a9191780b0489d1", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 107, "avg_line_length": 30.016129032258064, "alnum_prop": 0.5502418054809243, "repo_name": "rurilee/applepie", "id": "3076283558c2667fc2b648a12abb61294433c577", "size": "19...
from collections import OrderedDict import fnmatch from os import listdir, path import re import logging import numpy as np import numpy.ma as ma from astropy.table import Table, MaskedColumn import astropy.io.fits as fits from astropy.utils import minversion import warnings from astropy.utils.exceptions import Ast...
{ "content_hash": "52c999a29585b0beb9665cdb579928eb", "timestamp": "", "source": "github", "line_count": 1002, "max_line_length": 104, "avg_line_length": 37.03792415169661, "alnum_prop": 0.5495257598620392, "repo_name": "mwcraig/ccdproc", "id": "ff58c46895f833522642bdbd37aadb7546ecf6b5", "size": "37...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: tower_job_launch author: "Wayne Witzel III (@wwitzel3)" ver...
{ "content_hash": "cf87bbaf6a7d1f65fb6c30e8fe38ef6d", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 136, "avg_line_length": 27.470967741935485, "alnum_prop": 0.6014560826679192, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "b332edf36e3737b2fdbbabe3811050f127...
from GenericRequest import GenericRequest from kol.database import SkillDatabase from kol.manager import PatternManager class UseSkillRequest(GenericRequest): def __init__(self, session, skillId, numTimes=1, targetPlayer=None): super(UseSkillRequest, self).__init__(session) self.get = True ...
{ "content_hash": "baf444227dab6fe759eacfdcbcb37612", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 72, "avg_line_length": 41.04, "alnum_prop": 0.6627680311890838, "repo_name": "ijzer/cwbot-ndy", "id": "4e8b2a42945bd3bed62610f4ed8bdba0528cd430", "size": "1026", "binary"...
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ from __future__ import unicode_literals from django.db.backends import uti...
{ "content_hash": "9997f567590b70c1b6813f85a403befb", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 85, "avg_line_length": 35.734299516908216, "alnum_prop": 0.6145734757334055, "repo_name": "adambrenecki/django", "id": "2a92978beb0232220470e590e7bb48afbda7b91c", "size": ...
from django.shortcuts import render, redirect from django.http import HttpResponse #TODO: Why is this loading templates from the /cards app index? def index(request): return render(request, 'index.html') def home(request): if request.is_ajax(): return render(request, 'home.html') return render(request, 'index....
{ "content_hash": "07ecc2c6b8a7fcc0328d7215d3b972e2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 96, "avg_line_length": 29.41176470588235, "alnum_prop": 0.74, "repo_name": "techtyler/HoldEmBonusSimulator", "id": "1f53fb2557a93098a24564245663386d303aed4c", "size": "500"...
try: from PIL import Image except ImportError: import Image def makeThumb(image, maxSize, method = 3): 'Resize PIL image, to fit into the maxSize' orig_size = image.size if orig_size[0] > maxSize[0] or orig_size[1] > maxSize[1]: min_extent = min( orig_size[0], orig_size[1] ) left...
{ "content_hash": "b86811443e6c1fcd47d679237eeeffaf", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 32.578947368421055, "alnum_prop": 0.5993537964458805, "repo_name": "svetlyak40wt/django-faces", "id": "2b0b84ac36ea0c5a75ed10aff36d49b18d11ebd9", "si...
from __future__ import division, print_function, unicode_literals __doc__ = """ Opens a new tab with all possible combinations of currently selected glyphs. """ Font = Glyphs.font selectedLayers = Font.selectedLayers namesOfSelectedGlyphs = ["/%s" % l.parent.name for l in selectedLayers if hasattr(l.parent, 'name')] ...
{ "content_hash": "ff66752a86159e037a241a5a4300d469", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 100, "avg_line_length": 31.09090909090909, "alnum_prop": 0.7543859649122807, "repo_name": "mekkablue/Glyphs-Scripts", "id": "d1f5dd9dbc56626afb9c2d5049435e69a6cec23c", "siz...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import copy import errno import logging import os import pkgutil import threading import xml.etree.ElementTree as ET from collections import OrderedDict, defaultdict, ...
{ "content_hash": "fc8cdf23834eaada379f0f2675829807", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 100, "avg_line_length": 41.98947368421052, "alnum_prop": 0.656430183003259, "repo_name": "dturner-tw/pants", "id": "bf83e902873156f1cfe155c3438705d0b444b70b", "size": "240...
""" Manages addition of mol2 output information to segments. """ ################################### MODULES ################################### from __future__ import absolute_import,division,print_function,unicode_literals from .TrajOutput import TrajOutput ################################### CLASSES ################...
{ "content_hash": "8bb34621912c7b14d2d0e5c56133b27d", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 37.463157894736845, "alnum_prop": 0.5487496487777466, "repo_name": "KarlTDebiec/md_format_converter", "id": "05581a36fa0802a15b8baec866deb96af0ef7c21",...
import sys import yahooscraper as ys from datetime import datetime, date from urllib.parse import urljoin # Environment variables USERNAME_ENV = 'YAHOO_USERNAME' PASSWORD_ENV = 'YAHOO_PASSWORD' # Command-line args REQUIRED_ARGS = [ '<league_id>', '<team_id>' ] OPTIONAL_ARGS = [] # Error messages LOGIN_ERRO...
{ "content_hash": "8577f6eb32dc8eb226022cd730d304b5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 76, "avg_line_length": 24.76829268292683, "alnum_prop": 0.605120630231413, "repo_name": "jbrudvik/yahoo-fantasy-basketball", "id": "edba2b17bbd63147e2694efe8a56a21fbc7e8bb6",...
"""Support for RESTful API sensors.""" import logging import json import voluptuous as vol import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth from homeassistant.components.sensor import PLATFORM_SCHEMA, DEVICE_CLASSES_SCHEMA from homeassistant.const import ( CONF_AUTHENTICATION, CONF_FORC...
{ "content_hash": "508fb2f38571f9ffaabd6ba41c286d62", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 88, "avg_line_length": 31.856589147286822, "alnum_prop": 0.6038447499695827, "repo_name": "qedi-r/home-assistant", "id": "41adb8559036cf28351f318b9c20a80c3ee5cce1", "size"...
from .generator import GraphGenerator
{ "content_hash": "994a71d68c7b2ca0b51b9efd4ce2fd06", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 37, "avg_line_length": 38, "alnum_prop": 0.868421052631579, "repo_name": "lucasdavid/edge", "id": "e23c1629319c57c9d9a2afab46a61a52f6fa0d61", "size": "38", "binary": false...
import subprocess from mock import patch, Mock, MagicMock from datetime import datetime, timedelta from .. import worker class TestWorker(object): @patch("os.path.exists") def test_restart_file_path_doesnt_exist(self, m_exists): m_exists.return_value = False result = worker.need_restart() ...
{ "content_hash": "0301a1e37152f10e010cead0e53b5c6a", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 88, "avg_line_length": 36.5, "alnum_prop": 0.569218372280419, "repo_name": "t-miyamae/teuthology", "id": "8fa8e7879690960120183047a711b3f44403eae9", "size": "6205", "bin...
from datetime import date from django import template from django.conf import settings from django.utils import translation from demo.models import PersonPage, BlogPage, EventPage, CoursePage, \ Advert, Page, StandardPage, StandardIndexPage, FormPage register = template.Library() # settings value @register.assi...
{ "content_hash": "679ea853e4c003a36758223606faa777", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 81, "avg_line_length": 33.08955223880597, "alnum_prop": 0.6749360998346113, "repo_name": "dudunato/ywam-cerrado", "id": "5031eae70fb565965599897ad35ba461b2b3aab2", "size":...
from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern import six from ..extern.six.moves import zip import warnings import weakref import re from copy import deepcopy import numpy as np from numpy import ma # Remove this when Numpy no longer emits...
{ "content_hash": "2027024da0195fc6bb9248ed2394fb0e", "timestamp": "", "source": "github", "line_count": 1263, "max_line_length": 98, "avg_line_length": 36.933491686460805, "alnum_prop": 0.5901987266062126, "repo_name": "AustereCuriosity/astropy", "id": "0432c4ed0ce00eb5a128e8834bb694a9adbbeda9", "s...
import shlex import os, sys, pickle, re import subprocess, shutil from collections import OrderedDict from . import backends from .. import modules from .. import environment, mesonlib from .. import build from .. import mlog from .. import dependencies from .. import compilers from ..compilers import CompilerArgs fro...
{ "content_hash": "875c51a92b3a804ca1269ced0b63a2ef", "timestamp": "", "source": "github", "line_count": 2518, "max_line_length": 132, "avg_line_length": 49.53455123113582, "alnum_prop": 0.5783865691745238, "repo_name": "wberrier/meson", "id": "761d508f9c0e3306b80bc4f099699b4e58cfbdf9", "size": "125...
import unittest import numpy as np from pymatgen.core.interface import Interface from pymatgen.core.surface import SlabGenerator from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.util.testing import PymatgenTest class InterfaceTest(PymatgenTest): def setUp(self): self.interface: In...
{ "content_hash": "3cb9bc1dd34e769cc7d419583a1243e9", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 104, "avg_line_length": 38.714285714285715, "alnum_prop": 0.6487084870848708, "repo_name": "fraricci/pymatgen", "id": "d78406f58eaee25395e4b49a2d2ef8c0c6d69ba4", "size": "...
from yelp.client import Client from yelp.oauth1_authenticator import Oauth1Authenticator import re def Yelp(command, yelp_authkeys): lowerCom = command.lower() searchType = re.findall(r'yelp (.*?) in', lowerCom, re.DOTALL) searchKey="" for t in searchType: searchKey+=t searchType=searchKe...
{ "content_hash": "a6a0091daf3683d319206d13c0899a77", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 364, "avg_line_length": 34.361111111111114, "alnum_prop": 0.6265157639450283, "repo_name": "jcallin/eSeMeS", "id": "6bfc37258f7965a4cc634b31850d40cb7ecd85c6", "size": "1237...
from importlib import import_module from django.core.exceptions import ImproperlyConfigured def import_attribute(import_path=None, options=None): if import_path is None: raise ImproperlyConfigured("No import path was given.") try: dot = import_path.rindex('.') except ValueError: r...
{ "content_hash": "bae58c0ae3de1283363edee903e3a0c2", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 33.28, "alnum_prop": 0.6334134615384616, "repo_name": "jazzband/django-queued-storage", "id": "1499dbce4661f4c292a15bbcd993a74d1525c38c", "size": "83...
from AccessControl import ClassSecurityInfo from smtplib import SMTPServerDisconnected, SMTPRecipientsRefused from Products.CMFCore.WorkflowCore import WorkflowException from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import formataddr from bika.lims import bikaMessa...
{ "content_hash": "fd1ca3cfa5f92d28e3116fe2fcd53e68", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 118, "avg_line_length": 45.154981549815496, "alnum_prop": 0.5875623110239437, "repo_name": "hocinebendou/bika.gsoc", "id": "937217d7f59170a87f9c998c3c1cf6bfe35f144c", "siz...
from ..singletons import agent, tracer, async_tracer, tornado_tracer from ..log import logger def extract_custom_headers(tracing_scope, headers): try: for custom_header in agent.options.extra_http_headers: # Headers are in the following format: b'x-header-1' for header_key, value i...
{ "content_hash": "9a2899474a6292530e36826098fa4466", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 119, "avg_line_length": 35.6551724137931, "alnum_prop": 0.6228239845261122, "repo_name": "instana/python-sensor", "id": "ba57239567fe066ef217bb7ab56625269591c324", "size": ...
from __future__ import unicode_literals import datetime import os import unittest import warnings from django import http from django.contrib.formtools import preview, utils from django.test import TestCase, override_settings from django.utils._os import upath from django.contrib.formtools.tests.forms import ( H...
{ "content_hash": "b56bf07b5bd0775b8007655e4a40dcae", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 81, "avg_line_length": 40.16304347826087, "alnum_prop": 0.6500676589986468, "repo_name": "mbox/django", "id": "5d3b2747a7270207d75fc05d54d6d4dcf3006926", "size": "7416", ...
"""Support for IHC sensors.""" from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.const import CONF_UNIT_OF_MEASUREMENT from homeassistant.util.unit_system import TEMPERATURE_UNITS from . import IHC_CONTROLLER, IHC_INFO from .ihcdevice import IHCDevice def setup_platform(h...
{ "content_hash": "a423a9c5e17398569af7c784b7dde41b", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 79, "avg_line_length": 34.111111111111114, "alnum_prop": 0.6389018147975802, "repo_name": "home-assistant/home-assistant", "id": "d032043b9321578379ed5f9d75998628a2aab2dd", ...
"""Read CSV as unicode from both python 2 and 3 transparently.""" from __future__ import absolute_import import csv import warnings import six # noinspection PyUnusedLocal class UnicodeReader(six.Iterator): """CSV reader that can handle unicode. Must be used as a context manager: with UnicodeReader('m...
{ "content_hash": "eac959809ba739fb6c88c253e9ea86d8", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 74, "avg_line_length": 33.01459854014598, "alnum_prop": 0.5525093964183064, "repo_name": "chill17/pycounter", "id": "cbe7ed16054de7c954f32ac84c31bbbcc8e99e46", "size": "45...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
{ "content_hash": "81d7861376bb2fb6230797d8dfffcb72", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 153, "avg_line_length": 48.766891891891895, "alnum_prop": 0.6560443366816765, "repo_name": "Azure/azure-sdk-for-python", "id": "5cd53fa45f3a6b9115fadd1ae1636f0c61f88dc1", ...
import argparse from utils import Storage class CLIArgumentsTreeParser(object): def __init__(self, config, root_name): self.parser = argparse.ArgumentParser() self.config = config self.root_name = root_name def build(self, parser, node, node_name): subparsers = parser.add_sub...
{ "content_hash": "b21ab35035bf598324446e4e2ec277f7", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 31.7, "alnum_prop": 0.5621451104100946, "repo_name": "voidpp/deprecated-python-tools", "id": "9638c825cec6dcd59e3fe73cf4244c79191c9f46", "size": "158...
''' add numbers which are in the position of prime numbers ''' N =int(raw_input()) marks = map(int, raw_input().split()) total = 0 for num in xrange(1,N+1): if all(num%i!=0 for i in xrange(2,num)): total += marks[num-1] print total
{ "content_hash": "7e444bbd5afed900ac2d45d00502f31d", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 54, "avg_line_length": 17.333333333333332, "alnum_prop": 0.5923076923076923, "repo_name": "ganesh-95/python-programs", "id": "029965387204148642b7d658fce881996f11785f", "si...
def add_native_methods(clazz): def initD3D____(a0): raise NotImplementedError() def getDeviceCapsNative__int__(a0, a1): raise NotImplementedError() def getDeviceIdNative__int__(a0, a1): raise NotImplementedError() def enterFullScreenExclusiveNative__int__long__(a0, a1, a2): ...
{ "content_hash": "d5b9abd0bff2a67956f589a1d0bb9350", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 139, "avg_line_length": 46.595238095238095, "alnum_prop": 0.7250894225855902, "repo_name": "laffra/pava", "id": "e9efddd36d2a07d0053f4e01a613fd9e60da55fb", "size": "1957", ...
import logging import urlparse from django.conf import settings # noqa from django.contrib.auth import logout # noqa from django.utils.translation import ugettext_lazy as _ # noqa from keystoneclient import exceptions as keystone_exceptions from openstack_auth import backend from horizon import exceptions from h...
{ "content_hash": "b1a603a10af8e28c1a80530d866b80f0", "timestamp": "", "source": "github", "line_count": 603, "max_line_length": 79, "avg_line_length": 35.34825870646766, "alnum_prop": 0.6411916490734225, "repo_name": "openstack-ja/horizon", "id": "e0b9f048d211f262b59bdf7084533e49b671171b", "size": ...
import pickle import socket import codecs from ConfigParser import SafeConfigParser from os.path import expanduser from OpenSSL import SSL from txjsonrpc.netstring import jsonrpc from binascii import unhexlify from twisted.application import service, internet from twisted.python.log import ILogObserver from twisted.i...
{ "content_hash": "b456c1a1d0c205e4811d5b3f6262d1a1", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 157, "avg_line_length": 36.04651162790697, "alnum_prop": 0.6557419354838709, "repo_name": "cpacia/Subspace", "id": "2757527851d399c7fd0a72af867743c73b48831a", "size": "775...
"""Find the functions in a module missing type annotations. To use it run ./functions_missing_types.py <module> and it will print out a list of functions in the module that don't have types. """ import argparse import ast import importlib import os NUMPY_ROOT = os.path.dirname(os.path.join( os.path.abspath(__f...
{ "content_hash": "994cb7bf045cdefbee0d7366a6d00f09", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 79, "avg_line_length": 23.856060606060606, "alnum_prop": 0.582089552238806, "repo_name": "madphysicist/numpy", "id": "c2fe156f07163533c6d5583858ec50e4989c4088", "size": "3...