text stringlengths 4 1.02M | meta dict |
|---|---|
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
USER_MODEL_NAME = USER_MODEL.split('.')[1]
class Migration(SchemaMigration):
def forwards(self, orm):
... | {
"content_hash": "b93cc3214f6f95bd21ad9ffd10b8ccd6",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 182,
"avg_line_length": 59.83098591549296,
"alnum_prop": 0.5637947269303202,
"repo_name": "bennylope/django-site-contacts",
"id": "d18666aad698b4e8dfe11ae9008272974c80f1a1",
... |
import re
from collections import OrderedDict
from substance.monads import *
from substance.logs import *
from substance.constants import Constants
from .exceptions import *
from .vbox import (vboxManager, _vboxLineEnding)
from . import machine
from netaddr import (IPAddress, IPNetwork)
# -- Structs
class PortForwar... | {
"content_hash": "9702662d1d8fea62290ee050ab53f7ed",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 160,
"avg_line_length": 30.77777777777778,
"alnum_prop": 0.5970338569616548,
"repo_name": "turbulent/substance",
"id": "8ed3d4e63e41888c4e5e3c32cd3058ccda40afcd",
"size": ... |
from testrunner import testhelp
import copy
import errno
import grp, itertools
import os
import pwd
import shutil
import stat
import tempfile
import StringIO
import sys
import time
from conary_test import recipes
from conary_test import rephelp
from conary import callbacks
from conary import conarycfg, conaryclient
f... | {
"content_hash": "cf62ae0f28487b03cc8cfca198950be5",
"timestamp": "",
"source": "github",
"line_count": 4639,
"max_line_length": 199,
"avg_line_length": 43.76309549471869,
"alnum_prop": 0.5526827802597812,
"repo_name": "sassoftware/conary",
"id": "977842def5be814b2f62a7c04be9ffc022bd2f1e",
"size": ... |
"""Train a policy net on Hearts actions based given a dataset of trajectories.
Trajectories from the Hearts bot Xinxin can be generated using
open_spiel/bots/xinxin/xinxin_game_generator.cc.
"""
import os
import pickle
from typing import Any, Tuple
from absl import app
from absl import flags
import haiku as hk
impo... | {
"content_hash": "98452e565d32dbc74e45c2e0ad6efc03",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 80,
"avg_line_length": 33.65919282511211,
"alnum_prop": 0.6620037303490541,
"repo_name": "deepmind/open_spiel",
"id": "707b95213978bd796406a2f0a483f59ed38b3958",
"size": "... |
"""Handlers for generating various frontend pages."""
__author__ = 'Saifu Angto (saifu@google.com)'
import datetime
import urllib
import urlparse
from models import models
from models import student_work
from models import transforms
from models.config import ConfigProperty
from models.counters import PerfCounter
fr... | {
"content_hash": "677f9feb64de7a1409bc4b80f0794993",
"timestamp": "",
"source": "github",
"line_count": 772,
"max_line_length": 80,
"avg_line_length": 37.03238341968912,
"alnum_prop": 0.5913113435237329,
"repo_name": "graemian/ami-mooc-pilot",
"id": "e62bc521b5d4aaf67eb69378f2dc14ba6d93eae9",
"size... |
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings # noqa
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'digihel.settings')
app = Celery('digihel')
# Using a string here means the worker ... | {
"content_hash": "9e451f3ed3eebdfe2d2a3607c46873d1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 67,
"avg_line_length": 28.235294117647058,
"alnum_prop": 0.775,
"repo_name": "City-of-Helsinki/digihel",
"id": "30a2e8f959451c62c47d70488a76bd1ed3a42c9b",
"size": "480",
... |
import tvm
from tvm import te
import numpy as np
from tvm import rpc
from tvm.contrib import util, xcode, coreml_runtime
import pytest
import os
proxy_host = os.environ.get("TVM_IOS_RPC_PROXY_HOST", "localhost")
proxy_port = os.environ.get("TVM_IOS_RPC_PROXY_PORT", 9090)
destination = os.environ.get("TVM_IOS_RPC_DEST... | {
"content_hash": "39d3e226bb715e6affb8cd0aa3514b8d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 99,
"avg_line_length": 35.20879120879121,
"alnum_prop": 0.6338951310861424,
"repo_name": "sxjscience/tvm",
"id": "f6b9d9eb58e4606515493fed0bc649dfe4bd15ec",
"size": "3989",... |
MAX_RANGE = 1000
RADIX = 10
def run():
max_digits = 0
max_index = 0
for i in range(1, MAX_RANGE):
remainders = []
base = divmod(1, i)[1]
digits = 0
while base not in remainders and base != 0:
remainders.append(base)
# Long division with remainder
... | {
"content_hash": "e0a56bb8d733c2847bc781f5356b286e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 114,
"avg_line_length": 32.048780487804876,
"alnum_prop": 0.5334855403348554,
"repo_name": "YangLuGitHub/Euler",
"id": "f8efd58c70b8fba4fe23f411280b113ae8534ab3",
"size": "... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1EventLi... | {
"content_hash": "9448d97ef71efc5d12124f1275a15ce0",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 281,
"avg_line_length": 31.43076923076923,
"alnum_prop": 0.5836188611519008,
"repo_name": "djkonro/client-python",
"id": "a5c405596aec84ceb3852d1b6ded3767142b6d4e",
"size"... |
import urllib2
import json
import datetime
import os.path, time
from os.path import expanduser
#market options: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ
market = 'en-US'
resolution = '1920x1080'
BingDirectory= 'output/'
WallpaperName = 'bing.jpg'
loop_value = 1
while (loop_value == 1):
try:
urlli... | {
"content_hash": "07806d0b30be98a0c2db270ba64fad87",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 111,
"avg_line_length": 33.84444444444444,
"alnum_prop": 0.5679579776756402,
"repo_name": "xe1gyq/nuupxe",
"id": "56a5f1bc4c3f0666dab48f8375aed0c6b40e8090",
"size": "1523",... |
from StringIO import StringIO
from fabric.api import cd, run, env, sudo, parallel, shell_env, settings, put, execute
from fabric.decorators import task, hosts
env.user = 'root'
env.hosts = ['irs1.verbit.io', 'irs2.verbit.io', 'irs3.verbit.io']
def generate_config_master(host):
return StringIO('''[program:orp]
com... | {
"content_hash": "e56b6db1985fa203ce8a8ef95dcb913d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 88,
"avg_line_length": 26.406593406593405,
"alnum_prop": 0.6695796920516022,
"repo_name": "verbit/orp",
"id": "c624a07c37048622e8cb08a06a8ce742269eb56d",
"size": "2403",
... |
import argparse
import logging
import sys
import time
from apache_beam.runners.portability import local_job_service
def run(argv):
if argv[0] == __file__:
argv = argv[1:]
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--port',
type=int,
help='port ... | {
"content_hash": "95d21f613459281744e3fcdca2d336ca",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 29.321428571428573,
"alnum_prop": 0.6528623629719854,
"repo_name": "tgroh/incubator-beam",
"id": "b6f2ef9710c809b9363f7e2bcb211dce4cc808b1",
"size": ... |
from base import add_request, add_worker, go
__version__ = "0.2.0" | {
"content_hash": "05738c157f2ba5b2c9f031b2f48c9e2c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.6716417910447762,
"repo_name": "swinton/twitterspawn",
"id": "80bc063f51fc8485aaa197b8ebad47b15c520f86",
"size": "... |
from twisted.internet.protocol import Protocol
import logging
import struct
import ctypes
import struct
from c2w.main.movie import *
from c2w.main.user import *
from c2w.main.constants import *
from c2w.main.constants import ROOM_IDS
import core
#version 53
logging.basicConfig()
moduleLogger = logging.getLogger('c2w.p... | {
"content_hash": "92de2c52f35e1b95df3ef166bd8bf768",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 211,
"avg_line_length": 37.0316091954023,
"alnum_prop": 0.6655544347016373,
"repo_name": "AntoineHus/C2W",
"id": "469074969da5929d459b72e690a72b3fdb9c0949",
"size": "12911... |
import logging
import claripy
import archinfo
from typing import Union, Optional, List
from .sim_type import SimTypeChar
from .sim_type import SimTypePointer
from .sim_type import SimTypeFixedSizeArray
from .sim_type import SimTypeArray
from .sim_type import SimTypeString
from .sim_type import SimTypeFunction
from .s... | {
"content_hash": "8f355e9e54cecbb86d4646ece66d27ea",
"timestamp": "",
"source": "github",
"line_count": 1444,
"max_line_length": 156,
"avg_line_length": 39.88296398891967,
"alnum_prop": 0.5991213904950426,
"repo_name": "schieb/angr",
"id": "7b39a207db8e310d1e82ee85ea8c69b6b5a8ba39",
"size": "57591"... |
import asyncio
from datetime import datetime, timedelta
from pony.orm import db_session
from planer.daemon.api import run_api_server
from planer.daemon.db import db
with db_session:
for c in db.Calendar.select():
c.delete()
c = db.Calendar(name="Test Calendar")
db.Event(summary="Test Event 1", st... | {
"content_hash": "42000100e69623c3af492b868b80a19c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 121,
"avg_line_length": 30.181818181818183,
"alnum_prop": 0.6927710843373494,
"repo_name": "FelixVanderJeugt/planer",
"id": "19fb7edcb8b2c7fa6bbd9d42fd3fb2498c03202d",
"siz... |
__all__ = [
'run',
]
from oslo_concurrency import lockutils
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import excutils
from glance.api.v2 import images as v2_api
from glance.common import exception
from glance.common.scripts import utils as script_utils
from glance.comm... | {
"content_hash": "cff6304a5749d045aab216a68f272543",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 40.86486486486486,
"alnum_prop": 0.603505291005291,
"repo_name": "openstack/glance",
"id": "cde2bf36b2638f1f6f25b9a170fee1fc1ed0eced",
"size": "6684... |
import make_runtime_features
import json5_generator
import template_expander
class CommonFeaturesImplWriter(make_runtime_features.BaseRuntimeFeatureWriter):
file_basename = 'features_generated'
def __init__(self, json5_file_path, output_dir):
super(CommonFeaturesImplWriter, self).__init__(json5_file_... | {
"content_hash": "db4be78e37bc5a269f6d68ef417b9182",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 34.225806451612904,
"alnum_prop": 0.6098020735155514,
"repo_name": "chromium/chromium",
"id": "03155a80ac2e017dae3cd0e85038a59ba2604bcf",
"size": "12... |
import api.models
import traceback
import logging
from sqlalchemy import asc
db_session = api.models.init_db()
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def get_achievements(user_id, lang):
try:
all_badges = db_session.query(api.models.Badge).order_by(asc(api.models.Ba... | {
"content_hash": "378e94428dd828fbbd309a6310083c93",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 31.88888888888889,
"alnum_prop": 0.6489547038327527,
"repo_name": "kort/kort-core",
"id": "ad05c94491036c3c6476649f6edabf0dde1b81ef",
"size": "1148"... |
from builtins import object
import geocoder
from django.conf import settings
from django.contrib.gis.db.models import PointField
from django.contrib.gis.geos import Point
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import gettext_lazy as _
from future.u... | {
"content_hash": "22055757b1c5ebe9647cfa9c10b16f2a",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 102,
"avg_line_length": 34.74409448818898,
"alnum_prop": 0.625042492917847,
"repo_name": "onepercentclub/bluebottle",
"id": "ed660df0c7a5b2cc825a6d13360bebcd480d54ab",
"si... |
"""
The MIT License (MIT)
Copyright (c) 2017 SML
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 rights to use, copy, modify, merge, publish,... | {
"content_hash": "9311fc8e66a81d2b8a704a23757840eb",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 94,
"avg_line_length": 30.710526315789473,
"alnum_prop": 0.6892316481005427,
"repo_name": "smlbiobot/SML-Cogs",
"id": "9284b91084ba88a0721754565e9a8167f4708629",
"size": "... |
"""
Mappings from file extensions to biopython types
"""
import bz2
import gzip
import os.path
import sys
# Define mappings in a dictionary with extension : BioPython_file_type.
EXTENSION_TO_TYPE = {'.aln': 'clustal',
'.afa': 'fasta',
'.fa': 'fasta',
'.faa... | {
"content_hash": "e06c35c7b4d5855cfb8da27970e01baf",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 31.397260273972602,
"alnum_prop": 0.5165794066317626,
"repo_name": "smilefreak/ancient_dna_pipeline",
"id": "b96971a53708fbce3bd9a897ba3515a0d5f563ce",... |
from sqlalchemy import Column, Integer, String, ForeignKey
from netseen.models.table import Table
class Prefix(Table):
'''
router tables
'''
__tablename__ = 'Prefix'
prefix = Column(String(32), primary_key=True, nullable=False, unique=True)
prefix_sid = Column(Integer, nullable=True)
pre... | {
"content_hash": "fa63bcc02d2452f996a505fba1357470",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 30.647058823529413,
"alnum_prop": 0.6833013435700576,
"repo_name": "ciscochina/netseen",
"id": "5ac62e3607dd5e5220cfac82af0cc8a70f5ab4b6",
"size": "1... |
import Config
from datetime import datetime
from datetime import timedelta
from time import sleep
import os, sys, signal
def send_emails():
import smtplib
from Messages import msgs
s = smtplib.SMTP_SSL(Config.host)
s.login(Config.email,Config.password)
for msg in msgs:
s.sendmail(Config.email,msg["To"],m... | {
"content_hash": "f9ae25c476db0eb53341e1d37c9626cd",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 67,
"avg_line_length": 22.81967213114754,
"alnum_prop": 0.6846264367816092,
"repo_name": "henfredemars/python-personal-projects",
"id": "19ca1ed997e94aabb23086869c1089f4ff015... |
'''
Created on Dec 30 2013
@author: Kelly Chan
Python Version: V2.7.3
Course: Python Data Mining
Lesson: Bayes
Methods:
'''
import os, codecs, math
class BayesText:
def __init__(self, trainingdir, stopwordlist):
"""This class implements a naive Bayes approach to text classification
trainingdi... | {
"content_hash": "82b77d8f6dbbb369f67965dfa4b2e5a7",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 104,
"avg_line_length": 38.13533834586466,
"alnum_prop": 0.54948738170347,
"repo_name": "KellyChan/python-examples",
"id": "446f3fd22ce384b2d2066abe52545e923d6f2014",
"siz... |
import unittest
from _pydev_bundle._pydev_saved_modules import thread
import queue as Queue
from _pydev_runfiles import pydev_runfiles_xml_rpc
import time
import os
import threading
import sys
#=======================================================================================================================
# fl... | {
"content_hash": "36d980798e4ce856ac8277bcb2c7261e",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 122,
"avg_line_length": 35.47565543071161,
"alnum_prop": 0.5371621621621622,
"repo_name": "joshcai/utdcs",
"id": "b34c45e951d1f06904e353fb0204035874eefc7e",
"size": "9472"... |
"""
defines declarations visitor class interface
"""
class decl_visitor_t(object):
"""
declarations visitor interface
All functions within this class should be redefined in derived classes.
"""
def __init__(self):
object.__init__(self)
def visit_member_function(self):
raise... | {
"content_hash": "fb02e859ff9e6fd71d91d844db43c26b",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 75,
"avg_line_length": 21.962962962962962,
"alnum_prop": 0.6644182124789207,
"repo_name": "BRAINSia/ITK",
"id": "43961ee1917efc6d31f70bff8c7b7598b190b8b2",
"size": "1381",
... |
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.backends.ddl_references import Statement
from django.db.backends.utils import strip_quotes
from django.db.models import UniqueConstraint
from django.db.transa... | {
"content_hash": "512d303185418d04990ed1afb2254a2b",
"timestamp": "",
"source": "github",
"line_count": 412,
"max_line_length": 114,
"avg_line_length": 47.689320388349515,
"alnum_prop": 0.5956840390879479,
"repo_name": "georgemarshall/django",
"id": "029e22e1888a52659dffb9dde9cedafca68e6a55",
"size... |
import sys, os
import pepper.utils
__all__ = ['Controller', 'TestCase']
from .base.controller import Controller
from .base.test_case import TestCase
__controllers = {}
__instances = {}
__classes = {}
def __init():
global __controllers
print 'Pepper v0.1\n'
cmd_folder = os.path.realpath('./pepper/lib/... | {
"content_hash": "4472ae51b1f1a0440e05c8a5abb9116b",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 100,
"avg_line_length": 28.36036036036036,
"alnum_prop": 0.6045108005082592,
"repo_name": "bbranta/pepper",
"id": "87fdb232a82b5f0219c9874f4e232071c773caa3",
"size": "3172... |
import os
import random
import re
import shlex
import signal
import string
import pexpect
import pexpect.replwrap
from ipykernel.kernelbase import Kernel
from ipykernel.kernelapp import IPKernelApp
__version__ = '0.2'
class MsfconsoleREPLWrapper(pexpect.replwrap.REPLWrapper):
def __init__(self):
self.child = pexp... | {
"content_hash": "88be516ca74bc26f1e1a7765b8b59e60",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 108,
"avg_line_length": 30.59124087591241,
"alnum_prop": 0.6733476497256025,
"repo_name": "zeroSteiner/ipy-msf-kernel",
"id": "23f68c5f89f78bc19f46b50b3ef9add1eef37f75",
"... |
from .resource import Resource
class NetworkSecurityGroup(Resource):
"""NetworkSecurityGroup resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar typ... | {
"content_hash": "d13be6eeb8300a966da92eb7e66944a1",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 164,
"avg_line_length": 42.61842105263158,
"alnum_prop": 0.6464958320469281,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "4e042062aad51879e3824f080b20d9259926d601",
... |
import unittest
import bslint.constants as const
from tests.resources.common.test_methods import CommonMethods as Common
class TestForBlockParse(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.common = Common()
def test_for_block(self):
self.common.match_program(const.BLOCK_STM... | {
"content_hash": "7ef4b6aa630f97a0777eb5519c61c171",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 95,
"avg_line_length": 34.82142857142857,
"alnum_prop": 0.68,
"repo_name": "sky-uk/bslint",
"id": "09d8b0e7e6f72839e0887b50388bd852456dbaab",
"size": "975",
"binary": fal... |
from zoo.chronos.detector.anomaly.abstract import AnomalyDetector
import numpy as np
from sklearn.cluster import DBSCAN
class DBScanDetector(AnomalyDetector):
"""
Example:
>>> #The dataset to detect is y
>>> y = numpy.array(...)
>>> ad = DBScanDetector(eps=0.1, min_sam... | {
"content_hash": "9d3788d5eb76a7b3056a0c7207777204",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 95,
"avg_line_length": 34.87179487179487,
"alnum_prop": 0.5886029411764706,
"repo_name": "intel-analytics/analytics-zoo",
"id": "6b0a24f42379f6392e5d27474b348185b3ccb02a",
... |
__author__ = "@jframos"
import behave
from behave import step
from hamcrest import assert_that, has_entries, has_length
from fiwarefacts_client.window_size_model_utils import get_window_size_rabbitmq_message
from commons.custom_asserts import is_message_in_consumer_list
from qautils.dataset.dataset_utils import Datase... | {
"content_hash": "ddcbd952f7d04c77113a4f46a83d5ab0",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 106,
"avg_line_length": 43.134328358208954,
"alnum_prop": 0.745674740484429,
"repo_name": "Fiware/cloud.Facts",
"id": "1da9de625e0ca5941552fb7e950484ca23ab4b55",
"size": "3... |
import random
import time
from BrickPi import BrickPi, BrickPiSetup, BrickPiSetupSensors, BrickPiUpdateValues, \
PORT_A, PORT_B, PORT_1, TYPE_SENSOR_ULTRASONIC_CONT
class SelfDrivingRobot(object):
"""
Self Driving robot that uses a reflex agent to avoid objects around him.
"""
def __init__(self, ... | {
"content_hash": "cd9132ef5fed695d22120e97fdfa0149",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 86,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.5923226433430515,
"repo_name": "rochapps/noisy",
"id": "9046baf8b0b0ed73b87029c6dd24454eadd1c436",
"size": "2058"... |
import urllib.request, urllib.error, urllib.parse
the_url = 'http://www.someserver.com/cgi-bin/register.cgi'
values = {'name' : 'Michael Foord',
'location' : 'Northampton',
'language' : 'Python' }
data = urllib.parse.urlencode(values)
req = urllib.request.Request(the_url, data)
print(req)
#handle ... | {
"content_hash": "63889be89649eeb38317033103e1ab01",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 58,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6793478260869565,
"repo_name": "rboman/progs",
"id": "a70f1134ff623be15dca28379e3dac50be48b9fe",
"size": "489",
... |
"""module docstring"""
# imports
import sys, os, argparse, logging # NOQA
from pprint import pprint
from twBase import * # NOQA
from utils import *
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input
import numpy as np
from sklearn.model_selection import train_test_spli... | {
"content_hash": "d457d530be80ce3b5fbeaa60697f6b84",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 158,
"avg_line_length": 35.64367816091954,
"alnum_prop": 0.6528539180909384,
"repo_name": "sysid/kg",
"id": "b9141056bfcd0e8a3be3778b77676cd2fe5db320",
"size": "6246",
"... |
"""MobileNet v1.
MobileNet is a general architecture and can be used for multiple use cases.
Depending on the use case, it can use different input layer size and different
head (for example: embeddings, localization and classification).
As described in https://arxiv.org/abs/1704.04861.
MobileNets: Efficient Convol... | {
"content_hash": "fe895741185cb2b0bd8acb48eb336b52",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 80,
"avg_line_length": 47.334939759036146,
"alnum_prop": 0.6068010588474853,
"repo_name": "mlperf/training_results_v0.5",
"id": "8a04785f007520b90205686bf03a019b17ec169b",
... |
import asyncio
import codecs
import json
import re
import time
from datetime import datetime
from urllib.parse import urlparse, urlunparse, urljoin
import lxml.html
import feedparser
import praw
import pytz
import requests
from django.conf import settings
from feedgen.feed import FeedGenerator
from lxml import etree
f... | {
"content_hash": "191810493ea8f72a08cb81e7a11dca8c",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 77,
"avg_line_length": 30.05263157894737,
"alnum_prop": 0.6035026269702277,
"repo_name": "aehlke/manabi",
"id": "2bd2d38c4d437a3d2f3573c8ed8e7281db67a168",
"size": "8591",... |
from tornado.web import authenticated
from tornado.escape import json_encode
from labcontrol.gui.handlers.base import BaseHandler
from labcontrol.db.composition import ReagentComposition
from labcontrol.db.process import ReagentCreationProcess
class ReagentCompositionListHandler(BaseHandler):
@authenticated
... | {
"content_hash": "3e43f4e5859e65e30869bd01e7113e47",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 65,
"avg_line_length": 35.38461538461539,
"alnum_prop": 0.7108695652173913,
"repo_name": "jdereus/labman",
"id": "62c23805b5a5189df6b70a6aa7ae8b36dfa1b037",
"size": "1268",... |
"""Retriever script for direct download of Bioclim data"""
from builtins import range
from retriever.lib.templates import Script
from pkg_resources import parse_version
try:
from retriever.lib.defaults import VERSION
except ImportError:
from retriever import VERSION
class main(Script):
def __init__(self,... | {
"content_hash": "e2c46cfb7bfc38bb3e145c81ffb8ab55",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 224,
"avg_line_length": 45.976190476190474,
"alnum_prop": 0.6525116519937856,
"repo_name": "goelakash/retriever",
"id": "cc230d3df099ec6179447a88c4f8faf8efc160d1",
"size": ... |
'''
BIDS to XNAT
Extract the information from BIDS for Xnatupload
@author: Praitayini Kanakaraj, Electrical Engineering, Vanderbilt University
'''
import os
import sys
import json
import glob
# check if valid bids
# extract and map to dict.
def split_name_with_nii(filename):
"""
Returns the clean basename... | {
"content_hash": "9ad35c6e7f871d3d3470c0d1b3b9e62e",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 96,
"avg_line_length": 37.09313725490196,
"alnum_prop": 0.48936170212765956,
"repo_name": "VUIIS/dax",
"id": "83a7191ca3b1fbd2a8f9318161bf65f462512d82",
"size": "7567",
... |
import argparse
import json
import os
import shutil
import subprocess
import sys
from os import path
from check_tidy import check_tidy
TERM_RED = "\033[1;31m"
TERM_YELLOW = "\033[1;33m"
TERM_GREEN = "\033[1;32m"
TERM_BLUE = "\033[1;34m"
TERM_EMPTY = "\033[0m"
def join_path(pathes):
return path.abspath(reduce(la... | {
"content_hash": "9c467286bb96f76636cce1f07b6af728",
"timestamp": "",
"source": "github",
"line_count": 770,
"max_line_length": 80,
"avg_line_length": 29.46883116883117,
"alnum_prop": 0.6194526464236922,
"repo_name": "wateret/iotjs",
"id": "5b6af313c229ec4576c0113be0617693f310b930",
"size": "23308"... |
import pandas as pd
import numpy as np
import chess
import matplotlib.pyplot as plt
import guerilla.train.stockfish_eval as sf
import guerilla.train.chess_game_parser as cgp
import guerilla.data_handler as dh
from guerilla.players import Guerilla
def metric_by_move(weight_files, labels=None, num_values=100, metric='... | {
"content_hash": "9392c175f936acb3f5a15f0821ce0e4a",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 109,
"avg_line_length": 36.101694915254235,
"alnum_prop": 0.5826291079812207,
"repo_name": "StephAO/guerilla",
"id": "8c33dcb8e427698966f93cbae4894fa6a0e682bd",
"size": "8... |
"""
FILE: sample_export_import_project.py
DESCRIPTION:
This sample demonstrates how to export and import a Qna project.
USAGE:
python sample_export_import_project.py
Set the environment variables with your own values before running the sample:
1) AZURE_QUESTIONANSWERING_ENDPOINT - the endpoint to you... | {
"content_hash": "07f077c42fe8ad01e721d71da0c90096",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 90,
"avg_line_length": 32.85227272727273,
"alnum_prop": 0.572120373573158,
"repo_name": "Azure/azure-sdk-for-python",
"id": "9cc7dd31c94ebb1956715ca7477b5770ab89d25a",
"siz... |
from google.cloud import dialogflow_v2
def sample_batch_create_entities():
# Create a client
client = dialogflow_v2.EntityTypesClient()
# Initialize request argument(s)
entities = dialogflow_v2.Entity()
entities.value = "value_value"
entities.synonyms = ['synonyms_value1', 'synonyms_value2']
... | {
"content_hash": "5fefeeb843f7badf75cc44c0eb8ca05f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 68,
"avg_line_length": 26.071428571428573,
"alnum_prop": 0.7027397260273973,
"repo_name": "googleapis/python-dialogflow",
"id": "8611dc976f64677e9db546052466a30852c4cb08",
... |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['mrs_motors'],
package_dir={'': 'scripts'})
setup(**setup_args)
| {
"content_hash": "b2aef1e0555c94ea51a88be15899f98e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 60,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.6943396226415094,
"repo_name": "prithvisekhar/mrs_pi_arduino",
"id": "a2f112dc18b1885abd65148ad1348d62badbe00a",
"... |
import traceback
from functools import wraps
from unittest import TestCase
import grail.state as state
import grail.settings as settings
def handle_steps(func):
@wraps(func)
def wrapper(*args, **kwargs):
try:
state.is_test_wrapped = True
result = func(*args, **kwargs)
... | {
"content_hash": "49e68920ce6a99be752ead75b070c850",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 115,
"avg_line_length": 32.68888888888889,
"alnum_prop": 0.6043507817811012,
"repo_name": "wgnet/grail",
"id": "40377210990fee38fc604478850a5fe35f880d94",
"size": "1471",
... |
import sys
import os
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
from fax_production_process import ProductionProcess
class SortTruth(ProductionProcess):
'''Sort peak infomation in fax_truth from peak to event level'''
process_oerder = 4
__version__ = '0.0.1'
de... | {
"content_hash": "592a3dd189c70a0cff4504130b0e7f80",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 173,
"avg_line_length": 45,
"alnum_prop": 0.576068376068376,
"repo_name": "XENON1T/processing",
"id": "f2a6437fb2d582f66ccc4daed0769bd5545e4ce5",
"size": "4680",
"binary... |
import odml.gui.treemodel.mixin
import unittest
import samplefile
class TestTreemodel(unittest.TestCase):
def setUp(self):
self.doc = samplefile.SampleFileCreator().create_document()
def path_property(self, prop, path):
for i, val in enumerate(prop):
self.assertEqual(val.to_path(),... | {
"content_hash": "dc6dc91539149ba959a3aa19578b5544",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 129,
"avg_line_length": 38.30555555555556,
"alnum_prop": 0.6236403190717912,
"repo_name": "stoewer/python-odml",
"id": "de6ba4d455a706e4724c8287fece2916e6f61981",
"size": "... |
import os, sys, inspect
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
#cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))... | {
"content_hash": "d67d8efa9b3f7816882b7cdee06d339b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 139,
"avg_line_length": 45.666666666666664,
"alnum_prop": 0.7299270072992701,
"repo_name": "aragos/tichu-tournament",
"id": "6ad6307714a7ca9e3b1087e57ba85796c5c266aa",
"size... |
import argparse
import errno
import logging
import os
PLUGIN_TEMPLATE = '''
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from pdc_client import plugin_helpers
class {class_name}(plugin_helpers.PDCClientPlugin):
... | {
"content_hash": "50187f84d5d9d9ca9a11bbb087d134a5",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 83,
"avg_line_length": 25.27956989247312,
"alnum_prop": 0.6363249680986814,
"repo_name": "product-definition-center/pdc-client",
"id": "8811d92e0ad51027ee307ac9dae39bd48f8520... |
import numpy as np
import theano.tensor as tt
from ..math import logsumexp
from .dist_math import bound
from .distribution import Discrete, Distribution, draw_values, generate_samples
from .continuous import get_tau_sd, Normal
def all_discrete(comp_dists):
"""
Determine if all distributions in comp_dists are... | {
"content_hash": "42e90205536e30ad2e361826d392af57",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 103,
"avg_line_length": 33.603550295857985,
"alnum_prop": 0.5110054587075189,
"repo_name": "wanderer2/pymc3",
"id": "a8e6f2e31776d1bdd380ec7f0288e7fa479384b7",
"size": "56... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("contenttypes", "0001_initial"),
]
operations = [
... | {
"content_hash": "6eede90562489f9df608cb5aae7d3523",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 114,
"avg_line_length": 35.19718309859155,
"alnum_prop": 0.43977591036414565,
"repo_name": "django/djangosnippets.org",
"id": "7ef21108459851cad510a01f8a916f537ad86df1",
"s... |
from collections import defaultdict
from typing import Tuple, Dict
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
XFORCE_URL = 'https://exchange.xforce.ibmcloud.com'
DEFAULT_THRESHOLD = 7
DBOT_SCORE_KEY = 'DBotScore(val.Indicator == obj.Indicator &... | {
"content_hash": "a26559bc259586227b807327c7ce5065",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 120,
"avg_line_length": 44.330206378986865,
"alnum_prop": 0.5668274928051464,
"repo_name": "VirusTotal/content",
"id": "5b285f276960e6497bc70f2cdc8f8604c13f7150",
"size": ... |
from os.path import exists
from distutils.core import setup
from liveserver import __version__
setup(
name='django-live-server',
version=__version__,
# Your name & email here
maintainer='Adam Charnock',
maintainer_email='adam@playnice.ly',
# If you had liveserver.tests, you would also include t... | {
"content_hash": "8c959614b0a4010dfb94696259b03b8e",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 86,
"avg_line_length": 36.083333333333336,
"alnum_prop": 0.6732101616628176,
"repo_name": "adamcharnock/django-live-server",
"id": "668f6e89cba2df269d2790366732c0f77c1de5f4",... |
import unittest
from docker.errors import (APIError, DockerException,
create_unexpected_kwargs_error)
class APIErrorTest(unittest.TestCase):
def test_api_error_is_caught_by_dockerexception(self):
try:
raise APIError("this should be caught by DockerException")
... | {
"content_hash": "b75b92914326e0d850b7457338934b9d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 37.90909090909091,
"alnum_prop": 0.657074340527578,
"repo_name": "auready/docker-py",
"id": "876ede3b5f277443b651acc7cc9b387259f0b547",
"size": "834"... |
from __future__ import print_function
import eigenpy
import numpy as np
import time
import timeit
from IPython import get_ipython
ipython = get_ipython()
quat = eigenpy.Quaternion()
a = [0., 0., 0.]
cmd1 = "timeit np.array(a)"
print("\n")
print(cmd1)
ipython.magic(cmd1)
print("\n")
cmd2 = "timeit np.matrix(a)"
pr... | {
"content_hash": "c29a0af8793e226534ae14cdbd8b55fb",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 42,
"avg_line_length": 17.210526315789473,
"alnum_prop": 0.6309887869520897,
"repo_name": "jcarpent/eigenpy",
"id": "6f42cc5a5f9db13b2a1f8566136a3546761cca11",
"size": "981... |
import logging
import os
logger = logging.getLogger('marathon_lb')
class ConfigTemplate:
def __init__(self, name, value, overridable, description):
self.name = name
self.full_name = 'HAPROXY_' + name
self.value = value
self.default_value = value
self.overridable = overrida... | {
"content_hash": "2fe6ff3bf253b19abb6b59e0db2cba66",
"timestamp": "",
"source": "github",
"line_count": 1601,
"max_line_length": 79,
"avg_line_length": 36.853216739537785,
"alnum_prop": 0.6017253652418562,
"repo_name": "matt-deboer/marathon-lb",
"id": "1723d1d9b7ce3b1fb83757329582834273bf6ec1",
"si... |
import os
from django.conf import settings
from celery import task
import requests
from .core import DocumentExtractor
@task
def send_ocr_results(file_id, cb_url, token):
filepath = os.path.join(settings.MEDIA_ROOT, file_id)
document = DocumentExtractor(filepath)
total_pages = document.file.numPages
... | {
"content_hash": "880096630b0ec93fa578c21837e6467f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 24.77777777777778,
"alnum_prop": 0.617339312406577,
"repo_name": "setaris/django-tesseract2",
"id": "18c515031eea5d3c45254f7cde50f69052ff41d9",
"size... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("users", "0007_migrate_avatars")]
operations = [
migrations.AlterModelOptions(
name="user",
options={
"ordering": ["pk"],
"verbose_name": "User",
... | {
"content_hash": "41cccea158cda10c41beb5f73378f162",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.49783549783549785,
"repo_name": "watchdogpolska/poradnia.siecobywatelska.pl",
"id": "511d1243f7dbeb5aedd965e27eee96... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from past.builtins import basestring
from collections import defaultdict, Counter
from datetime import datetime
import getpass
import logging
import socket
import subpr... | {
"content_hash": "a64039338c4dd7bf76de12c1eaf95f42",
"timestamp": "",
"source": "github",
"line_count": 2105,
"max_line_length": 110,
"avg_line_length": 41.55344418052257,
"alnum_prop": 0.5227620898593803,
"repo_name": "btallman/incubator-airflow",
"id": "2a6af3902b39046f97cc9e915d32131fb15face7",
... |
import copy
import mock
from nova import block_device
from nova.compute import flavors
from nova import context
from nova import db
from nova import exception
from nova import objects
from nova import test
from nova.tests import fake_block_device
import nova.tests.image.fake
from nova.virt import block_device as driv... | {
"content_hash": "51f395179c45d0e3bf343dd459b63772",
"timestamp": "",
"source": "github",
"line_count": 982,
"max_line_length": 79,
"avg_line_length": 43.95723014256619,
"alnum_prop": 0.4763239586711764,
"repo_name": "virtualopensystems/nova",
"id": "b5a3cd3740abe4310e1008c47ff772633048de4d",
"size... |
import synapse.lib.module as s_module
class SciMod(s_module.CoreModule):
@staticmethod
def getBaseModels():
modl = {}
name = 'sci'
return ((name, modl),)
| {
"content_hash": "7a17a6d1f5ea4c4f3579ccb31020e237",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 37,
"avg_line_length": 20.88888888888889,
"alnum_prop": 0.5957446808510638,
"repo_name": "vivisect/synapse",
"id": "f0a0bb909726123f8a5e58dcea9596bebf2ca4ce",
"size": "188",... |
import win32ui
from pywin.mfc import docview
from pywin import default_scintilla_encoding
import scintillacon
import win32con
import string
import os
import codecs
import re
crlf_bytes = "\r\n".encode("ascii")
lf_bytes = "\n".encode("ascii")
# re from pep263 - but we use it both on bytes and strings.
re_encoding_byte... | {
"content_hash": "749eb8d55b426f5ed88a4abbfbdc7457",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 109,
"avg_line_length": 34.434306569343065,
"alnum_prop": 0.7048224695283519,
"repo_name": "mollstam/UnrealPy",
"id": "7dd39596f0afd42b49232c0c78fafd7fd8a545e1",
"size": "... |
"""
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the... | {
"content_hash": "8d88404597298df46d1e6b6647a5b1ee",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 186,
"avg_line_length": 31.632478632478634,
"alnum_prop": 0.5474196163199135,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "11591bb374079a25faf8a6f815b3fe76c9bfff0e",
... |
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import os
import vm
vm_ops = None
image_ops = None
def test():
global vm_ops
global image_ops
vm_ops = vm.VM()
image = test_lib.lib_get_specific_stub(suite_name='e2e_mini/image', specific_name='image')
imag... | {
"content_hash": "e4e453d6482944b5119eb81ddd71818c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 94,
"avg_line_length": 29.073170731707318,
"alnum_prop": 0.6820469798657718,
"repo_name": "zstackio/zstack-woodpecker",
"id": "7a84367ad8280f140bc7e0ac48c09cc7772cd183",
"s... |
import base64
import datetime
import sys
from protorpc import message_types
from protorpc import messages
import six
from six.moves import urllib_parse
import unittest2
from apitools.base.py import base_api
from apitools.base.py import encoding
from apitools.base.py import http_wrapper
class SimpleMessage(messages.... | {
"content_hash": "478a80fefd07876fddd370bc36267ae9",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 79,
"avg_line_length": 40.120535714285715,
"alnum_prop": 0.6513853343718705,
"repo_name": "r3tard/BartusBot",
"id": "7758c434aa7c93c5e886c1f17823f0d42f4ed9bc",
"size": "89... |
"""This example module shows how to generate 2D terrain or noise with
no dependency, for Python2 and Python3."""
from __future__ import print_function
import random, math
import thornoise.purepython.noisegen as ng
if __name__ == "__main__":
#declare a colorscale
summer = ng.ColorScale([ [(0,0,0), (0,0,100), ... | {
"content_hash": "36d32a9f99a5b236ab0ec95e464c75b8",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 87,
"avg_line_length": 46.77358490566038,
"alnum_prop": 0.5260185558693021,
"repo_name": "YannThorimbert/PyWorld2D",
"id": "6c36a0b85c369c331ae9c15fdd48df28493845d6",
"size... |
"""
.. module:: django_core_models.core.tests.factories
:synopsis: core models application unit test factories module.
*core models* application unit test factories module.
"""
from __future__ import absolute_import, print_function
import factory.fuzzy
from django_core_utils.tests.factories import (NamedModelFac... | {
"content_hash": "b44ad294ed418db011b2984b6f2b6243",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 69,
"avg_line_length": 27.283333333333335,
"alnum_prop": 0.6682956627978008,
"repo_name": "ajaniv/django-core-models",
"id": "e5ccd08c192ec2ca167529952c90169645177190",
"si... |
"""The TestStream implementation for the DirectRunner
The DirectRunner implements TestStream as the _TestStream class which is used
to store the events in memory, the _WatermarkController which is used to set the
watermark and emit events, and the multiplexer which sends events to the correct
tagged PCollection.
"""
... | {
"content_hash": "ef1897ef8a95313618592e557a7acfd4",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 80,
"avg_line_length": 36.979166666666664,
"alnum_prop": 0.7096177062374246,
"repo_name": "iemejia/incubator-beam",
"id": "a32a1149cdee96a07e2cc802762a64c62c72a1f3",
"size... |
"""
Book: Building RESTful Python Web Services
Chapter 6: Working with models, SQLAlchemy, and hyperlinked APIs in Flask
Author: Gaston C. Hillar - Twitter.com/gastonhillar
Publisher: Packt Publishing Ltd. - http://www.packtpub.com
"""
from flask import Flask
from flask_restful import abort, Api, fields, marshal_with, ... | {
"content_hash": "eaad3e202b8f68415b7a0fd6edc21ced",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 114,
"avg_line_length": 32.3859649122807,
"alnum_prop": 0.6411159263271939,
"repo_name": "xianjunzhengbackup/code",
"id": "5d453cc476801292151346d3ec7519ff89ab95e4",
"size... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('story', '0008_auto_20170213_2310... | {
"content_hash": "e9a3e1a78834e818af6e211d5fce6bbd",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 118,
"avg_line_length": 39.8125,
"alnum_prop": 0.6208791208791209,
"repo_name": "OrhanOdabasi/weirdbutreal",
"id": "8df01b5832b3c33f7667e7cefb382f69cd118daf",
"size": "1347... |
import json
import sys
import unittest
from unittest import mock
from unittest.mock import patch
import kubernetes.client.models as k8s
import pendulum
import pytest
from kubernetes.client.api_client import ApiClient
from kubernetes.client.rest import ApiException
from airflow.exceptions import AirflowException
from ... | {
"content_hash": "d25f1547d23d57f0f21e0b018bf7bbbe",
"timestamp": "",
"source": "github",
"line_count": 601,
"max_line_length": 103,
"avg_line_length": 37.22129783693843,
"alnum_prop": 0.5320071524362986,
"repo_name": "apache/incubator-airflow",
"id": "683400886d5fad172cbc641d9b9405fbb13d5be2",
"si... |
"""
GetExternalIPAction sends the external IP of the current machine
"""
# Operation specific imports
from future.moves.urllib.request import urlopen
import json
import LingerActions.LingerBaseAction as lingerActions
class GetExternalIPAction(lingerActions.LingerBaseAction):
"""GetExternalIPAction sends the exte... | {
"content_hash": "dee9d236d667d7dd4860e594d6acdcb5",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 86,
"avg_line_length": 35.8780487804878,
"alnum_prop": 0.7042828008157715,
"repo_name": "GreenBlast/Linger",
"id": "0169974329333fd16e30326bf64b6039edb5043f",
"size": "1471... |
from setuptools import setup
setup()
| {
"content_hash": "a898b3d9184e0d9f61b016006f56eb51",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 28,
"avg_line_length": 12.666666666666666,
"alnum_prop": 0.7894736842105263,
"repo_name": "snowflakedb/snowflake-sqlalchemy",
"id": "66a8ea8e7f52bf077a0e2391597a0a1128b39b44",... |
import os
import time
import re
import cookielib
import pycurl
from BeautifulSoup import BeautifulSoup
import logging
from http import http
class o2(http):
"""
"""
def __init__(self, config={}):
"""
Setup class, takes in a config for our settings
"""
http.__init__(self)
self.config = config # TODO: throw... | {
"content_hash": "0fb17596a76590041897abac713edd73",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 160,
"avg_line_length": 29.692307692307693,
"alnum_prop": 0.6697887604623356,
"repo_name": "d-fens/smspie",
"id": "36e349f86bc7ea5889d6750bae91a44cdb2c5779",
"size": "5048... |
from __future__ import absolute_import
import os
import sys
import json
from todo.commands.base import Command
from todo.utils.styles import Fore, Style
class RenameCommand(Command):
def rename_project(self, data):
"""Returns the project with the new name"""
data_copy = data.copy()
new_n... | {
"content_hash": "84fb67dc824cb39948ec55c0018bec31",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 25.64,
"alnum_prop": 0.514820592823713,
"repo_name": "francoischalifour/todo-cli",
"id": "7fa6f9581baf4e8360393e0f2d14d8f0732822bf",
"size": "1282",
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profile', '0006_auto_20160424_1511'),
('profile', '0006_auto_20160415_1337'),
]
operations = [
]
| {
"content_hash": "b8a6987af513749d026459dfc3200e20",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 47,
"avg_line_length": 18.928571428571427,
"alnum_prop": 0.6339622641509434,
"repo_name": "Axiologue/AxiologueAPI",
"id": "b33fd10de70f69772c328673dcc40384e0d344d7",
"size"... |
"""
This module contains AWS Glue Catalog Hook
"""
from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
class AwsGlueCatalogHook(AwsBaseHook):
"""
Interact with AWS Glue Catalog
:param aws_conn_id: ID of the Airflow connection where
credentials and extra configuration are stored
... | {
"content_hash": "2112e8b7a129bcb9671730be54a89592",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 137,
"avg_line_length": 33.857142857142854,
"alnum_prop": 0.5849433710859427,
"repo_name": "mtagle/airflow",
"id": "e785e5985ca7d10fe852e11f88b4c64084deae43",
"size": "529... |
"""Floating IP Pool action implementations"""
import logging
from cliff import lister
from openstackclient.common import utils
class ListFloatingIPPool(lister.Lister):
"""List floating-ip-pool command"""
log = logging.getLogger(__name__ + '.ListFloatingIPPool')
def take_action(self, parsed_args):
... | {
"content_hash": "a018da7fcdcb7cf1f1e2755910fdcb99",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 61,
"avg_line_length": 25.40740740740741,
"alnum_prop": 0.6064139941690962,
"repo_name": "metacloud/python-openstackclient",
"id": "e1da97c3d8bd2e7746d6ce6f23231b7112cbaf2c",... |
"""
commentbayes
============
An add-on to Django's contrib.comments app that adds SpamBayes filtering.
"""
from commentbayes.models import ScoredComment
from commentbayes.forms import ScoredCommentForm
def get_model():
return ScoredComment
def get_form():
return ScoredCommentForm
| {
"content_hash": "e91e6e4f247fbbfe1cddd848a9bce43b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 73,
"avg_line_length": 19.6,
"alnum_prop": 0.7482993197278912,
"repo_name": "waylan/django-spambayes",
"id": "d1a8bda927ef299f38f2da298a8d26657171382a",
"size": "294",
"b... |
from .....testing import assert_equal
from ..featuredetection import DilateMask
def test_DilateMask_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
inputBinaryVolume=dict(argst... | {
"content_hash": "2dcad3482c3081698887a49c37dbed97",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 78,
"avg_line_length": 28.61904761904762,
"alnum_prop": 0.64891846921797,
"repo_name": "iglpdc/nipype",
"id": "91fb032420e4de40f3854eed1f00ede6165ec736",
"size": "1256",
... |
import logging
import os
import sys
import warnings
import django
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
from openstack_dashboard.static_settings import get_staticfiles_dirs # noqa
warnings.formatwarning = lambda message, category, *args, **kwargs: \
... | {
"content_hash": "be5daae38f6bff2695c592a2c7012670",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 79,
"avg_line_length": 31.38658146964856,
"alnum_prop": 0.6804763843648208,
"repo_name": "VaneCloud/horizon",
"id": "93c9d4a7c9035232f74bd391a628f1774f1b1495",
"size": "10... |
"""
unit test for the loaders
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from py.test import raises
import time
import tempfile
from jinja2 import Environment, loaders
from jinja2.loaders import split_template_path
from jinja2.excepti... | {
"content_hash": "4a1c45d04e229819ab161f034f8d622a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 74,
"avg_line_length": 32.477064220183486,
"alnum_prop": 0.6711864406779661,
"repo_name": "minixalpha/SourceLearning",
"id": "8faf987b03ea7ab8d6c81a604ba057f7b5a17edd",
"s... |
import itertools
import pickle
import cPickle
from microscopes.common.rng import rng
from microscopes.lda.definition import model_definition
from microscopes.lda.model import initialize, deserialize
from microscopes.lda.testutil import toy_dataset
from nose.tools import assert_equals, assert_true, raises
from nose.to... | {
"content_hash": "b81addbba23ffa287c9c6207d7b68472",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 80,
"avg_line_length": 30.846534653465348,
"alnum_prop": 0.5869041887337506,
"repo_name": "datamicroscopes/lda",
"id": "01ce9bc442f9d80cad9906e3ffdc8979ef6a10b5",
"size": ... |
from connector import channel
from google3.cloud.graphite.mmv2.services.google.cloud_billing import (
project_billing_info_pb2,
)
from google3.cloud.graphite.mmv2.services.google.cloud_billing import (
project_billing_info_pb2_grpc,
)
from typing import List
class ProjectBillingInfo(object):
def __init__... | {
"content_hash": "858a986b52c3a6104c0b85c8e4867c3d",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 88,
"avg_line_length": 35.04347826086956,
"alnum_prop": 0.6647022332506204,
"repo_name": "GoogleCloudPlatform/declarative-resource-client-library",
"id": "d7bab3ddff6c8846508... |
import collections
class WordDistance:
# initialize your data structure here.
# @param {string[]} words
def __init__(self, words):
self.wordIndex = collections.defaultdict(list)
for i in xrange(len(words)):
self.wordIndex[words[i]].append(i)
# @param {string} word1
# @... | {
"content_hash": "3853e5ab30574ca8f2730f8edb119341",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 60,
"avg_line_length": 29,
"alnum_prop": 0.5554187192118226,
"repo_name": "kamyu104/LeetCode",
"id": "21807b273c94d8d9176b095357fe99dc4593a345",
"size": "901",
"binary": ... |
try:
from appnope import *
except ImportError:
__version__ = '0.0.5'
import sys
import platform
from distutils.version import LooseVersion as V
if sys.platform != "darwin" or V(platform.mac_ver()[0]) < V("10.9"):
from _dummy import *
else:
from ._nope import *
del sys, ... | {
"content_hash": "9fe6a744bef3f0d8052c18c0e25e2a9c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 23.714285714285715,
"alnum_prop": 0.6024096385542169,
"repo_name": "poojavade/Genomics_Docker",
"id": "014645d9a504f649cdf1c680d3ce9f30027b0f73",
"si... |
import os
import platform
from . import shell
try:
from build_swift.build_swift.wrappers import xcrun
except ImportError:
from build_swift.wrappers import xcrun
class Platform(object):
"""
Abstract representation of a platform Swift can run on.
"""
def __init__(self, name, archs, sdk_name=N... | {
"content_hash": "6eb29340f3c77c982ff6ffee0a4a2936",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 87,
"avg_line_length": 33.725903614457835,
"alnum_prop": 0.5892649816915245,
"repo_name": "allevato/swift",
"id": "6bc7abe319fb07169ea5e37b8010e3d75a55d7e4",
"size": "1161... |
from AXUI.exceptions import DriverException
class Method(object):
'''
optional interface,
this class is a method wrapper for UIElement methods, if UI API has native python lib, this class might not needed
'''
pass
class Pattern(object):
'''
optional interface,
this class is a method se... | {
"content_hash": "ab3913dae80b3e9a40b07b9b973e4506",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 118,
"avg_line_length": 35.52517985611511,
"alnum_prop": 0.6006480356419603,
"repo_name": "xcgspring/AXUI",
"id": "c7c5fa7e00a3944c02232eda8130baafa7c3c51a",
"size": "4939... |
"""Unit tests for cros_mark_as_stable.py."""
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', '..'))
from chromite.lib import cros_build_lib
from chromite.lib import cros_build_lib_unittest
fr... | {
"content_hash": "cc797cd8c3f2bc9e2d176c343adb2b62",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 38.12101910828026,
"alnum_prop": 0.6629908103592315,
"repo_name": "mxOBS/deb-pkg_trusty_chromium-browser",
"id": "5b1329e1d7fc2569b08eb59d64043a2653d0... |
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import urllib
def graph_data(stock):
ax1 = plt.subplot2grid((1, 1), (0, 0))
stock_price_url = 'http://chartapi.finance.yahoo.com/instrument/1.0/' + stock + '/chartdata;type=quote;range=10d/csv'
source_code = urllib.request.urlopen(st... | {
"content_hash": "e5bc622b29d42a25e8a603cbb2b0d717",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 121,
"avg_line_length": 37.648648648648646,
"alnum_prop": 0.6087580760947595,
"repo_name": "mayankdcoder/Matplotlib",
"id": "b33e952b500b17bdc25401f3db311382a73a1af6",
"siz... |
from pyash.core.entitysystem import EntitySystem
class IteratingSystem(EntitySystem):
"""A simple EntitySystem that iterates over each entity and calls process_entity()
for each entity every time the EntitySystem is updated. This is really just a
convenience class as most systems iterate over a list of entiti... | {
"content_hash": "a52f0a3dcc454d09e3f5e0c638046d00",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 87,
"avg_line_length": 35.146341463414636,
"alnum_prop": 0.7279666897987509,
"repo_name": "kellpossible/PyAsh",
"id": "2fc46a7c41349206f48cbc346f4d6eda19de2f63",
"size": "1... |
"""
This module provides an interface between the previous Pod
API and outputs a kubernetes.client.models.V1Pod.
The advantage being that the full Kubernetes API
is supported and no serialization need be written.
"""
from __future__ import annotations
import copy
import datetime
import hashlib
import os
import re
impo... | {
"content_hash": "c7e0b9aeccd99e03ab6ed64a4bb2cc0d",
"timestamp": "",
"source": "github",
"line_count": 507,
"max_line_length": 108,
"avg_line_length": 38.71597633136095,
"alnum_prop": 0.619440623567171,
"repo_name": "cfei18/incubator-airflow",
"id": "b120f2590812fa177306d7bb212c922c339b859d",
"siz... |
"""
Flickr OAuth support.
This contribution adds support for Flickr OAuth service. The settings
FLICKR_APP_ID and FLICKR_API_SECRET must be defined with the values
given by Flickr application registration process.
By default account id, username and token expiration time are stored in
extra_data field, check OAuthBac... | {
"content_hash": "f11d99bde29a23e86ed07b4d22cc3202",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 75,
"avg_line_length": 34.15217391304348,
"alnum_prop": 0.6330362826225334,
"repo_name": "gugu/django-social-auth-1",
"id": "39dbb79848bf76ee1b990652f56b3d790dbac996",
"siz... |
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.pdf import PDFSupport
from ingestors.support.ooxml import OOXMLSupport
class OfficeOpenXMLIngestor(Ingestor, OOXMLSupport, PDFSupport):
"""Office/Word document ingestor class.
Converts the document to PDF and ext... | {
"content_hash": "4488daeef8cf024bde002e237e7c9dcd",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 74,
"avg_line_length": 29.88,
"alnum_prop": 0.6318607764390897,
"repo_name": "alephdata/ingestors",
"id": "2b426b98a890148a69bdab8f08db0e6a4e52f775",
"size": "1494",
"bin... |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import sys
__all__ = []
def print_progress(progress, message=None, out=None):
"""Display a progress bar filled with a variable value. print_progress
also work... | {
"content_hash": "7e216043bcf8aafb3324e93a46587001",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 104,
"avg_line_length": 24.11965811965812,
"alnum_prop": 0.5588235294117647,
"repo_name": "bnoi/scikit-tracker",
"id": "0ab7e2065e41c3edbc6958cc274ae4c21b745239",
"size": ... |
"""
WSGI config for blog 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.7/howto/deployment/wsgi/
"""
import os
import sys
root = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(root,'..','si... | {
"content_hash": "947dc8bf9d540eda426beaf194ef345e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 27.11111111111111,
"alnum_prop": 0.7479508196721312,
"repo_name": "midori1/midorinoblog",
"id": "256b9e0184e8c6ad5a4ca055674e116b9f8cce2c",
"size": "... |
from django.conf.urls import url
from apps.autoconfig.views import autoconfig
urlpatterns = [
url(r'^config-v1.1.xml$', autoconfig),
]
| {
"content_hash": "896167d1b968381d6d1df71df0b6ec50",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 44,
"avg_line_length": 20.142857142857142,
"alnum_prop": 0.7304964539007093,
"repo_name": "dotKom/onlineweb4",
"id": "823df9703096036791b9b49c573466491085699d",
"size": "166... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.