text stringlengths 4 1.02M | meta dict |
|---|---|
from AccActionsContainer import AccActionsContainer
from AccNode import AccNode
from AccLattice import AccLattice
from AccNodeBunchTracker import AccNodeBunchTracker
__all__ = []
__all__.append("AccActionsContainer")
__all__.append("AccNode")
__all__.append("AccLattice")
__all__.append("AccNodeBunc... | {
"content_hash": "cd957208faadf406ed8efab94713ae40",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 36.77777777777778,
"alnum_prop": 0.7371601208459214,
"repo_name": "azukov/py-orbit",
"id": "cb7fcfd5273f01ec7c42f2ff2184bebc076ee750",
"size": "730",
... |
from oslo_config import cfg
from oslo_utils import importutils as i_utils
from cloudkitty import config # noqa
from cloudkitty import service
from cloudkitty import storage
from cloudkitty import utils as ck_utils
from cloudkitty import write_orchestrator
CONF = cfg.CONF
CONF.import_opt('period', 'cloudkitty.collect... | {
"content_hash": "677966bdf46998a01c5c401c12440dd4",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 75,
"avg_line_length": 33.197916666666664,
"alnum_prop": 0.5842485095701286,
"repo_name": "openstack/cloudkitty",
"id": "a090d98eb8d6fc52d05326d86f4e347c4be8f779",
"size": ... |
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from... | {
"content_hash": "dc57477ccf100da99512e80cd301768f",
"timestamp": "",
"source": "github",
"line_count": 1034,
"max_line_length": 139,
"avg_line_length": 46.05512572533849,
"alnum_prop": 0.6397177715713656,
"repo_name": "Azure/azure-sdk-for-python",
"id": "ad80398bc0e98e1597d5174bf0cc1f0604aaeaa9",
... |
import datetime
from webob.datetime_utils import UTC
import webmachine.exc
def b03(res, req, resp):
"Options?"
if req.method == 'OPTIONS':
for (header, value) in res.options(req, resp):
resp[header] = value
return True
return False
def b04(res, req, resp):
"Request entity ... | {
"content_hash": "0075effd9f43838557ac200950d11cd5",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 83,
"avg_line_length": 28.90823529411765,
"alnum_prop": 0.6274621520429757,
"repo_name": "benoitc/dj-webmachine",
"id": "ef53f09fba1daf32b7dc89801a0b8a9e9f868c75",
"size":... |
import os
import sys
import argparse
from PIL import Image
from PIL import ImageDraw
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.dirname(BASE_DIR))
from global_variables import *
sys.path.append(os.path.join(g_render4cnn_root_folder, 'render_pipeline'))
if _... | {
"content_hash": "e414bbc47bd57384bf66658f006b5f1a",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 151,
"avg_line_length": 40.38333333333333,
"alnum_prop": 0.5955427156417664,
"repo_name": "ShapeNet/RenderForCNN",
"id": "dd83df813fa7ba8c86a33450f786271d2b42b5e1",
"size":... |
from os.path import join
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from scipy._build_utils.system_info import get_info
from scipy._build_utils import (uses_blas64, blas_ilp64_pre_build_hook,
... | {
"content_hash": "dd444e35fccaf9fc8ed0ccd32b0ecdcd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 31.127659574468087,
"alnum_prop": 0.5721120984278879,
"repo_name": "perimosocordiae/scipy",
"id": "0c00548f81a9b3432cebf97b4f14e8a4851ae442",
"size":... |
"""Python client for InfluxDB v0.8."""
import warnings
import json
import socket
import requests
import requests.exceptions
from six.moves import xrange
from six.moves.urllib.parse import urlparse
from influxdb import chunked_json
session = requests.Session()
class InfluxDBClientError(Exception):
"""Raised wh... | {
"content_hash": "ac58be1d8201619c4141f346c026ab79",
"timestamp": "",
"source": "github",
"line_count": 842,
"max_line_length": 79,
"avg_line_length": 30.72209026128266,
"alnum_prop": 0.5583732797278491,
"repo_name": "tzonghao/influxdb-python",
"id": "965a91dbbc66ee82a6d663ceb8d8338a7dba4247",
"siz... |
from __future__ import unicode_literals
import os
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 impo... | {
"content_hash": "79960d4784d0759708992f25a3b1dca5",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 119,
"avg_line_length": 35.42574257425743,
"alnum_prop": 0.5771380659586361,
"repo_name": "guettli/django",
"id": "067a3743eb8e6d52e82c25380eead256a457ae7e",
"size": "1789... |
import os
import shutil
import tempfile
import numpy as np
import pytest
from PIL import Image
from imgavg import imgavg
def test_happy_path(args):
with tempfile.TemporaryDirectory() as temp_dir:
args["output"] = os.path.join(temp_dir, "out.png")
result = imgavg.average(args)
im = Image.ope... | {
"content_hash": "0f71a829f5e2cc714116bb8f6d1a59d2",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 85,
"avg_line_length": 29.113636363636363,
"alnum_prop": 0.7033567525370804,
"repo_name": "DoWhileGeek/imgavg",
"id": "db4e0accbf630a70622e7c628d992e806326b000",
"size": "1... |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from dajaxice.core import dajax... | {
"content_hash": "b106b8d15a4c2711a394a4618f1cbc15",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 30,
"alnum_prop": 0.7281481481481481,
"repo_name": "joeyuan19/flaming-bear",
"id": "c6767eb8aa69b35d1ae9cff5353c526d35fb8f9b",
"size": "1350",
"bin... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import math
import random
import functools
import numpy as np
import paddle
from imgtool import process_image
random.seed(0)
DATA_DIR = "./data/Stanford_Online_Products/"
TRAIN_LIST = './data/Stanfo... | {
"content_hash": "299f34e9983ae81a3d8976d6b3a33faf",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 101,
"avg_line_length": 33.78835978835979,
"alnum_prop": 0.5490134669589728,
"repo_name": "kuke/models",
"id": "ac8f257ecbadbb08454ffc616b1c587455cc92b6",
"size": "6386",
... |
from addresses.models import Person, Organisation
from django import forms
class PersonForm(forms.ModelForm):
"""
ModelForm for creating/updating Person instances. All field properties are inherited from
the Person model.
"""
class Meta:
model = Person
fields = (
'tit... | {
"content_hash": "c47041f6e11fc0643d5e656fc21d8eec",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 99,
"avg_line_length": 23.4,
"alnum_prop": 0.5196581196581197,
"repo_name": "Alexceptional/Adm-Web-Assignment",
"id": "c32fae6537417cce1ea0556bc8312de78c550848",
"size": "1... |
import os
import sys
import subprocess
def addr2lineQuery(binary, addr):
line_query = ["addr2line", "-e", binary, addr]
assert not os.path.exists("tmpaddrquery.out")
fout = open("tmpaddrquery.out", "w")
subprocess.call(line_query, stdout=fout, stderr=fout)
assert os.path.exists("tmpaddrquery.out")... | {
"content_hash": "ee7cb47a4814febdcfa137454f1707a4",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 75,
"avg_line_length": 27.571428571428573,
"alnum_prop": 0.5557858376511227,
"repo_name": "mdsalman729/flexpret_project",
"id": "2477257dcc579f43f9fdfec19c5c430ec211ff35",
... |
import os
import sys
import re
from distutils.dep_util import newer_group, newer
from glob import glob
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_info, NotFoundError
from numpy.distutils.misc_util import Configuration
config = ... | {
"content_hash": "a9e8dab8f03f9d06135e7f7eae6aa75c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 29.377777777777776,
"alnum_prop": 0.5832072617246596,
"repo_name": "huard/scipy-work",
"id": "5cfbbffc1014694abd3c83891c4f2891df754a81",
"size": "139... |
from datapackage_pipelines_knesset.common.base_processors.base import BaseProcessor
from datapackage_pipelines.utilities.resources import PROP_STREAMING
class BaseResourceProcessor(BaseProcessor):
"""Base class for processing a single resource"""
def __init__(self, *args, **kwargs):
super(BaseResource... | {
"content_hash": "84fd4fe1fe46a2d868c03a6379ac2a1e",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 108,
"avg_line_length": 52.76470588235294,
"alnum_prop": 0.6528428093645485,
"repo_name": "hasadna/knesset-data-pipelines",
"id": "0306dabceece55976e0d3df394a5e1479bd220f5",
... |
import logging
from datetime import datetime
from django.contrib.auth.models import User
from desktop.conf import LDAP
from models import UserProfile, get_profile
from views import import_ldap_users
import ldap_access
LOG = logging.getLogger(__name__)
class LdapSynchronizationMiddleware(object):
"""
Synchro... | {
"content_hash": "fb584023c2111d8380b87c9d8766002a",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 135,
"avg_line_length": 26.19047619047619,
"alnum_prop": 0.7066666666666667,
"repo_name": "vmax-feihu/hue",
"id": "6ba9f27a4358345b138e5ae5245797306e2638ad",
"size": "2442"... |
"""Support for Ambient Weather Station Service."""
import asyncio
import logging
from aioambient import Client
from aioambient.errors import WebsocketError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_NAME,
ATTR_LOCATION,
CONF_API_K... | {
"content_hash": "f4f4762e2cfc2a2f55bde55399e9f289",
"timestamp": "",
"source": "github",
"line_count": 527,
"max_line_length": 88,
"avg_line_length": 37.990512333965846,
"alnum_prop": 0.6270915538684382,
"repo_name": "qedi-r/home-assistant",
"id": "7a805d6b86763d443a0514395e689dd70f165ae4",
"size"... |
import copy
from tacker import context
from tacker import objects
from tacker.tests.unit.db.base import SqlTestCase
from tacker.tests.unit.objects import fakes
from tacker.tests import uuidsentinel
class TestInstantiatedVnfInfo(SqlTestCase):
def setUp(self):
super(TestInstantiatedVnfInfo, self).setUp()
... | {
"content_hash": "a6a501ea6b8591273d84df6df1233b41",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 76,
"avg_line_length": 46.90530303030303,
"alnum_prop": 0.6550916579181135,
"repo_name": "stackforge/tacker",
"id": "fdcb24d377e11ebd3a1a3f855bc52e8cd452afb1",
"size": "12... |
import re
class version_info(object):
def __init__(self, verstr):
"""verstr - version string"""
m1 = re.match('(.*?)([RBIXSF-])(.*)', verstr)
self.type = m1.group(2)
self.major = tuple(map(int, m1.group(1).split('.'))) # creates tuyple
after_type = m1.group(3).split('.')... | {
"content_hash": "f472bd465843e89bfee8ddf629a48ff6",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 95,
"avg_line_length": 35.91787439613527,
"alnum_prop": 0.49710827168796234,
"repo_name": "mith1979/ansible_automation",
"id": "bb20f7f91998b03b714f4d7ed45a68ea4e89ea8b",
... |
import json
import os
import tempfile
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.urlresolvers import reverse
from django.forms.fields import Field
from django.utils.encoding import smart_unicode
import mock
from jinja2.utils import escape
from no... | {
"content_hash": "af69795c38d1857ee81a302ad611bf97",
"timestamp": "",
"source": "github",
"line_count": 1577,
"max_line_length": 79,
"avg_line_length": 37.81610653138871,
"alnum_prop": 0.600241464886981,
"repo_name": "clouserw/zamboni",
"id": "912823268152687be96b798734c9ec505bafb8fb",
"size": "596... |
"""
.. describe:: ./manage.py mtbalance
Print the current account balance.
"""
from django.conf import settings
from django.core.management.base import BaseCommand
from mturk.utils import get_mturk_connection
class Command(BaseCommand):
args = '' # '<dir1> <dir2> ...'
help = 'Prints the current balan... | {
"content_hash": "e79628db1140c3bd23fc00d38824ab65",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 27.64,
"alnum_prop": 0.6309696092619392,
"repo_name": "seanbell/opensurfaces",
"id": "1c6d41c1dfe7676fbb133cbbe1c96654e770ee8e",
"size": "691",
"bi... |
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
f... | {
"content_hash": "6abbbfdd268fddd6c192dcaa442fe1d8",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 310,
"avg_line_length": 44.79080824088748,
"alnum_prop": 0.6516647206595195,
"repo_name": "Azure/azure-sdk-for-python",
"id": "abea0c93db47d1ab8b23c311d6871ef02c9ab292",
"... |
from __future__ import unicode_literals, absolute_import
import json
import unittest
import responses
from linebot import (
LineBotApi
)
from linebot.models import (
VideoSendMessage
)
class TestLineBotApi(unittest.TestCase):
def setUp(self):
self.tested = LineBotApi('channel_secret')
... | {
"content_hash": "a37ce0d1dfb6dc68d498b4a0af765fbe",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 74,
"avg_line_length": 27.80392156862745,
"alnum_prop": 0.5571227080394923,
"repo_name": "monhustla/line-bot-sdk-python",
"id": "217b5838fa41bd11d30aaab757adfa6b868032d7",
... |
import sys
import warnings
import pytest
import numpy as np
from .test_table import comparerecords
from ..hdu.base import _ValidHDU
from ....io import fits
from . import FitsTestCase
class TestChecksumFunctions(FitsTestCase):
# All checksums have been verified against CFITSIO
def setup(self):
supe... | {
"content_hash": "24b6158ec03e1ef614f01d6ea7e31929",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 83,
"avg_line_length": 45.47692307692308,
"alnum_prop": 0.5745698820800309,
"repo_name": "funbaker/astropy",
"id": "14959407a2c2baaef42f5b6394311b6feb9e0e24",
"size": "207... |
import datetime
import unittest
from unittest import mock
from airflow.models import TaskInstance
from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from airflow.utils import dot_renderer
from airflow.utils.state import State
START_DA... | {
"content_hash": "f381bbf36edc52e3a13b7159d3295f63",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 108,
"avg_line_length": 45.04494382022472,
"alnum_prop": 0.6465452731354453,
"repo_name": "mrkm4ntr/incubator-airflow",
"id": "3016b0c32ff4c326f33a397403a6c3269caf0e68",
"s... |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0032_datamigrate_update_for_no_none_values_in_assignment_firstdeadline'),
]
operations = [
migrations.AlterField(
model_name='assignment',
na... | {
"content_hash": "39a019f5eab106748bb12ffb2a232054",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 260,
"avg_line_length": 37.47826086956522,
"alnum_prop": 0.622969837587007,
"repo_name": "devilry/devilry-django",
"id": "008b6eefb67033c19113c63b27ffe5fc4152b0cf",
"size":... |
import xmlrpclib
import functools
HOST = 'localhost'
PORT = 8069
DB = 'i18n_plantilla'
USER = 'admin'
PASS = 'admin'
ROOT = 'http://%s:%d/xmlrpc/' % (HOST,PORT)
# 1. Login
uid = xmlrpclib.ServerProxy(ROOT + 'common').login(DB,USER,PASS)
print "Logged in as %s (uid:%d)" % (USER,uid)
call = functools.partial(
xmlr... | {
"content_hash": "cea812d9ca53b84733ff0fb255046aef",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 111,
"avg_line_length": 28.36,
"alnum_prop": 0.6495063469675599,
"repo_name": "arogel/openacademy-project",
"id": "68a4b41332aaac1241c8fc44352a4346296355c3",
"size": "1418"... |
import json
import os
from golem.core import utils
from golem.test_runner import test_runner
from golem.test_runner.conf import ResultsEnum
from golem.report.execution_report import create_execution_directory
from golem.report import test_report
from golem.report.test_report import get_test_file_report_json
from gole... | {
"content_hash": "0729348cd747376bd72ac340452298bf",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 108,
"avg_line_length": 42,
"alnum_prop": 0.5887241689128482,
"repo_name": "lucianopuccio/golem",
"id": "95310f3a1974ecacb9b4d9f102d8341e940c7c7f",
"size": "8904",
"bina... |
from JumpScale import j
class GitClient:
def __init__(self, baseDir, check_path=True): # NOQA
self._repo = None
if not j.sal.fs.exists(path=baseDir):
raise j.exceptions.Input("git repo on %s not found." % baseDir)
# split path to find parts
baseDir = j.sal.fs.pathCl... | {
"content_hash": "7f8638d305fec2c61c26534dcb2595b2",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 146,
"avg_line_length": 31.489795918367346,
"alnum_prop": 0.5334691232293306,
"repo_name": "Jumpscale/jumpscale_core8",
"id": "98591ee943d0ae66c585bdf51fd5a6711266b503",
"... |
"""Support for representing current time of the day as binary sensors."""
from datetime import datetime, timedelta
import logging
import pytz
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_AFTER,
CONF_BEFOR... | {
"content_hash": "b0ffd2aba32ce709c78769ac81283da9",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 88,
"avg_line_length": 37.02074688796681,
"alnum_prop": 0.6195920197265187,
"repo_name": "robbiet480/home-assistant",
"id": "8a5bbf16c6cfa0991d209b2acb770bac20bf902e",
"si... |
"""
Udacity CS253 - Lessen 1 - Homework 1
"""
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, Udacity!')
application = webapp2.WSGIApplication([('/', MainPage),], debug=True) | {
"content_hash": "f6fa5b29863c32677e53147b2196c93a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 26.454545454545453,
"alnum_prop": 0.697594501718213,
"repo_name": "vcelis/cs253",
"id": "c35b8967f65b2aff641acbd17c01334542e25085",
"size": "291",
... |
import traceback
try:
from hashlib import md5
except ImportError:
from md5 import md5
from datetime import datetime, timedelta
class RateLimitFilter(object):
_errors = {}
def filter(self, record):
from django.conf import settings
from django.core.cache import cache ... | {
"content_hash": "3f420ea7deb4d8381c661cc87ec3f7a9",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 117,
"avg_line_length": 36.89473684210526,
"alnum_prop": 0.4940561103185925,
"repo_name": "MadeInHaus/django-social",
"id": "6e04f36b964c0aceff5a8a689aeda03d59d41142",
"siz... |
import os
import sys
import unittest
import PRESUBMIT
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..',
'..', '..'))
from PRESUBMIT_test_mocks import (MockInputApi, MockOutputApi, MockAffectedFile)
class AccessibilityEventsTestIncludesAndroidTest(unittest.TestCase):
# ... | {
"content_hash": "f0de2f16afe4bd647d4952eb90943d80",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 80,
"avg_line_length": 35.85470085470085,
"alnum_prop": 0.6255065554231227,
"repo_name": "ric2b/Vivaldi-browser",
"id": "6dc43c2b6298c6dc4ced6a690601e861b0151092",
"size":... |
import functools
import itertools
import math
from typing import Callable, cast, Dict, Iterable, List, Optional, Sequence, Tuple, Type
import cirq
import stim
def cirq_circuit_to_stim_circuit(
circuit: cirq.AbstractCircuit, *, qubit_to_index_dict: Optional[Dict[cirq.Qid, int]] = None
) -> stim.Circuit:
"""Co... | {
"content_hash": "7cba043881f4a131c6cfd3ae1455d860",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 115,
"avg_line_length": 37.01809954751131,
"alnum_prop": 0.5628285050727295,
"repo_name": "quantumlib/Stim",
"id": "df61d8a5c3021954cc4a3be6d9e5f2a75863ab54",
"size": "163... |
"""Blink frame presubmit script
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
USE_PYTHON3 = True
def _RunUmaHistogramChecks(input_api, output_api): # pylint: disable=C0103
import sys
original_sys_path = sys.path
... | {
"content_hash": "cdfc27e758b38709b777b7077c5a3090",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 80,
"avg_line_length": 31.842105263157894,
"alnum_prop": 0.6258953168044077,
"repo_name": "ric2b/Vivaldi-browser",
"id": "3e18b11a0b508f18400eaebaabeb43b766b9ec0a",
"size":... |
import json
import stubout
import webob
from nova import compute
from nova import context
from nova import test
from nova.tests.api.openstack import fakes
last_add_fixed_ip = (None, None)
last_remove_fixed_ip = (None, None)
def compute_api_add_fixed_ip(self, context, instance_id, network_id):
global last_add_f... | {
"content_hash": "46d201b2286f02752466551ff79af1be",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 75,
"avg_line_length": 33.71739130434783,
"alnum_prop": 0.6318504190844616,
"repo_name": "nii-cloud/dodai-compute",
"id": "cecc4af4ffec778f306821f09521e6c5eae7bb55",
"size"... |
"""Accesses the google.monitoring.v3 MetricService API."""
import collections
import json
import os
import pkg_resources
import platform
from google.gax import api_callable
from google.gax import config
from google.gax import path_template
import google.gax
from google.api import metric_pb2 as api_metric_pb2
from go... | {
"content_hash": "7fddd93a27b703dd0097565be0582601",
"timestamp": "",
"source": "github",
"line_count": 635,
"max_line_length": 170,
"avg_line_length": 46.113385826771655,
"alnum_prop": 0.6253671197322588,
"repo_name": "shinfan/api-client-staging",
"id": "0103b9ade53e3fce55a0e604b10f83fb306b08cb",
... |
from django.test import client
from mailserver.handlers import BaseMessageHandler
from django.test import signals
from django.utils.functional import curry
class Client(client.Client):
def __init__(self, **defaults):
client.Client.__init__(self, **defaults)
self.handler = BaseMessageHandler()
... | {
"content_hash": "e0ea1534f7a4c97570f8be5f344d3e4d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 75,
"avg_line_length": 34.5625,
"alnum_prop": 0.6142254370102471,
"repo_name": "telenieko/django-mailserver",
"id": "8ff928b070b328cd6eb50b30b4545a8a459eab1c",
"size": "165... |
from os.path import abspath
from StringIO import StringIO
import numpy
import unittest
# Enthought library imports.
from mayavi.core.null_engine import NullEngine
from mayavi.sources.builtin_surface import BuiltinSurface
from mayavi.modules.surface import Surface
from mayavi.modules.outline import Outline
class Test... | {
"content_hash": "1e69828112b71ace7bc031c4601edbc9",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 89,
"avg_line_length": 31.96747967479675,
"alnum_prop": 0.6065615462868769,
"repo_name": "liulion/mayavi",
"id": "d7edcc8fc4f4da39630609346bf150b0ab1560cc",
"size": "4131"... |
from __future__ import unicode_literals, absolute_import, division, print_function
import random
from functools import total_ordering
from collections import Iterable
from enum import Enum, EnumMeta
class _PokerEnumMeta(EnumMeta):
def __init__(self, clsname, bases, classdict):
# make sure we only have tu... | {
"content_hash": "5fbee425ba7bdb0adda0ea920e1f1fca",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 96,
"avg_line_length": 32.354166666666664,
"alnum_prop": 0.5952994204764971,
"repo_name": "Seanmcn/poker",
"id": "04793b7f9429775af298239805f6f0fa69e4ddd3",
"size": "3130",... |
"""Gherkin step implementations for chart axis features."""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from behave import given, then, when
from pptx import Presentation
from pptx.enum.chart import XL_AXIS_CROSSES, XL_CATEGORY_TYPE
from helpers import test_pptx
# gi... | {
"content_hash": "acd80359f3ada13285f822fd25e7b37f",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 79,
"avg_line_length": 34.3968253968254,
"alnum_prop": 0.6697738809413937,
"repo_name": "biggihs/python-pptx",
"id": "853e5c5544b6caeae376f7207741658a5a26e8ad",
"size": "1... |
import os.path as op
import tempita
from depsolver._package_utils \
import \
parse_package_full_name
from depsolver.compat \
import \
OrderedDict
from depsolver.package \
import \
PackageInfo
from depsolver.requirement \
import \
Requirement
from depsolver.solver.rules_... | {
"content_hash": "7e02a34effbbb857a165aecdfa73f10e",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 95,
"avg_line_length": 29.638297872340427,
"alnum_prop": 0.6331658291457286,
"repo_name": "enthought/depsolver",
"id": "da03d65e57c56a3957d36f21c15ab6e404381398",
"size": ... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='SpecimenInfo',
version='1.3.0',
description=('Fetch ... | {
"content_hash": "afdfb7243574b618096bab0d9b474656",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 36,
"alnum_prop": 0.6004273504273504,
"repo_name": "zxjsdp/SpecimenInfo",
"id": "03542ac9832c3c27dec8e4042e5256bc0accd8a4",
"size": "1404",
"binary... |
import django.dispatch
invite_sent = django.dispatch.Signal(providing_args=["invitation",])
invite_accepted = django.dispatch.Signal(providing_args=["invitation"])
| {
"content_hash": "d47f5ee49178f368750be496c0518a31",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 71,
"avg_line_length": 33.2,
"alnum_prop": 0.7831325301204819,
"repo_name": "amitagrawal/kaleo",
"id": "3b8928cbaecb8811a3e6e6078975591c57c71490",
"size": "166",
"binary":... |
from direct.distributed.ClockDelta import globalClockDelta
from pandac.PandaModules import Point3
from toontown.toonbase import TTLocalizer
import PartyGlobals
from DistributedPartyTeamActivity import DistributedPartyTeamActivity
from PartyCogActivity import PartyCogActivity
class DistributedPartyCogActivity(Distribut... | {
"content_hash": "ed94cb8f67dc9506512463e3697ab3fb",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 188,
"avg_line_length": 37.402010050251256,
"alnum_prop": 0.6584710466209862,
"repo_name": "Spiderlover/Toontown",
"id": "7a6b97208cfa65e9fe205841bd9871734e360d48",
"size"... |
"""TensorFlow NMT model implementation."""
from __future__ import print_function
import argparse
import os
import random
import sys
# import matplotlib.image as mpimg
import numpy as np
import tensorflow as tf
from . import inference
from . import train
from .utils import evaluation_utils
from .utils import misc_uti... | {
"content_hash": "2a52de6c2879b313db35dcddb84de45c",
"timestamp": "",
"source": "github",
"line_count": 702,
"max_line_length": 80,
"avg_line_length": 41.585470085470085,
"alnum_prop": 0.6281642859589628,
"repo_name": "mlperf/inference_results_v0.5",
"id": "ce9e683e145e3e92c10d3b5f5a5065ec4930785a",
... |
"""Profiler client APIs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.framework import errors
def start_tracing(service_addr,
logdir,
duration... | {
"content_hash": "4e5cc5567f9889fba4c11d5400626abd",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 77,
"avg_line_length": 38.18421052631579,
"alnum_prop": 0.6995175740868367,
"repo_name": "kevin-coder/tensorflow-fork",
"id": "6f09d8b63419f4f837f74cd59fb1b3083b7d968b",
"s... |
import tempfile
try:
import requests
HAVE_REQUESTS = True
except ImportError:
HAVE_REQUESTS = False
from viper.common.out import bold
from viper.common.abstracts import Module
from viper.core.session import __sessions__
VIRUSTOTAL_URL = 'https://www.virustotal.com/vtapi/v2/file/report'
VIRUSTOTAL_URL_SUB... | {
"content_hash": "ed7ffceb61c6cf80a811d47fcbd3888b",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 144,
"avg_line_length": 40.94705882352941,
"alnum_prop": 0.5216204568309151,
"repo_name": "jorik041/viper",
"id": "5e2c4d76dc1d34acedcc16b2efea8c0ec3412d5a",
"size": "7078... |
from __future__ import absolute_import
import xmlrpclib
from .genicode import GENICODE
class SfaFault(xmlrpclib.Fault):
def __init__(self, faultCode, faultString, extra = None):
if extra:
faultString += ": " + str(extra)
xmlrpclib.Fault.__init__(self, faultCode, faultString)
class Sfa... | {
"content_hash": "6d9172621df8746febd118057da477b5",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 88,
"avg_line_length": 37.37012987012987,
"alnum_prop": 0.6214596003475239,
"repo_name": "tcmitchell/geni-tools",
"id": "6e7a1d47f1077de09817c044f8b2b405a26f967b",
"size":... |
setupdict= {
'name': 'txAMQP',
'version': '0.6.2',
'author': 'Esteve Fernandez',
'author_email': 'esteve@fluidinfo.com',
'url': 'https://launchpad.net/txamqp',
'description': 'Python library for communicating with AMQP peers and brokers using Twisted',
'long_description': '''This project con... | {
"content_hash": "a964c7f9332b5d266889f84f996128e7",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 191,
"avg_line_length": 39.8,
"alnum_prop": 0.6758793969849246,
"repo_name": "beevek/txamqp",
"id": "026b154abc14334a9d659d7d70f2559c9b5d61ac",
"size": "1194",
"binary": ... |
import os
import sys
import builtins
import contextlib
import difflib
import inspect
import pydoc
import keyword
import _pickle
import pkgutil
import re
import string
import test.support
import time
import types
import unittest
import xml.etree
import textwrap
from io import StringIO
from collections import namedtuple
... | {
"content_hash": "59eefdc6ad1b98997b85e7e38400cf5b",
"timestamp": "",
"source": "github",
"line_count": 939,
"max_line_length": 191,
"avg_line_length": 36.815761448349306,
"alnum_prop": 0.5813711310384727,
"repo_name": "tpsatish95/Python-Workshop",
"id": "81b58a2e802700f6340ea46e474325a3b902385a",
... |
"""Tests for tf_agents.utils.nest_utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
import tensorflow as tf
from tf_agents.specs import array_spec
from tf_agents.specs import tensor_spec
from tf_agents.utils im... | {
"content_hash": "acead16f780b02f5376fdbba0150588a",
"timestamp": "",
"source": "github",
"line_count": 943,
"max_line_length": 116,
"avg_line_length": 37.705196182396605,
"alnum_prop": 0.6420857239284509,
"repo_name": "tensorflow/agents",
"id": "6b0f0827cf883bfcd194a855290f0f7ea298204b",
"size": "... |
from __future__ import absolute_import
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _, ugettext
from sentry import roles
from sentry.models import OrganizationMember, OrganizationMemberTeam, Team
f... | {
"content_hash": "ccdc4d6afae03c8f0a8aa54335be5de8",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 115,
"avg_line_length": 36.00934579439252,
"alnum_prop": 0.5883726966000519,
"repo_name": "mitsuhiko/sentry",
"id": "14b0d703fb7d7490ada837e05fa461c2d973a51f",
"size": "38... |
import getpass
import json
import tempfile
from unittest.mock import patch
from urllib.parse import urljoin
import pytest
import responses
from pythonanywhere.api.base import get_api_endpoint
from pythonanywhere.api.files_api import Files
class TestFiles:
username = getpass.getuser()
base_url = get_api_endp... | {
"content_hash": "090db8b91fc59a35f3a1b3ce8924290a",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 97,
"avg_line_length": 36.78212290502793,
"alnum_prop": 0.5896111786148238,
"repo_name": "pythonanywhere/helper_scripts",
"id": "718d4b12e77dbd963a44f93de44e1a9661b2cb1c",
... |
import os
from collections import Sequence, namedtuple
from urllib.parse import urlparse
import markdown
from mkdocs import utils, theme, plugins
from mkdocs.config.base import Config, ValidationError
class BaseConfigOption:
def __init__(self):
self.warnings = []
self.default = None
def is_... | {
"content_hash": "2780905289408e269f0fa2ff262534e8",
"timestamp": "",
"source": "github",
"line_count": 615,
"max_line_length": 109,
"avg_line_length": 33.00813008130081,
"alnum_prop": 0.5784236453201971,
"repo_name": "jimporter/mkdocs",
"id": "5fd61f1d7751b3a71ab6b8cbbca345113124dd1a",
"size": "20... |
"""Class to monitor a MongoDB server on a background thread."""
import atexit
import time
import weakref
from typing import Any, Mapping, cast
from pymongo import common, periodic_executor
from pymongo.errors import NotPrimaryError, OperationFailure, _OperationCancelled
from pymongo.hello import Hello
from pymongo.lo... | {
"content_hash": "24929a4310c65b153d1d008e60789991",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 98,
"avg_line_length": 34.57746478873239,
"alnum_prop": 0.5939579090291921,
"repo_name": "ShaneHarvey/mongo-python-driver",
"id": "44390e9180e264d3bd88698ad81e3cb20437bbd6",... |
class Style(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
attributeMap (dict): ... | {
"content_hash": "f7c854cf09abfc38bf3fb10ccebaa9b7",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 651,
"avg_line_length": 43.714285714285715,
"alnum_prop": 0.5773420479302832,
"repo_name": "asposecells/Aspose_Cells_Cloud",
"id": "7ab9e62793733f4926ce66732dceb708e1cf4cb1",... |
import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="histogram.marker.colorbar",
**kwargs
):
super(TickformatstopsValidator, self).__init_... | {
"content_hash": "9f984e1c43c26acbdb86e620c5e2eeb1",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 84,
"avg_line_length": 43.01851851851852,
"alnum_prop": 0.5492897115798536,
"repo_name": "plotly/python-api",
"id": "1ff1860673ad567b9c8467e6fb28325f1961175e",
"size": "232... |
import sys
#Removes genes for which no score good be computed
def isValidAffinity(lineSplit):
for i in range(1,len(lineSplit)):
if ("ENSG" in lineSplit[i]):
return False
for i in range(1,len(lineSplit)):
if (float(lineSplit[i]) != 0.0):
return True
return False
def main():
#Checking Affinity
infile=o... | {
"content_hash": "598d8fe94b564b6cd46bff2bd3266321",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 61,
"avg_line_length": 21.925925925925927,
"alnum_prop": 0.6891891891891891,
"repo_name": "SchulzLab/TEPIC",
"id": "69c69b54ff3968f56a6cd8aaf0e2283df7af5bcc",
"size": "592"... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/food/shared_dessert_air_cake.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "40f1d82be068f4600c9c994ee4f40dcc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 76,
"avg_line_length": 23.46153846153846,
"alnum_prop": 0.6918032786885245,
"repo_name": "obi-two/Rebelion",
"id": "467a37fd7170c5eca7262e395b1d735c752ef4b3",
"size": "450"... |
"""
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | {
"content_hash": "b0aeb8a71faa495881408915e212d4e2",
"timestamp": "",
"source": "github",
"line_count": 1415,
"max_line_length": 100,
"avg_line_length": 39.51378091872792,
"alnum_prop": 0.6025897839462012,
"repo_name": "airbnb/streamalert",
"id": "b9f78e27c78ed420c9e5db3e27d0df311722787e",
"size": ... |
import logging
from sys import argv
from makehex.lexer import lex
from makehex.parser import parser
from makehex.config import parse_config
_stream_handler = logging.StreamHandler()
_stream_handler.setLevel(logging.WARNING)
_stream_handler.setFormatter(logging.Formatter("%(levelname)s [%(asctime)s] %(filename)-15s %(m... | {
"content_hash": "60da0ecd5a888f062e5c2caf86c3673d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 106,
"avg_line_length": 36.18518518518518,
"alnum_prop": 0.6929375639713409,
"repo_name": "Pasha13666/makehex",
"id": "8b9f6071acec82db0433e5de8a3c07863ef72654",
"size": "9... |
BOT_NAME = 'social_scraper'
SPIDER_MODULES = ['social_scraper.spiders']
NEWSPIDER_MODULE = 'social_scraper.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'social_scraper (+http(s)://www.yourdomain.com)'
DOWNLOADER_MIDDLEWARES = {
'scrapy.contrib.downloader... | {
"content_hash": "0abec23af9fc3ffe29059b5c615c8ae7",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 24.324324324324323,
"alnum_prop": 0.7366666666666667,
"repo_name": "piotrpawlaczek/social_scraper",
"id": "230b495941fc5395623c5343cf69456bb081db81",
... |
"""
Problem Statement
Given an array of integers Y=[y1,y2,…,yn], we have n line segments, such that, the endpoints of ith segment are (i,0)
and (i,yi). Imagine that from the top of each segment a horizontal ray is shot to the left, and this ray stops when it
touches another segment or it hits the y-axis. We construct ... | {
"content_hash": "105c78753dc91d39e2211ec8e9dbe813",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 120,
"avg_line_length": 35.41379310344828,
"alnum_prop": 0.5968841285296982,
"repo_name": "ee08b397/HackerRankAlgorithms",
"id": "f29dfa00ac4bec80cbdf868ed7108015b418744a",
... |
import base64
import copy
import datetime
import functools
import os
import string
import tempfile
import fixtures
from oslo.config import cfg
from nova.api.ec2 import cloud
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.api.metadata import password
from nova.compute import api as com... | {
"content_hash": "c4214deba40bcd71f615bad2b50d2803",
"timestamp": "",
"source": "github",
"line_count": 2698,
"max_line_length": 79,
"avg_line_length": 45.146404744255,
"alnum_prop": 0.522162472804893,
"repo_name": "sridevikoushik31/nova",
"id": "e58d260fbf7f9bffa199baf4f05770ae22dea1a8",
"size": "... |
from django.db import migrations
def update_ram_usage(apps, schema_editor):
bytes_in_mb = 2 ** 20
app_label = 'waldur_slurm'
Allocation = apps.get_model(app_label, 'Allocation')
for allocation in Allocation.objects.all():
if allocation.ram_usage != 0:
allocation.ram_usage = alloca... | {
"content_hash": "0f5fc33857ffcf246d7236baccb3289b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 82,
"avg_line_length": 37.05714285714286,
"alnum_prop": 0.6576715497301465,
"repo_name": "opennode/nodeconductor-assembly-waldur",
"id": "4fd5a51347ec0cd5f055f694c971b4309898... |
import threading
import logging
import queue
import pymongo
import numpy as np
from time import sleep
class Annotator(threading.Thread):
'''
Handles manual annotations.
Queries database for uncertain statuses, presents and presents them to the
user.
Arguments:
---------------
... | {
"content_hash": "8f24bbc8deb5a179ca7da3389cde8070",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 80,
"avg_line_length": 37.51923076923077,
"alnum_prop": 0.4614727490175978,
"repo_name": "flinder/active_stream",
"id": "1d6f85cf2fa94afbd86d8a1ccb6f698b2734d7c7",
"size":... |
"""ovirt-host-setup vmconsole_proxy plugin."""
from otopi import util
from . import core
@util.export
def createPlugins(context):
core.Plugin(context=context)
# vim: expandtab tabstop=4 shiftwidth=4
| {
"content_hash": "6e55bad9a32e860798a5a15dcf733072",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 46,
"avg_line_length": 14.066666666666666,
"alnum_prop": 0.7345971563981043,
"repo_name": "walteryang47/ovirt-engine",
"id": "861d4b36fd31722184e57e43e533908eb7d33a4e",
"si... |
"""
Enable basic can over a PCAN USB device.
"""
import logging
logger = logging.getLogger(__name__)
from can.interfaces.PCANBasic import *
from can.bus import BusABC
from can.message import Message
boottimeEpoch = 0
try:
import uptime
import datetime
boottimeEpoch = (uptime.boottime() - datetime.dateti... | {
"content_hash": "1f803a1b0530a09e04ac603e930beb12",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 117,
"avg_line_length": 31.45925925925926,
"alnum_prop": 0.607487638332941,
"repo_name": "BateauNautilus/DriveSimulator",
"id": "cc2f55e9fe968cc2298dd754a9287e324e8972a9",
... |
"""Block Storage Replication Control."""
| {
"content_hash": "4c0cabdaa01618501e2b0fdbf17761b2",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 40,
"avg_line_length": 41,
"alnum_prop": 0.7317073170731707,
"repo_name": "skraghu/softlayer-python",
"id": "ac0a44b7eba09e3fa55ddbbca605eb1b5cdab437",
"size": "41",
"bina... |
"""
Subsequent Address Family Idenitifier (SAFI)
http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml
"""
UNICAST = 1
MULTICAST = 2
MPLS_LABEL = 4 # RFC 3107
MPLS_VPN = 128 # RFC 4364
ROUTE_TARGET_CONSTRAINTS = 132 # RFC 4684
| {
"content_hash": "52b1cd1743346017ce3132fe9a29d678",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 67,
"avg_line_length": 24.5,
"alnum_prop": 0.726530612244898,
"repo_name": "zangree/ryu",
"id": "17ca138cb0b6ea97be0cb2a2f37dd89b19084f7f",
"size": "934",
"binary": false... |
import os
import sys
import datetime
import json
import psycopg2
from psycopg2.extras import Json
from bottle import get, post, run, request
from bottle import jinja2_template as template
# Connection credentials
DB_HOST = os.environ.get('DB_HOST')
if not DB_HOST:
print >> sys.stderr, 'Missing environment variab... | {
"content_hash": "10512b21d59251cbe9f743d1e6e98e3f",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 110,
"avg_line_length": 23.60810810810811,
"alnum_prop": 0.6720091585575272,
"repo_name": "joshuakarjala/mandrill-to-rds",
"id": "54192df76ad45a4e872ca83183fb4332b0604790",
... |
import sys
import os
from re import sub
import smtplib
from email.mime.text import MIMEText
from getpass import getpass
class KaleInterp:
def __init__(self):
self.for_bool = False # tells file_reader whether or not it should writeout loops
self.while_bool = False # same as for_bool but for whil... | {
"content_hash": "89fbcf31b01d4bfe4d289974addc70b7",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 119,
"avg_line_length": 39.39393939393939,
"alnum_prop": 0.5561538461538461,
"repo_name": "LordIronwheel/Munch-Kale",
"id": "782ec72c9ab93511ea58083e26fd1a0f9b58bba8",
"si... |
from django.db import models
class DownloadLocationEquivalent(models.Model):
old_location = models.CharField(max_length=512)
new_location = models.CharField(max_length=512)
class WhatTorrentMigrationStatus(models.Model):
STATUS_PROCESSING = 0
STATUS_DUPLICATE = 1
STATUS_SKIPPED = 2
STATUS_UP... | {
"content_hash": "2aa070e4d1054651dcd0ad94f1abbc75",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 62,
"avg_line_length": 27.862068965517242,
"alnum_prop": 0.7116336633663366,
"repo_name": "karamanolev/WhatManager2",
"id": "e6049b6d7376fa34fc4a2a1df6497c563185cc3d",
"siz... |
"""
Copyright (c) 2012-2014, Austin Benson and David Gleich
All rights reserved.
This file is part of MRTSQR and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
"""
""" Generate TSQR test problems.
Th... | {
"content_hash": "fa1f889f6cef1aa73a194a20581127c9",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 93,
"avg_line_length": 28.225,
"alnum_prop": 0.5886625332152348,
"repo_name": "arbenson/mrtsqr",
"id": "532b043a6f24ef0daa1bc231a9c4125f204f1319",
"size": "5645",
"binar... |
from yubikey_totp_gui import main
| {
"content_hash": "c4db091387215b56120ee0ff385f8ffe",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.8235294117647058,
"repo_name": "ldrumm/yubikey-totp-gui",
"id": "b72aaf646703ca37d6bc1134929f7abdbce9eeb6",
"size": "34",
"binar... |
from django.db.models import Q
from django.test import SimpleTestCase
from django_perf_rec.orm import patch_ORM_to_be_deterministic
class PatchORMToBeDeterministicTests(SimpleTestCase):
def test_call_it(self):
patch_ORM_to_be_deterministic()
def test_call_it_again(self):
patch_ORM_to_be_dete... | {
"content_hash": "ca836f7178e5cb863bede3c40b38c253",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 61,
"avg_line_length": 28.77777777777778,
"alnum_prop": 0.6640926640926641,
"repo_name": "YPlan/django-perf-rec",
"id": "efdda1cc40b802cb1697a51ca1e2d61fc39f4643",
"size": ... |
from django.conf.urls import url
from common import views
urlpatterns = [
url(r'^$', views.index, name='home'),
url(r'^disciplines/?$', views.disciplines_index, name='disciplines.index'),
url(r'^disciplines/new$',
views.DisciplineCreateView.as_view(), name='disciplines.new'),
url(r'^disciplin... | {
"content_hash": "3c8160af22ab4883a81dc56b8b492c18",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 79,
"avg_line_length": 44.392857142857146,
"alnum_prop": 0.6395816572807723,
"repo_name": "saechtner/turn-events",
"id": "14ad687a234ad8952cd6bf115409322cd38c7216",
"size":... |
import azurelinuxagent.utils.shellutil as shellutil
from azurelinuxagent.distro.default.osutil import DefaultOSUtil
class AlpineOSUtil(DefaultOSUtil):
def __init__(self):
super(AlpineOSUtil, self).__init__()
self.agent_conf_file_path = '/etc/waagent.conf'
def is_dhcp_enabled(self):
ret... | {
"content_hash": "10a9ebd13962112a22ca473dbb8f7800",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 63,
"avg_line_length": 29.363636363636363,
"alnum_prop": 0.651702786377709,
"repo_name": "nathanleclaire/WALinuxAgent",
"id": "e20c1a590b703d3f95c963b0688caa7bbcf9138e",
"s... |
import os
import sys
import fcntl
import random
import socket
import logging
import threading
import collections
import multiprocessing
import synapse.exc as s_exc
import synapse.glob as s_glob
import synapse.common as s_common
import synapse.dyndeps as s_dyndeps
import synapse.eventbus as s_eventbus
import synapse.l... | {
"content_hash": "b81947c1b8cbad5f0d269f478ced20c9",
"timestamp": "",
"source": "github",
"line_count": 897,
"max_line_length": 149,
"avg_line_length": 28.0479375696767,
"alnum_prop": 0.5553082395961684,
"repo_name": "vivisect/synapse",
"id": "d5df79cc137b2efa3d2fc66303c75f18f33feac9",
"size": "251... |
alice_name = "Alice"
alice_age = 20
alice_is_drinking = True
bob_name = "Bob"
bob_age = 12
bob_is_drinking = False
charles_name = "Charles"
charles_age = 22
charles_is_drinking = True
| {
"content_hash": "ad67bf785aa4e4a41433be25c2254947",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 26,
"avg_line_length": 16.90909090909091,
"alnum_prop": 0.6989247311827957,
"repo_name": "marwahaha/python-fundamentals",
"id": "d6f8b2349fac1b83bf3856806a8299e9ad8b02a6",
... |
from __future__ import unicode_literals
from oauth2_provider.settings import oauth2_settings
from django.db import models, migrations
import oauth2_provider.validators
import oauth2_provider.generators
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.sw... | {
"content_hash": "7b298202b77ebecc24b1a84673d2eb10",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 253,
"avg_line_length": 54.6764705882353,
"alnum_prop": 0.6097364174287251,
"repo_name": "ramcn/demo3",
"id": "7b0b40a36c3d00e4f3d1c07278de7bb33e097f2d",
"size": "3742",
... |
"""Tests for the Windows recycler parsers."""
import unittest
from plaso.lib import definitions
from plaso.parsers import recycler
from tests.parsers import test_lib
class WinRecycleBinParserTest(test_lib.ParserTestCase):
"""Tests for the Windows Recycle Bin parser."""
def testParseVista(self):
"""Tests t... | {
"content_hash": "ca9d78a209b7f7a2f5f69e7052d3ebcd",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 35.36585365853659,
"alnum_prop": 0.6896551724137931,
"repo_name": "kiddinn/plaso",
"id": "c1f1b179260373c7700dfd7dd72d1e0034be6bf6",
"size": "2947",
... |
"""Tests if the version numbers are consistent in Python and compiled code."""
from asap3 import _asap, __version__
from asap3 import __file__ as mainfile
versionerror = """
OOPS - BAD ASAP INSTALLATION: INCONSISTENT VERSION NUMBERS
Version number of Python code: %s
Version number of compiled code: %s
Perha... | {
"content_hash": "0f57c777f26884578e83d3ba99ed8c2b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 83,
"avg_line_length": 27.8,
"alnum_prop": 0.6937307297019527,
"repo_name": "auag92/n2dm",
"id": "0004d6fed4e108d654959c3b6688c9bcb6116a89",
"size": "973",
"binary": fals... |
import pytest
import numpy as np
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_equal
from sklearn._config import config_context, get_config
from sklearn.utils._set_output import _wrap_in_pandas_container
from sklearn.utils._set_output import _safe_set_output
from sklearn.utils._set_output... | {
"content_hash": "2a300ee022d79046d86eeecd1eb119f5",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 87,
"avg_line_length": 33.48535564853557,
"alnum_prop": 0.6658752967637136,
"repo_name": "scikit-learn/scikit-learn",
"id": "ae33b75f65c4c027c68e6774582cb8d3ca3a3502",
"si... |
"""
Gauges Package contains
G{packagetree }
"""
| {
"content_hash": "6d93b10ca0df110cc8de0406774ef87d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 23,
"avg_line_length": 8.333333333333334,
"alnum_prop": 0.66,
"repo_name": "USGSDenverPychron/pychron",
"id": "091298fecefd691523b938dde0d40fdf731df0d2",
"size": "787",
"b... |
import itertools
import json
import unittest
import os
from hashlib import md5
import mock
import six.moves.cPickle as pickle
import tempfile
import time
import shutil
import re
import random
import struct
import collections
from eventlet import Timeout, sleep, spawn
from contextlib import closing, contextmanager
from... | {
"content_hash": "272db24545e2af45288b506237252565",
"timestamp": "",
"source": "github",
"line_count": 4686,
"max_line_length": 79,
"avg_line_length": 43.275501493811355,
"alnum_prop": 0.5292742703006573,
"repo_name": "clayg/swift",
"id": "942703f11e19439af6043236849efe1d43245e12",
"size": "203383... |
import abc
import logging
class Logger(abc.ABC):
@abc.abstractmethod
def error(self, msg):
pass
@abc.abstractmethod
def warning(self, msg):
pass
@abc.abstractmethod
def info(self, msg):
pass
class PythonOnlyLogger(Logger):
def __init__(self, skip_logging_configu... | {
"content_hash": "3b1db79de87f556e319d39e790794b18",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 57,
"avg_line_length": 20.575757575757574,
"alnum_prop": 0.6215022091310751,
"repo_name": "danking/hail",
"id": "26301b714a48355a8f728fd612d40f5eccb3b986",
"size": "679",
... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
cwd = os.getcwd()
paren... | {
"content_hash": "f936dc3e6680b73f25148efa22697b20",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 80,
"avg_line_length": 32.29045643153527,
"alnum_prop": 0.7047031611410949,
"repo_name": "Lordmzn/pydmmt",
"id": "e874735f88060179499c852922be658a874db446",
"size": "8203"... |
from contextlib import ContextDecorator, contextmanager
from django.db import (
DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections,
)
class TransactionManagementError(ProgrammingError):
"""Transaction management is used improperly."""
pass
def get_connection(using=None):
"""
... | {
"content_hash": "e0623dac525947eb6d476af04c40ba63",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 97,
"avg_line_length": 38.170347003154575,
"alnum_prop": 0.5946280991735537,
"repo_name": "frankvdp/django",
"id": "901d8b62e7a5152fd55754df42cd2f18ad71c154",
"size": "121... |
try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
# Ignore import error and assume Python 3 which already has setuptools.
pass
from setuptools import setup, find_packages
classifiers = ['Development St... | {
"content_hash": "1d46a2507d1d143373f21ec7802009d0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 118,
"avg_line_length": 44,
"alnum_prop": 0.5833333333333334,
"repo_name": "adafruit/Adafruit_Python_CharLCD",
"id": "5c82f4856b69ef7866090d84e1baea184f1ad0cd",
"size": "13... |
learned_opt = "@HyperV2()"
sample_task_family = "phase_two_distribution"
init_params = "..."
# pyformat: disable
gin_params = {
"HyperV2.param_inits": 256,
"HyperV2.lstm_hidden_size": 512,
"HyperV2.use_bugged_loss_features": False,
"run_train.lopt": learned_opt,
"run_train.outer_learner_fn": "@G... | {
"content_hash": "d556e3d257ab0309217ecd5c00d15a23",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 83,
"avg_line_length": 35.39495798319328,
"alnum_prop": 0.6783000949667616,
"repo_name": "google/learned_optimization",
"id": "aad5017f71c53f55db4dc6a90d46ca5969e67185",
"... |
"""Tests for tree_format."""
| {
"content_hash": "2a1e556def24b6d32b3bb9db64c1504e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.6206896551724138,
"repo_name": "jml/tree-format",
"id": "7c31dadf7820645266f3cc78f865179e6777575c",
"size": "29",
"binary": fals... |
import tools.pluginmanager as pm
from DelegateBase import DelegateBase
from HandlerBase import HandlerBase
from Exceptions import *
from tools.cert_utils import *
from tools.chapi_log import *
from MethodContext import *
ma_logger = logging.getLogger('mav1')
# RPC handler for Member Authority (MA) API calls
class MA... | {
"content_hash": "8f05462ca882f15d52a4628f27d895d5",
"timestamp": "",
"source": "github",
"line_count": 644,
"max_line_length": 89,
"avg_line_length": 44.40372670807454,
"alnum_prop": 0.4738075255280459,
"repo_name": "tcmitchell/geni-ch",
"id": "ec76ab84de3bef51c35221b64d9bfacc7d9471e4",
"size": "2... |
import functools
from oslo.config import cfg
from nova.compute import flavors
from nova import exception
from nova.i18n import _
from nova.network import base_api
from nova.network import floating_ips
from nova.network import model as network_model
from nova.network import rpcapi as network_rpcapi
from nova import ob... | {
"content_hash": "26cc7e896e57107b2262e0f955b8d266",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 79,
"avg_line_length": 42.23105360443623,
"alnum_prop": 0.6048496520330897,
"repo_name": "tianweizhang/nova",
"id": "5bffda6a06b8834f6e5361cca8810795e19e88f2",
"size": "23... |
from neutron.api.v2 import attributes as attr
from neutron import context
from neutron.db import db_base_plugin_v2
from neutron.db import portsecurity_db
from neutron.db import securitygroups_db
from neutron.extensions import portsecurity as psec
from neutron.extensions import securitygroup as ext_sg
from neutron.manag... | {
"content_hash": "687599a450bf95ce67c4e919feab9adf",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 79,
"avg_line_length": 50.454787234042556,
"alnum_prop": 0.5586421380001054,
"repo_name": "Juniper/neutron",
"id": "c336db23a853ee052a1911d50ef2a9e9f0c7d531",
"size": "195... |
import os.path
import warnings
from glob import glob
from io import BytesIO
from numbers import Number
from pathlib import Path
import numpy as np
from .. import Dataset, backends, conventions
from ..core import indexing
from ..core.combine import (
_CONCAT_DIM_DEFAULT, _auto_combine, _infer_concat_order_from_pos... | {
"content_hash": "8072a24731a8c221563dacc28daa6588",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 82,
"avg_line_length": 41.753299492385786,
"alnum_prop": 0.6313127629051475,
"repo_name": "chunweiyuan/xarray",
"id": "afb69f6e9e94f2433faebd41d7617fe65ba399d9",
"size": "... |
"""
Ref: http://shin.hateblo.jp/entry/2013/03/23/211750
Usage 1. tm.start() is ued to start, and tm.update('tag') is to show time with
'tag' name.
tm = TimeMeasure()
tm.start()
# Run method1
tm.update('method1')
# Run method2
tm.update('method2')
...
tm.start()
# Run meth... | {
"content_hash": "9b1b4da12622d677840b2e7a28ed6222",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 82,
"avg_line_length": 26.706349206349206,
"alnum_prop": 0.525111441307578,
"repo_name": "corochann/chainerex",
"id": "41a087402b7d04318fdd480ab4d8287884bc4283",
"size": "... |
from HTMLParser import HTMLParser
import logging
import os
import re
from docs_server_utils import FormatKey
from file_system import FileNotFoundError
import compiled_file_system as compiled_fs
from third_party.handlebar import Handlebar
# TODO(kalman): rename this HTMLDataSource or other, then have separate intro
# ... | {
"content_hash": "4b66978868a0e3e9d3d966e8da537267",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 80,
"avg_line_length": 36.15966386554622,
"alnum_prop": 0.6177085754125029,
"repo_name": "codenote/chromium-test",
"id": "b4407c0b9ea46c2716d0d603a03df76f97352025",
"size"... |
from JumpScale import j
import ujson
class AUTH():
def load(self,osis):
pass
def authenticate(self,osis,method,user,passwd, session):
if j.core.osis.cmds._authenticateAdmin(user=user,passwd=passwd):
return True
return False
| {
"content_hash": "fc46080505ba12abb44366efd5bd9c81",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 24.545454545454547,
"alnum_prop": 0.6592592592592592,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "8d7b3c32700d13063a4ac16acceaea8c1abb2219",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.