text stringlengths 4 1.02M | meta dict |
|---|---|
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from orcid_api_... | {
"content_hash": "f69e2872e95b3ceef40ef70825815983",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 119,
"avg_line_length": 27.727272727272727,
"alnum_prop": 0.5512568306010929,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "cdc89683880351fbecc1d53b65479a... |
'''
2D Legendre Fitting
Based on Numpy legendre routines
'''
import numpy as np
from numpy.polynomial.legendre import legfit,legvander,legvander2d
from numpy.linalg import lstsq
import matplotlib.pyplot as p
import warnings
def leg2dfit(array, deg, rcond=None, full=False, w=None):
'''
2D Lege... | {
"content_hash": "40572a5eafb6bccce11b9fda37793c5e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 112,
"avg_line_length": 37.71345029239766,
"alnum_prop": 0.6073809893006668,
"repo_name": "e-koch/ewky_scripts",
"id": "c9211c1341d632e1fb43bf3c9f432dbb932f6bc1",
"size": ... |
from __future__ import division, unicode_literals
import abc
import os
import re
import glob
import logging
import fnmatch
import json
import warnings
import six
from six.moves import zip
from monty.io import zopen
from pymatgen.io.vasp.inputs import Incar, Potcar, Poscar
from pymatgen.io.vasp.outputs import Vaspru... | {
"content_hash": "848612542085ebb9a6d698f7b762b2cd",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 81,
"avg_line_length": 39.95189873417721,
"alnum_prop": 0.5666941258475382,
"repo_name": "johnson1228/pymatgen",
"id": "c63c929c51c2e39706c3e84e41aa2986101a1501",
"size": ... |
"""This module contains a class for representing the gameboard."""
from random import randint
from collections import namedtuple
import json
import pandas as pd
from .constants import Constants as C
from .gameboard_delegate import GameBoardDelegate
from .combiners import combine_left, combine_right
from .combiners impo... | {
"content_hash": "70a856d16a44ecf8375bbb6fb8384f36",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 110,
"avg_line_length": 34.88986013986014,
"alnum_prop": 0.5556446359673297,
"repo_name": "Kautenja/tfe_engine",
"id": "5315073df1ec344a7fc4de40785608e3edc08741",
"size": ... |
import logging
from typing import Text
from rasa.shared.exceptions import RasaException
logger = logging.getLogger(__name__)
# TODO: remove/move
class InvalidModelError(RasaException):
"""Raised when a model failed to load.
Attributes:
message -- explanation of why the model is invalid
"""
... | {
"content_hash": "20ab4276588892ea867971659d850fcd",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 58,
"avg_line_length": 23.208333333333332,
"alnum_prop": 0.6588868940754039,
"repo_name": "RasaHQ/rasa_nlu",
"id": "52832731f56176fb9e353b4cfb1e21dc708caa30",
"size": "557"... |
import os
import sys
import functools
import resource
STATUS = 0
def error_unless_permitted(env_var, message):
global STATUS
if not os.getenv(env_var):
sys.stderr.write(message)
STATUS = 1
def only_on(platforms):
def decorator(func):
@functools.wraps(func)
def inner():
... | {
"content_hash": "ed85f4ebbccb5e781cdb5d3deff49212",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 23.595238095238095,
"alnum_prop": 0.644803229061554,
"repo_name": "miniupnp/rust",
"id": "0d9c430ec3acd9c5fcb3f7c96da0886bf8c740fc",
"size": "1478",
... |
"""
Support for interacting with and controlling the cmus music player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cmus/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MEDIA_TYPE_MUS... | {
"content_hash": "521668bf845166345fc42edcb6a9238d",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 79,
"avg_line_length": 31.172727272727272,
"alnum_prop": 0.6086322543015457,
"repo_name": "tinloaf/home-assistant",
"id": "2711ac1ff11c8560f8e070d223a7eb8a27fae1a3",
"size... |
from flask import Flask, render_template
from flask_static_digest import FlaskStaticDigest
import argparse
from sqlalchemy import create_engine, MetaData
import config.aggregate
import config.config
# import config.ingest
import config.query
flask_static_digest = FlaskStaticDigest()
def create_app():
app = Fla... | {
"content_hash": "41faed95652c42ecfa25de6081584345",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 124,
"avg_line_length": 34.25130890052356,
"alnum_prop": 0.6566799143992663,
"repo_name": "critzo/piecewise",
"id": "eedcdf09a9d51183da8ba115c9a2e8a2f9184a70",
"size": "65... |
from __future__ import with_statement
import Gaffer
import GafferUI
## \todo Maths expressions to modify the existing value
## \todo Enter names of other plugs to create a connection
## \todo Color change for connected plugs and output plugs
## \todo Reject drag and drop of anything that's not a number
class NumericP... | {
"content_hash": "d7029eb5da864206120d48fd8e69339d",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 127,
"avg_line_length": 32.66129032258065,
"alnum_prop": 0.7086419753086419,
"repo_name": "davidsminor/gaffer",
"id": "a06a87a81dcd349af5a7fb7088b32c7b37193972",
"size": "... |
import simplejson
qwerty = r'''
`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+
qQ wW eE rR tT yY uU iI oO pP [{ ]} \|
aA sS dD fF gG hH jJ kK lL ;: '"
zZ xX cC vV bB nN mM ,< .> /?
'''
dvorak = r'''
`~ 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) [{ ]}
'" ,< .> pP yY fF gG cC rR lL /? =+ \|
aA oO eE uU iI dD hH tT n... | {
"content_hash": "1534fe5d773c25c68a50f5c2fc9594ff",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 99,
"avg_line_length": 39.520833333333336,
"alnum_prop": 0.5632577754348972,
"repo_name": "shotishu/zxcvbn",
"id": "2b894088f47c75b71d7dd52a6a7ccde768916158",
"size": "3794... |
from nose.tools import * # flake8: noqa
from website.models import NodeLog
from website.project.model import Auth
from website.util import permissions
from api.base.settings.defaults import API_BASE
from website.util import disconnected_from_listeners
from website.project.signals import contributor_removed
from tes... | {
"content_hash": "1b75a48a0d18e23156ec2a16b8b1f5c7",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 130,
"avg_line_length": 44.26704545454545,
"alnum_prop": 0.5964574509048902,
"repo_name": "hmoco/osf.io",
"id": "866d371a19ac79698268c46bfb1b5ec5b33fb1fd",
"size": "38979"... |
import os
import tempfile
import zipfile
import django_rq
from api.geovite_importer import import_records
from api.models import GeoVITeImportData
def extract_xml_paths(zip_file, directory):
paths = []
for file_name in zip_file.namelist():
if file_name.endswith('.xml'):
paths.append(os.p... | {
"content_hash": "ff57edde60430e17e740285cf853fd5d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 33.42424242424242,
"alnum_prop": 0.6944696282864914,
"repo_name": "geometalab/G4SE-Compass",
"id": "a4fa1b75adcd3b49de8ba22c6e8afd57cbf4d786",
"size"... |
"""
Requirements:
- requests (installation: pip install requests)
- lxml (installation: pip install lxml)
"""
import requests
import lxml.html
import os
def download_file(file_name, url):
#file_name = url.split('/')[-1]
# NOTE the stream=True parameter
r = requests.get(url, stream=True)
wi... | {
"content_hash": "6f6c1b04631dceb06b99969152896b64",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 126,
"avg_line_length": 40.25806451612903,
"alnum_prop": 0.6225961538461539,
"repo_name": "fossasia/parliament-scaper",
"id": "161b3c5779379e8bc53e35ff1f2462dfd95e82cd",
"s... |
import pytest
from requests import ConnectionError
from datadog_checks.riak import Riak
from . import common
@pytest.mark.integration
@pytest.mark.usefixtures('dd_environment')
def test_check(aggregator, check, instance):
check.check(instance)
check.check(instance)
tags = ['my_tag']
sc_tags = tags +... | {
"content_hash": "4967988428dd22e364ff768b71cb65c3",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 98,
"avg_line_length": 29.16216216216216,
"alnum_prop": 0.7052826691380908,
"repo_name": "DataDog/integrations-core",
"id": "f59e46e473911721661bb03863aa910b9b187609",
"siz... |
from __future__ import unicode_literals, division, absolute_import, with_statement
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
from future.moves.urllib.parse import quote
import os
import re
import threading
import logging
from xml.etree.ElementT... | {
"content_hash": "64fc910231b175175646d4c4da6f5171",
"timestamp": "",
"source": "github",
"line_count": 1020,
"max_line_length": 117,
"avg_line_length": 40.40294117647059,
"alnum_prop": 0.5399529251898765,
"repo_name": "qk4l/Flexget",
"id": "23f4a7fc052ec2f094771fe10031c94b6367d824",
"size": "41211... |
from netforce.model import get_model
from netforce import migration
from netforce.database import get_connection
class Migration(migration.Migration):
_name="stock.stock_cost_amount"
_version="3.1.0"
def migrate(self):
for move in get_model("stock.move").search_browse([["cost_amount","=",None]]):
... | {
"content_hash": "f94e0423e9527b2b000fa5e2aa9472bf",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 86,
"avg_line_length": 34.4,
"alnum_prop": 0.6724806201550387,
"repo_name": "sidzan/netforce",
"id": "64d7b5128da93bb04831318a04bcaa50436c30d0",
"size": "516",
"binary": ... |
'''
Module for generic helpers
'''
from itertools import product
def pin_version(package_name, version_steps, exact=False):
'''
create a tuple of strings with package and pinned versions.
:param package_name: package name to be pinned
:param version_steps: an iterable of versions for the given packag... | {
"content_hash": "bdcd86d7e4e1d54c3caed513c0972b58",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 86,
"avg_line_length": 30.178947368421053,
"alnum_prop": 0.5538890826648064,
"repo_name": "slafs/tox-matrix",
"id": "0c79852324b58fd477337119c84b0203b92b5a38",
"size": "288... |
import re
import numbers
from collections import namedtuple
from .shapes import *
LAYER_DESCRIPTORS = {
# Caffe Types
'AbsVal': shape_identity,
'Accuracy': shape_scalar,
'ArgMax': shape_not_implemented,
'BatchNorm': shape_identity,
'BNLL': shape_not_implemented,
'Concat': shape_concat,
... | {
"content_hash": "9ac38ed00b49a4ea82a409965f05ac5b",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 98,
"avg_line_length": 32.53061224489796,
"alnum_prop": 0.6116687578419071,
"repo_name": "vishaalprasad/AnimeRecommendation",
"id": "c3c595588512cf82511fc3139a76a3bf4e2f511c... |
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import flavors as schema
from tempest.lib.api_schema.response.compute.v2_1 import flavors_access \
as schema_access
from tempest.lib.api_schema.response.compute.v2_1 impor... | {
"content_hash": "176bb35357d00792fc5766f43f055b57",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 41.36645962732919,
"alnum_prop": 0.5992492492492493,
"repo_name": "nuagenetworks/tempest",
"id": "50f1dccc9e8ca2ee0d07dc0579891a8f9f418860",
"size":... |
from extended_signals.signals import form_pre_init, form_post_init, form_clean, form_pre_save, form_post_save
class FormSignalsMixin(object):
def __init__(self, *args, **kwargs):
form_pre_init.send(sender=self.__class__, instance=self, args=args, kwargs=kwargs)
super().__init__(*args, **kwargs)
... | {
"content_hash": "c2621f0a520e854bd6eabcfbe789f3f2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 109,
"avg_line_length": 45.833333333333336,
"alnum_prop": 0.6472727272727272,
"repo_name": "biljettshop/django_extended_signals",
"id": "6b55b959e8f844479216f2315d06273b60b17... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('submit_reports', '0002_auto_20160324_2152'),
]
operations = [
migrations.AlterField(
model_name='submitreport',
name='end_ti... | {
"content_hash": "25b0c709aea60cbc05ef236688aa2a4e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 54,
"avg_line_length": 23.043478260869566,
"alnum_prop": 0.5641509433962264,
"repo_name": "ServiceLearningB/ServiceLearning",
"id": "e66212de112ef55a9dcc7895504416accf2f732b"... |
"""FeatureFlags API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class FeatureFlagsAPI(BaseCanvasAPI):
"""FeatureFlags API Version 1.0."... | {
"content_hash": "3f7e8ecc7a1ef8057030bfb61bfe79ac",
"timestamp": "",
"source": "github",
"line_count": 837,
"max_line_length": 252,
"avg_line_length": 32.0884109916368,
"alnum_prop": 0.5553652543003946,
"repo_name": "tylerclair/py3canvas",
"id": "a7b2c407766904a4d3f6b0ee56f143c800bab9da",
"size": ... |
from direct.distributed.ClockDelta import *
from direct.showbase import DirectObject
from direct.directnotify import DirectNotifyGlobal
from direct.task import Task
import random
import TreasurePlannerAI
class RegenTreasurePlannerAI(TreasurePlannerAI.TreasurePlannerAI):
notify = DirectNotifyGlobal.directNotify.new... | {
"content_hash": "db562689f65d15e94d5679c5985ac033",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 101,
"avg_line_length": 37.27272727272727,
"alnum_prop": 0.725,
"repo_name": "ToontownUprising/src",
"id": "a3aa4dc05f007e12586f6dcb62f8c8fb673247d7",
"size": "1640",
"bi... |
from google.analytics import admin_v1alpha
def sample_get_custom_dimension():
# Create a client
client = admin_v1alpha.AnalyticsAdminServiceClient()
# Initialize request argument(s)
request = admin_v1alpha.GetCustomDimensionRequest(
name="name_value",
)
# Make the request
respons... | {
"content_hash": "88860ae623f1d2dee2b4d79ee0f6d0a7",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 86,
"avg_line_length": 26.526315789473685,
"alnum_prop": 0.7361111111111112,
"repo_name": "googleapis/python-analytics-admin",
"id": "f1b219e8d78d8fc5f78802524857279c112db1a3... |
import sys
from gui.application import Application
app = Application()
sys.exit(app.run())
| {
"content_hash": "911b5858dd749e45db8bd8dc31b03e0a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 39,
"avg_line_length": 15.5,
"alnum_prop": 0.7634408602150538,
"repo_name": "coolhandmook/trayjenkins",
"id": "f6a477c45efb517f41c2ffbb5c5db569d7b675b1",
"size": "112",
"b... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cdadmap', '0011_auto_20150624_1138'),
]
operations = [
migrations.AddField(
model_name='surveypanel',
name='Organization_Log... | {
"content_hash": "2bf3b4f3669a9552d6dbc64af4ae4f17",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 25.157894736842106,
"alnum_prop": 0.5962343096234309,
"repo_name": "NiJeLorg/CDADMap",
"id": "3bb47943d637103f6fa2c9fa6b6da667cf6e817a",
"size": "502... |
"""
This module provides testing functionality of the Apache Solr Init Action.
"""
import os
import pkg_resources
from absl.testing import absltest
from absl.testing import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class SolrTestCase(DataprocTestCase):
COMPONENT = 'solr'
... | {
"content_hash": "80dacdbae35fef7df355926b5e8b6808",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 74,
"avg_line_length": 32.15686274509804,
"alnum_prop": 0.6146341463414634,
"repo_name": "GoogleCloudDataproc/initialization-actions",
"id": "609801de842a85fb8ed6e39da86cdc81... |
"""
Django settings for polyclinic project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | {
"content_hash": "3c64f19492aa009cb1185cd64bd247a0",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 71,
"avg_line_length": 25.87037037037037,
"alnum_prop": 0.6882605583392984,
"repo_name": "thefivekey/django-doctor-appointment",
"id": "deb3e87e7428dc533f1490103e281457f06c4... |
from capabilities.capability import capability
import subprocess # used for bash commands (when required), unix-only
from pipes import quote # used to sanitize bash input when complex commands are required, unix-only
class tasks(capability):
# the standard command for getting folder size is filtered down to the m... | {
"content_hash": "796c71d9de65ea45ef5c3f88b6952fd9",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 99,
"avg_line_length": 37.97674418604651,
"alnum_prop": 0.6068585425597061,
"repo_name": "Nateowami/flex-languagedepot-metadata",
"id": "4f2aab2f9228ac8874f4564fc53a2dc5b878e... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .core import UnitedStates
class Minnesota(UnitedStates):
"""Minnesota"""
include_thanksgiving_friday = True
include_columbus_day = False
| {
"content_hash": "4a9e78c1b27aeef9db297e6bc95ceafd",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 26.6,
"alnum_prop": 0.6729323308270677,
"repo_name": "sayoun/workalendar",
"id": "003a97a1f67231845a42dcd25a50389600fd709a",
"size": "290",
"binary... |
"""Definition of Legendre polynomial class"""
from utils.poly.Jacobi import Jacobi
class Legendre(Jacobi):
"""Legendre polynomial
Its attributions are the same as the Polynomial class.
"""
def __init__(self, _n):
"""initialize the instance of Jacobi polynomial
Args:
_n:... | {
"content_hash": "b35e1a8bc72921be419d133c14f75d64",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 58,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.56640625,
"repo_name": "piyueh/SEM-Toolbox",
"id": "15e8fb6b1f06c399d6e57ae1ac0c6dcc4c45e609",
"size": "682",
"... |
import argparse, os
# Command Line Arguments
parser = argparse.ArgumentParser(description='This script converts a tab file to a json fixture for django.')
parser.add_argument('-a', '--appname', help='Name of the app that owns the model: myawesomeapp', required=True)
parser.add_argument('-m', '--modelname', help='... | {
"content_hash": "8cf4c13298770a4c0b8536b21eb7df18",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 119,
"avg_line_length": 50.44,
"alnum_prop": 0.5344964314036479,
"repo_name": "HalescodeLLC/django-munsell",
"id": "46124ccc452afe4820b7fb9566352bb5cf042362",
"size": "2522... |
import SWIGParser as parser
def dir_contents():
print 'parser contents:', dir(parser)
print
print 'parser.ExtPos contents:', dir(parser.ExtPos)
def display_parses(parses):
for i, (score, tree) in enumerate(parses):
print i, score
print tree
print tree.toStringPrettyPrint()
... | {
"content_hash": "c346d2f571763bd4cdacea6df7919650",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 105,
"avg_line_length": 33.74528301886792,
"alnum_prop": 0.6276209113782499,
"repo_name": "dmcc/bllip-parser",
"id": "41d61c1841379ccbbf68a3c85829008ac77f8a2d",
"size": "4... |
"""resource property
Revision ID: 02e2f2186d98
Revises: f4084140f608
Create Date: 2020-04-17 15:51:40.542459
"""
# revision identifiers, used by Alembic.
revision = '02e2f2186d98'
down_revision = 'f4084140f608'
import uuid
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def u... | {
"content_hash": "401243ea91f305f527c15fd4a1f3f180",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 79,
"avg_line_length": 38.151162790697676,
"alnum_prop": 0.5672051203901249,
"repo_name": "openstack/blazar",
"id": "89d30170f48849c3927c648724978d60d68d6922",
"size": "386... |
from flask import Blueprint, Response, jsonify
from application.helpers import crossdomain
from modules.job_table.controllers import get_job_table_filter, get_job_table_query
job_table_api_pages = Blueprint('job_table_api', __name__
, template_folder='templates')
@job_table_api_pages.route("/common")
@crossdomain(... | {
"content_hash": "5f1e2cd8bc6a58b8233ea392029d72c1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 83,
"avg_line_length": 30,
"alnum_prop": 0.7352941176470589,
"repo_name": "srcc-msu/job_statistics",
"id": "4be6b8d879cef48b16e805a03d9f3aded757721e",
"size": "510",
"bin... |
"""JOSE interfaces."""
import abc
import collections
import json
import six
from acme.jose import errors
from acme.jose import util
# pylint: disable=no-self-argument,no-method-argument,no-init,inherit-non-class
# pylint: disable=too-few-public-methods
@six.add_metaclass(abc.ABCMeta)
class JSONDeSerializable(objec... | {
"content_hash": "cfb85ec1a136b835c6fe9e213a93b176",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 35.86574074074074,
"alnum_prop": 0.6415386601265006,
"repo_name": "ghyde/letsencrypt",
"id": "f85777a30ce8b1c3714a92da428ee1deb6ac73f4",
"size": "77... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("XGBRegressor" , "california_housing" , "oracle")
| {
"content_hash": "42c479052caa4f5011f91fb4e594dc24",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 68,
"avg_line_length": 34.5,
"alnum_prop": 0.7753623188405797,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "8306e86c1248b7de39bb409b8cd406c9c0bd5d20",
"size": "138... |
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class Organization(models.Model):
"""Model for organisations"""
name = models.CharField(max_length=255, unique=True)
description = models.TextField(max_length=500, blank=True)
website = models.U... | {
"content_hash": "ba43febbd9bb155c248867d1b951d24f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 101,
"avg_line_length": 35.90909090909091,
"alnum_prop": 0.7113924050632912,
"repo_name": "ebu/radiodns-plugit",
"id": "4bfe468d814ae0bbca7accd67046cd094e7c24c6",
"size": "... |
"""Test MockupDB."""
import contextlib
import datetime
import os
import ssl
import sys
import tempfile
import unittest
from struct import Struct
if sys.version_info[0] < 3:
from io import BytesIO as StringIO
else:
from io import StringIO
try:
from queue import Queue
except ImportError:
from Queue imp... | {
"content_hash": "fcad60068bbbe0ec5168f558b4007d61",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 80,
"avg_line_length": 36.03186274509804,
"alnum_prop": 0.5654717366165567,
"repo_name": "ajdavis/mongo-mockup-db",
"id": "e9d04e8d1f3cbfc9178fc21a0cd77c32c8c1980e",
"size... |
"""oilboy URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-bas... | {
"content_hash": "c2a0af3dce58e5cd8cd5a63b912408c4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 36.75,
"alnum_prop": 0.6893424036281179,
"repo_name": "oilboy/oilboy",
"id": "e9bd264095750dc30ff44a52e5a1907b6897bcf0",
"size": "882",
"binary": f... |
"""
Module import for `hsdev` backend.
"""
| {
"content_hash": "b2f0a39f9bc9013537119e9543458c8e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 34,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.627906976744186,
"repo_name": "bscottm/SublimeHaskell",
"id": "96fbcaa4f836d0e89f539320b1495b39cbc67588",
"size": ... |
import DexReader
reader = DexReader.DexReader("/dev/ttyp3")
data = reader.read()
print "===DEX DATA:"
print data
print "=== end of data" | {
"content_hash": "d150b3003db240bbd71e54ac4cf99ff5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 17.25,
"alnum_prop": 0.6956521739130435,
"repo_name": "mdisibio/dex-reader",
"id": "d67d741912da10390053e228fd5caab9d3b56462",
"size": "138",
"binar... |
import unittest
import os
import shutil
import dirtools
import incremental_backups_tools as ibt
class TestIncrementalBackupstools(unittest.TestCase):
def setUp(self):
""" Initialize directory for testing diff and patch. """
base_path = '/tmp/test_incremental_backups_tools'
self.base_path ... | {
"content_hash": "f8d92a008fb1edc7d1d9efb2b1837628",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 83,
"avg_line_length": 41.859154929577464,
"alnum_prop": 0.5942126514131898,
"repo_name": "tsileo/incremental-backups-tools",
"id": "4c0f9cead6795678e440c34c7540c3536e4fe206"... |
import datetime
from django.core.cache import cache
from django.db import models
from django.db.models import Sum
import commonware.log
import mkt
import mkt.constants.comm as comm
from mkt.comm.utils import create_comm_note
from mkt.site.models import ManagerBase, ModelBase
from mkt.site.utils import cache_ns_key
f... | {
"content_hash": "00006ddc0c904c527a409f02b23ea4f7",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 79,
"avg_line_length": 33.645714285714284,
"alnum_prop": 0.5754642210144928,
"repo_name": "mudithkr/zamboni",
"id": "f2d7369d2aa24c07e054c1b7882b345ffe80a390",
"size": "17... |
""" TODO: Add docstring """
import re
import pexpect
class MediaObject(object):
"""Represents an encodable object"""
def __init__(self, input_filename, output_filename):
self.input_filename = input_filename
self.output_filename = output_filename
self.media_duration = self.get_media_d... | {
"content_hash": "af9f5b0b915bd30ab2aace0a393f2c27",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 79,
"avg_line_length": 43.47826086956522,
"alnum_prop": 0.5915,
"repo_name": "thethomaseffect/travers-media-tools",
"id": "8bc713893f094a797174f4e97f59580181e33cff",
"size"... |
from setuptools import setup, find_packages
setup(
name='django-nose',
version='0.1',
description='Django test runner that uses nose.',
long_description=open('README.rst').read(),
author='Jeff Balogh',
author_email='me@jeffbalogh.org',
url='http://github.com/jbalogh/django-nose',
licen... | {
"content_hash": "07702ee5cd9b3264d7d8e016c8b8b7a6",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 71,
"avg_line_length": 30.962962962962962,
"alnum_prop": 0.6220095693779905,
"repo_name": "jsocol/django-nose",
"id": "d7345970ce67c06627e1daa264a8ede0dc3dd5f6",
"size": "8... |
import gdb
import pwndbg
import pwndbg.gdblib.arch
import pwndbg.gdblib.memory
import pwndbg.gdblib.symbol
import pwndbg.gdblib.typeinfo
import pwndbg.glibc
import pwndbg.heap
import tests
from pwndbg.heap.ptmalloc import SymbolUnresolvableError
HEAP_MALLOC_CHUNK = tests.binaries.get("heap_malloc_chunk.out")
def ge... | {
"content_hash": "6b9c1c1e07e1be36da9b72882dbe76b7",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 165,
"avg_line_length": 44.97374701670645,
"alnum_prop": 0.664243260454256,
"repo_name": "pwndbg/pwndbg",
"id": "0e1b90d083d0bc429114a46284a071586f315a54",
"size": "18844"... |
from flask import g, jsonify
from flask_httpauth import HTTPBasicAuth
from . import api
from ..models import User, AnonymousUser
auth = HTTPBasicAuth()
@auth.verify_password
def verify_password(email_or_token, password):
if email_or_token == '':
g.current_user = AnonymousUser()
return True
... | {
"content_hash": "9bb7eb5c0bb7a8f3d5824c18674fb504",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 65,
"avg_line_length": 23.636363636363637,
"alnum_prop": 0.6605769230769231,
"repo_name": "neo1218/rest",
"id": "4f9cd805b0a7902e26be5c00a9f5a43a6d861243",
"size": "1057",
... |
import matplotlib.pyplot as plt
import sys
from matplotlib.ticker import FormatStrFormatter
projectName=str(sys.argv[1])
inputFile=str(sys.argv[2])
outPrefix=str(sys.argv[3])+"/"+projectName
time = []
coverage = []
execution = []
memory = []
finished = []
remaining = []
depth = []
states = []
distinctStates = []
repe... | {
"content_hash": "b745075e5d756ce4049db2aa0ad77b77",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 163,
"avg_line_length": 29.451515151515153,
"alnum_prop": 0.5979010186233151,
"repo_name": "p-org/P",
"id": "fb43a54394b94fe13ccb7c96e8a83dcc7946aa54",
"size": "9719",
"... |
from io import BytesIO
from unittest import main
from uuid import uuid4
import os
import time
import shutil
import re
from swiftclient import client
from swift.obj.diskfile import get_data_dir
from test.probe.common import ReplProbeTest
from swift.common.request_helpers import get_reserved_name
from swift.common.util... | {
"content_hash": "e4c491c434111ca748024cf5c1961ff2",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 78,
"avg_line_length": 37.11981566820276,
"alnum_prop": 0.5482309124767225,
"repo_name": "swiftstack/swift",
"id": "3bc7ed928e53d5dceaf02c5061873962c2cf5901",
"size": "867... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
from pants.backend.codegen.targets.jaxb_library import JaxbLibrary
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backe... | {
"content_hash": "8ece2eb36d6320bc6ef6a343b3a229f6",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 96,
"avg_line_length": 38.406976744186046,
"alnum_prop": 0.6690887072358462,
"repo_name": "cevaris/pants",
"id": "bdedbe35da042656664e5785629946fcdf492180",
"size": "3450",... |
"""
archivebot.py - discussion page archiving bot.
usage:
python pwb.py archivebot [OPTIONS] TEMPLATE_PAGE
Bot examines backlinks (Special:WhatLinksHere) to TEMPLATE_PAGE.
Then goes through all pages (unless a specific page specified using options)
and archives old discussions. This is done by breaking a page in... | {
"content_hash": "b6d94e22ec1e2b077c38bab3c752f5ae",
"timestamp": "",
"source": "github",
"line_count": 815,
"max_line_length": 79,
"avg_line_length": 36.4159509202454,
"alnum_prop": 0.5647427473971495,
"repo_name": "PersianWikipedia/pywikibot-core",
"id": "eddf7cf35d947f0bce83ec4714ada0e6bb58b68f",
... |
"""This example creates an exchange rate.
To determine which exchange rates exist, run get_all_exchange_rates.py.
"""
# Import appropriate modules from the client library.
from googleads import dfp
def main(client):
# Initialize appropriate service.
exchange_rate_service = client.GetService('ExchangeRateServ... | {
"content_hash": "756c3456937f455d6b0f47e6bc22eeca",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 77,
"avg_line_length": 31.19047619047619,
"alnum_prop": 0.6038167938931298,
"repo_name": "wubr2000/googleads-python-lib",
"id": "f8928d03d261643c7fc9afd80334ae511ba4621c",
... |
"""
autodoc
~~~~~~~
Autodoc Python implementation.
`Ruby autodoc <https://github.com/r7kamura/autodoc>`_
`Perl autodoc <https://metacpan.org/pod/Test::JsonAPI::Autodoc>`_
:copyright: (c) 2014-2018 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
impo... | {
"content_hash": "626bb259fa79e7fb7b5c60447191b437",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 75,
"avg_line_length": 29.068825910931174,
"alnum_prop": 0.49735376044568247,
"repo_name": "heavenshell/py-autodoc",
"id": "de8aac5d7ba55ec8303628bc52e4906ad90f02e0",
"siz... |
from runtests.mpi import MPITest
import pytest
import time
def test_benchmark1(benchmark):
comm = benchmark.comm
with benchmark("test 1"):
time.sleep((1+comm.rank)*0.25)
@pytest.mark.parametrize('x', [1, 2])
def test_benchmark2(benchmark, x):
comm = benchmark.comm
with benchmark("test 2"):
... | {
"content_hash": "03a06c5a87d75ab3f62d224b224cb1e3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 38,
"avg_line_length": 22.375,
"alnum_prop": 0.6675977653631285,
"repo_name": "rainwoodman/mpi4py_test",
"id": "4a221b46cffa440adc8d81dcc9dea389237194d0",
"size": "358",
... |
"""
Level loading and tileset code based on qq demo
https://bitbucket.org/thesheep/qq/overview
by Radomir Dopieralski <qq@sheep.art.pl>
@copyright: 2014 Andrew Conway <nalumc@gmail.com>
@license: BSD, see COPYING for details
"""
import pygame
import pygame.locals as pg
from random import randint
# Dimensions of th... | {
"content_hash": "6de690eed97b12bdd27786787c0e4ad8",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 99,
"avg_line_length": 30.665236051502145,
"alnum_prop": 0.5444366689993002,
"repo_name": "mcnalu/dungeon-massacre",
"id": "f246e74e7b33e7637572b69f3e7202c218b7fa21",
"siz... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "indicator.number"
_path_str = "indicator.number.font"
_valid_props = {"color", "family", "size... | {
"content_hash": "da58244e3fa0b04bbed4017ee4064321",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 82,
"avg_line_length": 37.118942731277535,
"alnum_prop": 0.5583906954664135,
"repo_name": "plotly/plotly.py",
"id": "bb2f5acb06d769dc14ae2b3f4f821803239013c9",
"size": "84... |
"""
tests.test_component_group
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the group compoments.
"""
# pylint: disable=protected-access,too-many-public-methods
import unittest
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN, ATTR_ICON, ATTR_HIDDEN)
import homeassistant.components.group as gr... | {
"content_hash": "82478f3a2d911417c9876c7b00350d68",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 82,
"avg_line_length": 39.77049180327869,
"alnum_prop": 0.5958367683429514,
"repo_name": "nnic/home-assistant",
"id": "8a3eeadcb145ede287242efda88be3c4fc3840ca",
"size": "... |
"""
This module is to support *bbox_inches* option in savefig command.
"""
from __future__ import print_function
import warnings
from matplotlib.transforms import Bbox, TransformedBbox, Affine2D
def adjust_bbox(fig, format, bbox_inches):
"""
Temporarily adjust the figure so that only the specified area
(... | {
"content_hash": "56325f977134149cac4a68cb5977e751",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 69,
"avg_line_length": 30.096296296296295,
"alnum_prop": 0.5673147920255969,
"repo_name": "lthurlow/Network-Grapher",
"id": "36c255b9fb922ecb73e8cd557211bda3df698df6",
"si... |
from os import remove
from os.path import isfile
from python_utility.configuration import Configuration
def test_set_get_remove() -> None:
configuration = Configuration()
# should be empty
assert configuration.contains('my-key') is False
assert configuration.get('my-key') == ''
# should contain... | {
"content_hash": "1685ac046e95d25c020b8ce7693ef967",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 27.424657534246574,
"alnum_prop": 0.6838161838161838,
"repo_name": "FunTimeCoding/python-utility",
"id": "31352e9d0e96e6ef10ead08bf20c5e5fc9283d91",
... |
import uuid
from oslo_config import cfg
from oslo_log import log
import tooz.coordination
from aodh.i18n import _LE, _LI
from aodh import utils
LOG = log.getLogger(__name__)
OPTS = [
cfg.StrOpt('backend_url',
default=None,
help='The backend URL to use for distributed coordination. ... | {
"content_hash": "643dfa1ecaac58de926e00e7be7e0e5b",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 79,
"avg_line_length": 35.84662576687116,
"alnum_prop": 0.5723087455074448,
"repo_name": "sileht/aodh",
"id": "f77ba370233c36272e1c011af719df5b41b989a2",
"size": "6419",
... |
"""
Regression tests for Aqara AR004.
This device has a non-standard programmable stateless switch service that has a
service-label-index despite not being linked to a service-label.
https://github.com/home-assistant/core/pull/39090
"""
from homeassistant.components.device_automation import DeviceAutomationType
from... | {
"content_hash": "20ca5bdcf7b5f4cf26fe34ca6ae0f852",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 32.280701754385966,
"alnum_prop": 0.653804347826087,
"repo_name": "home-assistant/home-assistant",
"id": "945d950ecc93e4d4fdfc18eb524e1c43ff45ca42",
... |
'''
This module contains methods that are invoked from the c notifier class
'''
def read_notification(file):
pass
def write_notification(file):
pass
def delete_notification(file):
pass
| {
"content_hash": "ed4b0b5455afbd01859962597b7a210f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 16.583333333333332,
"alnum_prop": 0.7236180904522613,
"repo_name": "NucleaPeon/cytify",
"id": "14e3f105fc3694f70b73085c49584d33dbf59fd0",
"size": "22... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
unified_strdate,
get_element_by_id,
get_element_by_attribute,
int_or_none,
qualities,
)
# There are different sources of video in arte.tv, the extraction process
# is dif... | {
"content_hash": "a5bb4f4dc6428ca46c5c357326dd57ab",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 140,
"avg_line_length": 37.40637450199203,
"alnum_prop": 0.5419107466183832,
"repo_name": "janusnic/youtube-dl-GUI",
"id": "929dd3cc5550beb1b2da8874763084b5146d2f33",
"siz... |
"""
tcp.py
Thread Criticality Predictor [bhattacharjee2009tcpfdpparmicm].
Keeps track of memory-related CPI component per core.
Defines a SimUtil command so the application can read TCP values per core.
From application, call SimUtil(SIM_USER_TCP, <coreid>) to get a core's absolute criticality metric (0..1000)
"""
i... | {
"content_hash": "f9a41936600c3fa97e5c91bbfb9fc8e4",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 113,
"avg_line_length": 35.24,
"alnum_prop": 0.6793416572077186,
"repo_name": "yonggang985/Sniper",
"id": "b02d9b4aa47369b51e60b7b012b3ea839121b75b",
"size": "1762",
"bin... |
from vtk import *
import os.path
# Set database parameters
data_dir = "../../../../VTKData/Data/Infovis/SQLite/"
if not os.path.exists( data_dir):
data_dir = "../../../../../VTKData/Data/Infovis/SQLite/"
if not os.path.exists( data_dir):
data_dir = "../../../../../../VTKData/Data/Infovis/SQLite/"
sqlite_file = dat... | {
"content_hash": "ebd5b5a4d624c6c851cbb6a7a09bf2d6",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 82,
"avg_line_length": 31.147058823529413,
"alnum_prop": 0.7645577588920365,
"repo_name": "ashray/VTK-EVM",
"id": "a2220e49d1730343ad74d880e322f86eae894a5a",
"size": "3199... |
import argparse
from pipeline.backend.pipeline import PipeLine
from pipeline.component import DataTransform
from pipeline.component import HeteroLinR
from pipeline.component import Intersection
from pipeline.component import Reader
from pipeline.interface import Data
from pipeline.utils.tools import load_job_config
... | {
"content_hash": "a06abd977c6efb18bf52259a030449c8",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 120,
"avg_line_length": 40.7887323943662,
"alnum_prop": 0.6301795580110497,
"repo_name": "FederatedAI/FATE",
"id": "9b404c8922544bc6a948a1755173ad43b0b8b083",
"size": "3513... |
"""Python client for pw_transfer integration test."""
import logging
import socket
import sys
from google.protobuf import text_format
from pw_hdlc.rpc import HdlcRpcClient, default_channels
from pw_status import Status
import pw_transfer
from pigweed.pw_transfer import transfer_pb2
from pigweed.pw_transfer.integratio... | {
"content_hash": "ae9ca560a74aa75902386a2167c64be2",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 82,
"avg_line_length": 36.152,
"alnum_prop": 0.5817658774065059,
"repo_name": "google/pigweed",
"id": "8bb4ec4f7aea31368504273daade72807452eb05",
"size": "5126",
"binary... |
from PySide import QtGui, QtCore
import sys
import time
from traits.api import HasTraits, Instance, on_trait_change, Range
from traitsui.api import View, Item
from mayavi.core.ui.api import MayaviScene, MlabSceneModel, \
SceneEditor
# Create the data.
from sympy import sympify
from predefined_surfaces impor... | {
"content_hash": "55172f268a8efcc5791b479108529ee7",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 119,
"avg_line_length": 40.00651465798045,
"alnum_prop": 0.6187103077674646,
"repo_name": "ChristosT/colour-surfaces",
"id": "f6572ab2157a45bd8af52441eea2a8e63c8f7197",
"s... |
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .lemmatizer import LOOKUP
from .stop_words import STOP_WORDS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from ...language import Language
from ...attrs import LANG, NORM
... | {
"content_hash": "0df167a329fedd68139cd213567a875d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 94,
"avg_line_length": 29.103448275862068,
"alnum_prop": 0.7476303317535545,
"repo_name": "recognai/spaCy",
"id": "9d1eedfe40660595ed26ba29a203f984c3025bbf",
"size": "859",... |
from openerp.osv import osv, fields
class res_partner(osv.Model):
_inherit = 'res.partner'
_order = 'display_name'
def _display_name_compute(self, cr, uid, ids, name, args, context=None):
context = dict(context or {})
context.pop('show_address', None)
return dict(self.name_get(cr, ... | {
"content_hash": "36545ce02171ca30b742d480f04712f6",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 131,
"avg_line_length": 44.5,
"alnum_prop": 0.6109550561797753,
"repo_name": "chjw8016/GreenOdoo7-haibao",
"id": "6247ca268065980ceebca2a76c7d4ef9bee62625",
"size": "2396",... |
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from securedpi_locks import views
urlpatterns = [
url(r'^(?P<pk>\d+)/edit/$',
login_required(views.EditLockView.as_view()),
name='edit_lock'),
url(r'^(?P<pk>\d+)/delete/$',
login_require... | {
"content_hash": "1ed4c2815ad4bcb87fc507c25414e6db",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 60,
"avg_line_length": 30.51851851851852,
"alnum_prop": 0.5825242718446602,
"repo_name": "Secured-Pi/Secured-Pi",
"id": "b8f6e9e2c8ee286887fba76d49775a047c45b10b",
"size": ... |
"""
.. dialect:: mysql
:name: MySQL
Supported Versions and Features
-------------------------------
SQLAlchemy supports MySQL starting with version 4.1 through modern releases.
However, no heroic measures are taken to work around major missing
SQL features - if your server version does not support sub-selects, f... | {
"content_hash": "711aa15b6ab2ca2ef59d75bf0c74d423",
"timestamp": "",
"source": "github",
"line_count": 3391,
"max_line_length": 94,
"avg_line_length": 35.720731347685046,
"alnum_prop": 0.5828331778517118,
"repo_name": "hsum/sqlalchemy",
"id": "2c78de2fc685f4245b55fe2aa5e24bc923eba33a",
"size": "12... |
import os
from twilio.rest import Client
# To set up environmental variables, see http://twil.io/secure
ACCOUNT_SID = os.environ['TWILIO_ACCOUNT_SID']
AUTH_TOKEN = os.environ['TWILIO_AUTH_TOKEN']
client = Client(ACCOUNT_SID, AUTH_TOKEN)
binding = client.notify.v1.services(sid='ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
... | {
"content_hash": "5d6cc7c984fee501e3b12bb12501bb91",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 33.72222222222222,
"alnum_prop": 0.7018121911037891,
"repo_name": "TwilioDevEd/api-snippets",
"id": "b1134beb272f72902fdc72fc6044f1baf79d58b7",
"size... |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class UserProfile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
submitted_not... | {
"content_hash": "5704685a47b78c5a4bbac0e1fdea7b9e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 87,
"avg_line_length": 31.870967741935484,
"alnum_prop": 0.6700404858299596,
"repo_name": "lojack/wagtail",
"id": "eb0aa0c9efbb34f2cc90d612471b9eeaf802bfe1",
"size": "988",... |
import os
def get_top_directory():
import asciimap
return os.path.basename(asciimap.__path__[0])
def get_test_module():
return get_top_directory().replace("/", ".")
| {
"content_hash": "5f7e5f5ad97aec834f3b75b1856bdc36",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 49,
"avg_line_length": 20,
"alnum_prop": 0.65,
"repo_name": "oubiwann/ascii-mapper",
"id": "89350a1061c243b6b8981a18bdea3ff8da431542",
"size": "180",
"binary": false,
"c... |
import os
import unittest
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
from systestlib import DutSystemTest
class TestApiMlag(DutSystemTest):
def test_get(self):
for dut in self.duts:
dut.config(['no interface Port-Channel1-2000',
'de... | {
"content_hash": "fdb06353e00a5c20c4068bead691c8d9",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 96,
"avg_line_length": 45.89949748743719,
"alnum_prop": 0.5943726735274798,
"repo_name": "SivagnanamCiena/pyeapi",
"id": "b77b65a8e840252e3731c9a42f904ed5c9f469cd",
"size"... |
import datetime
import pytz
from unittest import TestCase
from mock import patch, Mock, call
from purchasing.jobs.job_base import JobBase, EmailJobBase
from purchasing_test.factories import JobStatusFactory
import logging
logging.getLogger("factory").setLevel(logging.WARN)
class FakeJobBase(JobBase):
jobs = []... | {
"content_hash": "7f3ceb7e999cc6af96c8bdf65ab595ed",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 100,
"avg_line_length": 30.83809523809524,
"alnum_prop": 0.6815935762816553,
"repo_name": "ajb/pittsburgh-purchasing-suite",
"id": "e7415bee26860efd2d655805b1ec0ca5a90d3c14"... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates... | {
"content_hash": "a9d235ff23f7bec2afcb64dff4664a3c",
"timestamp": "",
"source": "github",
"line_count": 12079,
"max_line_length": 130,
"avg_line_length": 36.2813974666777,
"alnum_prop": 0.6502282979990553,
"repo_name": "googleapis/python-aiplatform",
"id": "c82d476bb5a8c197a3432d3770a693dc30277b1f",
... |
from functools import lru_cache
import random
import re
from sqlalchemy import Column, String
from seabird.plugin import Plugin, CommandMixin
from .db import Base, DatabaseMixin
class Bleep(Base):
__tablename__ = "bleep"
bad_word = Column(String, primary_key=True)
replacement = Column(String)
class ... | {
"content_hash": "a0da4be13619996899aa21d5da479275",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 80,
"avg_line_length": 28.571428571428573,
"alnum_prop": 0.5753846153846154,
"repo_name": "belak/pyseabird",
"id": "d81d3c48035be2c95f0fb7c77af616344fa74e1e",
"size": "2600... |
import telnetlib
import time
from getpass import getpass
import socket
import sys
pynet_rtr1 = u'184.105.247.70'
COMMAND = ('show ip interface brief',)
TELNET_PORT = 23
TELNET_TIMEOUT = 6
class TN(object):
def __init__(self, ip_addr, TELNET_PORT=23, TELNET_TIMEOUT=6):
'''' constructor to initialise varia... | {
"content_hash": "3df2b967a7b5f24fad434ce88029e6f0",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 93,
"avg_line_length": 31.483870967741936,
"alnum_prop": 0.6111680327868853,
"repo_name": "krunal7558/week2",
"id": "538e038f11aa344a24e9aca40c9d7aaeb19f83e0",
"size": "197... |
"""
===================
Gtf_subset pipeline
===================
Overview
========
This pipeline generates a number of annotations that can be used with
downstream CGAT pipelines. The user will download a GTF from ENSEMBL
and then the GTF is parsed and filtered.In addition to downloading an
ensembl GTF the user will n... | {
"content_hash": "543dd5117a11cdf6d1b4028d08902db0",
"timestamp": "",
"source": "github",
"line_count": 1624,
"max_line_length": 79,
"avg_line_length": 30.19704433497537,
"alnum_prop": 0.6408849918433932,
"repo_name": "CGATOxford/CGATPipelines",
"id": "0eef8a92d65190f9a5c93c1c0a6ac19eb1ee658c",
"si... |
import tensorflow as tf
import configuration
import numpy as np
from LSTM_model import LSTM_model
def main():
config = configuration.ModelConfig(data_filename="input_seqs_eval")
train(config)
def train(config):
with tf.Graph().as_default():
model = LSTM_model(config)
inputs_seqs_batch, outputs_batch = ... | {
"content_hash": "fb18c5e15f361630f3c190b9cdd6569a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 85,
"avg_line_length": 30.615384615384617,
"alnum_prop": 0.6168341708542714,
"repo_name": "jxwufan/AssociativeRetrieval",
"id": "8984fe7e06595e92dd92763b27f3daa815944676",
... |
__license__ = "Apache 2.0"
__copyright__ = "Copyright 2008 nb.io"
__author__ = "Randy Reddig - ydnar@nb.io"
from django.template import Library, Node
from django.conf import settings
from nbio.django.shortcuts import build_url
class UrlNode(Node):
def __init__(self, host=None, path='', allow_override=False):
... | {
"content_hash": "fb3298093537ee71d33656fe06a4318b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 86,
"avg_line_length": 27.82,
"alnum_prop": 0.6757728253055356,
"repo_name": "nbio/nbio-django",
"id": "930588c8ead4f29d95212cb156194027bdcbff2e",
"size": "1391",
"binary... |
import io
import math
import os
import re
import shlex
import subprocess
from collections import deque
from threading import Thread
import eventlet
from eventlet.green.subprocess import Popen
from app import db, config, app
from app.library.formatters import duration_to_seconds
from app.models.file import File
from a... | {
"content_hash": "b209267e1d9de7ca9ce5d7c422a7a3e5",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 143,
"avg_line_length": 38.551515151515154,
"alnum_prop": 0.606980034585757,
"repo_name": "dhardtke/pyEncode",
"id": "58921bf8e4b81cfe349fe1c2738acc60afdb8ebc",
"size": "6... |
from doxygen import DoxygenNode
from sphinx.util.compat import Directive
class concept(DoxygenNode):
def __init__(self, name, inherits, **kwargs):
super(concept,self).__init__(**kwargs)
self.inherits = inherits
self.name = name
def render(self):
# template = self.environment.ge... | {
"content_hash": "7d09ce27a48364d762252470d21a3472",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 81,
"avg_line_length": 28.848484848484848,
"alnum_prop": 0.5955882352941176,
"repo_name": "troelsfr/Gasp",
"id": "de6a64e5483558a1bca8ce1d4112dd1c70259ce1",
"size": "1904",... |
"""
SPECSENS calulates the calibration curve given an observation, a standard star,
and the extinction curve for the site. The task assumes a 1-D spectrum that
has already been sensed from the original observations.
Author Version Date
-----------------------------------------------
S. M. Crawfor... | {
"content_hash": "a44826ec016910f7ef8ca32127035f31",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 138,
"avg_line_length": 36.62721893491124,
"alnum_prop": 0.6516962843295638,
"repo_name": "saltastro/pysalt",
"id": "497cd8ead6b7e020dfcb3c2d86a18526fe891282",
"size": "63... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contest', '0004_remove_contestproblem_difficulty'),
]
operations = [
migrations.AddField(
model_name='contestproblem',
name=... | {
"content_hash": "f0536aa8eeb55659313f63260e880a86",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 61,
"avg_line_length": 22,
"alnum_prop": 0.6111111111111112,
"repo_name": "Timeship/OnlineJudge-1",
"id": "e0a025dc0e1582222ee61cdef862a2bccae30ffb",
"size": "420",
"bina... |
"""Offer time listening automation rules."""
from datetime import datetime
from functools import partial
import voluptuous as vol
from homeassistant.components import sensor
from homeassistant.const import (
ATTR_DEVICE_CLASS,
CONF_AT,
CONF_PLATFORM,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeas... | {
"content_hash": "13538463374955484536f44868265313",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 89,
"avg_line_length": 33.56666666666667,
"alnum_prop": 0.519364448857994,
"repo_name": "adrienbrault/home-assistant",
"id": "69f01672078cc2c408285d1a4994e89c87a18d3b",
"s... |
import _plotly_utils.basevalidators
class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator):
def __init__(self, plotly_name="colorscale", parent_name="heatmapgl", **kwargs):
super(ColorscaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | {
"content_hash": "44d4ddd0ad115e7d3c83d89ba81b93cf",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 41.166666666666664,
"alnum_prop": 0.6356275303643725,
"repo_name": "plotly/plotly.py",
"id": "3574f6667bed070522574ea1f9ac1ef3227c0fb8",
"size": "494... |
from __future__ import print_function
import sys
import glob
sys.path.append("..")
sys.path.append("../data_sequence")
sys.path.append("../helpers")
from detections_pb2 import Detections, Detection
from data_sequence import DataSequence
import os, os.path
from optparse import OptionParser
def open_data_sequence(... | {
"content_hash": "8e743c5a835a6aeb0924a5e6799275e2",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 145,
"avg_line_length": 25.011904761904763,
"alnum_prop": 0.6454069490718706,
"repo_name": "LevinJ/Pedestrian-detection-and-tracking",
"id": "d85fb67ae586e2514491d2ab055ddaa... |
from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if not ("django.contrib.sites" in settings.INSTALLED_APPS):
raise ImproperlyConfigured("django.contrib.sites is required")
# The maximum allowed length for field values.
FIELD_MAX_LE... | {
"content_hash": "e69deea19af657e0800db49281510b11",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 81,
"avg_line_length": 40.607142857142854,
"alnum_prop": 0.7559366754617414,
"repo_name": "nimbis/django-forms-builder",
"id": "7a16ba3fd224c0d59182fb0cfea2a15d54185f3e",
"... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('waldur_rancher', '0012_cluster_initial_data'),
]
operations = [
migrations.RemoveField(model_name='cluster', name='initial_data',),
]
| {
"content_hash": "67ab196456d3a21db8a03aa24cb7cfc9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 21.75,
"alnum_prop": 0.6513409961685823,
"repo_name": "opennode/waldur-mastermind",
"id": "bc59c1e8191e721c4a9de5c2e85f6fe3688b29b1",
"size": "310",
... |
"""Jarvis
Multi-purpose processing framework with frequently used utilities.
"""
__author__ = ["Alexandru Coman", "Cosmin Poieana"]
__copyright__ = "Copyright (c) 2014 RoPython"
__credits__ = []
__version__ = "0.1a"
__maintainer__ = ["Alexandru Coman", "Cosmin Poieana"]
__email__ = ["alex@ropython.org", "cmin@ropytho... | {
"content_hash": "94d81ce9ff503893665011a65a9de59b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 66,
"avg_line_length": 29.583333333333332,
"alnum_prop": 0.6591549295774648,
"repo_name": "RoPython/jarvis",
"id": "9378b0a7333a41e11f41f6d0cdcffcacf79fb0c4",
"size": "355"... |
import os
import pickle
import copy
import numpy as np
CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 }
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, 'r', encoding='utf-8') as f:
return f.read()
def p... | {
"content_hash": "7e30b7660a561f3ba38f72a432b166c2",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 110,
"avg_line_length": 28.1010101010101,
"alnum_prop": 0.5970524802300503,
"repo_name": "d-k-b/udacity-deep-learning",
"id": "4ec7c43fd617d664cf4f2ecae84d68b0f2a5a886",
"s... |
import string
import os
import sys
DIST_PACK_DIR = os.path.dirname(os.path.realpath(__file__))
VIA_SRC_DIR = os.path.join(DIST_PACK_DIR, '..')
SOURCE_HTML = os.path.join(VIA_SRC_DIR, 'src', 'index.html')
OUT_HTML = os.path.join(VIA_SRC_DIR, 'dist', 'via.html')
def get_src_file_contents(filename):
full_filename = o... | {
"content_hash": "1f5b39959af91651be840effdbf7fbe8",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 75,
"avg_line_length": 36.26190476190476,
"alnum_prop": 0.5633617859487853,
"repo_name": "ox-vgg/via",
"id": "08ab4ec927d3a797df6fab487256cc6cc752137e",
"size": "1635",
"... |
import argparse
import datetime
import json
import os
import math
import random
import re
import shutil
import sys
import subprocess
import tempfile
class FileInfo(object):
mb = 1000000 # we use os.stat that gives the file size in kb
@staticmethod
def normalize_name(name):
"""
:param n... | {
"content_hash": "e482471a664dfe3c0b614f171a2c66cb",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 115,
"avg_line_length": 32.89664804469274,
"alnum_prop": 0.5992188163369279,
"repo_name": "ofreshy/ojo",
"id": "86ded157e68b5c711c073f135a4624623acc563e",
"size": "11777",... |
from a10sdk.common.A10BaseClass import A10BaseClass
class PortRange(A10BaseClass):
""" :param port_start: {"optional": false, "type": "number", "description": "Single Port or Port Range Start", "format": "number"}
:param port_end: {"optional": false, "type": "number", "description": "Port Range End", ... | {
"content_hash": "a38be2296b823087d713479e35dd5e38",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 177,
"avg_line_length": 36.13157894736842,
"alnum_prop": 0.6453022578295703,
"repo_name": "amwelch/a10sdk-python",
"id": "9f676bc531a1cc94b85ef675d3be2a01ac9d4568",
"size":... |
from collections import OrderedDict
import re
import os
from xml.etree import ElementTree as ET
import openmc
import openmc.checkvalue as cv
from openmc.data import NATURAL_ABUNDANCE, atomic_mass
class Element(str):
"""A natural element that auto-expands to add the isotopes of an element to
a material in the... | {
"content_hash": "7bbd41ca3faee08a3ec5b356ad3e7835",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 80,
"avg_line_length": 41.20673076923077,
"alnum_prop": 0.5856959514642399,
"repo_name": "johnnyliu27/openmc",
"id": "336d1f028bc74433e8686e77f8a5dfc852d7ad68",
"size": "8... |
from suit.apps import DjangoSuitConfig
from suit.menu import ChildItem, ParentItem
class SuitConfig(DjangoSuitConfig):
layout = 'vertical'
menu = (
ParentItem('Users', children=[
ChildItem(model='users.user'),
ChildItem(model='auth.group'),
], icon='fa fa-users'),
... | {
"content_hash": "b7615fcc577a13e5cd90b460c1fe1feb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 61,
"avg_line_length": 27.428571428571427,
"alnum_prop": 0.6276041666666666,
"repo_name": "mongkok/defocus",
"id": "601d4056272ab2f788b5a0c135e8419104c170a0",
"size": "384"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.