text stringlengths 4 1.02M | meta dict |
|---|---|
def f():
return 4
def g(_):
return 5
def h():
return 6
print(f'no interpolation')
print(f"no interpolation")
print(f"""no interpolation""")
x, y = 1, 2
print(f'{x}')
print(f'{x:08x}')
print(f'a {x} b {y} c')
print(f'a {x:08x} b {y} c')
print(f'a {"hello"} b')
print(f'a {f() + g("foo") + h()} b')
def foo... | {
"content_hash": "7fadf7e04fbe7a2955ac53b4fb771087",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 21.92156862745098,
"alnum_prop": 0.6305903398926654,
"repo_name": "bvernoux/micropython",
"id": "4f7225fcad8b6d3e4a1f81dd63b01621e8550c6d",
"size": "... |
"""
PostgreSQL database backend for Django.
Requires psycopg 1: http://initd.org/projects/psycopg1
"""
from django.db.backends import *
from django.db.backends.postgresql.client import DatabaseClient
from django.db.backends.postgresql.creation import DatabaseCreation
from django.db.backends.postgresql.introspection i... | {
"content_hash": "6f72aab3f6e22aa735ec3513365b7411",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 139,
"avg_line_length": 40.27891156462585,
"alnum_prop": 0.651748015537916,
"repo_name": "weigj/django-multidb",
"id": "ad271f2e38e10c434f2ddf90a08875a7e9db6780",
"size": ... |
DOCUMENTATION = '''
---
module: gce_net
version_added: "1.5"
short_description: create/destroy GCE networks and firewall rules
description:
- This module can create and destroy Google Compue Engine networks and
firewall rules U(https://developers.google.com/compute/docs/networking).
The I(name) paramete... | {
"content_hash": "7b9a16b5a74892131451d7c47255e9e5",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 95,
"avg_line_length": 30.78030303030303,
"alnum_prop": 0.5806054639428994,
"repo_name": "mith1979/ansible_automation",
"id": "bafe6d1d43a2ef220efdc94514a5b77937363dcf",
"... |
from os.path import abspath
from re import compile as re_compile
from datadog_checks.base import ConfigurationError, is_affirmative
MAX_FILEGAUGE_COUNT = 20
class DirectoryConfig(object):
def __init__(self, instance):
if 'directory' not in instance:
raise ConfigurationError('DirectoryCheck: ... | {
"content_hash": "3ca747641ecdc73e5541fae01ba46462",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 96,
"avg_line_length": 52.54838709677419,
"alnum_prop": 0.6893799877225292,
"repo_name": "DataDog/integrations-core",
"id": "0c2bf74ed0b0e2cb4df66eb7a165472a887476eb",
"siz... |
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import User
class UserDetailView(LoginRequiredMixin, DetailVie... | {
"content_hash": "0ab6ae357a053d81e3d286496da82ef0",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 30.62264150943396,
"alnum_prop": 0.6987060998151571,
"repo_name": "nikkomidoy/project_soa",
"id": "80f7bc544386799bd74ad7efedac7d9cce907efb",
"size":... |
import json
from typing import (
TYPE_CHECKING,
Awaitable,
Callable,
Collection,
Dict,
Iterable,
List,
Mapping,
Optional,
Set,
TypeVar,
Union,
)
import jsonschema
from jsonschema import FormatChecker
from synapse.api.constants import EduTypes, EventContentFields
from sy... | {
"content_hash": "8ea1c682b5a40ca06ac40810c4e6c051",
"timestamp": "",
"source": "github",
"line_count": 512,
"max_line_length": 118,
"avg_line_length": 37.099609375,
"alnum_prop": 0.5910502763885233,
"repo_name": "matrix-org/synapse",
"id": "a9888381b4512988eb3dc0f3cc19e3444fe7e839",
"size": "19709... |
import os
import re
import sys
from setuptools import setup
execfile(os.path.join("openobject", "release.py"))
version_dash_incompatible = False
if 'bdist_rpm' in sys.argv:
version_dash_incompatible = True
try:
import py2exe
from py2exe_utils import opts
version_dash_incompatible = True
except Import... | {
"content_hash": "55fb5a56156010178d18a1c350406db0",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 96,
"avg_line_length": 28.376470588235293,
"alnum_prop": 0.5762852404643449,
"repo_name": "inafev/openerpappliance",
"id": "6c1831645667273cbf5a9a6afadf8fde595d5de1",
"size... |
import Gaffer
import GafferTest
import GafferUI
import GafferUITest
class PlugLayoutTest( GafferUITest.TestCase ) :
def testRenamingPlugs( self ) :
n = Gaffer.Node()
n["a"] = Gaffer.IntPlug( flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )
ui = GafferUI.PlugLayout( n )
w = ui.plugValueWidge... | {
"content_hash": "2e28ac578afde7d53ca724b6927c820c",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 123,
"avg_line_length": 29.951612903225808,
"alnum_prop": 0.6303177167474421,
"repo_name": "goddardl/gaffer",
"id": "03296036ac8c1bf0be94ed95262c78ab924f3775",
"size": "55... |
import errno
import json
import os
import subprocess
import sys
from collections import defaultdict
MISC_XML = """<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component
name="ProjectRootManager"
version="2"
languageLevel="%(java_language_level)s"
assert-keyword="true"
jdk-15="t... | {
"content_hash": "bee94b9d5e846efa9e8a99adde98e4d1",
"timestamp": "",
"source": "github",
"line_count": 615,
"max_line_length": 127,
"avg_line_length": 37.60650406504065,
"alnum_prop": 0.577957454168108,
"repo_name": "1yvT0s/buck",
"id": "dad2c5cd993d0b6daabec8753490c75ca3b9b12a",
"size": "23128",
... |
import shlex
import subprocess
import time
import pytest
import fsspec
pytest.importorskip("paramiko")
def stop_docker(name):
cmd = shlex.split('docker ps -a -q --filter "name=%s"' % name)
cid = subprocess.check_output(cmd).strip().decode()
if cid:
subprocess.call(["docker", "rm", "-f", cid])
... | {
"content_hash": "e9b3c5d9983255bdddce68f347607890",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 83,
"avg_line_length": 30.36521739130435,
"alnum_prop": 0.5947880870561283,
"repo_name": "intake/filesystem_spec",
"id": "a0ba10d825dcf58b880e0f324a47acbdf8215190",
"size"... |
from silverflask import db
from tests.test_base import BaseTest
from silverflask.models import DataObject
from silverflask.mixins import OrderableMixin
class OrderedItem(OrderableMixin, DataObject, db.Model):
def __repr__(self):
return "<OrderedItem id: %s, sort_order: %s>" % (self.id, self.sort_order)
c... | {
"content_hash": "430f7bb8768d647132b0fad8caf059e2",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 82,
"avg_line_length": 30.020408163265305,
"alnum_prop": 0.619986403806934,
"repo_name": "wolfv/SilverFlask",
"id": "66308a2d0d5e83eb712d181559291c9d0e4a8ac5",
"size": "151... |
from django import forms
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.db.models.base import ModelBase
from django.forms.forms import DeclarativeFieldsMetaclass
from django.forms.utils import flatatt
from django.... | {
"content_hash": "be9fd7816ae3fdd9c6ee55fad99191a3",
"timestamp": "",
"source": "github",
"line_count": 662,
"max_line_length": 134,
"avg_line_length": 35.26737160120846,
"alnum_prop": 0.584314901272112,
"repo_name": "A425/django-nadmin",
"id": "1ee2bd7184785b8279a087e6b4e5da59e73277c6",
"size": "2... |
import logging
import flask
import flask_cors
from docker_registry.core import compat
from docker_registry.core import exceptions
json = compat.json
from . import storage
from . import toolkit
from .lib import mirroring
from .lib import signals
from .app import app
store = storage.load()
logger = logging.getLogge... | {
"content_hash": "3df1fbb73d881da53f5c0d9e45c13553",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 77,
"avg_line_length": 35.08955223880597,
"alnum_prop": 0.6695023394300298,
"repo_name": "nicescale/docker-registry",
"id": "3737bd8a9c823abd77b12e73fa3d8c7390399d20",
"si... |
import os
import sys
from airflow import configuration as conf
from importlib import import_module
def prepare_classpath():
"""
Ensures that the Airflow home directory is on the classpath
"""
config_path = os.path.join(conf.get('core', 'airflow_home'), 'config')
config_path = os.path.expanduser(c... | {
"content_hash": "ba62f085e84a75b5719bbd106bd33018",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 86,
"avg_line_length": 28.77777777777778,
"alnum_prop": 0.665057915057915,
"repo_name": "adamhaney/airflow",
"id": "51c6adf4e642c3f8f90dcd4e543c3440cced0c1f",
"size": "1847... |
class MPNeuron(object):
def __init__(self, threshold, inputs):
self.threshold = threshold
self.inputs = inputs
def activate(self):
excitations = 0
for trigger in self.inputs:
if trigger.excitatory:
excitations += trigger.value
else:
... | {
"content_hash": "ed724017f0440cab5945840c21c01854",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 62,
"avg_line_length": 28.37037037037037,
"alnum_prop": 0.5313315926892951,
"repo_name": "mcneela/Retina",
"id": "36d5e67fcc7fa33cbd16cc2c743cf195f0bff33d",
"size": "2298",... |
"""The tests for the device tracker component."""
# pylint: disable=protected-access
import asyncio
import json
import logging
import unittest
from unittest.mock import call, patch
from datetime import datetime, timedelta
import os
from homeassistant.components import zone
from homeassistant.core import callback
from ... | {
"content_hash": "f10fa50d3353e9c7a08ee3d68d6f1d29",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 79,
"avg_line_length": 41.99088145896656,
"alnum_prop": 0.5866087585957293,
"repo_name": "kyvinh/home-assistant",
"id": "4f932cd177fac522b39bb649025ceaa49f8ee934",
"size":... |
from webob import exc
import nova
from nova.api.openstack import common
from nova.api.openstack.compute.views import addresses as views_addresses
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.i18n import _
ALIAS = 'ips'
class IPsController(wsgi.Controller):
"""The serve... | {
"content_hash": "d657f3a53c339b5ccc6d71171db7c214",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 73,
"avg_line_length": 31.5,
"alnum_prop": 0.6458333333333334,
"repo_name": "jumpstarter-io/nova",
"id": "cfdbacf44c0c18e92483b221a3588a6abfc487c6",
"size": "2652",
"bina... |
from __future__ import annotations
import unittest
from unittest import mock
import pytest
from airflow.exceptions import AirflowException
from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
from airflow.providers.amazon.aws.sensors.sagemaker import SageMakerTransformSensor
DESCRIBE_TRANSFORM_INP... | {
"content_hash": "34bcb422ccc799c06b9190d9d5e9b93f",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 98,
"avg_line_length": 33.9041095890411,
"alnum_prop": 0.6787878787878788,
"repo_name": "cfei18/incubator-airflow",
"id": "860f5c5d43a0bf9f1b22901bab8e6a7ba98b0b7b",
"size"... |
"""Create pose regression dataset.
Given a CAD directory structured like:
CAD
Object Class
Object files
Render objects at different rotations and save the image and angle of rotation.
Warning: Overwrites pusher.xml in gym package.
"""
from __future__ import print_function
import contextlib
import logging
impor... | {
"content_hash": "bcc94f86dd13d7d99a4d816601d8a37c",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 80,
"avg_line_length": 27.886497064579256,
"alnum_prop": 0.5771228070175438,
"repo_name": "google-research/google-research",
"id": "fa722c4ee0e6a41a384c8f626604943838750eb0"... |
import json
from . import http
from app import app
from common.db import session
from common import utils
from flask import session as sess
from models.feedback import Feedback
def test_create_feedback():
with app.test_client() as c:
with c.session_transaction() as s:
s["is_login"] = True
... | {
"content_hash": "9ec65486eb74a254a4d9e16c6b07ef2e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 31.77777777777778,
"alnum_prop": 0.6381118881118881,
"repo_name": "livoras/feifanote-server",
"id": "e64d7792386505c9edd417086366907299962e52",
"size... |
"""d4rl_adroit_hammer dataset."""
from typing import Any
from tensorflow_datasets.d4rl import dataset_builder
import tensorflow_datasets.public_api as tfds
class D4rlAdroitHammer(dataset_builder.D4RLDatasetBuilder):
"""DatasetBuilder for d4rl_adroit_hammer dataset."""
VERSION = tfds.core.Version('1.1.0')
RELE... | {
"content_hash": "ab292ced3cdb9839a8d3911698cf0bcc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 30.59090909090909,
"alnum_prop": 0.6909361069836553,
"repo_name": "tensorflow/datasets",
"id": "f2162ae668fcea83f5a0ef7cf27d2b6df77b3a17",
"size": "1... |
from boolalg import to_cnf, And, Or, Not, Xor, Nand, Nor, Implies, Equivalent, ITE
from inference import satisfiable
| {
"content_hash": "bd40584759c5cc6f9884a7bd09dd6cb4",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 82,
"avg_line_length": 58.5,
"alnum_prop": 0.7692307692307693,
"repo_name": "Cuuuurzel/KiPyCalc",
"id": "98ccdfde4db5e02bd8621406baf6140adbe258c0",
"size": "117",
"binary"... |
"""
=====================================
Creating MNE objects from data arrays
=====================================
In this simple example, the creation of MNE objects from
numpy arrays is demonstrated. In the last example case, a
NEO file format is used as a source for the data.
"""
# Author: Jaakko Leppakangas <ja... | {
"content_hash": "5320af6e7861fa22d00392765f46d90c",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 79,
"avg_line_length": 34.457317073170735,
"alnum_prop": 0.5937002300477792,
"repo_name": "mne-tools/mne-tools.github.io",
"id": "c7444b149c29ad9ed1d558efddc9b05408849269",
... |
"""
A module for helper functions to read SNANA simulations
"""
from __future__ import absolute_import
import numpy as np
import sncosmo
try:
from . import filters
except:
print('This may fail without the throughputs directory')
__all__ = ['SnanaSims']
class SnanaSims(object):
"""
class to hold da... | {
"content_hash": "74e77e2be8ebf92fc15838541692bfe6",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 85,
"avg_line_length": 33.916666666666664,
"alnum_prop": 0.5753721636074577,
"repo_name": "lisaleemcb/sncosmo_lc_analysis",
"id": "32b0ae3090629d2577f6e9f82c4364724dfd547f",... |
"""This code example creates a new mobile line item. Mobile features needs to be
enabled in your account to use mobile targeting. To determine which line
items exist, run get_all_line_items.py. To determine which orders exist, run
get_all_orders.py. To determine which placements exist, run
get_all_placements.py."""
__... | {
"content_hash": "271155efa0c9ce00be8097fd2fe27018",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 80,
"avg_line_length": 32.770833333333336,
"alnum_prop": 0.5940877304513669,
"repo_name": "krux/adspygoogle",
"id": "6141303870c15ac7a59a296819c192fdd960ab0f",
"size": "376... |
import webob
from nova.openstack.common import jsonutils
from nova import test
from nova.tests.api.openstack import fakes
NS = {
'atom': 'http://www.w3.org/2005/Atom',
'ns': 'http://docs.openstack.org/common/api/v1.0'
}
EXP_LINKS = {
'v2.0': {
'html': 'http://docs.openstack.org/'
},
'v3.0'... | {
"content_hash": "e308947b757ab1c89c00a1ce465e1d42",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 75,
"avg_line_length": 31.946564885496183,
"alnum_prop": 0.5388291517323776,
"repo_name": "viggates/nova",
"id": "b3aab297613bbab5d35ff37fa1c07f3c8d656174",
"size": "4830"... |
import numpy as np
import math
i_d = 0
i_u = 1
i_pbd = 2
i_pbu = 3
i_b = 4
i_ibt = 5
class Classifier:
def __init__(self, label):
self.label = label
self.inter_burst_times = np.array([])
self.num_burst = np.array([])
self.per_burst_dn = np.array([])
self.per_burst_up = np.array([])
self.tot_cells_dn = n... | {
"content_hash": "b34b65c83e883d3b65f92e493facf375",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 70,
"avg_line_length": 25.095541401273884,
"alnum_prop": 0.6593908629441624,
"repo_name": "chhans/tor-automation",
"id": "f104288ca918162fddfe19620d7bc18861b97dc5",
"size"... |
from openturns import *
TESTPREAMBLE()
try:
try:
# Test function operator ()
levelFunction = NumericalMathFunction(
["x1", "x2", "x3", "x4"], ["y1"], ["x1+2*x2-3*x3+4*x4"])
specific = CobylaSpecificParameters()
startingPoint = NumericalPoint(4, 1.0)
myAlgorithm... | {
"content_hash": "b1114400f8bda14b21b12ce440513aa3",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 32.18518518518518,
"alnum_prop": 0.6570771001150748,
"repo_name": "sofianehaddad/ot-svn",
"id": "c897e6b6c060c23fa0b69059f341f27adc992c27",
"size": "... |
from fs.mountfs import MountFS
from fs.memoryfs import MemoryFS
import unittest
class TestMountFS(unittest.TestCase):
def test_auto_close(self):
"""Test MountFS auto close is working"""
multi_fs = MountFS()
m1 = MemoryFS()
m2 = MemoryFS()
multi_fs.mount('/m1', m1)
... | {
"content_hash": "988e69ba9764cf26bc4b078671968cef",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 105,
"avg_line_length": 35.88,
"alnum_prop": 0.5982905982905983,
"repo_name": "alekibango/pyfilesystem",
"id": "b2a3adaa7c766027b77edb92c855f047d71709f2",
"size": "2691",
... |
"""
Program to test that all methods/functions have at least one example
doctest. Also checks if docstrings are imported into Sphinx. For this to
work, the Sphinx docs need to be built first. Use "cd doc; make html" to
build the Sphinx docs.
Usage:
./bin/coverage_doctest.py sympy/core
or
./bin/coverage_doctest.py... | {
"content_hash": "9321cef804a530b776f27e245ffeb982",
"timestamp": "",
"source": "github",
"line_count": 648,
"max_line_length": 141,
"avg_line_length": 33.02160493827161,
"alnum_prop": 0.5467333395644453,
"repo_name": "hrashk/sympy",
"id": "944157b1a35a203d85ccccca4c62477542302182",
"size": "21421"... |
from __future__ import print_function
import os
import sys
import tempfile
from target_test import FileSystemTargetTestMixin
from helpers import with_config, unittest
from boto.exception import S3ResponseError
from boto.s3 import key
from moto import mock_s3
from luigi import configuration
from luigi.s3 import FileN... | {
"content_hash": "c4577248756e56162bb443e0566eb570",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 95,
"avg_line_length": 38.00754716981132,
"alnum_prop": 0.6320492454328832,
"repo_name": "glenndmello/luigi",
"id": "45f1ccd8357e7de877415a910ac290bee184184c",
"size": "10... |
"""Elastic Search indexes for Data model."""
import elasticsearch_dsl as dsl
from resolwe.elastic.fields import Name, ProcessType
from resolwe.elastic.indices import BaseIndex
from ..models import Data
from .base import BaseDocument, BaseIndexMixin
class DataDocument(BaseDocument):
"""Document for data search."... | {
"content_hash": "09d24bfd5a7c75100664bf3f0fd6d0ee",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 28.69333333333333,
"alnum_prop": 0.6305762081784386,
"repo_name": "jberci/resolwe",
"id": "d3f50f40d92eb90b58df6987739b22d1eab92af8",
"size": "2152",... |
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='base.html')),
url(r'^admin/', include(admin.site.urls)),
]
if settings.DEBUG:
import deb... | {
"content_hash": "dda63c216279781599ab92b9211579ce",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 26,
"alnum_prop": 0.6923076923076923,
"repo_name": "donnex/django-docker-coookiecutter",
"id": "007efac1b8e1a22e52bbe19fdebc574979799f64",
"size": "4... |
import sys, urllib, urllib2, time, os, math
import httplib
try:
from optparse import OptionParser
except ImportError:
OptionParser = False
# setting this to True will exchange more useful error messages
# for privacy, hiding URLs and error messages.
HIDE_ALL = False
class WMS (object):
fields = ("bbox",... | {
"content_hash": "72ebcbead7532f626db1e03ab198749f",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 218,
"avg_line_length": 42.74251497005988,
"alnum_prop": 0.5462314373774166,
"repo_name": "DistributedOpenUnifiedGovernmentNetwork/mapwarper",
"id": "b2e05f94349a84309eeaedf... |
import copy
import os
from django.utils.log import DEFAULT_LOGGING
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)
# Application definition
INSTALLED_APPS = [
'wagtail.wagtailusers',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
... | {
"content_hash": "6fc4f2d2354256268b596a212d006981",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 82,
"avg_line_length": 25.966666666666665,
"alnum_prop": 0.6903080872913993,
"repo_name": "ychab/privagal",
"id": "af43f17f6af1b80562e27a1a3c8ba455fc793b51",
"size": "3116... |
from __future__ import absolute_import
import warnings
warnings.warn("DEAD: Broken module", UserWarning, stacklevel=2)
DEAD = True
if not DEAD:
import re
import six
from gherkin.formatter import filters
re_type = type(re.compile(''))
class FilterError(Exception):
pass
class Filter... | {
"content_hash": "21ae8d73ec735d620c14919f55b1a69a",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 87,
"avg_line_length": 35.875,
"alnum_prop": 0.5472319008904375,
"repo_name": "allanlewis/behave",
"id": "858a60af4a7f0525565477677586efea9021d2a3",
"size": "5200",
"bin... |
from django.db import models
class DNSIncrementalManager(models.Manager):
def get_query_set(self):
return super(DNSIncrementalManager, self).get_query_set().filter(ttype='dns-incremental') # noqa
class DNSFullManager(models.Manager):
def get_query_set(self):
return super(DNSFullManager, sel... | {
"content_hash": "7cbb40b5d21ecdc03c0d50eed30d848c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 105,
"avg_line_length": 31.980392156862745,
"alnum_prop": 0.6468424279583078,
"repo_name": "rtucker-mozilla/inventory",
"id": "a469a5ddabb405c49b83a9cc392c843fc23309a1",
"s... |
from __future__ import unicode_literals, division, absolute_import
from flask import jsonify
from flask_restplus import inputs
from flexget.api import api, APIResource
from flexget.api.app import etag, BadRequest, NotFoundError
from flexget.plugin import get_plugin_by_name
tmdb_api = api.namespace('tmdb', descriptio... | {
"content_hash": "38ac90c496e4a224184ff8a8b1345417",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 119,
"avg_line_length": 39.675438596491226,
"alnum_prop": 0.5604687154543445,
"repo_name": "sean797/Flexget",
"id": "bb2660f9c1416a90bbb819c1ed7b58d2639e00e0",
"size": "45... |
import random
from direct.directnotify import DirectNotifyGlobal
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import ClockDelta
from direct.interval.IntervalGlobal import *
from direct.task import Task
from otp.ai.AIBase import *
from otp.level import BasicEntities
from otp.level import D... | {
"content_hash": "f8a93fc1944ce4a2527ec74acf430794",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 118,
"avg_line_length": 33.51401869158879,
"alnum_prop": 0.6422197434467373,
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"id": "aa099c8b265c4cacfa929e70467b933ba28... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.add_image, 'image1', 'root', os.environ.get('isoForVmUrl')],
[TestAction.create_vm_by_image, 'image1',... | {
"content_hash": "b2023886f7938d7f066501cf10e81dfc",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 104,
"avg_line_length": 40.138888888888886,
"alnum_prop": 0.6878892733564014,
"repo_name": "zstackio/zstack-woodpecker",
"id": "527f3ead4dd927235e5daa0f2a173a79c5504951",
"... |
from praw.models import User
from .. import UnitTest
class TestUser(UnitTest):
def test_me__in_read_only_mode(self):
assert self.reddit.read_only
user = User(self.reddit)
assert user.me() is None
| {
"content_hash": "0558efe5a3669dcad03f4189fa9d8dd5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 41,
"avg_line_length": 22.7,
"alnum_prop": 0.6607929515418502,
"repo_name": "leviroth/praw",
"id": "1542fb46310fafea9c7fba9f0838902e999f8e35",
"size": "227",
"binary": fa... |
from cms.models import Page
from cms.models.titlemodels import Title
from cms.utils import i18n
from collections import defaultdict
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.db.models.signals import post_save, post_delete
from django.ut... | {
"content_hash": "4271d1f3c6b3ce175c30fb164763ab24",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 125,
"avg_line_length": 37.19387755102041,
"alnum_prop": 0.6710562414266118,
"repo_name": "chrisglass/django-cms",
"id": "f40a7631780a46081b0d63d256f479f8ffc83418",
"size":... |
DEFAULT_BAUDRATE = 38400
import sys
if (hasattr(sys, 'implementation') and
sys.implementation.name == 'micropython'):
# if using pyBoard
from pyb import UART as uart_base
else:
from serial import Serial as uart_base
from obdlib.logging import logger
class UART(object):
def __init__(self)... | {
"content_hash": "cb7f7495be83d6d85813840df4ba928b",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 27.589285714285715,
"alnum_prop": 0.5372168284789643,
"repo_name": "s-s-boika/obdlib",
"id": "d41fccb7523d2734e1207ea00040f62a02a41e0c",
"size": "154... |
"""Django ORM models for Social Auth"""
import six
from django.db import models
from django.conf import settings
from django.db.utils import IntegrityError
from social.utils import setting_name
from social.storage.django_orm import DjangoUserMixin, \
DjangoAssociationMixin, \
... | {
"content_hash": "2b988dca993972bb8a97740fda17311a",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 76,
"avg_line_length": 34.2952380952381,
"alnum_prop": 0.6523188003332407,
"repo_name": "duoduo369/python-social-auth",
"id": "cf886b9766839f036cfe30c868a5cef9b3ab4565",
"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weibo_admin.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
raise ImportEr... | {
"content_hash": "b9e3301d01593e32dcaedcc9bafcfa41",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 77,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.6056105610561056,
"repo_name": "ResolveWang/WeiboSpider",
"id": "b73b94e2a3c3a8583b5f7c6ed4ad3bc7cc37385e",
"size... |
from flask.ext.wtf import Form
from wtforms import TextField, BooleanField
from wtforms.validators import Required
class LoginForm(Form):
openid = TextField("openid", validators=[Required()])
remember_me = BooleanField("remember_me", default=False)
| {
"content_hash": "387b041f046939ce9a177250cd7e5854",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 32.375,
"alnum_prop": 0.7683397683397684,
"repo_name": "pkulev/c3",
"id": "a6a340aa5f0a4c37623e95df171d07e2217f4c26",
"size": "259",
"binary": false... |
import tensorflow as tf
import numpy as np
import traceback
from .param import Variable, Parameterized, graph_key
from .tf_wraps import clip
from ._settings import settings
float_type = settings.dtypes.float_type
np_float_type = np.float32 if float_type is tf.float32 else np.float64
class MatBias(Parameterized):
d... | {
"content_hash": "ed7e0416c303343b294d0c3a78e88c2a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 82,
"avg_line_length": 39.5632183908046,
"alnum_prop": 0.530796048808832,
"repo_name": "fujii-team/Henbun",
"id": "37b94b00181766fb384062e9f30748c22ba7007a",
"size": "3442"... |
from __future__ import division
from __future__ import absolute_import
from __future__ import with_statement
from __future__ import print_function
from __future__ import unicode_literals
from flask import Module, request, Response, jsonify
from babel import localedata
from stutuz.extensions import db
mod = Module(_... | {
"content_hash": "957da27a5fe0cb03bf4c65c1edda7c10",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 76,
"avg_line_length": 31.34090909090909,
"alnum_prop": 0.6519216823785352,
"repo_name": "dag/stutuz",
"id": "077877f4adf0ba9f6f7bcf80e77fab76e82d90ee",
"size": "1402",
"... |
selected = {}
for l in open("survey.txt", 'r'):
teams = frozenset(l.split())
if teams in selected:
selected[teams] += 1
else:
selected[teams] = 1
notSelected = {"Bel", "Eng", "Ger", "Fra", "Ita", "Spa", "Cam"}
for teams in selected.keys():
notSelected = notSelected.difference(teams)
prin... | {
"content_hash": "401b091b25852dc8297a8373ff18324f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 74,
"avg_line_length": 35.294117647058826,
"alnum_prop": 0.6183333333333333,
"repo_name": "JoachimVandersmissen/CodingSolutions",
"id": "755b7ee4ab130335011c7f29ca8bea249b82c... |
import unittest
import IECore
import Gaffer
import GafferImage
import GafferImageTest
class ConstantTest( GafferImageTest.ImageTestCase ) :
def testChannelData( self ) :
constant = GafferImage.Constant()
constant["format"].setValue( GafferImage.Format( IECore.Box2i( IECore.V2i( 0 ), IECore.V2i( 511 ) ), 1 ) )... | {
"content_hash": "440e917ad3ed9640803abd307be0cda0",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 108,
"avg_line_length": 32.465648854961835,
"alnum_prop": 0.6447213731483659,
"repo_name": "chippey/gaffer",
"id": "d93a3301a35663264b31a9930568ca7f073837b5",
"size": "611... |
from __future__ import absolute_import
from __future__ import division
from six import text_type
from typing import Any, Dict, List, Tuple, Optional, Sequence, Callable, Union
from django.db import connection
from django.db.models.query import QuerySet
from django.template import RequestContext, loader
from django.cor... | {
"content_hash": "3971eee47884fee60e01560184e9acbd",
"timestamp": "",
"source": "github",
"line_count": 925,
"max_line_length": 106,
"avg_line_length": 30.393513513513515,
"alnum_prop": 0.5269616561143914,
"repo_name": "umkay/zulip",
"id": "3f48f187ec24d0b10a7067386a7d3bdd6906b85e",
"size": "28114"... |
import numpy as np
from capstone.datasets.ucic4 import get_random_win_game, get_random_loss_game
from capstone.game.players.kerasplayer import KerasStatePlayer
from capstone.game.players import RandPlayer
from capstone.game.utils import play_match, play_series
from capstone.utils import print_aec, str_aec
keras = Kera... | {
"content_hash": "6d0303c2d21d4d551a25f7c1579a4861",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 77,
"avg_line_length": 27.704545454545453,
"alnum_prop": 0.6735028712059065,
"repo_name": "davidrobles/mlnd-capstone-code",
"id": "9c22cb5036a6f44120b730d9fe66be81c914d06e",
... |
'''Mikes wrapper for the visualizer???'''
from contextlib import contextmanager
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
import OpenGL
__all__ = '''
gl
glu
glut
'''.strip().split()
class ModuleProxy(object):
def __init__(self, name, module):
self.name = na... | {
"content_hash": "552350a1086a4c9335782165397e41e8",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 71,
"avg_line_length": 27.288659793814432,
"alnum_prop": 0.5477899508877975,
"repo_name": "pupil-labs/PyAV",
"id": "8c755b2b98bad61fea5e30959ebe0d82fe56a416",
"size": "2647... |
"""
Pynba
~~~~~
:copyright: (c) 2015 by Xavier Barbosa.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import, unicode_literals
from .local import LOCAL_STACK
from functools import wraps
from pynba.core import logger
__all__ = ['LocalProxy']
class LocalProxy(objec... | {
"content_hash": "9bfb0df3fad218acc119d9997c427b6e",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 76,
"avg_line_length": 29.349206349206348,
"alnum_prop": 0.5581395348837209,
"repo_name": "johnnoone/pynba",
"id": "34fd5f7392363f5d3c165050fc39bfa31a67afb0",
"size": "1849... |
"""habersitesi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | {
"content_hash": "c1495c80466bb0caa7217f39f8620296",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 117,
"avg_line_length": 44.5625,
"alnum_prop": 0.6914446002805049,
"repo_name": "hirmak/habersitesi",
"id": "b8ed7d71bf191a7510c4348caa093d47c37eb50b",
"size": "1426",
"b... |
"""
__find_two_match_elements_same_type_diff_rules_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: levi
Modified: Thu Aug 22 11:40:12 2013
______________________________________________________________________________________________... | {
"content_hash": "f7033fd3fc5e68c55ebfdc6414d706df",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 625,
"avg_line_length": 46.763636363636365,
"alnum_prop": 0.6412130637636081,
"repo_name": "levilucio/SyVOLT",
"id": "1fd8a4fe88e7d49111e4dc448eab5324d43798f0",
"size": "1... |
"""Classes to read from and write to SQLite databases."""
import re
import sqlite3
class Sqlite3DatabaseFile(object):
"""SQLite3 database file."""
_HAS_TABLE_QUERY = (
'SELECT name FROM sqlite_master '
'WHERE type = "table" AND name = "{0:s}"')
def __init__(self):
"""Initializes a database f... | {
"content_hash": "109522765e00f5cc7faada0f9044d363",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 79,
"avg_line_length": 29.703241895261847,
"alnum_prop": 0.6490638905213668,
"repo_name": "libyal/esedb-kb",
"id": "66660bb24d9a24e6cdd6c1b7bccab68d5e85c125",
"size": "119... |
def sanitize(time_string):
if '-' in time_string:
splitter = '-'
elif ':' in time_string:
splitter = ':'
else:
return(time_string)
(mins, secs) = time_string.split(splitter)
return(mins + '.' + secs)
def get_coach_data(filename):
try:
with open(filename) as f:
... | {
"content_hash": "218edaa19c926011f0e0411b9b830f92",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 78,
"avg_line_length": 34,
"alnum_prop": 0.5645161290322581,
"repo_name": "tdean1995/HFPythonSandbox",
"id": "1be10a4320dc70ad84951c1dee5f735278517b77",
"size": "1055",
"... |
import json
import uuid
from oslo_log import log as logging
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from mistral.api.controllers import resource
from mistral.api.controllers.v2 import types
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc... | {
"content_hash": "0c6f631f045e4e2caad639b787b13e01",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 74,
"avg_line_length": 29.489208633093526,
"alnum_prop": 0.624786533300805,
"repo_name": "dennybaa/mistral",
"id": "87fdcce5a9bbe0ca3093f9c1bb881b33233ab8e3",
"size": "470... |
"""Functions for computing rich-club coefficients."""
from __future__ import division
import networkx as nx
from networkx.utils import accumulate
from networkx.utils import not_implemented_for
__all__ = ['rich_club_coefficient']
@not_implemented_for('directed')
@not_implemented_for('multigraph')
def rich_club_coeff... | {
"content_hash": "2ea63c90fc8c4d55031b7dd9709b6682",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 72,
"avg_line_length": 34.73504273504273,
"alnum_prop": 0.6124507874015748,
"repo_name": "cmtm/networkx",
"id": "a3bcaf0d7a60fb7c33f030e97126310a75b250a3",
"size": "4365",... |
import unittest
import AutoCorrect
class testLearn(unittest.TestCase):
def setUp(self):
self.Dictionary = AutoCorrect.Dictionary()
def tearDown(self):
self.Dictionary = None
# .learn_word
def test_learn_one_word(self):
"""Test to see if it learns one word"""
self.Dictionary.learn_word('foobar')
expect... | {
"content_hash": "fbd0427e71832febb976aee183cf3ad5",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 89,
"avg_line_length": 29.70149253731343,
"alnum_prop": 0.6412060301507537,
"repo_name": "ericcornelissen/AutoCorrect-py",
"id": "848d07f934a88ab3c0e4a2b91f3dfa4273ff0496",
... |
"""Creates a pair of recurrant models for the Stack Overflow next word prediction task.
Modified version of
tff.simulation.baselines.stackoverflow.create_word_prediction_task and dependent
functions which allows for different sized recurrant models
"""
import functools
import tensorflow as tf
import tensorflow_federat... | {
"content_hash": "6b252d5b35171fd15dc7732fad7076c2",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 87,
"avg_line_length": 41.42883548983364,
"alnum_prop": 0.5704278766787132,
"repo_name": "google-research/federated",
"id": "4b7d620a8951005371a61d8dd93676704b59876f",
"si... |
from __future__ import annotations
import hashlib
import importlib
import importlib.machinery
import importlib.util
import os
import sys
import textwrap
import traceback
import warnings
import zipfile
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, NamedTuple
from sqlalchemy.exc import Oper... | {
"content_hash": "3fc6e0ff039970ea88536378b0926a13",
"timestamp": "",
"source": "github",
"line_count": 679,
"max_line_length": 110,
"avg_line_length": 41.359351988217966,
"alnum_prop": 0.5827724958159741,
"repo_name": "apache/airflow",
"id": "8f11d7996f6d573be06507ef3fdefcd1c1147473",
"size": "288... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "196580f8a264c56895eb0664559f2070",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 362,
"avg_line_length": 38.73461538461538,
"alnum_prop": 0.6366795750173766,
"repo_name": "kubernetes-client/python",
"id": "71283a866afac5b459bd56ee768b87ad87ddb791",
"si... |
__author__ = 'Christian Heinrich'
__copyright__ = 'Copyright 2014, Haveibeenpwned Project'
__credits__ = []
__license__ = 'GPL'
__version__ = '0.1'
__maintainer__ = 'Christian Heinrich'
__email__ = 'christian.heinrich@cmlh.id.au'
__status__ = 'Development' | {
"content_hash": "e46b4bd7a99171393fc75cb6f1acb3cf",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 28.555555555555557,
"alnum_prop": 0.6459143968871596,
"repo_name": "cmlh/Maltego-Transforms",
"id": "77ed79e205d50b1e0e7206c09712423e5b0a3727",
"size"... |
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=mo... | {
"content_hash": "7f941d517b11a132c8d02f1087b28f06",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 30.5,
"alnum_prop": 0.7494145199063232,
"repo_name": "jolahde/rak",
"id": "22f469e7c0319967a6b09bd76cdb7b428dea6feb",
"size": "427",
"binary": fals... |
from treap import Treap, PersistentTreap
from sys import getrefcount
t = (Treap(PersistentTreap(Treap([[1], [2]]))))
print(getrefcount(t[0]))
| {
"content_hash": "e000e9078a3e307e137e0d7f5271ed98",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 47,
"avg_line_length": 28.6,
"alnum_prop": 0.7342657342657343,
"repo_name": "DLunin/implicit-treap",
"id": "e290aa2defe12bc65248fce998086f4a58386992",
"size": "143",
"bina... |
import datetime
from email import utils
import test.support
import time
import unittest
import sys
import os.path
class DateTimeTests(unittest.TestCase):
datestring = 'Sun, 23 Sep 2001 20:10:55'
dateargs = (2001, 9, 23, 20, 10, 55)
offsetstring = ' -0700'
utcoffset = datetime.timedelta(hours=-7)
t... | {
"content_hash": "7cfadcdc51181198ba5ae19ba9bdf41a",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 81,
"avg_line_length": 38.75714285714286,
"alnum_prop": 0.6269812016218209,
"repo_name": "olemis/brython",
"id": "e507dd2c03a4a127bbb6f3cde434227f100faffa",
"size": "5426"... |
from trove.common import wsgi
from trove.common.auth import admin_context
from trove.extensions.mgmt.volume import models
from trove.extensions.mgmt.volume import views
from trove.openstack.common import log as logging
from trove.common.i18n import _
LOG = logging.getLogger(__name__)
class StorageController(wsgi.Con... | {
"content_hash": "c1e31606fd910f38c0703ddab5828967",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 72,
"avg_line_length": 36.80952380952381,
"alnum_prop": 0.703751617076326,
"repo_name": "CMSS-BCRDB/RDS",
"id": "3359871f3d902a55b6aa2c7a9ab0259142c225d3",
"size": "1410",
... |
from twiki.factory import create_app
from tweepy import TweepError
from wikipedia import WikipediaException
import pytest
import json
import sys
PY3 = sys.version_info[0] > 2
try:
from unittest import mock
except ImportError:
import mock
def make_json(data):
if PY3:
return json.loads(data.decod... | {
"content_hash": "5dd156776327d9b5f31c50090d031f6e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 100,
"avg_line_length": 24.87878787878788,
"alnum_prop": 0.6500203004466099,
"repo_name": "justanr/twiki",
"id": "b0d167a77f20c4e65f1e1c0720131a45feb15240",
"size": "2463",... |
import numpy as np
from .base import LinearClassifierMixin
from ..feature_selection.selector_mixin import SelectorMixin
from ..svm.base import BaseLibLinear
class LogisticRegression(BaseLibLinear, LinearClassifierMixin, SelectorMixin):
"""Logistic Regression (aka logit, MaxEnt) classifier.
In the multiclass... | {
"content_hash": "5f4a6c5193790504ceeb9124d20150b6",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 78,
"avg_line_length": 37.28082191780822,
"alnum_prop": 0.6428440198419989,
"repo_name": "lucidfrontier45/scikit-learn",
"id": "71f63edf74b86dbabeac3c34c9bde9bb2bd7898b",
... |
from botocore.exceptions import ClientError
from botocore.utils import get_service_module_name
class BaseClientExceptions(object):
ClientError = ClientError
def __init__(self, code_to_exception):
"""Base class for exceptions object on a client
:type code_to_exception: dict
:param cod... | {
"content_hash": "e11d9d261fcd599e16827e866afa6d5f",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 79,
"avg_line_length": 41.6578947368421,
"alnum_prop": 0.6541377132027796,
"repo_name": "pplu/botocore",
"id": "b192a66dedba286fc48539182dd75680186365a4",
"size": "3727",
... |
import calendar
import logging
import json
import uuid
from itertools import chain
from django.contrib.auth import models as auth_models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.staticfiles.storage import staticfiles_storage
from dj... | {
"content_hash": "7bccac595e0262e87375f5b9b622ffd6",
"timestamp": "",
"source": "github",
"line_count": 791,
"max_line_length": 180,
"avg_line_length": 34.29709228824273,
"alnum_prop": 0.6574882966567143,
"repo_name": "javachengwc/hue",
"id": "7b5f78cbea172d7c4f0259c6906be46cff85ea9d",
"size": "279... |
from bson.objectid import ObjectId
__author__ = 'Rafael'
class CategoryDAO:
def __init__(self, database):
self.db = database
self.categories = self.db.categories
def add(self, category):
try:
self.categories.insert_one(category)
except Exception as e:
... | {
"content_hash": "66f187d114b296d5b1d9495e08312ffa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 94,
"avg_line_length": 28.134615384615383,
"alnum_prop": 0.5864661654135338,
"repo_name": "rafaeljec/financialcontroller",
"id": "9b4cae6173e1e1dd3051b020f4916b258c2fe1b2",
... |
from __future__ import division
import copy
import os.path
from vistrails.core.system import current_user, current_time
from vistrails.core.mashup.alias import Alias
from vistrails.core.mashup.component import Component
from vistrails.core.mashup.mashup import Mashup
class MashupController(object):
def __init__(s... | {
"content_hash": "20521e50b635a5635181466de8db6dea",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 86,
"avg_line_length": 44.53333333333333,
"alnum_prop": 0.5174877517691889,
"repo_name": "VisTrails/VisTrails",
"id": "2b376788f62d231af5dd9e7ca8ca9d75191348d4",
"size": "... |
import subprocess
import os
import os.path
import shlex
import sys
from subprocess import *
import shutil
import uuid
import glob
from common import DeviceItem
import traceback
class DiskUtil(object):
def __init__(self, patching, logger):
self.patching = patching
self.logger = logger
def get_d... | {
"content_hash": "52e759e1dd8f062ed0e2da3f5dbcfb9a",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 326,
"avg_line_length": 59.13380281690141,
"alnum_prop": 0.5668095748481601,
"repo_name": "krkhan/azure-linux-extensions",
"id": "da5f6e952c5726a934f0923e6d1bf7c6e7d9ac30",
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 5, transform = "Anscombe", sigma = 0.0, exog_count = 100, ar_order = 0); | {
"content_hash": "f71e585f35ff8f2f5ac9b986f8e2c22d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 164,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.7045454545454546,
"repo_name": "antoinecarme/pyaf",
"id": "915af4f7874b3ad35d70131e7567abb299393f7b",
"size": "26... |
from django.contrib import admin
from models import *
class BlockInline(admin.TabularInline):
model = Block
class SectionAdmin(admin.ModelAdmin):
inlines = [
BlockInline
]
admin.site.register(Block)
admin.site.register(Section, SectionAdmin)
admin.site.register(Template)
| {
"content_hash": "2fb6211542569f5f83577cf1cec4f5ec",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 42,
"avg_line_length": 17.6875,
"alnum_prop": 0.7809187279151943,
"repo_name": "igudym/twango",
"id": "059c1601cfa1f16abd8b07ebe0e0ebcfe157796b",
"size": "283",
"binary":... |
import unittest
from google.appengine.ext import testbed
from application import app
class AppEngineTestCase(unittest.TestCase):
def setUp(self):
# Flask apps testing. See: http://flask.pocoo.org/docs/testing/
app.config['TESTING'] = True
app.config['CSRF_ENABLED'] = False
self.app ... | {
"content_hash": "514879bddc158ffdf4040d73f78b7063",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 32.888888888888886,
"alnum_prop": 0.6570945945945946,
"repo_name": "rhololkeolke/apo-website",
"id": "ce03302d80c5264817f3efbc041eb4ee8d1c7108",
"siz... |
from random import getrandbits
from datetime import datetime, timedelta
import globus_sdk
from globus_sdk.exc import TransferAPIError
from tests.framework.constants import (GO_EP1_ID,
SDKTESTER1A_NATIVE1_TRANSFER_RT,
SDKTESTER2B_NATIVE1_TRAN... | {
"content_hash": "aba5cde4f4351f860e050381c69b2c85",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 38.81372549019608,
"alnum_prop": 0.5991411972720384,
"repo_name": "aaschaer/globus-sdk-python",
"id": "bb57621c99b4d1dda0de098324fb58ddfd243dbd",
"s... |
from Expressions.Expr import Expr
class Number(Expr):
def __init__(self, value):
self.value = value
def eval(self):
return self.value
def type(self):
return Number
def copy(self):
return Number(self.eval())
def to_cli(self):
return str(self.eval()) + " ... | {
"content_hash": "e6b54debcedabd3ec944765198561e52",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 55,
"avg_line_length": 16.536585365853657,
"alnum_prop": 0.556047197640118,
"repo_name": "mathiasquintero/LlamaLang",
"id": "db91758f723b9e92698719987e867dc150ad03f8",
"siz... |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
import uuid
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
for xform in orm.XForm.objects.all():
xform.uuid = uuid.uuid4().hex
... | {
"content_hash": "7e10015289a963d042c4b868d3d55087",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 182,
"avg_line_length": 70.38613861386139,
"alnum_prop": 0.5469123646082431,
"repo_name": "ehealthafrica-ci/formhub",
"id": "194bcd1a962cce9773503815bb9a6f5fb81aed86",
"si... |
"""Contains the logic for `aq del city`."""
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.processes import DSDBRunner
from aquilon.worker.dbwrappers.location import get_location
from aquilon.worker.templates.city import PlenaryCity
from aquilon.worker.locks import lock_q... | {
"content_hash": "cf78d82b39265e5dcecfe8a1497e0e16",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 72,
"avg_line_length": 32,
"alnum_prop": 0.6509146341463414,
"repo_name": "stdweird/aquilon",
"id": "600735666b83ff19889f4cfaf3742772a03e4f7b",
"size": "2020",
"binary": ... |
import urllib
import urllib2
from lxml import html
from tempest import config
from tempest.scenario import manager
from tempest import test
CONF = config.CONF
class TestDashboardBasicOps(manager.ScenarioTest):
"""
This is a basic scenario test:
* checks that the login page is available
* logs in a... | {
"content_hash": "92c8e5142eb289b3ef0203f339389bfa",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 75,
"avg_line_length": 33.016129032258064,
"alnum_prop": 0.6521739130434783,
"repo_name": "nikolay-fedotov/tempest",
"id": "f218fb23469976b01416cda21c404740177fc4a6",
"size... |
import posixpath
from recipe_engine import recipe_api
MOUNT_SRC = '/SRC'
MOUNT_OUT = '/OUT'
class DockerApi(recipe_api.RecipeApi):
def _chmod(self, filepath, mode, recursive=False):
cmd = ['chmod']
if recursive:
cmd.append('-R')
cmd.extend([mode, filepath])
name = ' '.join([str(elem) for ele... | {
"content_hash": "02e748eda2ee503e1ab8985f5c834b22",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 137,
"avg_line_length": 36.19444444444444,
"alnum_prop": 0.6250959324635457,
"repo_name": "HalCanary/skia-hc",
"id": "0170d01de85e7bad8a37baf02f04813fef7ffbd9",
"size": "27... |
import binwalk.core.plugin
class Unjffs2DepreciatedPlugin(binwalk.core.plugin.Plugin):
pass
| {
"content_hash": "719b47a13181173a19dc2e8e3967ea43",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 59,
"avg_line_length": 19.6,
"alnum_prop": 0.8061224489795918,
"repo_name": "devttys0/binwalk",
"id": "1a2604f294cdaba264a996db828c09e10f891c1f",
"size": "268",
"binary": ... |
def extraNumber(a, b, c):
return c if a == b else a if a != c else b
| {
"content_hash": "cc9c9879a59957ef7bf73acf604a8b2e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 46,
"avg_line_length": 36.5,
"alnum_prop": 0.5753424657534246,
"repo_name": "RevansChen/online-judge",
"id": "caa426f601621620caf8a388e6ae7b1cc2725f33",
"size": "84",
"bin... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ploghubapp', ... | {
"content_hash": "c9062085abf91da5508fa5aca614075a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 200,
"avg_line_length": 58.220588235294116,
"alnum_prop": 0.5950997726698661,
"repo_name": "ploggingdev/ploghub",
"id": "99fe6dfa1b4178a168b9a2d50dfb7c69c7ee98ad",
"size": ... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
Resourc... | {
"content_hash": "f7f899c020cc5de55cd64242771d1cac",
"timestamp": "",
"source": "github",
"line_count": 6979,
"max_line_length": 339,
"avg_line_length": 50.180398337870756,
"alnum_prop": 0.6548032746160151,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2f568d744fea6db07d3f8b3bef7fc4d371d8bfb5",
... |
from alert import Alert
from level import Level
| {
"content_hash": "a4f4adf793dbc0972e7ee15232b44f9d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 23,
"avg_line_length": 24,
"alnum_prop": 0.8333333333333334,
"repo_name": "mogproject/easy-alert",
"id": "7448d6882f60fb4881d926c9001ee4535e61eabe",
"size": "48",
"binary"... |
import json
from moto.core.responses import BaseResponse
from .models import codepipeline_backends
class CodePipelineResponse(BaseResponse):
@property
def codepipeline_backend(self):
return codepipeline_backends[self.region]
def create_pipeline(self):
pipeline, tags = self.codepipeline_b... | {
"content_hash": "f40f720a25bf786e89a21aa19dd3098b",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 77,
"avg_line_length": 28.016129032258064,
"alnum_prop": 0.6286701208981001,
"repo_name": "william-richard/moto",
"id": "0223dfae601979d480d0bfe94f629260ce1a3fb6",
"size": ... |
from AestheticsHelper import GetFeatures
from PicSift import app
import os
from threading import Lock
import numpy as np
from collections import defaultdict
import pickle
from PIL import Image
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import MinMaxScaler
from skle... | {
"content_hash": "4e1df80ab850897f5d12ed6fc1a3d29e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 77,
"avg_line_length": 35.53333333333333,
"alnum_prop": 0.650562851782364,
"repo_name": "kumbhani/PicSift",
"id": "501e960f2c685dfa6e74e89c6d6d7db0f55c756b",
"size": "2132"... |
from os.path import abspath, dirname, join
import pandas as pd
import pytest
from histogrammar.dfinterface.spark_histogrammar import SparkHistogrammar
from histogrammar.dfinterface.make_histograms import make_histograms
try:
from pyspark.sql import SparkSession
from pyspark import __version__ as pyspark_ver... | {
"content_hash": "aaf19ce4b4a688758bbddc4de769fbd4",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 109,
"avg_line_length": 31.556701030927837,
"alnum_prop": 0.5915278231514756,
"repo_name": "histogrammar/histogrammar-python",
"id": "6e5e09f07c2580c60c079e54e52a0233aa5f954... |
from __future__ import absolute_import
from __future__ import print_function
import bpy
import os
import sys
import argparse
from string import Template
from io import open
def main():
# Drop everything before '--'
args = sys.argv[sys.argv.index('--')+1:]
parser = argparse.ArgumentParser(description='Re... | {
"content_hash": "e9de843b5e79a8311fab61407bae8f4f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 61,
"avg_line_length": 23.097560975609756,
"alnum_prop": 0.6378035902851109,
"repo_name": "peragro/peragro-at",
"id": "76ee3085042e09f23442235639f2dd03ba1d2ca7",
"size": "9... |
"""initial migration
Revision ID: 2daaf886cde0
Revises: 50fabd562efc
Create Date: 2017-03-01 15:26:38.680187
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2daaf886cde0'
down_revision = '50fabd562efc'
branch_labels = None
depends_on = None
def upgrade():
... | {
"content_hash": "6e1d2cb1794cd4db0f17a132e9f266dc",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 81,
"avg_line_length": 26.033333333333335,
"alnum_prop": 0.6824583866837388,
"repo_name": "TomSGao/blogTom",
"id": "551950721b00e54772b015e36bb357d65455bb4e",
"size": "781"... |
import os
import imp
from .plugins.Base import *
from ckstyle.cmdconsole.ConsoleClass import console
from ckstyle.browsers.BinaryRule import ALL
class CssChecker():
'''CSS检查类,需要CSS解析器作为辅助'''
def __init__(self, parser, config = None):
self.parser = parser
self.config = config
# 错误记录,log... | {
"content_hash": "0652b339eb0842d3b30eaccbb9825e1a",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 108,
"avg_line_length": 37.60769230769231,
"alnum_prop": 0.5576464171268835,
"repo_name": "wangjeaf/CSSCheckStyle",
"id": "e0dfe64b9fcbcb27d361eed9bb4d3c3c766446bf",
"size... |
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = PACKAGE_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "dev.db",
... | {
"content_hash": "c833c33d8e707e0e45899facd00d3b82",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 82,
"avg_line_length": 29.81081081081081,
"alnum_prop": 0.6951949229374433,
"repo_name": "sargentstudley/pinaxbootcamp",
"id": "5561a480853cd7b435676bd5df42bfa931063738",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DailyStatus'
db.create_table('player_mgr_dailystatus', (
('id', self.gf('django.db.models.fields... | {
"content_hash": "125ad9298d5661167d4a48443ab24a5b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 182,
"avg_line_length": 71.95192307692308,
"alnum_prop": 0.5489776827475611,
"repo_name": "KendyllD/boukenda-project",
"id": "2c9253eb2db2322f69ca803115d7bace6c97eb7b",
"s... |
import functools
import socket
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.http import HttpResponseForbidden
from djerlyvideo.models import Server
from djerlyvideo.utils import get_remote_address
__SERVER_IPS = []
def test_access(f):
@functools.wraps(f)
... | {
"content_hash": "1d17e781a0eed0dd4b0f13ced1422acf",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 50,
"avg_line_length": 24.485714285714284,
"alnum_prop": 0.6721120186697783,
"repo_name": "plazix/django-erlyvideo",
"id": "4fae9a3f7b97aa6593f1f726ec0feabbbb7c2bef",
"size... |
from __future__ import print_function, absolute_import
__author__ = 'katharine'
from six import with_metaclass, iteritems
from binascii import hexlify
import collections
import logging
import struct
from libpebble2.exceptions import IncompleteMessage
from .types import Field, DEFAULT_ENDIANNESS
__all__ = ["PebblePa... | {
"content_hash": "df68d7a882fd49824a5b48afcd66b002",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 124,
"avg_line_length": 41.256410256410255,
"alnum_prop": 0.5830743733167599,
"repo_name": "pebble/libpebble2",
"id": "9d2c04d0a9827cda6d4c680d821afbc8640ef9fd",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.