text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import sys
import string
import utils
from SCons.Script import *
from utils import _make_path_relative
from mkdist import do_copy_file
BuildOptions = {}
Projects = []
Rtt_Root = ''
Env = None
# SCons PreProcessor patch
def start_handling_includes(self, t=None):
"""
Causes the PreProcessor object to... | {
"content_hash": "977d8a7b8632661ba61f061245a8b0de",
"timestamp": "",
"source": "github",
"line_count": 982,
"max_line_length": 139,
"avg_line_length": 33.95926680244399,
"alnum_prop": 0.5618627803766343,
"repo_name": "gbcwbz/rt-thread",
"id": "8d461102bc1d6b6f515feef54af757d9b148f1dd",
"size": "34... |
from __future__ import division, print_function
import math
import warnings
from operator import itemgetter
import itertools
import numpy as np
from numpy import ma
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.artist as martist
from matplotlib.artist import allow_rasterization
import matplotlib... | {
"content_hash": "065c746ca0c5339e54ffeb683e5d7c3f",
"timestamp": "",
"source": "github",
"line_count": 9408,
"max_line_length": 89,
"avg_line_length": 35.55846088435374,
"alnum_prop": 0.5344210155021613,
"repo_name": "RobertABT/heightmap",
"id": "a3a92ee54d1f0502a49f8d1d0f69d2cbfa03e217",
"size": ... |
"""Tests for gree component."""
from datetime import timedelta
from unittest.mock import DEFAULT as DEFAULT_MOCK, AsyncMock, patch
from greeclimate.device import HorizontalSwing, VerticalSwing
from greeclimate.exceptions import DeviceNotBoundError, DeviceTimeoutError
import pytest
from homeassistant.components.climat... | {
"content_hash": "e223e5c6851dcca39b469d15a28eb7c0",
"timestamp": "",
"source": "github",
"line_count": 771,
"max_line_length": 106,
"avg_line_length": 32.09597924773022,
"alnum_prop": 0.6841509738947709,
"repo_name": "toddeye/home-assistant",
"id": "ac818c7fd32713116474f21aeb580c5b4b0a760e",
"size... |
"""SCons.Tool.GettextCommon module
Used by several tools of `gettext` toolset.
"""
# __COPYRIGHT__
#
# 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
# withou... | {
"content_hash": "ee6bc5f00e8dfc0fdde5611d2d9c7a77",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 96,
"avg_line_length": 42.00232558139535,
"alnum_prop": 0.588837827362826,
"repo_name": "Distrotech/scons",
"id": "cd2f306cf0d518158151d9dee2d4ba580c72dce0",
"size": "1806... |
"""
WSGI config for icecream_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... | {
"content_hash": "2b3671d99194ecc99eeacac3b6acd00d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 87,
"avg_line_length": 42.7027027027027,
"alnum_prop": 0.7917721518987342,
"repo_name": "resalisbury/twoscoops",
"id": "8b6b34a66caaa1f96a30306a13c12910b4f18ea0",
"size": "... |
import datetime
from vcms.www.managers import ContentManager
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.contrib.auth.models import User
from vcms.www.models.page import BasicPage
from site_language.models import Language
# -- CONTENT
# ----------
class Content(m... | {
"content_hash": "2cd39fa1aeb494696233ff1205488188",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 103,
"avg_line_length": 35.12068965517241,
"alnum_prop": 0.6666666666666666,
"repo_name": "francisl/vcms",
"id": "e931b5b5a8bb98fb4e0122fb097d7b8d8d2684a8",
"size": "2156",... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Invoice.date_of_issue'
db.alter_column('books_invoice', 'date_of_issue', self.gf('django.db.models.fields.DateTim... | {
"content_hash": "e3e3d2d10868e754274913600d1ce523",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 182,
"avg_line_length": 74.49397590361446,
"alnum_prop": 0.5384117742196345,
"repo_name": "carquois/blobon",
"id": "a4096c28d50c8fd79e87710e076fb77390c3ef71",
"size": "123... |
"""Queues api module"""
from src.core import storage
from .helpers import *
class Api:
"""Api root class"""
def __init__(self):
self.queues = Queues()
def config(self):
queues_routes = cherrypy.dispatch.RoutesDispatcher()
queues_routes.explicit = False
queues_routes.conn... | {
"content_hash": "89e52d3c5d84f6095814355144198455",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 112,
"avg_line_length": 31.048192771084338,
"alnum_prop": 0.5801319363601086,
"repo_name": "meeron/norimq",
"id": "ac236536c5fd3ce05146e7a1d1f826c117f9b75b",
"size": "2577"... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "14e14b538253e4c868798d5065bbf06a",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 356,
"avg_line_length": 37.08791208791209,
"alnum_prop": 0.7235555555555555,
"repo_name": "esno/polartray",
"id": "c39f327ae5d40c45eb49b6ca498ea2ba307c725b",
"size": "3475"... |
r"""Replace variables in InfoPlist.strings with file.
% python tweak_info_plist_strings.py --output=out.txt --input=in.txt \
--branding=Mozc
"""
import codecs
import datetime
import logging
import optparse
import sys
from build_tools import tweak_data
_COPYRIGHT_YEAR = datetime.date.today().year
def Parse... | {
"content_hash": "347ce04689c7f86177dda2d6745dbfb4",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 74,
"avg_line_length": 26.134328358208954,
"alnum_prop": 0.6436322101656197,
"repo_name": "fcitx/mozc",
"id": "f659a99db01a62916ba4f20a35e6508c1a59e05f",
"size": "3320",
... |
import httplib2
import gspread
import os
import praw
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
# https://github.com/burnash/gspread
SCOPES = 'https://www.googleapis.com/auth/drive.metadata.readonly https://spreadsheets.google.com/feeds https://d... | {
"content_hash": "117ab1b7916839f18d818844ebe580b6",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 134,
"avg_line_length": 33.5,
"alnum_prop": 0.6712686567164179,
"repo_name": "jeffles/LI",
"id": "999c5e3ad7cae79c5da5ad99837043a749a854fe",
"size": "2680",
"binary": fal... |
import random
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, Group, User
from django.db import connection
import mock
from nose.tools import eq_
from test_utils import RequestFactory
from test_app import views
import waffle
from waffle.middleware import WaffleMiddleware
from w... | {
"content_hash": "5e9c6cccc2b9f7b12147c29e3fea1650",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 79,
"avg_line_length": 37.973837209302324,
"alnum_prop": 0.636454107019827,
"repo_name": "ekohl/django-waffle",
"id": "a3bbeee016339bb47f48282070a5fa80c9c11bc7",
"size": "... |
"""Commands that can be used to operate on explorations.
All functions here should be agnostic of how ExplorationModel objects are
stored in the database. In particular, the various query methods should
delegate to the Exploration model class. This will enable the exploration
storage model to be changed without affect... | {
"content_hash": "3445e86c5c95f7904bd91b528cae96f2",
"timestamp": "",
"source": "github",
"line_count": 2032,
"max_line_length": 116,
"avg_line_length": 42.10088582677165,
"alnum_prop": 0.6534500695507838,
"repo_name": "brianrodri/oppia",
"id": "7319ae1cb445e0e252fecf1e8419cf88abf158bc",
"size": "8... |
import theano
import unittest
import numpy as np
from theano import tensor
from numpy import random as rnd
from theano.gradient import verify_grad
from utils.complex_expm import complex_expm
from utils.complex_matrix_inverse import complex_matrix_inverse
from utils.theano_complex_extension import complex_reshape, com... | {
"content_hash": "10504772077c0b40fb15192f6370d107",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 107,
"avg_line_length": 37.07258064516129,
"alnum_prop": 0.5747226452033936,
"repo_name": "Nehoroshiy/urnn",
"id": "76763cd954c5ed2c773b5c8abe35b61631443883",
"size": "459... |
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc as orm_exc
from sqlalchemy.sql import expression as expr
from quantum.common import exceptions as q_exc
from quantum import context
from quantum.db import api as db
from quantum.db import model_base
from quantum.db import models_v2
from ... | {
"content_hash": "c3007ff5fd8469bbc7e70479d7b7155f",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 79,
"avg_line_length": 43.996763754045304,
"alnum_prop": 0.5765354909893343,
"repo_name": "rossella/neutron",
"id": "04318a3650fa8d61c274639972c5f4fa55a2657e",
"size": "14... |
import os
import fast_brute
# read constant
NUM_READS = 1 # change to 30
READ_LEN = 100
# seed constants
SEED_LEN_MIN = 5
SEED_LEN_MAX = 20
MIN_ERRORS = 2
MAX_ERRORS = 5
# input file constants
DATA_DIR = "./Freq-data/"
# output file constants
OUTPUT_FILE = "optimal_seeds.out"
"""
"" begin the main program
"""
# ... | {
"content_hash": "19b2485341ac0ec7ec54fbf636368141",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 120,
"avg_line_length": 26.73469387755102,
"alnum_prop": 0.5877862595419847,
"repo_name": "xhongyi/toybrick",
"id": "bebe0c144960ee9e8f690c7185b287e4507fc996",
"size": "132... |
"""All exceptions used in the Cookiecutter code base are defined here."""
class CookiecutterException(Exception):
"""
Base exception class.
All Cookiecutter-specific exceptions should subclass this class.
"""
class NonTemplatedInputDirException(CookiecutterException):
"""
Exception for when... | {
"content_hash": "3e3b04a483dd731d4dc5d1201d796bf4",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 76,
"avg_line_length": 23.938650306748468,
"alnum_prop": 0.6960533059969246,
"repo_name": "audreyr/cookiecutter",
"id": "9461aa9851cda30fbd2e1fe6aa0b67ca5ca02ee8",
"size":... |
import scrapy
from scrapy import signals, Spider
from urllib.parse import urlencode
import time
from random import randint
import datetime
import logging
from copy import copy
from dateutil.relativedelta import relativedelta
import collections
import json
from bs4 import BeautifulSoup
from random import randint
from zo... | {
"content_hash": "6011368b2444cf1ba645762e6901eb1a",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 96,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.6332214765100671,
"repo_name": "ChuangYuMing/futures_spread_analysis",
"id": "2b0f4a69b8c46c39d8ce80e80cfd8f44f4178... |
"""
Implementation of a feature which maps integers to binary-valued vectors, with
the resulting vector having all entries zero except at the index indicated by
the supplied integer.
Can be used to represent the tabular case in terms of arrays, for example.
"""
import numpy as np
from flib.abstract import UnaryFeatur... | {
"content_hash": "558daa9e8d42ed638ff0c314930dad27",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 31,
"alnum_prop": 0.7011884550084889,
"repo_name": "rldotai/flib",
"id": "3f08c3db47668724674f853ffde2ea263a7f8fab",
"size": "589",
"binary": false... |
import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="scatter3d.marker", **kwargs):
super(CmidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "a9cd4970a3f3ea73a34c884343f7f1b1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 85,
"avg_line_length": 38.46153846153846,
"alnum_prop": 0.6,
"repo_name": "plotly/python-api",
"id": "740983d49d2c621a72a78c7d9d89e45da217fd29",
"size": "500",
"binary": ... |
'''
Comparison of Continuous No-Regret Algorithms for the 2nd NIPS paper
@author: Maximilian Balandat
@date: May 11, 2015
'''
# Set up infrastructure and basic problem parameters
import multiprocessing as mp
import numpy as np
import datetime, os
from ContNoRegret.Domains import nBox, UnionOfDisjointnBoxes, Differenc... | {
"content_hash": "24f02cabe5ccdd5b0428d7336a2b4620",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 132,
"avg_line_length": 46.58,
"alnum_prop": 0.7241305281236582,
"repo_name": "Balandat/cont_no_regret",
"id": "f41fc3d73cbef552f6ceb02abbc2a14a6cd7d2d9",
"size": "4658",
... |
from __future__ import absolute_import, print_function, unicode_literals
from django.conf.urls import patterns, url, include
from .core import Upload
urlpatterns = patterns(
'',
url(r'^qq/', include('api.qq.urls', namespace='qq')),
url(r'^members/', include('api.member.urls', namespace='member')),
ur... | {
"content_hash": "0e9071640e3b39dd07840d26786bdb24",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 35.785714285714285,
"alnum_prop": 0.656686626746507,
"repo_name": "mozillazg/chendian-plus",
"id": "2c307626d7923d3f931eaa12834ae28867089639",
"size"... |
import unittest
from absl.testing import absltest
from absl.testing import parameterized
import tensorflow as tf
from tensorflow_federated.python.core.impl.compiler import building_block_factory
from tensorflow_federated.python.core.impl.executors import eager_tf_executor
from tensorflow_federated.python.core.impl.ex... | {
"content_hash": "c1721f42674174618d3a9c7e0a9ab9d5",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 94,
"avg_line_length": 38.70783132530121,
"alnum_prop": 0.6985448603221539,
"repo_name": "tensorflow/federated",
"id": "dfe991bc16bd9e84adf6f2f6109b9cd560eac329",
"size": ... |
"""
Publish a digital object as a public resource for anyone
NOTE: this package will be loaded only if IRODS_ANONYMOUS is set
"""
from b2stage.apis.commons.endpoint import EudatEndpoint
from restapi import decorators as decorate
from restapi.protocols.bearer import authentication
from b2stage.apis.commons import path... | {
"content_hash": "7f7832d052932e74d8162d09f8aec6f0",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 88,
"avg_line_length": 32.85964912280702,
"alnum_prop": 0.5525894287239722,
"repo_name": "EUDAT-B2STAGE/http-api",
"id": "3f3091ccc248f814e7ca26eb2c369d6f2bcf32c3",
"size"... |
"""
This module defines constants that don't fit into tool or inteferface
categories
"""
from pfp.native import predefine
predefine(
"""
const int true = 1;
const int True = 1;
const int TRUE = 1;
const int false = 0;
const int False = 0;
const int FALSE = 0;
"""
)
| {
"content_hash": "4b8fb2bed26cc6f5f69cd8b8df4693b4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 14.95,
"alnum_prop": 0.6220735785953178,
"repo_name": "d0c-s4vage/pfp",
"id": "2e3cbbeb12bda0462f0e196d08ee80d72e508d77",
"size": "347",
"binary": ... |
"""Set module version.
<Major>.<Minor>.<maintenance>[alpha/beta/..]
Alphas will be numbered like this -> 0.4.0a0
"""
VERSION = '0.1'
| {
"content_hash": "02706167d1d47719a1fa744ece13a6ad",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 44,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.6567164179104478,
"repo_name": "Parsl/parsl",
"id": "e78007161adfa817699b7d47fe311b7a4c169739",
"size": "134",
"... |
from dp_tornado.engine.controller import Controller
class DynamodbController(Controller):
def get(self):
for _ in range(3):
try:
table_name = 'dp_test_%s' % self.ini.server.identifier
index_columns = [
('key1', self.helper.web.aws.dynamodb.t... | {
"content_hash": "7f31b1dff659a2f20ce5d1aac005b34a",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 134,
"avg_line_length": 40.011049723756905,
"alnum_prop": 0.4370339685169843,
"repo_name": "why2pac/dp-tornado",
"id": "dd5afe3500be6298851023e889f0e94224105f98",
"size": ... |
from __future__ import unicode_literals
from django.db import models
from patient.models import Patient
from clinic.models import Clinic
class XRay(models.Model):
clinic = models.ForeignKey(Clinic)
patient = models.ForeignKey(Patient)
time = models.DateTimeField(auto_now=True)
FULL = 'f'
ANTERIO... | {
"content_hash": "2833225e28960473109f22bd6298c571",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 27.657894736842106,
"alnum_prop": 0.6013320647002854,
"repo_name": "slogan621/tscharts",
"id": "5ab88f1decf7ca4e6e540981a35af0c57a06e00e",
"size": "1... |
import os
import sys
import django
def main():
"""
Standalone django model test with a 'memory-only-django-installation'.
You can play with a django model without a complete django app installation.
http://www.djangosnippets.org/snippets/1044/
"""
sys.path.append(os.path.abspath(os.path.dirnam... | {
"content_hash": "9fcfba931b2ac5625a7fcd78224f714c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 80,
"avg_line_length": 31.933333333333334,
"alnum_prop": 0.662491301322199,
"repo_name": "hirokiky/django-websettings",
"id": "6c3422c87161bc0105d89ef72fc3d60c2ddd6bbd",
"s... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if... | {
"content_hash": "bd3ff1beb6d655dba390f4b6f2b5673e",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 127,
"avg_line_length": 34.09615384615385,
"alnum_prop": 0.6843391614965219,
"repo_name": "anler/django-blackhole",
"id": "3ce82bc208f8a1ece5e2f143cf9d375e43631316",
"size... |
"""Support for Envisalink zone bypass switches."""
from __future__ import annotations
import logging
from homeassistant.components.switch import SwitchEntity
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_p... | {
"content_hash": "49226e3eb61586f7e99c66854890fb54",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 80,
"avg_line_length": 32.57471264367816,
"alnum_prop": 0.6587861679604798,
"repo_name": "rohitranjan1991/home-assistant",
"id": "6f5179a8649a3af78bf8977c340f577ebc3f97c4",
... |
import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
README_FILE = os.path.join(ROOT_DIR, "README.rst")
with open(README_FILE) as f:
long_description = f.read()
setup(
name="xutils",
version="2... | {
"content_hash": "a28ec3a1cc5f1f279b3626205c6fcac7",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 80,
"avg_line_length": 30.81578947368421,
"alnum_prop": 0.6285226302305722,
"repo_name": "xgfone/pycom",
"id": "5562b5f4c6ffee86fc2a16e3dbaf270f0de98e6a",
"size": "1171",
... |
import pytest
from nltk import config_megam
from nltk.classify.rte_classify import RTEFeatureExtractor, rte_classifier, rte_features
from nltk.corpus import rte as rte_corpus
expected_from_rte_feature_extration = """
alwayson => True
ne_hyp_extra => 0
ne_overlap => 1
neg_hyp => 0
neg_txt ... | {
"content_hash": "3d9281915d7ca18fdd8430d696d74a3a",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 88,
"avg_line_length": 28.414893617021278,
"alnum_prop": 0.5859228753275927,
"repo_name": "nltk/nltk",
"id": "0a573ea7e291c46e22ceb9ae39fc4aff880c6398",
"size": "2671",
"... |
import os
import sys
import re
import datetime
import string
from scriptCommon import catchPath
versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*\).*' )
includesParser = re.compile( r'\s*#include\s*"(.*)"' )
guardParser = re.compile( r'\s*#.*TWOBLUECUBES_CA... | {
"content_hash": "77ee00a4f1ec61657c012891e9ba4986",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 163,
"avg_line_length": 35.51048951048951,
"alnum_prop": 0.5571090980701063,
"repo_name": "rao1219/Vedio",
"id": "8930c45e3c2dede44b78902bdeb58ffd57e67a4d",
"size": "5806"... |
"""Miscellaneous utility functions."""
from __future__ import division
import os
import sys
import re
import shutil
import fnmatch
from collections import defaultdict
import traceback
import subprocess
MAX_FILENAME_LENGTH = 200
WINDOWS_MAGIC_PREFIX = u'\\\\?\\'
class HumanReadableException(Exception):
"""An Exce... | {
"content_hash": "76990c0c03fa6ba0c6890e023060eae0",
"timestamp": "",
"source": "github",
"line_count": 611,
"max_line_length": 78,
"avg_line_length": 34.12602291325695,
"alnum_prop": 0.6177641360126612,
"repo_name": "jayme-github/beets",
"id": "0efd5ae448a37ca2ae849c1102e96bffebd5b0b3",
"size": "2... |
"""
Loads Section Status change events from SQS
"""
import logging
import traceback
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from myuw.event.section_status import SectionStatusProcessor
from myuw.logger.timer import Timer
from myuw.util.settings import get_cronjob_reci... | {
"content_hash": "9e45fa6407713d0b45dca6b024b70b16",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 34.51724137931034,
"alnum_prop": 0.6593406593406593,
"repo_name": "uw-it-aca/myuw",
"id": "8c4287bc53d48bb7271f0043b3c1999d8bbfdd7d",
"size": "1089",... |
import pytest
from pandas.errors import AbstractMethodError
import pandas as pd
@pytest.mark.parametrize(
"exc",
[
"UnsupportedFunctionCall",
"UnsortedIndexError",
"OutOfBoundsDatetime",
"ParserError",
"PerformanceWarning",
"DtypeWarning",
"EmptyDataEr... | {
"content_hash": "8c3458579984b0b29f9ef366aa0c1bcc",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 70,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.6592814371257485,
"repo_name": "gfyoung/pandas",
"id": "6207b886b95c71569d56d28028d856bc9d63ac91",
"size": "1670"... |
import numpy as np
import matplotlib.pyplot as plt
import illustris_python as ilpy
import translate_coordinates as tc #renato's code for camera projections
import tng_api_utils as tau
# Used only sparingly (maybe remove dependencies?)
import os
import astropy.io.ascii as ascii
import astropy
import astropy.io.fits as ... | {
"content_hash": "7ae1e5facefc92ef637d744054583fd2",
"timestamp": "",
"source": "github",
"line_count": 622,
"max_line_length": 241,
"avg_line_length": 44.90192926045016,
"alnum_prop": 0.5910344086791507,
"repo_name": "gsnyder206/mock-surveys",
"id": "4858ade892b6741465d32aa0200492ae16d035d9",
"siz... |
from msrest.serialization import Model
class EdifactFramingSettings(Model):
"""The Edifact agreement framing settings.
:param service_code_list_directory_version: The service code list
directory version.
:type service_code_list_directory_version: str
:param character_encoding: The character enco... | {
"content_hash": "4031c549904b80dfaaa1f06f64435a00",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 281,
"avg_line_length": 54.57142857142857,
"alnum_prop": 0.6899095668729177,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "59bfcf4c3c911c3631cac5d56b222b62f3ba0b66",
"si... |
from __future__ import unicode_literals
if __name__ == "__main__":
import time
import gc
import timeit
import functools
from v8cffi.platform import platform
OPS_NUMBER = 110000
def do_all():
with platform as pm:
with pm.create_vm() as vm:
with vm.cre... | {
"content_hash": "edf724f3c93e44f667d183cde62ddeab",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 108,
"avg_line_length": 25.586206896551722,
"alnum_prop": 0.5094339622641509,
"repo_name": "nitely/v8-cffi",
"id": "38766db8a9a8f2c655fb09e7de0b482523cc5bbd",
"size": "767"... |
from GameLogic import BarrackFactory
from GameLogic import UnitFactory
from GameLogic.Player import Player
class GameLogic:
def __init__(self, players, _turn=0):
self.Players = players
self._turn = _turn
from GameLogic.Map import Map
self._map = Map(self)
@property
def Map... | {
"content_hash": "029738be880554b1352d5dd9cb4fa73c",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 87,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.6159029649595688,
"repo_name": "HRODEV/Frequency",
"id": "ddd952e1265dd3dfc189c1fa9faace803585f623",
"size": "2226... |
import copy, sys
import numpy
if sys.version_info[0] > 2:
xrange = range
def preserve_doc(f):
f.__doc__ = eval('numpy.ndarray.%s.__doc__' % f.__name__)
return f
class TaggedArray(numpy.ndarray):
'''
TaggedArray extends numpy.ndarray with an attribute 'axistags'. Any
axistags object must support the s... | {
"content_hash": "06c24d94c493e37b7c32f8a41e5361bf",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 109,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.5666525960320811,
"repo_name": "funkey/vigra",
"id": "b5aa9546f96f2d3ab959c559b9184b4aa727c84b",
"size": "13458... |
import tensorflow as tf
from data_generator import DataGenerator
from models import Model
import os,sys
import time
from mlperf_logging import mllog
from threading import Thread
###### npu ######
from npu_bridge.estimator import npu_ops
from tensorflow.core.protobuf.rewriter_config_pb2 import RewriterConfig
from npu_b... | {
"content_hash": "fea2938b7081447ec5b4349e435ebca6",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 172,
"avg_line_length": 44.661490683229815,
"alnum_prop": 0.5932132675057368,
"repo_name": "mlperf/training_results_v0.7",
"id": "90b3961b771415d2eedf25e81153a307ef10c851",
... |
"""Convert a rectangular file to a JSON file ready for mongoimport
Usage:
./rectangular_file_to_json.py data.tab [data_set_id] > output.mongoexport
"""
# pip install bson
from bson.objectid import ObjectId
import json
import sys
def main():
argv = sys.argv
if len(argv) == 3:
firstLine = True
... | {
"content_hash": "70fc3f3fdc90411cf54198e4b67ec101",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 131,
"avg_line_length": 31.90566037735849,
"alnum_prop": 0.5807214665878179,
"repo_name": "UCSC-MedBook/MedBook_",
"id": "c3e249f84f2d3aa57928e5825dd8375327fd0f22",
"size":... |
from botocore.client import ClientError
from collections import Counter
from concurrent.futures import as_completed
from datetime import datetime, timedelta
from dateutil.parser import parse
from dateutil.tz import tzutc
import logging
import itertools
import time
from c7n.actions import ActionRegistry, BaseAction,... | {
"content_hash": "ae1f370cac44df2c16e365bb33b95e38",
"timestamp": "",
"source": "github",
"line_count": 909,
"max_line_length": 88,
"avg_line_length": 35.66776677667767,
"alnum_prop": 0.5724508050089445,
"repo_name": "gwh59/cloud-custodian",
"id": "8e59c0a6ffb558cd35d35ce66c9cb825643b4645",
"size":... |
from mock import *
from gp_unittest import *
from gpconfig_modules.compare_segment_guc import MultiValueGuc
from gpconfig_modules.database_segment_guc import DatabaseSegmentGuc
from gpconfig_modules.file_segment_guc import FileSegmentGuc
class CompareSegmentGucTest(GpTestCase):
def setUp(self):
row = ['co... | {
"content_hash": "33cc7913804f90a215174d1546b64692",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 122,
"avg_line_length": 47.283236994219656,
"alnum_prop": 0.6135696821515892,
"repo_name": "jmcatamney/gpdb",
"id": "870d56b2976e3dcf240600d2c1585fa5d2fc57b4",
"size": "81... |
from functools import partial
import zlib
import json
from io import BytesIO
import sys
import platform
from electrum_arg.plugins import BasePlugin, hook
from electrum_arg_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog
from electrum_arg.util import print_msg, print_error
from electrum_arg.i18n import... | {
"content_hash": "014caaf744a27491a2b5ebac8d4a624e",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 82,
"avg_line_length": 32.2992125984252,
"alnum_prop": 0.6126279863481229,
"repo_name": "argentumproject/electrum-arg",
"id": "39cbf465d8822186baeaf54860e10fa230762fe8",
"... |
from PySide import QtCore, QtGui
class Ui_RunStringDock(object):
def setupUi(self, RunStringDock):
RunStringDock.setObjectName("RunStringDock")
RunStringDock.resize(375, 285)
self.dockWidgetContents = QtGui.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
... | {
"content_hash": "8964d24d05efb09b030156b012ce548c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 135,
"avg_line_length": 57.375,
"alnum_prop": 0.743355119825708,
"repo_name": "cloudteampro/juma-editor",
"id": "3bc1b170ed8531e92ad45705e991b44ea7715a80",
"size": "2542",
... |
from .chomsky import generate_chomsky
from .wordfinder import word_finder
from .minimalset import MinimalSet
from .babelfish import babelize_shell
| {
"content_hash": "38b60d743f4dfa273d1f6c22e61b0189",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 37,
"avg_line_length": 36.75,
"alnum_prop": 0.8435374149659864,
"repo_name": "haya14busa/alc-etm-searcher",
"id": "880ed9f5b189489a6604fed793c1edc961db2e6e",
"size": "354",
... |
import urllib2
'''
Top 10000 words in the german language
Nasty iso something encoding. Should be able to strip that in the future
'''
URL_DE = 'http://wortschatz.uni-leipzig.de/Papers/top10000de.txt'
class German_words:
def __init__(self, max_num = 10000):
if max_num > 10000:
print 'Truncating, maximum wordc... | {
"content_hash": "9760a348828e5ca55d050b8d079106dc",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 89,
"avg_line_length": 26.902439024390244,
"alnum_prop": 0.5548504079782411,
"repo_name": "thomi137/Python-Samples",
"id": "8cf50ccc1a73953f59afcd50cc3a92afc2d408a8",
"size... |
"""A sample application for cmd2.
Thanks to cmd2's built-in transtript testing capability, it also serves as a test suite for example.py when used with
the exampleSession.txt transcript.
Running `python example.py -t exampleSession.txt` will run all the commands in the transcript against example.py,
verifying that t... | {
"content_hash": "6de731702c6b18f9905c9f2606353f65",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 117,
"avg_line_length": 38.25352112676056,
"alnum_prop": 0.5688512518409425,
"repo_name": "tleonhardt/CodingPlayground",
"id": "2de104a0059a07f7bcf28f07b1fb57f419d9b9b6",
"... |
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.shortcuts import render
# Explicitly get the 500 template outside the Django template
# loading mechanism. We do this so there is absolutely no
# chance that Django w... | {
"content_hash": "632a66daa0989143cc9ea2f82270aa79",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 35.06060606060606,
"alnum_prop": 0.7277441659464131,
"repo_name": "pydanny/django-blarg",
"id": "aa79f36fcfa759ba67fd4c02d885db42a23dfbb9",
"size": "... |
import hashlib
from math import ceil
__author__ = 'Iurii Sergiichuk'
'''
The ANSI X9.63 key derivation function
We assume that we use SHA-512 hash function
'''
HASH_LEN = 512
MAX_INPUT = HASH_LEN * (2 << 32 - 1)
class SharedInfo(object):
def __init__(self, algorithm_id, counter=0, entityAinfo=None, entityBinfo=... | {
"content_hash": "b385d0b44f95fb815953a903f12c8599",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 104,
"avg_line_length": 31.138297872340427,
"alnum_prop": 0.6081311923471131,
"repo_name": "xSAVIKx/ISO-IEC-11770-3",
"id": "1a6b217f92005e5ae149291d0dcc86baff523476",
"siz... |
import argparse
import importlib
import os
import types
import dcm.agent.plugins.builtin as builtins
filelist = [f for f in os.listdir(os.path.dirname(builtins.__file__))
if not f.startswith("__")
and not f.endswith(".pyc")]
def dynamic_import(f):
"""
:param f: this is the filename
... | {
"content_hash": "f74916064ba2e52914cd0b2de1cdb334",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 26.655913978494624,
"alnum_prop": 0.5679709560306575,
"repo_name": "JPWKU/unix-agent",
"id": "0af26705437c9535efd739c6d40fc43eb74ae08e",
"size": "306... |
import os
import sys
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as i... | {
"content_hash": "40b862df4c73771d240b6ba69001a9c3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 152,
"avg_line_length": 47.7,
"alnum_prop": 0.512428870919437,
"repo_name": "greggian/TapdIn",
"id": "7312264224943a83bd7ed3532c6ac33c6753bf6f",
"size": "3339",
"binary":... |
import compileall
import os
from importlib import import_module
from django.db import connection, connections
from django.db.migrations.exceptions import (
AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError,
)
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder i... | {
"content_hash": "ecd792befa57dff946348a159416f0aa",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 108,
"avg_line_length": 41.27569331158238,
"alnum_prop": 0.6073432930203146,
"repo_name": "ghickman/django",
"id": "03a98506e3e27bbc087fdbdff13259e7e8b7f321",
"size": "253... |
from __future__ import absolute_import
import ssl
import threading
import pytest
from thriftpy._compat import MODERN_SSL
from thriftpy.transport import TTransportException, create_thriftpy_context
from thriftpy.transport.sslsocket import TSSLSocket, TSSLServerSocket
def _echo_server(sock):
c = sock.accept()
... | {
"content_hash": "664133818ff1059add69d61f706a2ba8",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 75,
"avg_line_length": 32.41573033707865,
"alnum_prop": 0.6357019064124784,
"repo_name": "keitheis/thriftpy",
"id": "15af2e984273ae589840ed34c51a661bd2a213cc",
"size": "291... |
from pytelemetry import Pytelemetry
import queue
import pytest
import unittest.mock as mock
class transportMock:
def __init__(self):
self.queue = queue.Queue()
def read(self, maxbytes=1):
data = []
amount = 0
while amount < maxbytes and not self.queue.empty():
c = s... | {
"content_hash": "cabbb2e76a75e3a2d00bd9f8f81a33c7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 105,
"avg_line_length": 26.876923076923077,
"alnum_prop": 0.5884373211219233,
"repo_name": "Overdrivr/pytelemetry",
"id": "d93752d245a5601e3223b55b960d0c72a7c3331d",
"size"... |
class Student(object):
def __init__(self, name, levels_list):
self.name = name
self.levels = levels_list
def __str__(self):
return "{} ==> {}".format(self.name, str(self.levels))
def __repr__(self):
return str(self.__dict__)
def path(self, domain_order, number=5):
... | {
"content_hash": "6c8e11d66c58f77189d9fe48a52e8106",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 28,
"alnum_prop": 0.5056390977443609,
"repo_name": "ganeshkbalaji/eSpark-coding-challenge",
"id": "92ed36eb0f3709a252176ae9e79445c4a3b784b3",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('legislature', '0004_auto_20161214_0237'),
('questing', '0001_initial'),
]
operations = [
... | {
"content_hash": "dec2a15f1d06330246a316b432cd894d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 137,
"avg_line_length": 38.41935483870968,
"alnum_prop": 0.5793450881612091,
"repo_name": "gnmerritt/dailyrippl",
"id": "cecbc657ceb653d7d6de95292c98488fdfc40e3b",
"size": ... |
from sklearn.utils.estimator_checks import check_estimator
from id3 import Id3Estimator
def test_estimator():
return check_estimator(Id3Estimator)
| {
"content_hash": "161f784e599c3a77059e0d7e5efb687f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 58,
"avg_line_length": 25.5,
"alnum_prop": 0.8104575163398693,
"repo_name": "svaante/decision-tree-id3",
"id": "014621db465cfbec9fea88d72248c8afde5c0da6",
"size": "153",
"... |
from concurrent import futures
import os
import signal
with futures.ProcessPoolExecutor(max_workers=2) as ex:
print('getting the pid for one worker')
f1 = ex.submit(os.getpid)
pid1 = f1.result()
print('killing process {}'.format(pid1))
os.kill(pid1, signal.SIGHUP)
print('submitting another t... | {
"content_hash": "faae2695b436087f91e4d09184a5be31",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 56,
"avg_line_length": 26.31578947368421,
"alnum_prop": 0.67,
"repo_name": "jasonwee/asus-rt-n14uhp-mrtg",
"id": "f9a9b43e013d1ce50cddf961b687ccf281ce2cd5",
"size": "500",
... |
"""
Solve day 24 of Advent of Code.
http://adventofcode.com/2016/day/24
"""
from collections import deque
from itertools import permutations
def make_grid(data):
grid = [list(line) for line in data]
return grid
def find_goals(grid):
goals = {}
for row in range(len(grid)):
for col in range... | {
"content_hash": "59b99c0e41203cb95c4cb46ae5331e46",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 72,
"avg_line_length": 26.184782608695652,
"alnum_prop": 0.5325861353258613,
"repo_name": "mpirnat/aoc2016",
"id": "898aa19ea8abf9f095f15ff5049135ccc95ea305",
"size": "2432... |
__author__ = 'qinpeng'
import random
from datetime import datetime, timedelta
import scrapy
from country.models import Country
from dealcrawler.spiders.BaseSpider import BaseSpider
from dealcrawler.util import *
from region.models import Region
from retailer.models import RetailerProperty
from source.models import D... | {
"content_hash": "b0ac3264cade5ddc7ac185983fa4d6f0",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 121,
"avg_line_length": 43.67094017094017,
"alnum_prop": 0.5756923378021332,
"repo_name": "ftkghost/SuperSaver",
"id": "a7c48fe25847cb1b89a713ad07529a7225d7b583",
"size": ... |
"""
jsonapi.asyncio.handler.collection
==================================
"""
# std
import asyncio
from collections import OrderedDict
# local
from jsonapi.base import errors
from jsonapi.base import validators
from jsonapi.base.serializer import serialize_many
from jsonapi.base.pagination import Pagination
from .bas... | {
"content_hash": "8f7a16ee6d48ac82feb23e02277b0a22",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 74,
"avg_line_length": 32.02739726027397,
"alnum_prop": 0.5966638152266894,
"repo_name": "benediktschmitt/py-jsonapi",
"id": "c994ad6fbe8b837a6fe40508d0c65bd0283fb48a",
"s... |
"""The test for light device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.light import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from ... | {
"content_hash": "e825482f9911aa99bc5321e90b80225f",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 87,
"avg_line_length": 34.75,
"alnum_prop": 0.47618456958571076,
"repo_name": "Teagan42/home-assistant",
"id": "969b4278aebc1bd5510bdac514225333e38a30e1",
"size": "8062",
... |
from integration_tests import AgentlessTestCase
from integration_tests.tests.utils import get_resource as resource
class TestUninstallDeployment(AgentlessTestCase):
def test_uninstall_application_single_node_no_host(self):
dsl_path = resource("dsl/single_node_no_host.yaml")
deployment, _ = self.d... | {
"content_hash": "b2bdbed8345285b9a52ce9740039fd51",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 78,
"avg_line_length": 39.436974789915965,
"alnum_prop": 0.627743447688046,
"repo_name": "isaac-s/cloudify-manager",
"id": "e1eefc625e13cf3c0dd5bf518296e52ebbe490ea",
"siz... |
class TestStateLookup(object):
def test_simple_lookup(self):
from schedule.window import AWS_INSTANCE_STATES
assert AWS_INSTANCE_STATES.STOPPED == [80, 'stopped']
def test_state_value_matches_dict_values(self):
from schedule.window import AWS_INSTANCE_STATES
di = {u'Code': 16, ... | {
"content_hash": "d8428ce98023e69ebb06f9ab715e6ff9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 61,
"avg_line_length": 39.9,
"alnum_prop": 0.6716791979949874,
"repo_name": "LostProperty/schedule",
"id": "b8cf3f0e874204d08ba64408ad2ca641b0ae7f10",
"size": "399",
"bin... |
from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Mapping,
Optional,
AsyncIterable,
Awaitable,
AsyncIterator,
Sequence,
Tuple,
Type,
Union,
)
import pkg_resources
from google.api_core.client_options import ClientOptions
from google.api_cor... | {
"content_hash": "b248ce70c78ef509ce3d51577689bc44",
"timestamp": "",
"source": "github",
"line_count": 801,
"max_line_length": 128,
"avg_line_length": 41.6354556803995,
"alnum_prop": 0.6145427286356822,
"repo_name": "googleapis/python-dialogflow",
"id": "1671567cedfe3ada89bb74b551347ed1cd94192a",
... |
from pydantic import BaseModel
class SubmissionBase(BaseModel):
survey_service_type: str
survey_outages: str
survey_disruptions: str
survey_subscribe_upload: str
survey_subscribe_download: str
survey_bundle: str
survey_current_cost: str
survey_satisfaction: str
survey_carrier_choic... | {
"content_hash": "a2001b38229cea36dc6d35f86551efbc",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 39,
"avg_line_length": 19.714285714285715,
"alnum_prop": 0.6869565217391305,
"repo_name": "critzo/piecewise",
"id": "dd74a826c6c23a2c63333e4f3d0a2d4bb1a298de",
"size": "690... |
from __future__ import print_function
from setuptools import setup
from setuptools.command.test import test as TestCommand
import codecs
import os
import sys
import coolcantonese
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
retur... | {
"content_hash": "d1bb7b8b28960b24199d6915dbcaab2c",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 75,
"avg_line_length": 26.764044943820224,
"alnum_prop": 0.6389588581024349,
"repo_name": "kk17/CoolCantonese",
"id": "7dcda318d379d97f02fb640f2611f534e143b568",
"size": "2... |
'''
New Integration test for image replication.
Check Image Replication after All BS recovering from network unreachable
@author: Legion
'''
import os
import time
import random
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
image_name = 'image-replication-test-' + time.... | {
"content_hash": "b74dc24743750e839ae1ab5713541a94",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 101,
"avg_line_length": 29.214285714285715,
"alnum_prop": 0.6948655256723716,
"repo_name": "zstackio/zstack-woodpecker",
"id": "e659eefa85057753da994ad5cb3fd4720bd5cef9",
"... |
"""
python-social-auth application, allows OpenId or OAuth user
registration/authentication just adding a few configurations.
"""
version = (0, 2, 2)
extra = '-dev'
__version__ = '.'.join(map(str, version)) + extra
| {
"content_hash": "574259b4ccaf481383f8020ba92f166b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 61,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.7023255813953488,
"repo_name": "SeanHayes/python-social-auth",
"id": "d5d5847c99af1256a84d64dc5d922b0c8deaa2f3",
"... |
from Tkinter import *
import SearchEngine
from SearchDialogBase import SearchDialogBase
def replace(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialog = engine._replacedialog
... | {
"content_hash": "d7c598115b5e3a3a735765c03a07b304",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 78,
"avg_line_length": 31.610778443113773,
"alnum_prop": 0.5004735745406327,
"repo_name": "ericlink/adms-server",
"id": "1f35414fb0575ed5efa76d3a06d075346f1a3ff9",
"size":... |
"""Default variable filters."""
from __future__ import unicode_literals
import re
import random as random_module
from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
import warnings
from django.template.base import Variable, Library, VariableDoes... | {
"content_hash": "b97db0597a7663f9570bafd907001bb7",
"timestamp": "",
"source": "github",
"line_count": 972,
"max_line_length": 102,
"avg_line_length": 29.17695473251029,
"alnum_prop": 0.6135049365303245,
"repo_name": "kswiat/django",
"id": "3e35e67bd0f2a3751e3328d1235a35c0fa978387",
"size": "28360... |
"""Module for compiling codegen output, and wrap the binary for use in
python.
.. note:: To use the autowrap module it must first be imported
>>> from sympy.utilities.autowrap import autowrap
This module provides a common interface for different external backends, such
as f2py, fwrap, Cython, SWIG(?) etc. (Curren... | {
"content_hash": "5494870a1b3cb6f88c05f22a560ddcac",
"timestamp": "",
"source": "github",
"line_count": 1121,
"max_line_length": 115,
"avg_line_length": 36.570026761819804,
"alnum_prop": 0.587169166971582,
"repo_name": "kaushik94/sympy",
"id": "bd6afb12d13b85cefa488fab2da5e08cb5790462",
"size": "40... |
"""An MNIST example using the Adam optimizer and lookahead wrapper."""
import functools
from absl import app
import jax
from jax import random
import jax.numpy as jnp
import optax
# pylint: disable=g-bad-import-order
import datasets # Located in the examples folder.
import mnist # Located in the examples folder.
# ... | {
"content_hash": "2bc9e0fdb0a83d3c94a53a3ee642b9b8",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 80,
"avg_line_length": 35.726027397260275,
"alnum_prop": 0.7055214723926381,
"repo_name": "deepmind/optax",
"id": "fce49efae5e851205de281b03abdf7d0b8ca256c",
"size": "3304"... |
import unittest
from tests.tools.client.fixtures import topic_metadata_v0
class MetadataV0ResponseTest(unittest.TestCase):
def setUp(self):
self.metadata = topic_metadata_v0()
def test_topic_names(self):
val = self.metadata.topic_names()
assert val == ['topic1']
def test_broker_... | {
"content_hash": "ce7fe26f4b5f02189d92c0338a98c4de",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 57,
"avg_line_length": 25.1875,
"alnum_prop": 0.652605459057072,
"repo_name": "toddpalino/kafka-tools",
"id": "b46ef80dc661641bb94566b159304eecfbf7d34e",
"size": "403",
"... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "d6171c7809d8a1f541665bf6f039282a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 117,
"avg_line_length": 36.81481481481482,
"alnum_prop": 0.6146881287726358,
"repo_name": "Mihai925/EduCoding",
"id": "59f68063f8f1a3d2a6d8e3620199faac49e4d5b3",
"size": "1... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import mock
import datetime
import logging
import unittest
import webapp2
import webtest
from dashboard import alert_groups
from dashboard import sheriff_config_client
from dashboard.common import testing_com... | {
"content_hash": "0de6bfa40652fcc15514749270727fc9",
"timestamp": "",
"source": "github",
"line_count": 886,
"max_line_length": 86,
"avg_line_length": 38.909706546275395,
"alnum_prop": 0.6501711434704415,
"repo_name": "catapult-project/catapult",
"id": "568c92c6fa3095544f764c0c6d62305e8fdedda2",
"s... |
import logging
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from vio.pub.msapi import extsys
from vio.pub.vim.vimapi.keystone import OperateTenant
from vio.pub.exceptions import VimDriverVioException
logger = logging.getLogger(__name__)
clas... | {
"content_hash": "c70bd618de9acdcd56698eaca18a0fc4",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 73,
"avg_line_length": 33.891304347826086,
"alnum_prop": 0.6023091725465042,
"repo_name": "onesafe/multivimdriver-vmware-vio",
"id": "3eff77f9270f76f44197272a1d8243fa6b914ea2... |
import sys
import os
import random
import csv
import tensorflow as tf
import numpy as np
from PIL import Image
import cv2
import face_pb2
FAC_DATA = 'fac_data'
IMAGE_DIR = 'Images'
AU_DIR = 'AUs'
BUFFER_SIZE = 50
TRAINING_PERCENT = 70
TESTING_PERCENT = (100 - TRAINING_PERCENT) / 2.0
VALIDATION_PERCENT = (100 - TRAIN... | {
"content_hash": "4486862d22beb297fdcf0c1457102fa8",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 93,
"avg_line_length": 28.75229357798165,
"alnum_prop": 0.6049776643267389,
"repo_name": "cosanlab/emote",
"id": "04b62be168374ed42f888eab78d926b8c2c2aa1c",
"size": "3135"... |
from checks import Check
# 3rd party
import uptime
try:
import psutil
except ImportError:
psutil = None
try:
from checks.libs.wmi.sampler import WMISampler
except Exception:
def WMISampler(*args, **kwargs):
"""
Fallback with a 'None' callable object.
"""
return
# datad... | {
"content_hash": "22afd3aab025bd04b285439c401ae4be",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 97,
"avg_line_length": 36.384,
"alnum_prop": 0.5786426267956611,
"repo_name": "tebriel/dd-agent",
"id": "0cc647eb1b7c878de0398d91aa68afb6654de91b",
"size": "13761",
"bin... |
"""
Modularized detection suite containing the phase_0 classes.
Authors: Johan Mickos jmickos@bu.edu
Josh Navon navonj@bu.edu
"""
# Standard library
import copy
import itertools
# External dependencies
import numpy as np
import cv2 as cv
# Project-specific
import utility
from utility import lo... | {
"content_hash": "6dbf134af848591069ddf8189f593158",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 131,
"avg_line_length": 46.42732558139535,
"alnum_prop": 0.5493081209692567,
"repo_name": "kartyboyz/n64-img-processing",
"id": "4e66cf81b65625c1cb91d0afaf442ef605103392",
... |
import unittest
from Cython.Compiler import Code, UtilityCode
def strip_2tup(tup):
return tup[0] and tup[0].strip(), tup[1] and tup[1].strip()
class TestUtilityLoader(unittest.TestCase):
"""
Test loading UtilityCodes
"""
expected = "test {{loader}} prototype", "test {{loader}} impl"
requir... | {
"content_hash": "52254da48b95700df0c583c15e787a91",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 89,
"avg_line_length": 33.07920792079208,
"alnum_prop": 0.6623765339718647,
"repo_name": "ryfeus/lambda-packs",
"id": "3d1906ca0b4af934a969a2b2499d3adcbaea1df7",
"size": "... |
from __future__ import division
import warnings
from qiita_core.exceptions import QiitaError
class QiitaDBError(QiitaError):
"""Base class for all qiita_db exceptions"""
pass
class QiitaDBNotImplementedError(QiitaDBError):
""""""
pass
class QiitaDBExecutionError(QiitaDBError):
"""Exception fo... | {
"content_hash": "c05f3963461213a5d77c95445e4fb926",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 33.028301886792455,
"alnum_prop": 0.6783776063981719,
"repo_name": "squirrelo/qiita",
"id": "eea058c864c9a68700fffec321be050924b6a4ac",
"size": "385... |
"""
OpenStack Client interface. Handles the REST calls and responses.
"""
# E0202: An attribute inherited from %s hide this method
# pylint: disable=E0202
import hashlib
import logging
import time
try:
import simplejson as json
except ImportError:
import json
from oslo_utils import encodeutils
from oslo_uti... | {
"content_hash": "2a23a573de1902794ae9d118d17eb0ae",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 78,
"avg_line_length": 35.51086956521739,
"alnum_prop": 0.5772115090296909,
"repo_name": "lvdongbing/python-bileanclient",
"id": "c6e4ddc6d180aa57f6b432d4ddee5a1ae48823b6",
... |
from distutils.core import setup
setup(
name="s3ts",
version="0.1.0",
author="Tim Docker",
author_email="timd@helixta.com.au",
# Contents
packages=["s3ts"],
package_dir={'' : 'src'},
include_package_data=False,
# Details
url="https://bitbucket.org/helix-collective/s3ts/wiki... | {
"content_hash": "80ec0a2f99bb403e75d7d11218d43dec",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 18,
"alnum_prop": 0.6047008547008547,
"repo_name": "helix-collective/s3ts",
"id": "b39b88709ecccba48a4d572c04cac5128244dccb",
"size": "468",
"binar... |
"""Leetcode 438. Find All Anagrams in a String
Medium
URL: https://leetcode.com/problems/find-all-anagrams-in-a-string/
Given a string s and a non-empty string p, find all the start indices of p's
anagrams in s.
Strings consists of lowercase English letters only and the length of both strings
s and p will not be lar... | {
"content_hash": "9e0149f904f05ae3bc776660209db2ce",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 81,
"avg_line_length": 27.129032258064516,
"alnum_prop": 0.5798652397938961,
"repo_name": "bowen0701/algorithms_data_structures",
"id": "6e4b445c9e1ac5bccc613b5bae98e1959d907... |
'''
This case can not execute parallelly
@author: Legion
'''
import os
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.operation... | {
"content_hash": "eabf13175735d02fe95fc07cc075c6f3",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 120,
"avg_line_length": 37.11267605633803,
"alnum_prop": 0.7157495256166982,
"repo_name": "zstackio/zstack-woodpecker",
"id": "381e0b48cf4fc32bf6fb76bb553422cf2fe30384",
"s... |
from insights.parsers import krb5
from insights.tests import context_wrap
KRB5CONFIG = """
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
include /etc/krb5test.conf
module /etc/krb5test.conf:residual
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/k... | {
"content_hash": "66d9a305af05cced9ca51e0079063963",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 129,
"avg_line_length": 34.223214285714285,
"alnum_prop": 0.7117140620923559,
"repo_name": "wcmitchell/insights-core",
"id": "22153a3368adcfb838df1246c3e74b2f11af5f67",
"s... |
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationListResult
from ._models_py3 import ResourceLink
from ._models_py3 import ResourceLinkFilter
from ._models_py3 import ResourceLinkProperties
from ._models_py3 import ResourceLinkResult
from ._patch import __al... | {
"content_hash": "5b8c392f314eadc6ec8184b53b808b54",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 32.68181818181818,
"alnum_prop": 0.7315716272600834,
"repo_name": "Azure/azure-sdk-for-python",
"id": "07cdd79d75c791b6de560b693cf324dab4e78973",
"si... |
"""Unit tests for core.domain.exp_fetchers."""
from __future__ import annotations
from core import feconf
from core.domain import caching_services
from core.domain import exp_domain
from core.domain import exp_fetchers
from core.domain import exp_services
from core.platform import models
from core.tests import test_u... | {
"content_hash": "3330beb36ec142f0f41b5403bb65b03a",
"timestamp": "",
"source": "github",
"line_count": 520,
"max_line_length": 79,
"avg_line_length": 39.70384615384615,
"alnum_prop": 0.6065097355419936,
"repo_name": "kevinlee12/oppia",
"id": "66efcfef82fd1741796feb0b3c9cdc2643a2145b",
"size": "212... |
"""
Common Policy Engine Implementation
Policies can be expressed in one of two forms: A list of lists, or a
string written in the new policy language.
In the list-of-lists representation, each check inside the innermost
list is combined as with an "and" conjunction--for that check to pass,
all the specified checks m... | {
"content_hash": "d8f13e5f79477834061ee32566b1ec2d",
"timestamp": "",
"source": "github",
"line_count": 920,
"max_line_length": 78,
"avg_line_length": 30.982608695652175,
"alnum_prop": 0.5947235475722705,
"repo_name": "Accelerite/cinder",
"id": "cf45ffa1df3dbf374ba12c6bf28169b1f91fcdf1",
"size": "2... |
"""Relations system field.
The field consists of:
- The system field itself.
- A relation mapping which is an object returned when accessing the system
field from an instance (e.g. ``record.relations``).
- Relations (e.g. PKRelation) used for defining a relationship to a specific
record type.
- Results, values re... | {
"content_hash": "60676021b66986297bb9df808611edfd",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 27.42222222222222,
"alnum_prop": 0.7374392220421394,
"repo_name": "inveniosoftware/invenio-records",
"id": "987b332b4366d0768079eee07aaab1d1e3c86f39",
... |
from io import BytesIO
from openslide import OpenSlideError
from cache import slide_cache
import os
class PILBytesIO(BytesIO):
def fileno(self):
'''Classic PIL doesn't understand io.UnsupportedOperation.'''
raise AttributeError('Not supported')
def get_slide(path):
if not os.path.exists(path):... | {
"content_hash": "b92feb281f4c7b5511692650caa3067a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 69,
"avg_line_length": 25.08695652173913,
"alnum_prop": 0.6360485268630849,
"repo_name": "dgutman/ADRCPathViewer",
"id": "dd3c6df127e99ea98ff7dff1e5b5761d1a9da4f4",
"size":... |
from netforce.model import Model, fields, get_model
import time
from netforce.access import get_active_user
import datetime
class WorkTime(Model):
_name = "work.time"
_string = "Work Time"
_key = ["project_id","resource_id","date"]
_fields = {
"resource_id": fields.Many2One("service.resource",... | {
"content_hash": "f9896bb6f67e597c200d473183679515",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 218,
"avg_line_length": 43.96727272727273,
"alnum_prop": 0.5449507898436854,
"repo_name": "bank-netforce/netforce",
"id": "dd64f7ef2de6129c3dd0ac42f74e0bf24f9bf326",
"size... |
from enum import Enum
# VK TWO FACTOR AUTH TYPE
class VKAuthApp(Enum):
APP = 0
SMS = 1
def parse_validation_method(param):
if param == '2fa_app':
return VKAuthApp.APP
else:
return VKAuthApp.SMS | {
"content_hash": "dc8cf98ed7e9468e73082cc9bca15e12",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 35,
"avg_line_length": 17.53846153846154,
"alnum_prop": 0.6359649122807017,
"repo_name": "ihydrogen/hydrogen-chat-bot-py",
"id": "3507e3315ed641efba8e8bf2ab8a2ea4edcf8691",
... |
"""empty message
Revision ID: 9e8429737ba0
Revises: ecbe7bbcbd6c
Create Date: 2017-08-12 19:53:27.652000
"""
# revision identifiers, used by Alembic.
revision = '9e8429737ba0'
down_revision = 'ecbe7bbcbd6c'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
# ### commands au... | {
"content_hash": "788901b14e2f4728b94069d6e36259a0",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 120,
"avg_line_length": 52.442622950819676,
"alnum_prop": 0.6874023132228821,
"repo_name": "codesmart-co/bit",
"id": "768da29a3929a184fadb01ee6b6da49abb4130ea",
"size": "31... |
import hashlib
import hmac
import json
import uuid
import urlparse
from django import http
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
from django.utils.datastructures import MultiValueDictKeyError
import basket
import commonware.log
from dja... | {
"content_hash": "73459079193a3ba1d26e798b542c381a",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 79,
"avg_line_length": 36.8618925831202,
"alnum_prop": 0.6317907444668008,
"repo_name": "ayushagrawal288/zamboni",
"id": "ae11f21e60a4e8660456989d8706924d6333e11c",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.