text
stringlengths
4
1.02M
meta
dict
import setuptools # In python < 2.7.4, a lazy loading of package `pbr` will break # setuptools if some other modules registered functions in `atexit`. # solution from: http://bugs.python.org/issue15881#msg170215 try: import multiprocessing # noqa except ImportError: pass setuptools.setup( setup_requires=...
{ "content_hash": "436a183f6cc62863024f5100c044ce9d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 68, "avg_line_length": 26.384615384615383, "alnum_prop": 0.7288629737609329, "repo_name": "sand8080/python-sketches", "id": "afe4430c30270d1ebaf9e2b662ed05a796d2d3e6", "siz...
import collections from oslo_config import cfg import psutil import six from six.moves.urllib import parse import yaml from spectrometer.openstack.common import log as logging from spectrometer.processor import config from spectrometer.processor import default_data_processor from spectrometer.processor import mls fro...
{ "content_hash": "b305be495c16b5437b53b308c465c6d3", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 79, "avg_line_length": 36.04109589041096, "alnum_prop": 0.6375902698593691, "repo_name": "dave-tucker/spectrometer", "id": "501142e634d6da498b63ffad0fc49dd9b941cf81", "siz...
"""Starters declarations. """
{ "content_hash": "cc420409eaa6c74d73e6c15c3b2e5dc0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 25, "avg_line_length": 10.333333333333334, "alnum_prop": 0.6451612903225806, "repo_name": "Ecpy/ecpy", "id": "df1b507a3d32e7ce2bd7c0a548767ec24f6fbdc5", "size": "414", "bi...
import ast import eventlet import random import six from oslo_log import log as logging from heat.common import exception from heat.objects import sync_point as sync_point_object LOG = logging.getLogger(__name__) KEY_SEPERATOR = ':' def _dump_list(items, separator=', '): return separator.join(map(str, items)...
{ "content_hash": "52bd9df970122debb94fcdca9f32396c", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 78, "avg_line_length": 30.015151515151516, "alnum_prop": 0.6110550227158001, "repo_name": "cwolferh/heat-scratch", "id": "56f08d614c21d2be6fd0dc68556e040621713c3c", "size"...
import json import requests class ASearch: def __init__(self, settings): self.settings = settings def character(self, term, page = 1, perpage = 3): """ Search for a character by term. Results are paginated by default. Page specifies which page we're on. Perpage specifi...
{ "content_hash": "d2b918e2226d0496103e5b1e3e81d472", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 96, "avg_line_length": 35.859437751004016, "alnum_prop": 0.42591555605330944, "repo_name": "ccubed/PyMoe", "id": "b31340fd1330f7dc74d6deb57b4a07394ab471c1", "size": "8929"...
class Stack(object): def __init__(self): #@initialize the Data structure self.items = [] def isEmpty(self): #@rtype: boolean return self.items == [] def push(self,item): #@type item:int #@rtype: void self.items.append(item) def pop(self): #@rtype: int ...
{ "content_hash": "24da9a03ce4c4aae7d000944dfbf3c64", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 46, "avg_line_length": 23.133333333333333, "alnum_prop": 0.5581171950048031, "repo_name": "rush2catch/algorithms-leetcode", "id": "79b4bbd6695d02801a79939cbb5b21d764f08b69", ...
from exceptions import Exception __doc__ = """ Various exception classes, nothing much to see here. move along... """ class LoginException(Exception): pass class MissingException(Exception): pass class MissingProperty(MissingException): pass class MissingClientUser(MissingException): pass cla...
{ "content_hash": "edad446fac23666f8d36add567a17a53", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 66, "avg_line_length": 15, "alnum_prop": 0.7540229885057471, "repo_name": "unixunion/python-libsolace", "id": "ad590d8a74b9ecd842677db3cc5e22b4398b48a3", "size": "435", "...
import sys import socket import traceback import urllib import struct #### ## You might find it useful to define variables that store various ## stack or function addresses from the zookd / zookfs processes, ## which you can then use in build_exploit(); the following are just ## examples. stack_buffer = 0x34567890 s...
{ "content_hash": "ceabe220c85d3b58bb9041d90cbcf90c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 70, "avg_line_length": 25.7027027027027, "alnum_prop": 0.6456361724500526, "repo_name": "Kaffa-MY/mit6.858Fall2014", "id": "054b41eac5333e92a0a84b63fc7915137df4ef2b", "size...
import sys import os import shlex import sphinx_rtd_theme # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os....
{ "content_hash": "bbb4c9b37c344037e06ecac2165071d0", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 80, "avg_line_length": 31.534285714285716, "alnum_prop": 0.7063513635951798, "repo_name": "dhhagan/atmospy", "id": "6662abee72068440c81cf548d60ef2f27d9c971c", "size": "114...
"""Support for tracking MQTT enabled devices identified through discovery.""" import logging import voluptuous as vol from homeassistant.components import device_tracker from homeassistant.components.device_tracker import SOURCE_TYPES from homeassistant.components.device_tracker.config_entry import TrackerEntity from...
{ "content_hash": "1005f8759d2fc987d1b4501a6419d7f0", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 87, "avg_line_length": 34.082608695652176, "alnum_prop": 0.6387294297742059, "repo_name": "tboyce021/home-assistant", "id": "4de2ae4fa6d576e0f3403e18a9e557c5d296a819", "si...
''' These are Tornado handlers for serving checkplots and operating on them. ''' #################### ## SYSTEM IMPORTS ## #################### import os import os.path import base64 import logging from io import BytesIO as StrIO import numpy as np import pickle import json from .checkplotserver_handlers import Fron...
{ "content_hash": "89a68bad951a2b39257705ded9a12c34", "timestamp": "", "source": "github", "line_count": 1814, "max_line_length": 80, "avg_line_length": 40.52370452039691, "alnum_prop": 0.36069922459529313, "repo_name": "waqasbhatti/astrobase", "id": "c1f527412a4fffb4b925eed592c221419e30348b", "size...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "BoxCox", sigma = 0.0, exog_count = 100, ar_order = 12);
{ "content_hash": "0c3493ee37669ed59ace99580a66bc9d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 163, "avg_line_length": 37.57142857142857, "alnum_prop": 0.7034220532319392, "repo_name": "antoinecarme/pyaf", "id": "db61d13dbddfe3e3172f9b71a6dd9b7fdef2f07a", "size": "263...
""" Solution to the second puzzle of Day 9 on adventofcode.com """ import os from itertools import permutations def main(): """ Optimize Santa's route! """ basedir = os.path.dirname(os.path.realpath(__file__)) file_path = os.path.join(basedir, 'input') cities = {} with open(file_path, 'r') as...
{ "content_hash": "55fca3e9f8a8fe00ed073ce43ce9b800", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 68, "avg_line_length": 25.6, "alnum_prop": 0.53515625, "repo_name": "JPinSPACE/AdventOfCode", "id": "9a6561a1664c95e5bc53eff0f26ebd6e8a7eeb71", "size": "1280", "binary": ...
"""Combine logs from multiple bitcoin nodes as well as the test_framework log. This streams the combined log output to stdout. Use combine_logs.py > outputfile to write to an outputfile.""" import argparse from collections import defaultdict, namedtuple import glob import heapq import itertools import os import re im...
{ "content_hash": "2b260e00d3b6872f107530456c438fd6", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 196, "avg_line_length": 41.81147540983606, "alnum_prop": 0.6112526955498921, "repo_name": "biblepay/biblepay", "id": "caa8c9c5bcc026b822461813883e3f8d680cf840", "size": "5...
import jellyfish def extract_closest_match(search_key, target_list, score_cutoff=0): """Return str value from target list with highest score using Jaro for String distance. search_key (str): A string used to search for closest match. target_list (list): A list of strings for comparison. score_...
{ "content_hash": "e9c52683815830891e4a49e04c16c4f5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 33, "alnum_prop": 0.6695526695526696, "repo_name": "GoogleCloudPlatform/professional-services-data-validator", "id": "9d5ae2b7d7683f8905a4216468a02525f...
"""Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'lupin' project = "Project Lupin" project_no_spaces = project.replace(' ', '') version = '0.1' description = 'A module for tracking eyeball movements' authors = ['Krishna Bagadia', ...
{ "content_hash": "b73d427f5c1d7762376d120d80b17000", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 31.764705882352942, "alnum_prop": 0.7166666666666667, "repo_name": "krishna95/lupin", "id": "bde45ed4cc8672b84e8ec9c2da329143626387e5", "size": "564"...
import google.api_core.grpc_helpers import google.api_core.operations_v1 from google.cloud.dataproc_v1.proto import clusters_pb2_grpc class ClusterControllerGrpcTransport(object): """gRPC transport class providing stubs for google.cloud.dataproc.v1 ClusterController API. The transport provides access to...
{ "content_hash": "f4307f4960a905a19858d07647ba2001", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 81, "avg_line_length": 35.39080459770115, "alnum_prop": 0.6146476128613186, "repo_name": "jonparrott/gcloud-python", "id": "c9ce91b99ee0decfad26c34c39e99d60b52959c4", "siz...
from time import time from sys import argv script, filename = argv alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for x in range(1, 27): alphabet[x-1] = (alphabet[x-1], x) opened = open(filename) listed = opened.read().split(",") for i in range(0, len(listed)): listed[i] = listed[i][1:-1] sort = ...
{ "content_hash": "30a5bc425878289102db16b9ba161286", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 47, "avg_line_length": 20.352941176470587, "alnum_prop": 0.6329479768786127, "repo_name": "kayson-hansen/Project-Euler", "id": "c977017c768c88ab8d5da5c48d978d01c1b51bda", "...
import sys, time, os sys.path.append('../../') from parsing.filing import filing from parsing.form_parser import form_parser, ParserMissingError from fec_alerts.utils.form_mappers import * from write_csv_to_db import CSV_dumper from fec_import_logging import fec_logger from hstore_helpers import dict_to_hstore fr...
{ "content_hash": "0fad1bd7049a904107da24d289da70b6", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 184, "avg_line_length": 36.34016393442623, "alnum_prop": 0.6205029886094507, "repo_name": "sunlightlabs/read_FEC", "id": "b1f69bbb169ef792e15f60ea36b07971ff2d6b9c", "size"...
"""Module for Assessment object""" from sqlalchemy import and_ from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import remote from sqlalchemy.orm import validates from ggrc import db from ggrc.models import reflection from ggrc.models.audit import Audit from ggrc.models.comment import Commenta...
{ "content_hash": "ba139ed58a2c07d861b046b355e0ead4", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 79, "avg_line_length": 32.5, "alnum_prop": 0.6681721947776994, "repo_name": "selahssea/ggrc-core", "id": "5462a35cef5176b3de0eda86377d00aef4f8aa31", "size": "7198", "bin...
import platform import sys import traceback from PyQt5.QtCore import QObject import PyQt5.QtCore as QtCore from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import * from electrum.i18n import _ from electrum.base_crash_reporter import BaseCrashReporter from .util import MessageBoxMixin class Exception_Window(BaseC...
{ "content_hash": "2a966cd0b939fb0d642a00273ca7e535", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 106, "avg_line_length": 33.532786885245905, "alnum_prop": 0.6418968467367392, "repo_name": "cryptapus/electrum", "id": "1d30b3eea8720b2e0de3facd338e4502e2ba99a8", "size": ...
import numpy from kmpfit import kmpfit def residuals(p, data): # Residuals function needed by kmpfit x, y = data # Data arrays is a tuple given by programmer a, b = p # Parameters which are adjusted by kmpfit return (y-(a+b*x)) d = numpy.array([42, 6.75, 25, 33.8, 9.36, 21.8, 5.58, 8....
{ "content_hash": "bb8b117f1362f168425f1fe865c2fc2b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 69, "avg_line_length": 39.56, "alnum_prop": 0.6147623862487361, "repo_name": "aoeftiger/kmpfit", "id": "240f7e5231a675f9897753bf16e80d2da57abe11", "size": "989", "binary"...
import calendar import re import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('foursquare') CONFIG = { 'logout_url': 'https://foursquare.com/logout', 'login_xpath': '//*[@id="username"]', 'password_xpath': '//*[@id="password"]', 'consent_xpaths'...
{ "content_hash": "71f9d374d0ea7c17fa8aad49c43858b2", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 36.78021978021978, "alnum_prop": 0.5703615177771139, "repo_name": "peterhudec/authomatic", "id": "c1e9295b4ce5299c1ef8a7bdcc59a6d9f0778fae", "size": ...
import re import requests import pickle import time from myanonamouse.models import MAMLoginCache from myanonamouse.settings import MAM_USERNAME, MAM_PASSWORD, MAM_LOGIN_URL, MAM_ROOT_URL class MAMException(Exception): pass class LoginException(MAMException): pass def process_url(url): if url.startsw...
{ "content_hash": "44f2f53f378fe409e7986aa9933683df", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 92, "avg_line_length": 33.31868131868132, "alnum_prop": 0.570910290237467, "repo_name": "MADindustries/WhatManager2", "id": "75d7a557611090f31785eef9e42b814ad1a9f388", "siz...
"""Windowing concepts. A WindowInto transform logically divides up or groups the elements of a PCollection into finite windows according to a windowing function (derived from WindowFn). The output of WindowInto contains the same elements as input, but they have been logically assigned to windows. The next GroupByKey(...
{ "content_hash": "398f54e28c5518765e383f60cc7b2857", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 100, "avg_line_length": 32.560810810810814, "alnum_prop": 0.6971709206612714, "repo_name": "dhalperi/incubator-beam", "id": "94187e0c5d54d14b065431deb675f422f4fb9a3a", "si...
""" Spelling corrector library, used to correct common typos in domains like gmal.com instead of gmail.com. The spelling corrector uses difflib which in turn uses the Ratcliff-Obershelp algorithm [1] to compute the similarity of two strings. This is a very fast an accurate algorithm for domain spelling correction. Th...
{ "content_hash": "e3a91de76b3fbd95f81facc00e1395b4", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 84, "avg_line_length": 25.872340425531913, "alnum_prop": 0.5916940789473685, "repo_name": "xjzhou/flanker", "id": "498862109e3ed629daceca4fec18aef0a18c579d", "size": "2447"...
"""Tests for the `MultiDeviceIterator` and `OwnedMultiDeviceIterator` API.""" from absl.testing import parameterized import numpy as np from tensorflow.python.data.experimental.ops import testing from tensorflow.python.data.kernel_tests import test_base from tensorflow.python.data.ops import dataset_ops from tensorfl...
{ "content_hash": "7fbad2617c48dad5e29dc3fc560aa4c7", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 82, "avg_line_length": 40.108225108225106, "alnum_prop": 0.6859686994063681, "repo_name": "tensorflow/tensorflow", "id": "a544842f4c45beeead44230473c990413b1fc0a2", "size"...
from __future__ import print_function import sys from oslo.config import cfg from neutron.common import config from neutron.plugins.nicira.common import config as nvp_cfg # noqa from neutron.plugins.nicira import NeutronPlugin from neutron.plugins.nicira import nvplib config.setup_logging(cfg.CONF) def help(name...
{ "content_hash": "20d8ec0b3aef5504ea657da9aa6222d1", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 40.85263157894737, "alnum_prop": 0.6104096882246843, "repo_name": "netscaler/neutron", "id": "092dfba326028d65d9371e29e696db81db42a538", "size": "458...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify the obj --stage option. """ import TestSCons_time test = TestSCons_time.TestSCons_time() test.fake_logfile('foo-000-0.log', 0) test.fake_logfile('foo-000-1.log', 0) test.fake_logfile('foo-000-2.log', 0) test.fake_logfile('foo-001-0.log', 1) t...
{ "content_hash": "2596871afd6806ec6500a0011c8ee258", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 24.1875, "alnum_prop": 0.6369509043927648, "repo_name": "datalogics/scons", "id": "5dbd15b98432d7f31e159eac54e98d747f1b3214", "size": "2650", "bina...
import http.client conn = http.client.HTTPSConnection("api-demo.airwallex.com", 443, timeout=10) payload = "{}" headers = { "Content-Type": "application/json", "x-api-key": "", "x-client-id": "" } conn.request("POST", "/api/v1/authentication/login", payload, headers) res = conn.getresponse() data = res.read(...
{ "content_hash": "efae579fc8a1aa87402e6bcc2d668fc7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 19.444444444444443, "alnum_prop": 0.6657142857142857, "repo_name": "SpAiNiOr/mystudy", "id": "6c2bfe68d4cdfb8465cd451de08068bcbf579a38", "size": "350...
import rospy import actionlib from actionlib_msgs.msg import GoalStatusArray, GoalStatus from move_base_msgs.msg import MoveBaseAction from door_pass.door_utils import DoorUtils class DoorPass(object): def __init__(self): max_trans_vel=rospy.get_param("~max_trans_vel", 0.15) max_rot_vel=rospy.ge...
{ "content_hash": "dd83150be5d799a18a1422ed46fa50bd", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 129, "avg_line_length": 46.46825396825397, "alnum_prop": 0.5940222032450897, "repo_name": "strands-project/strands_apps", "id": "977c00b56cd78d8e8ae76210390925da60440ca1", ...
"""Tests for V2 summary ops from summary_ops_v2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from tensorflow.core.util import event_pb2 from tensorflow.python.keras import testing_utils from tensorflow.python.keras.engine.sequential import...
{ "content_hash": "0a1da881bcc5f4ff831785fdd8361cca", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 78, "avg_line_length": 31.646616541353385, "alnum_prop": 0.6851983844143502, "repo_name": "aldian/tensorflow", "id": "7d9a89ec60c31fdd499fb1527bb8bb4f26fea7c9", "size": "4...
import access import util from datetime import datetime import numpy as np import gluon.contrib.simplejson as simplejson @auth.requires_login() def view_submissions(): """This function enables the view of the ranking of items submitted to a venue. It is assumed that the people accessing this can have full ...
{ "content_hash": "d42820b935ba1105aee9a79280e922b3", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 147, "avg_line_length": 45.92745098039216, "alnum_prop": 0.6225504845664518, "repo_name": "lucadealfaro/crowdranker", "id": "9db9371077d5e2cb6de7b4beeed39bf4bf16425f", "si...
from django.contrib.auth.models import User from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.http import HttpResponseRedirect from social.models import Friend @login_required def friendlist(request): frie...
{ "content_hash": "40262f8a91a171ad38aa13e9f86f0f21", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 166, "avg_line_length": 34.42857142857143, "alnum_prop": 0.6754264638082066, "repo_name": "Ezphares/sw809f14", "id": "42b882306da473484980a47a562164275d9e4d6a", "size": "21...
""" Simple example: .. UIExample:: 50 b = ui.Button(text="Push me") Example with interaction: .. UIExample:: 200 from flexx import app, ui, event class Example(ui.BoxPanel): def init(self): with ui.VBox(): self.b1 = ui.Button(text='apple') self.b2...
{ "content_hash": "15eac81648155acaab27ee65d4a4277c", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 85, "avg_line_length": 31.738589211618258, "alnum_prop": 0.5450385671329585, "repo_name": "JohnLunzer/flexx", "id": "b66a89b1d0e9a741067a8c7c3968466f0ab825fd", "size": "76...
import types import collections __all__ = ("wrap", "indent", "Join", "fl", "fd") # ------------------------------------------------------------ def wrap(s, wrapping): "Wrap a string s before and after with the value of wrapping." return "{0}{1}{0}".format(wrapping, s) def bpad(s, padding="\n\n"): "Pad a str...
{ "content_hash": "9c8fce54f98816540fb716826e99d1a6", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 94, "avg_line_length": 28.36842105263158, "alnum_prop": 0.5791147627882322, "repo_name": "spiralx/mypy", "id": "ed5f755663e8ea7e304a657af00ad21116c77f4f", "size": "3782", ...
"""Cloud browser URLs.""" from django.conf.urls import patterns, url from django.views.generic.base import RedirectView from cloud_browser.app_settings import settings from cloud_browser.views import UploadFileView, MkdirView, DeleteView, \ RenameView, MoveFileView # pylint: disable=invalid-name, no-value-for-par...
{ "content_hash": "e81873efeb30f18f9537a807df0758a0", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 39.12903225806452, "alnum_prop": 0.6430338004946414, "repo_name": "lantip/aws-filemanager", "id": "68a983e02b047afb0b7e054502173c2becc8c44e", "size":...
from arsenalExtractor import * class ExtractionFactory: def createExtractor(self, team): if team == "Arsenal": return ArsenalExtractor()
{ "content_hash": "870631ded2246f784a9ec226c2cae830", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 36, "avg_line_length": 22.714285714285715, "alnum_prop": 0.6855345911949685, "repo_name": "DownCastAce/SoccerFixtureService", "id": "fa15be59c957b7e8152f9abf8fea175a4ccdaf1f",...
from django.test import TestCase from django.core.exceptions import ValidationError from django_dynamic_fixture import G from nose.plugins.attrib import attr from oscar.core.compat import get_user_model from oscar.apps.catalogue.reviews import models from oscar.test.factories import create_product User = get_user_mod...
{ "content_hash": "455cfe7468034bba921bbd2737737ccb", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 66, "avg_line_length": 31.5, "alnum_prop": 0.6236138290932811, "repo_name": "Idematica/django-oscar", "id": "61cef0313c0b903ac4752c771fdc9abe2c3f7f0f", "size": "4599", "...
from __future__ import unicode_literals, print_function, absolute_import # # Copyright 2015 MarkLogic Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
{ "content_hash": "4b0fb273c1f2677d1073f0deeeeb27f0", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 112, "avg_line_length": 31.512280701754385, "alnum_prop": 0.6411312771406302, "repo_name": "supriyantomaftuh/python_api", "id": "83fb49bfe0b0f5e7259d8c84d71a6eedc018d45d", ...
""" There is a way to put keys of any type in a type's dictionary. I think this allows various kinds of crashes, but so far I have only found a convoluted attack of _PyType_Lookup(), which uses the mro of the type without holding a strong reference to it. Probably works with super.__getattribute__() too, which uses th...
{ "content_hash": "1df3f1c1fb593d6472d435a900888af6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 30.857142857142858, "alnum_prop": 0.6324074074074074, "repo_name": "MalloyPower/parsing-python", "id": "a8c6e63ee2bc7562c435b4541bb2784fdc2e3c86", "s...
import numpy from numpy.testing import assert_almost_equal import torch from torch.nn.parameter import Parameter from torch.autograd import Variable from allennlp.common import Params from allennlp.modules.similarity_functions import LinearSimilarity from allennlp.common.testing import AllenNlpTestCase class TestLine...
{ "content_hash": "449a3b376592301fbaf7d42f0c90a3d8", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 98, "avg_line_length": 49.522222222222226, "alnum_prop": 0.6161094906888042, "repo_name": "nafitzgerald/allennlp", "id": "2a5a64030133c129f629f847f1dbedfe9cccf219", "size":...
r"""Support for regular expressions (RE). This module provides regular expression matching operations similar to those found in Perl. It supports both 8-bit and Unicode strings; both the pattern and the strings being processed can contain null bytes and characters outside the US ASCII range. Regular express...
{ "content_hash": "a511f29c72b4c42e3dce3f70c8a7b1c0", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 79, "avg_line_length": 42.59375, "alnum_prop": 0.6202894684185953, "repo_name": "nattee/cafe-grader-web", "id": "0d27092b0778eaf6dbc171ae6eae763f1aa1331d", "size": "15507"...
"""This module is deprecated. Please use `airflow.gcp.hooks.datastore`.""" import warnings # pylint: disable=unused-import from airflow.gcp.hooks.datastore import DatastoreHook # noqa warnings.warn( "This module is deprecated. Please use `airflow.gcp.hooks.datastore`.", DeprecationWarning, stacklevel=2 )
{ "content_hash": "b8c4349ca73371d3ff8f8539992124ed", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 75, "avg_line_length": 28.90909090909091, "alnum_prop": 0.7578616352201258, "repo_name": "Fokko/incubator-airflow", "id": "da521195fc678c923a8327dd9382e539b3eecf65", "size"...
from __future__ import unicode_literals from .util import PY_3_OR_HIGHER if PY_3_OR_HIGHER: import urllib.request as urllib_request import urllib.error as urllib_error else: import urllib2 as urllib_request import urllib2 as urllib_error import json from ssl import SSLError import socket import codecs...
{ "content_hash": "f8726a1e97210176da93c593db26110b", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 92, "avg_line_length": 33.26865671641791, "alnum_prop": 0.5833333333333334, "repo_name": "sixohsix/twitter", "id": "142cf1f674de874cfe4edea1c377995f2d005ac4", "size": "893...
import logging import os from catapult_base import cloud_storage from catapult_base.dependency_manager import exceptions BACKUP_PATH_EXTENSION = 'old' class CloudStorageUploader(object): def __init__(self, bucket, remote_path, local_path, cs_backup_path=None): if not bucket or not remote_path or not local_p...
{ "content_hash": "c82e38b6520c7cbe64e3e33c2b03fd7f", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 80, "avg_line_length": 38.22549019607843, "alnum_prop": 0.6334957681456784, "repo_name": "XiaosongWei/chromium-crosswalk", "id": "08e9c8f6b35d5159a1af8a40cf240a8e92de1e84", ...
from flask import Flask, jsonify, request,make_response from flask.ext.httpauth import HTTPBasicAuth import json import MySQLdb from flask.ext.cors import CORS app = Flask(__name__) CORS(app) #create a temporary users table users = {"jtramley":"password"} #MySQL connection information. #host='localhost',user='jtramley...
{ "content_hash": "bbac8c440da2296a6c2b9b82fe58922c", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 196, "avg_line_length": 27.738853503184714, "alnum_prop": 0.6920780711825488, "repo_name": "DevMoore94/FlaskBlog", "id": "46ab19c33f6785790dfdd3e13f67585d3e018dc0", "size"...
import contextlib import os import posixpath import datetime import pathlib import pickle import sys import textwrap import tempfile import threading import time import numpy as np import pytest import pyarrow as pa import pyarrow.compute as pc import pyarrow.csv import pyarrow.feather import pyarrow.fs as fs from py...
{ "content_hash": "4b86e4b8e3b324ca296ffc7674437078", "timestamp": "", "source": "github", "line_count": 4772, "max_line_length": 79, "avg_line_length": 36.440276613579215, "alnum_prop": 0.6299563524696221, "repo_name": "icexelloss/arrow", "id": "5e2135fde42ce3ad51249e01886439f4d94e0fa9", "size": "1...
from django import forms from audiotracks.models import get_track_model class TrackUploadForm(forms.ModelForm): class Meta: model = get_track_model() fields = ('audio_file',) class TrackEditForm(forms.ModelForm): class Meta: model = get_track_model() exclude = ('user', 'cre...
{ "content_hash": "14c395aba7ae443ec626f8a0e38f1ca5", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 29.59259259259259, "alnum_prop": 0.6132665832290363, "repo_name": "amarandon/django-audiotracks", "id": "5ab003dafc33e0c3459b598386fc5cd14e77c5b0", "...
"""Regresssion tests for urllib""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None import sys import tempfile from nt...
{ "content_hash": "e8bfc066902919e7af9614b6212d158b", "timestamp": "", "source": "github", "line_count": 1483, "max_line_length": 108, "avg_line_length": 40.49359406608227, "alnum_prop": 0.5702058216212615, "repo_name": "ms-iot/python", "id": "28fe21be817275616bca2f1e9672a119fb400e1f", "size": "6005...
from django import template from django.urls import reverse from blargg.models import Entry register = template.Library() @register.simple_tag def entry_archive_year_url(): """Renders the ``entry_archive_year`` URL for the latest ``Entry``.""" entry = Entry.objects.filter(published=True).latest() arg_lis...
{ "content_hash": "5cf2c8b1b7f6eee87c74fa6093937422", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 32.53846153846154, "alnum_prop": 0.723404255319149, "repo_name": "bradmontgomery/django-blargg", "id": "e1f471b26c5ad9c6957df5d6479fda14213e3b11", "s...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', #'-Wextra', '-Werror', #'-Wc++98-compat', '-Wno-long-long', '-Wno-v...
{ "content_hash": "a71ed045bab22833252b01336b722d2b", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 80, "avg_line_length": 32.96527777777778, "alnum_prop": 0.6854855698335791, "repo_name": "elalfer/IoT-Cronus", "id": "03931f0959ef87db1fd65590911dc8581a3a8ed9", "size": "6...
import re def _findIndex(_list, _object, startIndex=0): index = startIndex while index < len(_list): line = _list[index].strip() line = line.replace(' ', '') if line == _object: return index index += 1 return -1 def _getSections(lines, tag, sections=None, remo...
{ "content_hash": "d339c26fb98979a439962690cd55dc82", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 77, "avg_line_length": 33.03191489361702, "alnum_prop": 0.52914653784219, "repo_name": "The-OpenROAD-Project/OpenROAD", "id": "74f047ca67dd2e3e2070e151c44f9962c60703eb", "s...
import hashlib import six import time from girder.exceptions import ValidationException from girder.models.file import File from girder.models.folder import Folder from girder.models.setting import Setting from girder.models.upload import Upload from girder.models.user import User from tests import base import girder...
{ "content_hash": "c9a7b55e93a80b0d6d730aeb8d5c4171", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 97, "avg_line_length": 38.94236311239193, "alnum_prop": 0.5818841115962406, "repo_name": "kotfic/girder", "id": "7374b4971034b798314f63bc972e801759400016", "size": "14307"...
""" HTML Dialog. Licensed under MIT Copyright (c) 2013 - 2017 Isaac Muse <isaacmuse@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation th...
{ "content_hash": "bf64b8b0134083a1a16087ef2221a9d8", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 113, "avg_line_length": 36.15625, "alnum_prop": 0.6992221261884183, "repo_name": "facelessuser/Rummage", "id": "95d9bbd77711356d09ac297337900d336233ba6c", "size": "2314", ...
"""The logic for Flake8's integration with setuptools.""" from distutils import log import os from typing import List, Tuple import setuptools from flake8.main import application as app UNSET = object() class Flake8(setuptools.Command): """Run Flake8 via setuptools/distutils for registered modules.""" des...
{ "content_hash": "c8f588997bce11e13cac3f6e83a75f53", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 77, "avg_line_length": 37.643478260869564, "alnum_prop": 0.5952875952875953, "repo_name": "TeamSPoon/logicmoo_workspace", "id": "fde290e6f2c0b33e1ad3ae54e0245c1548cd3878", ...
from django.test import TestCase, Client from django.urls import reverse from accounts.models import Account class CoreTestCase(TestCase): def setUp(self): self.user = Account.objects.create_user('user', is_active=True) self.client = Client() def test_home_page(self): """Přihlášený ...
{ "content_hash": "760ba422bc396534e5114ed09162a21c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 152, "avg_line_length": 38.3469387755102, "alnum_prop": 0.6647152740819585, "repo_name": "bugulin/gymgeek-web", "id": "338c0403ff0fe8eefcf5c69195c46e78c01a3e98", "size": "1...
""" mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
{ "content_hash": "25bac0fd1c1fd0d94e2657bb5f4a1506", "timestamp": "", "source": "github", "line_count": 1652, "max_line_length": 210, "avg_line_length": 45.06113801452784, "alnum_prop": 0.5490657030399914, "repo_name": "sam-geek/mbed", "id": "d52485286e1e301b309a9839fde0748bed26465f", "size": "7444...
from lib.action import PyraxBaseAction __all__ = [ 'DeleteNodeFromLoadBalancerAction' ] class DeleteNodeFromLoadBalancer(PyraxBaseAction): def run(self, loadbalancer_id, ip): clb = self.pyrax.cloud_loadbalancers self.logger.info('Deleting node from loadbalancer...') load_balancer = c...
{ "content_hash": "a50baeb864e020538964dcb2bb51c569", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 87, "avg_line_length": 29.88, "alnum_prop": 0.643908969210174, "repo_name": "jtopjian/st2contrib", "id": "e67efd75090361a60016725969d84601eb201ecb", "size": "747", "binar...
"""Primitive Neural Net (NN) Operations. ## Notes on padding Several neural network operations, such as `tf.nn.conv2d` and `tf.nn.max_pool2d`, take a `padding` parameter, which controls how the input is padded before running the operation. The input is padded by inserting values (typically zeros) before and after the...
{ "content_hash": "99b4a6e5ea504bdc7cf7850605155ba1", "timestamp": "", "source": "github", "line_count": 6025, "max_line_length": 116, "avg_line_length": 40.55668049792531, "alnum_prop": 0.653969241346571, "repo_name": "sarvex/tensorflow", "id": "3b1c3539eb989f6d05366ce54754c9d19f2c1c7b", "size": "2...
""" The core parsing function of RDFa. Some details are put into other modules to make it clearer to update/modify (eg, generation of literals, or managing the current state). @summary: RDFa core parser processing step @requires: U{RDFLib package<http://rdflib.net>} @organization: U{World Wide Web Consortium<http://ww...
{ "content_hash": "6493146f1fb9dfc2c268c1e425bb47ac", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 132, "avg_line_length": 47.03517587939699, "alnum_prop": 0.6112179487179488, "repo_name": "Letractively/rdflib", "id": "d5b411fe199697f03cb985511485a5e15f7ae7f1", "size": ...
from django.conf.urls import url from django.views.generic.base import RedirectView from states.views import state_action_confirm, state_action, state_action_ajax, report, state_history urlpatterns = [ url(r'^action/confirm/(?P<state_pk>\d+)/(?P<action>.*)/noparam/$', state_action_confirm, {'next': 'state_action_...
{ "content_hash": "bf9be7ee9f82fcd788bf056dcbfce686", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 167, "avg_line_length": 77, "alnum_prop": 0.6436688311688312, "repo_name": "vikingco/django-states", "id": "dccf81a21fadab7304d46b85672e4f6e4aa50e31", "size": "1232", "bi...
import logging from collections import deque from satori.core.checking.accumulators import accumulators from satori.core.checking.reporters import reporters from satori.core.models import Test, TestMapping class DispatcherBase(object): def __init__(self, supervisor, test_suite_result): super(DispatcherBas...
{ "content_hash": "3538855798433d331b5622ab6b3352bf", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 116, "avg_line_length": 36.59615384615385, "alnum_prop": 0.63977929584866, "repo_name": "zielmicha/satori", "id": "f018ab9bb23ee92367685a827ec302937773c9f9", "size": "3838...
""" mfnwt module. Contains the ModflowNwt class. Note that the user can access the ModflowNwt class as `flopy.modflow.ModflowNwt`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow-nwt/MODFLOW-NWT-Guide/nwt_newton_solver.htm>`_. """ import s...
{ "content_hash": "0d2af315d9a9cae1196be1c163f3cda4", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 92, "avg_line_length": 36.32098765432099, "alnum_prop": 0.5613771001262504, "repo_name": "aleaf/flopy", "id": "c798a9559923d3ffa0567a75998efaf784a2e282", "size": "20594", ...
""" parse and set up voters from uploaded voter files DEPRECATED Ben Adida ben@adida.net 2010-05-22 """ from django.core.management.base import BaseCommand, CommandError import csv, datetime from helios import utils as helios_utils from helios.models import * ## ## UTF8 craziness for CSV ## def unicode_csv_reade...
{ "content_hash": "94fbb3fe9fbf5e1f5cf6342ebadaa043", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 157, "avg_line_length": 28.744444444444444, "alnum_prop": 0.6165442597603401, "repo_name": "dmgawel/helios-server", "id": "5b82285a68650b1a06ae36c0f3bb3dd0cea236e7", "size"...
from ._operations import Operations from ._admin_keys_operations import AdminKeysOperations from ._query_keys_operations import QueryKeysOperations from ._services_operations import ServicesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_oper...
{ "content_hash": "7ab3df75a531a2b56b329827c9eac9d4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 90, "avg_line_length": 38.333333333333336, "alnum_prop": 0.7714285714285715, "repo_name": "Azure/azure-sdk-for-python", "id": "5f7e85a6a72d9cc52eb894f675986aba4735418d", "s...
"""Utility functions for the Google Drive add-on. """ import os import logging from urllib import quote from website.util import web_url_for from website.addons.googledrive.exceptions import ExpiredAuthError logger = logging.getLogger(__name__) class GoogleDriveNodeLogger(object): """Helper class for adding co...
{ "content_hash": "10564f4d2ce50cbe97377ac2c3d2cf3b", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 93, "avg_line_length": 32.96402877697842, "alnum_prop": 0.6195984286337843, "repo_name": "himanshuo/osf.io", "id": "4ce583df9076174942bdfd8abdb2867efa3b1c4f", "size": "460...
""" (c) 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
{ "content_hash": "95dd76d7d1d8eda603bd58451bdaf11a", "timestamp": "", "source": "github", "line_count": 618, "max_line_length": 212, "avg_line_length": 31.0873786407767, "alnum_prop": 0.6567249635644389, "repo_name": "jeeftor/alfredToday", "id": "c95ec305b50d92a1325e14bd62759e4edf6f2a45", "size": "...
""" # decorator_run.py # # Copyright(C) by AbsentM. 2018 # # Author: AbsentM # Date: 2018/02/10 # # Description: # Use decorator function to execute simple run flow. # # decorator_run.py == simple_sun.py # """ def wrapper(func): """ Define a wrapper function, and use function as params. :par...
{ "content_hash": "f43ccfc654f05266249d7c6f60a98835", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 56, "avg_line_length": 17.666666666666668, "alnum_prop": 0.5978152929493545, "repo_name": "absentm/Demo", "id": "eeb5be6640152f7e3b9365669884b28a63e93be5", "size": "1023", ...
import pandas import os import sys import json import movement.config as CONFIG data_path = CONFIG.data.dir csv_path = CONFIG.data.movement.dir files = os.listdir(data_path) if not os.path.exists(csv_path): os.makedirs(csv_path) count = 0 movement_headers = ["team_id", "player_id", "x_loc", "y_loc", "radius", "...
{ "content_hash": "48b3c36efc3a26bf0615edf9ba386909", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 121, "avg_line_length": 32, "alnum_prop": 0.5793269230769231, "repo_name": "sealneaward/nba-movement-data", "id": "2d717e6348e6f973518177e9aeee9c14a309889f", "size": "1664"...
from __future__ import absolute_import, division, print_function import six import numpy as np import copy from matplotlib.collections import LineCollection from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.ticker import NullLocator def mark_region(ax, low, high, vline_style, span_style): ...
{ "content_hash": "153447e0a94151bb9b0edfa9feb38074", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 77, "avg_line_length": 27.83783783783784, "alnum_prop": 0.591123439667129, "repo_name": "sameera2004/xray-vision", "id": "090deaf1561b9cbb45cea0af6f88db19e5bb6cf7", "size"...
"""Tests for `tf.data.experimental.assert_cardinality()`.""" from absl.testing import parameterized from tensorflow.python.data.experimental.ops import cardinality from tensorflow.python.data.kernel_tests import checkpoint_test_base from tensorflow.python.data.kernel_tests import test_base from tensorflow.python.data....
{ "content_hash": "5ec993335507c653cb5ceb8efe134a57", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 44.645161290322584, "alnum_prop": 0.683766859344894, "repo_name": "paolodedios/tensorflow", "id": "1a226418c476f88ccf41db32e510194ffdfa3a93", "size":...
"""Tests for ceilometer/central/manager.py """ import mock from ceilometer.central import manager from ceilometer.openstack.common.fixture import mockpatch from ceilometer.openstack.common import test from ceilometer.tests import agentbase class TestManager(test.BaseTestCase): @mock.patch('ceilometer.pipeline....
{ "content_hash": "58fb7f587c745dab92c74e91381c7189", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 27.517241379310345, "alnum_prop": 0.7230576441102757, "repo_name": "rackerlabs/instrumented-ceilometer", "id": "573c73aebb5d177b4ad8add8d6b9997a6b41f81...
import re NATION_REGEX = re.compile("@@([^@]{0,40})@@") REGION_REGEX = re.compile("%%([^%]{0,40})%%") def parse_nation(s): """Accepts a string, and outputs the nations referenced if it can find them""" return NATION_REGEX.findall(s) def parse_region(s): """Accepts a string, and outputs the regions r...
{ "content_hash": "b1958bd51c46a076d488e772dab2a46d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 59, "avg_line_length": 24.5625, "alnum_prop": 0.6412213740458015, "repo_name": "Dolphman/pynationstates", "id": "3625325b6d4e462dc7dd2fce13391b1ea3e9b250", "size": "393", ...
"""The volumes extension.""" from oslo_utils import strutils from webob import exc from nova.api.openstack import common from nova.api.openstack.compute.schemas import volumes as volumes_schema from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api import validation from nova impo...
{ "content_hash": "418b136ca06af492c01d132fa5109f79", "timestamp": "", "source": "github", "line_count": 551, "max_line_length": 79, "avg_line_length": 35.16515426497278, "alnum_prop": 0.5983175061932288, "repo_name": "shail2810/nova", "id": "83137acec6af55b27bab4afdeb31db7a46cc6479", "size": "20012...
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('myclient.apps.api.views', (r'^date_joined/?$', 'date_joined'), (r'^last_login/?$', 'last_login'), (r'^email/?$', 'email'), (r'^remote/date_joined/?$', 'remote', {'target_method': 'date_jo...
{ "content_hash": "400b8cdf636e83891edc14f191c00884", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 79, "avg_line_length": 48.4, "alnum_prop": 0.5289256198347108, "repo_name": "pingali/aadhaar-oauth2-server", "id": "8399a72b8e1f582e448b687b2374dd15bcd01c89", "size": "507"...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResour...
{ "content_hash": "d27869aad1a09de95ca77e6d16fcefa3", "timestamp": "", "source": "github", "line_count": 661, "max_line_length": 129, "avg_line_length": 38.94553706505295, "alnum_prop": 0.6416501573243212, "repo_name": "twilio/twilio-python", "id": "07c34b4a0f30a0a72cae6f68a95b049f6a98b31f", "size":...
from django.conf.urls.defaults import * urlpatterns = patterns('shopping', # Example: # (r'^server/', include('server.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib...
{ "content_hash": "bf2612c78cc1af15bd535570efd3ce03", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 31.6, "alnum_prop": 0.6518987341772152, "repo_name": "eob/synckit-research", "id": "b0fd69333983d35ff044a3e936885cd5845660c2", "size": "474", "bina...
"""Handles function calls, by generating compiled function names and calls. Note: this transformer does not rename the top level object being converted; that is the caller's responsibility. Requires function_scopes. """ from __future__ import absolute_import from __future__ import division from __future__ import pri...
{ "content_hash": "1a5c595997b3924a66427073ee0cef01", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 80, "avg_line_length": 33.01069518716577, "alnum_prop": 0.6705005669852584, "repo_name": "DavidNorman/tensorflow", "id": "5a5a2c95ddec1680457c5b5b262b8e70502c15dd", "size"...
""" WSGI config for project project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Django...
{ "content_hash": "95d4490aa2e5b1c63797538f4142f90a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 26, "alnum_prop": 0.7884615384615384, "repo_name": "nicogid/Projet4Moc1", "id": "48e5c4fb36be11eb6b2d2640774c5b96c519be43", "size": "520", "binary"...
from django.contrib.contenttypes.fields import GenericRelation from django.db import models from modelcluster.fields import ParentalKey, ParentalManyToManyField from modelcluster.models import ClusterableModel def _extract_field_data(source, exclude_fields=None): """ Get dictionaries representing the model's ...
{ "content_hash": "07a706a1c8a3d0b8a97bc4f5c3423fc3", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 149, "avg_line_length": 34.5929203539823, "alnum_prop": 0.6045024302890765, "repo_name": "thenewguy/wagtail", "id": "178c260ba8ec6db5f84d73404cb78648f20a335d", "size": "39...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
{ "content_hash": "b1907642195eb9cc067eeab19930f7ed", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 34.074074074074076, "alnum_prop": 0.6603260869565217, "repo_name": "margguo/python-ivi", "id": "18991709fd7ed085cacdb030b46322870121519c", "size": "1...
"""Component to interface with various media players.""" import asyncio import base64 import collections from datetime import timedelta import functools as ft import hashlib import logging from random import SystemRandom from typing import Optional from urllib.parse import urlparse from aiohttp import web from aiohttp...
{ "content_hash": "20d0bd60832b2dd84225569379134859", "timestamp": "", "source": "github", "line_count": 914, "max_line_length": 85, "avg_line_length": 29.200218818380744, "alnum_prop": 0.6193562891078721, "repo_name": "postlund/home-assistant", "id": "8a31dbe6bdb611443580ca611a0ee910d539744f", "siz...
import json import requests import unittest from sure import expect from httpretty import HTTPretty from social.utils import parse_qs, module_member from social.p3 import urlparse from social.actions import do_auth, do_complete from social.tests.models import TestStorage, User, TestUserSocialAuth, \ ...
{ "content_hash": "c9a285b66b2f33c2d662500ef04c14e2", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 76, "avg_line_length": 39.680952380952384, "alnum_prop": 0.5598223928957158, "repo_name": "nvbn/python-social-auth", "id": "19b2bdda372c4f6884abb9d841c17eb6caaab868", "siz...
""" babel.core ~~~~~~~~~~ Core locale representation and locale data access. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import os from babel import localedata from babel._compat import pickle, string_types from babel.plural import PluralRule __all__...
{ "content_hash": "20a676f4d97d8f92953ec505904bbb3c", "timestamp": "", "source": "github", "line_count": 1131, "max_line_length": 86, "avg_line_length": 32.5393457117595, "alnum_prop": 0.569751643932395, "repo_name": "vicky2135/lucious", "id": "bb59b7413f8365c889528d1074c85af06b88820f", "size": "368...
import os.path import re from lxml import etree import six from conveyor.i18n import _ from conveyor import utils XMLNS_V10 = 'http://docs.rackspacecloud.com/servers/api/v1.0' XMLNS_V11 = 'http://docs.openstack.org/compute/api/v1.1' XMLNS_COMMON_V10 = 'http://docs.openstack.org/common/api/v1.0' XMLNS_ATOM = 'http:/...
{ "content_hash": "e8723b4dbc2fba0612091f0b78f54800", "timestamp": "", "source": "github", "line_count": 953, "max_line_length": 79, "avg_line_length": 31.28436516264428, "alnum_prop": 0.5822767827195278, "repo_name": "Hybrid-Cloud/conveyor", "id": "86df072e0e889158ed41230c968a79fbc29bfd32", "size":...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "spades.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "235229d399c3ecc399366558a4ebee5f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 70, "avg_line_length": 25.22222222222222, "alnum_prop": 0.7092511013215859, "repo_name": "foxbenjaminfox/deckofcards", "id": "b8a2fbaccb92042f437bc5ac4c0304e2ef87ab6b", "siz...
import ctypes import itertools import json import pickle import random from binascii import a2b_hex from io import BytesIO from unittest import mock, skipIf from django.contrib.gis import gdal from django.contrib.gis.geos import ( GeometryCollection, GEOSException, GEOSGeometry, LinearRing, LineString, MultiLi...
{ "content_hash": "6ec871573ec70e87faa910bb3da28ba2", "timestamp": "", "source": "github", "line_count": 1449, "max_line_length": 115, "avg_line_length": 40.50310559006211, "alnum_prop": 0.5701920291707134, "repo_name": "koordinates/django", "id": "d1496a3b3eae1ac2ec198afad1fabc22f1a16b86", "size": ...
from django.test import TestCase from survey.forms.question import * from survey.models import Batch from survey.models.question import Question from survey.models.householdgroups import HouseholdMemberGroup class QuestionFormTest(TestCase): def setUp(self): self.batch = Batch.objects.create(name='Batch A...
{ "content_hash": "b23323446df361ccad2a9be0e05e5a2e", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 133, "avg_line_length": 52.87924528301887, "alnum_prop": 0.6594590737172625, "repo_name": "unicefuganda/mics", "id": "bdd5685f827f79d0c672e0b7013890db6f994b00", "size": "1...
"""Module providing public analytics interfaces.""" __author__ = 'Mike Gainer (mgainer@google.com)' import re import jinja2 from common import crypto from controllers import utils as controllers_utils from models.analytics import display from models.analytics import utils as analytics_utils from models import data_s...
{ "content_hash": "fca400d0764c827a6234931730d74616", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 80, "avg_line_length": 37.916, "alnum_prop": 0.6431058128494567, "repo_name": "andela-angene/coursebuilder-core", "id": "d51649f34607e6dcf5a226da987c26babd76720a", "size":...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/poi/shared_naboo_gungtrad_medium2.iff" result.attribute_template_id = -1 result.stfName("poi_n","base_poi_building") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "99347f4ff5bc16593413a65edc3e1be1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 23.692307692307693, "alnum_prop": 0.6948051948051948, "repo_name": "anhstudios/swganh", "id": "78e7ee98a852febddde9276ef65087c9869edfd5", "size": "45...
"""Data module for the Sanskrit languages alphabet and related characters.""" # The digits in sanskrit start from index 0 to 9. The index # of the list tells about the corresponding number digit in Sanskrit DIGITS = ['०','१','२','३','४','५','६','७','८','९'] # This is a list of Simple Vowels for Sanskrit Language. #...
{ "content_hash": "871ab4057e6a545fdcab9c045a0b45fb", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 110, "avg_line_length": 37.93055555555556, "alnum_prop": 0.706334675942878, "repo_name": "LBenzahia/cltk", "id": "2803ab0ce5527c62ef20fd6e0e952cde1b84ac20", "size": "2889",...
"""Plots relating to the wind.""" from makani.analysis.plot.python import mplot from makani.lib.python.h5_utils import numpy_utils from matplotlib.pyplot import plot from matplotlib.pyplot import ylabel import pandas as pd MFig = mplot.PlotGroup.MFig # pylint: disable=invalid-name class Plots(mplot.PlotGroup): "...
{ "content_hash": "96063500612260e84d1fc2d8f79c9d89", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 40, "alnum_prop": 0.6395348837209303, "repo_name": "google/makani", "id": "098b15d7e683a81504a338ec28212238b2589b77", "size": "2309", "binary": fal...
from conans.model import Generator import json class YouCompleteMeGenerator(Generator): template = ''' # This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public d...
{ "content_hash": "aafeb67cb849feee04e9d3d1b1ae77c2", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 83, "avg_line_length": 33.61734693877551, "alnum_prop": 0.6926696008499014, "repo_name": "luckielordie/conan", "id": "9871fd9656e3532ecb0a85fc87e17bd1742c19bb", "size": "6...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ApiException from...
{ "content_hash": "925ec4a65a0c0398e9044ff8aef52158", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 94, "avg_line_length": 21.175, "alnum_prop": 0.7012987012987013, "repo_name": "kinow-io/kinow-python-sdk", "id": "a3863581591eeef67ecf392a628ff856566960e6", "size": "864", ...
import math from fontTools.misc import transform from fontParts.base.base import ( BaseObject, TransformationMixin, InterpolationMixin, SelectionMixin, PointPositionMixin, IdentifierMixin, dynamicProperty, reference ) from fontParts.base import normalizers from fontParts.base.compatibili...
{ "content_hash": "f659cb8055825b646b03438682365b9f", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 88, "avg_line_length": 26.80708661417323, "alnum_prop": 0.5424438243501248, "repo_name": "robofab-developers/fontParts", "id": "3014a48329f990fd4242fb34a30aaca848db768f", ...
from __future__ import unicode_literals from django.db import models, migrations import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = ...
{ "content_hash": "5398a9cfbbf6176f13d1a310a40e7dd1", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 159, "avg_line_length": 49.28846153846154, "alnum_prop": 0.573546625048771, "repo_name": "mvpoland/django-press-links", "id": "fac3ae48b60cf89e00f3bdafbf4bb4732b8a98f8", "s...
import argparse, sys import numpy as np from matplotlib import pyplot as plt import scipy.sparse.linalg as LA # Parse command line parser = argparse.ArgumentParser(description='Display the result of the covariance example.') parser.add_argument('input', help="path to covariance result (mean image or covariance image)"...
{ "content_hash": "b626d46abdd1e7a864b17d246d5d8dcb", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 100, "avg_line_length": 29.603448275862068, "alnum_prop": 0.5934769947582994, "repo_name": "hrushikesh-dhumal/hipi", "id": "a8e23ab14ed5804d0be38e2b5818005979d054c6", "size...
"""Stores the dictionary in a linked list.""" from bogglesolver.twl06 import WORD_LIST from bogglesolver.twl06 import TEST_WORD_LIST class _dictnode: """ An element of the dictionary. Each element represents one letter in a word. Each element contains an array of potential next elements. This ...
{ "content_hash": "804f497dd323e7d788e819266169772d", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 83, "avg_line_length": 30.418032786885245, "alnum_prop": 0.5914847749932632, "repo_name": "theovoss/BoggleSolver", "id": "78e54f079c58d43bb71256ff8cd37106facee2df", "size"...
"""Base Sensor for the Xbox Integration.""" from __future__ import annotations from yarl import URL from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from . import PresenceData, ...
{ "content_hash": "e2eb8ff8c3064605dde0c69ad41b5d4a", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 102, "avg_line_length": 35.70886075949367, "alnum_prop": 0.640907479617157, "repo_name": "mezz64/home-assistant", "id": "5d0f3f92434e9e743ac33da2018655ef47aa01db", "size": ...