text stringlengths 4 1.02M | meta dict |
|---|---|
from os import environ
from django.core.management.base import BaseCommand, CommandError
from seed_services_client import StageBasedMessagingApiClient
from registrations.models import SubscriptionRequest
from ._utils import validate_and_return_url
class Command(BaseCommand):
help = (
"This command will... | {
"content_hash": "519da937b6de003162c477b174faee8f",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 87,
"avg_line_length": 32.84615384615385,
"alnum_prop": 0.5680829708932753,
"repo_name": "praekeltfoundation/ndoh-hub",
"id": "0a9a73ff069ae9e3db6a0a70ddf396cc308baf3b",
"s... |
import sys
import unittest
from nose.config import Config
from nose.plugins import debug
from optparse import OptionParser
from StringIO import StringIO
class StubPdb:
called = False
def post_mortem(self, tb):
self.called = True
class TestPdbPlugin(unittest.TestCase):
def setUp(self):
sel... | {
"content_hash": "f45681ffc52fb5b0219349f8b6ce2641",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 74,
"avg_line_length": 27.700854700854702,
"alnum_prop": 0.5541499537179883,
"repo_name": "dbbhattacharya/kitsune",
"id": "cdd43f23c4a6ef6c895a40120d5e477218ef7ac4",
"size... |
"""Class to perform under-sampling based on the instance hardness
threshold."""
from __future__ import print_function
from __future__ import division
import numpy as np
from collections import Counter
from sklearn.cross_validation import StratifiedKFold
from ..base import BaseBinarySampler
ESTIMATOR_KIND = ('knn'... | {
"content_hash": "61d565cd2457e500caae884b5837a0e4",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 80,
"avg_line_length": 36.357798165137616,
"alnum_prop": 0.6018168054504164,
"repo_name": "dvro/imbalanced-learn",
"id": "5951c077336992a0600911a2a2f556a1a95107c8",
"size"... |
import py, pytest
import sys
class TestPDB:
def pytest_funcarg__pdblist(self, request):
monkeypatch = request.getfuncargvalue("monkeypatch")
pdblist = []
def mypdb(*args):
pdblist.append(args)
plugin = request.config.pluginmanager.getplugin('pdb')
monkeypatch.set... | {
"content_hash": "107191ea39e7318f7625319d81dd8f55",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 71,
"avg_line_length": 30.524752475247524,
"alnum_prop": 0.49367499189101527,
"repo_name": "lotaku/pytest-2.3.5",
"id": "71781afb4ce432aae136d706b82e227af414e86b",
"size":... |
import sys
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import transaction
from tenant_schemas.utils import get_public_schema_name
def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True):
from django.core.management import color
fr... | {
"content_hash": "5728ca5af0d7abc6361da07bba3496f3",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 86,
"avg_line_length": 29.421875,
"alnum_prop": 0.6691449814126395,
"repo_name": "mcanaves/django-tenant-schemas",
"id": "5ce6c599dc118e0d436d747809c5c5c40bec8e82",
"size":... |
from django.apps import AppConfig
class CalendarioConfig(AppConfig):
name = 'frequencia.calendario'
| {
"content_hash": "b939f67470c4a69339be0e7cfcfeaf2f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 21.2,
"alnum_prop": 0.7830188679245284,
"repo_name": "bczmufrn/frequencia",
"id": "dd5fccb7ce863ce6c15ecb817c39222e43357a90",
"size": "106",
"binary... |
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <Security/SecItem.h>
"""
TYPES = """
const CFTypeRef kSecAttrKeyType;
const CFTypeRef kSecAttrKeySizeInBits;
const CFTypeRef kSecAttrIsPermanent;
const CFTypeRef kSecAttrKeyTypeRSA;
const CFTypeRef kSecAttrKeyTypeDSA;
const CFTyp... | {
"content_hash": "903ce0ac5604672f85c5c9a3c1699a4e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 64,
"avg_line_length": 17.4,
"alnum_prop": 0.7402298850574712,
"repo_name": "viraptor/cryptography",
"id": "ac3dad3ffadb3c5ee920e61a01955bae0c72e12b",
"size": "981",
"bin... |
from test.parser.pattern.matching.base import PatternMatcherBaseClass
class PatternMatcherISetTests(PatternMatcherBaseClass):
def test_basic_iset_match(self):
self.add_pattern_to_graph(pattern="I AM A <iset>MAN, WOMAN</iset>", topic="*", that="*", template="1")
context = self.match_sentence("I A... | {
"content_hash": "6fc21a88f366a34d9d2d31dbbe502715",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 110,
"avg_line_length": 44.05882352941177,
"alnum_prop": 0.678237650200267,
"repo_name": "CHT5/program-y",
"id": "72bd7d0edde0c85f72b736e2d0a177f7950bd5bb",
"size": "750",
... |
import logging
import urllib3, socket, json
import time, math
# Parse config
from six.moves import configparser
config = configparser.ConfigParser()
config.read('bot.cfg')
wallet = config.get('main', 'wallet')
# MySQL requests
from common_mysql import mysql_select_accounts_list, mysql_select_accounts_list_extra
# ... | {
"content_hash": "17fb4371020de952744240af7b2cf5d7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 87,
"avg_line_length": 25.178571428571427,
"alnum_prop": 0.6971631205673758,
"repo_name": "SergiySW/RaiWalletBot",
"id": "5dc7c4a983169895c84f8e71df9d1509f4209abc",
"size":... |
"""
Resources needed by pkg providers
"""
import copy
import fnmatch
import logging
import os
import pprint
import salt.utils.data
import salt.utils.versions
import salt.utils.yaml
from salt.exceptions import SaltInvocationError
log = logging.getLogger(__name__)
__SUFFIX_NOT_NEEDED = ("x86_64", "noarch")
def _rep... | {
"content_hash": "35208b8a2a54d59ff2c18f966f226867",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 225,
"avg_line_length": 30.276442307692307,
"alnum_prop": 0.5797538705835649,
"repo_name": "saltstack/salt",
"id": "a6fa5eecd3fa34da9f36b0e661decf3dec4dc57a",
"size": "125... |
"""Module for some node classes. More nodes in scoped_nodes.py
"""
import abc
import builtins as builtins_mod
import itertools
import pprint
from functools import lru_cache
from functools import singledispatch as _singledispatch
from astroid import as_string
from astroid import bases
from astroid import context as co... | {
"content_hash": "f3780731b2c74696f67dd63cab287358",
"timestamp": "",
"source": "github",
"line_count": 4671,
"max_line_length": 93,
"avg_line_length": 29.190323271248126,
"alnum_prop": 0.5829715140669464,
"repo_name": "ekwoodrich/python-dvrip",
"id": "204d80233a117dd5241d1d358ffa4bb5dddaeee5",
"si... |
from google.cloud import artifactregistry_v1beta2
def sample_delete_repository():
# Create a client
client = artifactregistry_v1beta2.ArtifactRegistryClient()
# Initialize request argument(s)
request = artifactregistry_v1beta2.DeleteRepositoryRequest(
name="name_value",
)
# Make the ... | {
"content_hash": "db980e008dc5b38c0a71bedcf9e3fd59",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 81,
"avg_line_length": 26.17391304347826,
"alnum_prop": 0.7342192691029901,
"repo_name": "googleapis/python-artifact-registry",
"id": "62a1456b4c6bf602e8434632998ad52c65ab33e... |
import json
import os
import re
import base64
import datetime
import mistune
import dbconn
import dbutil
from contextlib import suppress
from hashlib import md5
from steem.blockchain import Blockchain
from steem.utils import block_num_from_hash
from bs4 import BeautifulSoup
from langdetect import detect
class Article:... | {
"content_hash": "8ec166774a72f117803187cdceb65aac",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 110,
"avg_line_length": 37.47692307692308,
"alnum_prop": 0.4967159277504105,
"repo_name": "taeminlee/steemtrend.crawler",
"id": "e2df2476032ec233da4e1220202a1e7be604b490",
... |
import logging
from django.conf import settings
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.contrib.auth import logout, login, get_user_model
from admin_helper.utils import... | {
"content_hash": "273169465ec5b8fc7fc11ab7c94dbb9b",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 97,
"avg_line_length": 34.40625,
"alnum_prop": 0.587344838026037,
"repo_name": "truetug/django-admin-helper",
"id": "5e63b92c95667b2e81c1444c48628820770a9bb6",
"size": "332... |
from __future__ import unicode_literals
from django.db import models
class Musician(models.Model):
no=models.IntegerField(primary_key=True)
name=models.CharField('原名',max_length=40)
stagename=models.CharField('艺名',max_length=40,null=True,blank=True)
sex=models.CharField('性别',choices=(('M', '男'), ('F', ... | {
"content_hash": "f3fcbf37bd5d76a152db47b4e8f95075",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 81,
"avg_line_length": 39.48780487804878,
"alnum_prop": 0.7492279184681903,
"repo_name": "tea321000/django-project",
"id": "20dc211d607ae7d284c588020ecf01f8f6617b4f",
"size... |
import configparser
# Configuring bot
config = configparser.ConfigParser()
config.read_file(open('config.ini'))
support_chat_id = int(config['DEFAULT']['support_chat_id'])
| {
"content_hash": "5deda3f9b5b83f999cc8dd538e816c82",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 59,
"avg_line_length": 24.857142857142858,
"alnum_prop": 0.7528735632183908,
"repo_name": "TheCoreMan/Irgunomator",
"id": "48412ae9325b4178b5421b906315a94566e12022",
"size":... |
import catoclient.catocommand
from catoclient.param import Param
class UpdateCloud(catoclient.catocommand.CatoCommand):
Description = 'Updates the properties of a Cloud Endpoint.'
API = 'update_cloud'
Examples = '''
_Update the address of a vCloud cloud endpoint_
cato-update-cloud -n "vcloud-test" -u... | {
"content_hash": "f5de7e638e5aed540664f4caf4eac374",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 95,
"avg_line_length": 44.44827586206897,
"alnum_prop": 0.5795190069821567,
"repo_name": "cloudsidekick/catoclient",
"id": "091c38bf6669e5ecf71aeee9a78d9fa745f9247e",
"size... |
from __future__ import print_function
import pickle
from time import time
from twisted.internet.defer import (
FirstError, DeferredList, inlineCallbacks, returnValue)
from twisted.web.http_headers import Headers
from twisted.python.log import msg
from twisted.web.http import NO_CONTENT, NOT_FOUND
from stats impo... | {
"content_hash": "27c9023c5000488cf68033d034ab21e0",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 111,
"avg_line_length": 31,
"alnum_prop": 0.5737783455764931,
"repo_name": "trevor/calendarserver",
"id": "34dba6be54d45449d756497bb457d3ce73bff644",
"size": "6872",
"bi... |
"""Abstract adapter class."""
from __future__ import absolute_import
import logging
from pprint import pformat
from functools import wraps
from six import Iterator
from pyasn1.type.univ import Null
from snmp_orm.config import DEBUG
from snmp_orm.settings import SnmpV2Settings, SnmpV3Settings
from snmp_orm.utils imp... | {
"content_hash": "9bf8df51d7c68e79d29146816ea19b8a",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 87,
"avg_line_length": 30.693181818181817,
"alnum_prop": 0.5497963717141799,
"repo_name": "blackwithwhite666/snmp_orm",
"id": "58567a3b8fa54bf3c3ea178383ff93d77c20aa81",
"... |
"""Serves content for "script" handlers using an HTTP runtime.
http_runtime supports two ways to start the runtime instance.
START_PROCESS sends the runtime_config protobuf (serialized and base64 encoded
as not all platforms support binary data over stdin) to the runtime instance
over stdin and requires the runtime i... | {
"content_hash": "8d43d77c28d11fc4f0720909e8896432",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 80,
"avg_line_length": 39.972972972972975,
"alnum_prop": 0.6951487491548344,
"repo_name": "ychen820/microblog",
"id": "0beff17ef42577e79eaa67e65272b656f9d25902",
"size": "... |
from django import forms
from django.core.validators import RegexValidator
from django.db import IntegrityError
from karaoke.models import Request
class RequestForm(forms.Form):
ultrastarValidator = RegexValidator(r'^https:\/\/ultrastar-es\.org\/en\/canciones\?.*$', message="Invalid url")
anilistValidator =... | {
"content_hash": "931b8a66c9499233f9fda8fcd13c503d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 115,
"avg_line_length": 41.529411764705884,
"alnum_prop": 0.626770538243626,
"repo_name": "WarwickAnimeSoc/aniMango",
"id": "9bf7b9767010d14aa360c8d2fa57943b44b7fa13",
"siz... |
import os
import glob
import json
from setup_app import paths
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils import base
from setup_app.installers.node import NodeInstaller
class PassportInstaller(NodeInstaller):
def __init__(self):
setattr(b... | {
"content_hash": "0d24c9327eff279b250c1917d79cb7b1",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 187,
"avg_line_length": 48.29716981132076,
"alnum_prop": 0.6529934563922258,
"repo_name": "GluuFederation/community-edition-setup",
"id": "a54e4dfdc825b3de53c2549da3d30636f7... |
from .resource_update import ResourceUpdate
class SnapshotUpdate(ResourceUpdate):
"""Snapshot update resource.
:param tags: Resource tags
:type tags: dict
:param account_type: the storage account type of the disk. Possible values
include: 'Standard_LRS', 'Premium_LRS'
:type account_type: str... | {
"content_hash": "3ac507438666ee5d293bc5208527bfb2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 132,
"avg_line_length": 49.51063829787234,
"alnum_prop": 0.690159003008165,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "c1adb27cea7e28a14cfa19a9172e5be0c06936bf",
... |
from designateclient import exceptions
from designateclient import v1 as client
from designateclient.v1 import domains
from designateclient.v1 import records
from heat.common import exception as heat_exception
from heat.engine.clients import client_plugin
from heat.engine import constraints
CLIENT_NAME = 'designate'
... | {
"content_hash": "f5ab83c633f52fb0f2b9597433e25e15",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 36.22222222222222,
"alnum_prop": 0.6284935241990457,
"repo_name": "cwolferh/heat-scratch",
"id": "88d0bbe5e2522d136ccd234b06805bb6a29a5111",
"size": ... |
"""Imports objects from music modules into the top-level music namespace."""
from magenta.music.chord_symbols_lib import ChordSymbolException
from magenta.music.chord_symbols_lib import ChordSymbolFunctions
from magenta.music.chords_encoder_decoder import ChordEncodingException
from magenta.music.chords_encoder_decod... | {
"content_hash": "545441096b1522c18b1d953d706727ca",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 81,
"avg_line_length": 48.4875,
"alnum_prop": 0.8623356535189481,
"repo_name": "YoshikawaMasashi/magenta",
"id": "dff859aecd081220c764c36f38caafd931696f79",
"size": "4475",... |
from lxml import etree as ET
from lxml import etree
import datetime
import itertools
import traceback
import pprint
import copy
import dateutil
import logging
from foam.core.exception import CoreException
from foam.core.configdb import ConfigDB
class NoGroupName(CoreException):
def __init__ (self):
super(NoGrou... | {
"content_hash": "bdfb7eda57cc408ab4a865dcdeb5e579",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 112,
"avg_line_length": 29.699386503067483,
"alnum_prop": 0.5937822763891758,
"repo_name": "ict-felix/stack",
"id": "3efa9b77c2ac2a72f22d63b3298b434283547228",
"size": "97... |
from __future__ import absolute_import
from unittest import TestCase
import six
from sentry.utils.compat.mock import patch
from sentry.testutils.helpers.faux import faux
def fakefunc(*args, **kwargs):
pass
@patch("tests.sentry.testutils.helpers.test_faux.fakefunc")
class TestFaux(TestCase):
def test_args(... | {
"content_hash": "e1084afed0aedee78e941235a9c677b4",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 98,
"avg_line_length": 30.03448275862069,
"alnum_prop": 0.6081132797550708,
"repo_name": "beeftornado/sentry",
"id": "d3b382e318546a1c2a959b123b3a254b7789e059",
"size": "26... |
from setuptools import setup
setup(
name='ut2_site',
packages=['ut2_site'],
include_package_data=True,
install_requires=[
'Flask',
'Flask-WTF',
'Flask-Uploads',
'pymongo',
'python-magic'
])
| {
"content_hash": "6b9aea94710694baa8520a4194739863",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 30,
"avg_line_length": 19.307692307692307,
"alnum_prop": 0.5418326693227091,
"repo_name": "cc-ru/ut2-site",
"id": "67ffdf8ce22c63a64feb12d3e7316fd44cbc70fe",
"size": "251",... |
'''
Websocket proxy that is compatible with OpenStack Nova.
Leverages websockify.py by Joel Martin
'''
import Cookie
from select import select
import socket
import websockify
import nova.console.sasl_helper as sasl_helper
from oslo.config import cfg
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from no... | {
"content_hash": "18953a10065576c8ded50f62869833e3",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 77,
"avg_line_length": 36.05084745762712,
"alnum_prop": 0.49396646293684376,
"repo_name": "DirectXMan12/nova-hacking",
"id": "e441699a5062de02df7b042fc5dd081b85789bf2",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0067_card_japan_only'),
]
operations = [
migrations.AlterField(
model_name='account',
name='play_with',
f... | {
"content_hash": "0093f20e6a72103b77aab25b381a6b18",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 603,
"avg_line_length": 53.4,
"alnum_prop": 0.604494382022472,
"repo_name": "rdsathene/SchoolIdolAPI",
"id": "cc61551663656894083df80c7e97082539f3db30",
"size": "1359",
"... |
from os import listdir, path
import numpy as np
from glaze.GL import glGenTextures, glDeleteTextures, glTexParameteri, glTexImage2D, glBindTexture, GL_TEXTURE_MAG_FILTER, GL_LINEAR, GL_TEXTURE_MIN_FILTER, \
GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_UNSIGNED_BYTE, GL_CLAMP_TO_EDGE, GL_TEXTURE_WRAP_R, GL_TEXTURE_CUBE_... | {
"content_hash": "cd36210147e465caad900c3b18d3a69c",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 162,
"avg_line_length": 39.87234042553192,
"alnum_prop": 0.5557630736392742,
"repo_name": "jr-garcia/Engendro3D",
"id": "1cfe1006fadeacac8f01747b17decf966148576a",
"size": ... |
import subprocess, jsonWebToken, APIStockParser
from subprocess import Popen, PIPE
#Checks to see of the user has a ticket
def has_kerberos_ticket():
return True if subprocess.call(['klist', '-s']) == 0 else False
#Issues the JWT to the client
def issueJwt(username, symbol, days):
return jsonWebToken.encode({'us... | {
"content_hash": "09d6e78280492b83ec448582ca640cde",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 82,
"avg_line_length": 33.026315789473685,
"alnum_prop": 0.7402390438247012,
"repo_name": "recreated/Yahoo_API_Parser",
"id": "55b458b8f602a525103a0a534948592cb8b792a1",
"s... |
"""Converts Python data into data for Google Visualization API clients.
This library can be used to create a google.visualization.DataTable usable by
visualizations built on the Google Visualization API. Output formats are raw
JSON, JSON response, JavaScript, CSV, and HTML table.
See http://code.google.com/apis/visua... | {
"content_hash": "2570cb0285a26eff7843bd7f67197fce",
"timestamp": "",
"source": "github",
"line_count": 1075,
"max_line_length": 105,
"avg_line_length": 41.85302325581395,
"alnum_prop": 0.6026626955903271,
"repo_name": "CVBDL/ccollab2eeplatform-python",
"id": "ed4174cd95ef6730c2e87d380471ded88dc26b9e... |
'''
Created on 15 Feb 2013
@author: plish
'''
from distutils.core import setup
setup(
name = 'Trolly',
version = '1.0.0',
author = 'plish',
author_email = 'plish.development@gmail.com',
url = 'https://github.com/plish/Trolly',
packages = ['trolly'],
license ... | {
"content_hash": "4da66129a4e3e68c6b44a8e4b1e90435",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 23.545454545454547,
"alnum_prop": 0.581081081081081,
"repo_name": "plish/Trolly",
"id": "23a417f4e35c4c96655dc0e50ce3fcbefd5dc957",
"size": "518",
... |
from django.conf.urls import *
from .views import ArticleListView, ArticleDetailView
urlpatterns = patterns('',
url(r'^$', ArticleListView.as_view(), name='article-list'),
url(r'^(?P<slug>[^/]+)/$', ArticleDetailView.as_view(), name='article-details'),
)
| {
"content_hash": "6789e3ba1b9310c0936565e7f817fe55",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 84,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.6818181818181818,
"repo_name": "jrief/django-parler",
"id": "a82e08b39a231b923526fbe5c6762909b8b93884",
"size": "2... |
import sys, os
sys.path.insert(0, os.path.split(os.path.split(os.getcwd())[0])[0])
from django.core.management import execute_manager
try:
from . import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the director... | {
"content_hash": "f554c661b8e99569fb6bc7c76970a645",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 299,
"avg_line_length": 44,
"alnum_prop": 0.7159090909090909,
"repo_name": "bjarnoldus/django-roa",
"id": "742cfeb7271ecedb7b4c642fa5b3417515e6e7cf",
"size": "616",
"bina... |
import torch
from typing import List
from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder
@Seq2SeqEncoder.register("compose")
class ComposeEncoder(Seq2SeqEncoder):
"""This class can be used to compose several encoders in sequence.
Among other things, this can be used to add a "pre-c... | {
"content_hash": "db278ad3ac496915fc4cf978a9b540a1",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 95,
"avg_line_length": 34.028985507246375,
"alnum_prop": 0.6448040885860307,
"repo_name": "allenai/allennlp",
"id": "c0dfc88f429181d7b9c9471f15c64eace5e14019",
"size": "234... |
"""Extractors for configuration and job-xml nodes"""
from os import path
from typing import Dict, List
import xml.etree.ElementTree as ET
from o2a.converter.constants import HDFS_FOLDER
from o2a.converter.exceptions import ParseException
from o2a.o2a_libs import el_parser
TAG_CONFIGURATION = "configuration"
TAG_PROPE... | {
"content_hash": "e99101f94c2d3721e97934485c1b1711",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 109,
"avg_line_length": 37.861111111111114,
"alnum_prop": 0.6419662509170947,
"repo_name": "GoogleCloudPlatform/oozie-to-airflow",
"id": "755975902e277e717c0bcb103e54f3fd9aa7... |
from alembic import context
from prettyconf import config
from sqlalchemy import create_engine
from thales import db
DATABASE_URL = config('DATABASE_URL')
METADATA = db.metadata
def run_migrations_offline():
context.configure(url=DATABASE_URL, metadata=METADATA)
with context.begin_transaction():
con... | {
"content_hash": "7410ca07fc9c565ca1b5d47cff56eeee",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 74,
"avg_line_length": 25.142857142857142,
"alnum_prop": 0.7272727272727273,
"repo_name": "cacarrara/thales",
"id": "f7a543f16cbc21ae85644a0070a6d9a51dc7fa7a",
"size": "704... |
from typing import Generator
from typing import Optional
from typing import Union
import pytest
from _pytest._io.saferepr import saferepr
from _pytest.config import Config
from _pytest.config import ExitCode
from _pytest.config.argparsing import Parser
from _pytest.fixtures import FixtureDef
from _pytest.fixtures impo... | {
"content_hash": "1fe3157a386a77a760c6af5a025781a0",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 108,
"avg_line_length": 32.9468085106383,
"alnum_prop": 0.636099451081692,
"repo_name": "nicoddemus/pytest",
"id": "44a1094c0d24faa3c0573ee24e1fd604e49266bc",
"size": "3097... |
import string
import re
import math
import nltk
class Resources(object):
@staticmethod
def set_config(conf):
Resources.conf = conf
@staticmethod
def ensure_nltk_packages():
for package in ('stopwords', 'punkt', 'wordnet'):
nltk.download(package)
""" Thresholds """
... | {
"content_hash": "9dd113d4ff9a6f47d637e18ac7c421b8",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 79,
"avg_line_length": 33.12413793103448,
"alnum_prop": 0.5252966895690193,
"repo_name": "recski/semeval",
"id": "832e7a5a1fc753f37fdc5e46fab9a515110a2998",
"size": "4803"... |
from pypom import Region
from selenium.webdriver.common.by import By
from pages.desktop.base import Base
class Home(Base):
"""Addons Home page"""
_extensions_category_locator = (By.CLASS_NAME, 'Home-CuratedCollections')
_featured_extensions_locator = (By.CLASS_NAME, 'Home-FeaturedExtensions')
_featu... | {
"content_hash": "cc4b1d94926a75e404d0422c2ffaaab1",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 79,
"avg_line_length": 36.8099173553719,
"alnum_prop": 0.6333632689717108,
"repo_name": "atiqueahmedziad/addons-server",
"id": "fcd625495c8ff5e059a9ffc23094809cace13530",
... |
from django import VERSION as DJANGO_VERSION
from django_comments_xtd.conf import settings
if DJANGO_VERSION[1] <= 5: # Django <= 1.5
from django_comments_xtd.compat import import_by_path as import_string
elif 6 <= DJANGO_VERSION[1] < 8: # Django v1.6.x and 1.7.x
from django.utils.module_loading import import_... | {
"content_hash": "82e1b5e4f8b43c0f469ce506b0541e6b",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 75,
"avg_line_length": 38.06818181818182,
"alnum_prop": 0.7253731343283583,
"repo_name": "agilosoftware/django-comments-xtd",
"id": "a80a929406adb6cf75b829d183c0739f51c13fbf"... |
"""
Port description language
This module implements a description mini-language for ports, and provides
functions to parse it and to use it to directly construct appropriate
network server services or to directly listen on them.
Here are some examples. They assume the following toy resource and factory
definitions::... | {
"content_hash": "9a3994c49e384c7b64402e2002b5673d",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 89,
"avg_line_length": 39.4974358974359,
"alnum_prop": 0.6560633601661906,
"repo_name": "sorenh/cc",
"id": "3654413488d689e4c440062065baeef7f3df593a",
"size": "7839",
"b... |
import contextlib
import os
import unittest
from systrace import decorators
from systrace import run_systrace
from systrace import update_systrace_trace_viewer
from systrace import util
TEST_DIR = os.path.join(os.path.dirname(__file__), '..', 'test_data')
COMPRESSED_ATRACE_DATA = os.path.join(TEST_DIR, 'compressed_a... | {
"content_hash": "4e8e0a0c940b8211fb7a8d1779f0c8c8",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 36.75471698113208,
"alnum_prop": 0.6155030800821355,
"repo_name": "catapult-project/catapult-csm",
"id": "2531c919f1d77abdf6fae71d994f6f8a3ccaec0e",
... |
"""Adding ability to mark domains as 'sensitive'
Revision ID: 4c50b903d1ae
Revises: 33de094da890
Create Date: 2015-12-30 10:19:30.057791
"""
# revision identifiers, used by Alembic.
revision = "4c50b903d1ae"
down_revision = "33de094da890"
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects impor... | {
"content_hash": "59bf7dff0bb780706a24117bb8f871e6",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 81,
"avg_line_length": 25.48148148148148,
"alnum_prop": 0.7078488372093024,
"repo_name": "Netflix/lemur",
"id": "93d4a312c8aff45d8a8b056dce50aad00040ba52",
"size": "688",
... |
class Config(object):
PLATFORM = 'sqlite'
DATABASE = '/tmp/blog.db'
DEBUG = False
TESTING = False
SECRET_KEY = 'development key'
MAX_PAGE_ENTRIES = 5
class ProductionConfig(Config):
DATABASE_URI = 'mysql://user@localhost/foo'
class DevelopmentConfig(Config):
DEBUG = True
class TestinConfig(... | {
"content_hash": "06f756cca2b100adbac185674741dff6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 21.75,
"alnum_prop": 0.6839080459770115,
"repo_name": "proudlygeek/proudlygeek-blog",
"id": "364c00dd2155453c44301a363c6b2e091af4f298",
"size": "348"... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_system_ha
except ImportError:
pytest... | {
"content_hash": "a772b597ba3c37ec385ac16df8bef9ae",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 133,
"avg_line_length": 42.06973058637084,
"alnum_prop": 0.49321931741128605,
"repo_name": "thaim/ansible",
"id": "dc2fdfbfb1bddc72201088032bf2a75ff628e592",
"size": "2724... |
import sys
import numpy as np
from ...core.parameterization.parameterized import Parameterized
from paramz.core.observable_array import ObsAr
from paramz.caching import Cache_this
from .kernel_slice_operations import KernCallsViaSlicerMeta
from functools import reduce
import six
@six.add_metaclass(KernCallsViaSlicerMe... | {
"content_hash": "d8a88b5103301973f7d49c2efcd24b58",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 482,
"avg_line_length": 42.501347708894876,
"alnum_prop": 0.6124429223744292,
"repo_name": "avehtari/GPy",
"id": "4379fb71f4ca6ffd518ee7989a0e97ce0927465d",
"size": "15881... |
"""Definition of a pulse, the elementary building block of sequences.
"""
import numpy as np
from atom.api import (Str, Enum, Typed, Property, set_default)
from exopy.utils.atom_util import (update_members_from_preferences)
from .shapes.base_shape import AbstractShape
from .shapes.modulation import Modulation
from .i... | {
"content_hash": "df72f6bd84b13a076902453c95ce0616",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 79,
"avg_line_length": 33.22222222222222,
"alnum_prop": 0.5641025641025641,
"repo_name": "Ecpy/ecpy_pulses",
"id": "f809679c312727ecb23ad68cd21229304eeef44c",
"size": "577... |
from components.component import valid_components
class GameObject(object):
def __init__(self):
self.components = {}
self.observers = {}
self.responders = {}
def copy_to(self, new_game_object):
for component in self.components.values():
new_game_object.register_com... | {
"content_hash": "c5de6b4393534069082e4d941c2c54dd",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 91,
"avg_line_length": 32.617283950617285,
"alnum_prop": 0.6180923542770629,
"repo_name": "jpalladino84/roguelike-game",
"id": "6e8b4114885111ae7b77773d2c8edb8e89ef8802",
"... |
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
'''
This package provides commonly used methods for dealing with file operation,
including working with network file system like S3, http, etc... | {
"content_hash": "318481ec3a3887a99818c19d8f9d200b",
"timestamp": "",
"source": "github",
"line_count": 840,
"max_line_length": 109,
"avg_line_length": 33.319047619047616,
"alnum_prop": 0.616407031584965,
"repo_name": "nkhuyu/SFrame",
"id": "64c5e4cfe9488816ade3872f0be2089f9cef7d89",
"size": "27988... |
#from sumatra.projects import load_project
#from sumatra.parameters import build_parameters
#from sumatra.decorators import capture
from ruffus import *
import sys
import os
import time
import datetime
import drmaa
import csv
from omics_pipe.utils import *
from omics_pipe.modules.fastqc import fastqc
fr... | {
"content_hash": "ef91ff229c298472cc8462e026b5dff7",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 134,
"avg_line_length": 32.67948717948718,
"alnum_prop": 0.6916437818752452,
"repo_name": "adammaikai/OmicsPipe2.0",
"id": "f4a878774936531a17923247f077e221b4873d83",
"size... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "dcb3119b700e8687426d26ef5cd74af5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 37.84,
"alnum_prop": 0.7970401691331924,
"repo_name": "alexryndin/ambari",
"id": "89ab726f0bd85e9e98c9e9eac0c63ddbefbfb6fb",
"size": "946",
"binary... |
import logging
from django.db import migrations
from django.db.models import Q
logger = logging.getLogger(__name__)
def update_record(related_record, parent_record):
if not related_record.update_user:
related_record.update_user = parent_record.update_user
if not related_record.create_user:
... | {
"content_hash": "ee0db07fb26e7f67a27fdbae69b4e996",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 94,
"avg_line_length": 33.38181818181818,
"alnum_prop": 0.6672113289760349,
"repo_name": "bcgov/gwells",
"id": "b29a9a0746bff7e502d5cbd1bcdd2d0c7afcc4f9",
"size": "1884",
... |
"""The Core Storage (CS) file system implementation."""
import pyfvde
from dfvfs.lib import cs_helper
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import cs_path_spec
from dfvfs.resolver import resolver
from dfvfs.vfs import cs_file_entry
from dfvfs.vfs import file_system
class CSF... | {
"content_hash": "25101ce7dea917007681e989814cef1b",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 30.981366459627328,
"alnum_prop": 0.6884522854851644,
"repo_name": "joachimmetz/dfvfs",
"id": "b46d94474f0d34f98b087ebbae3a8e0f954118f7",
"size": "5... |
"""HydraTK extensions implementation class
.. module:: core.extension
:platform: Unix
:synopsis: HydraTK extensions implementation class
.. moduleauthor:: Petr Czaderna <pc@hydratk.org>
"""
class Extension(object):
"""Class Extension
"""
_ext_id = 'Undefined'
_ext_name = 'Undefined'
_ext_... | {
"content_hash": "36c3804185d7a69522d1fc7b54ea8286",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 119,
"avg_line_length": 23.11764705882353,
"alnum_prop": 0.5456197746274082,
"repo_name": "hydratk/hydratk",
"id": "5da82bd3ca9eedc4e4538e1f9a7af2fb4f1308c2",
"size": "277... |
from __future__ import unicode_literals
import re
import unittest
from unittest import skipUnless
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import (
HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite,
m... | {
"content_hash": "4ac5cf576b1016b8ccbce970f5eb49d8",
"timestamp": "",
"source": "github",
"line_count": 811,
"max_line_length": 227,
"avg_line_length": 46.91861898890259,
"alnum_prop": 0.6205355969619721,
"repo_name": "Lightmatter/django-inlineformfield",
"id": "0d43f63eedbb676a8ca825b2be81b57a86b711... |
'''
A flexible renderer that takes a templating engine and a data format
:maintainer: Jack Kuan <kjkuan@gmail.com>
:maturity: new
:platform: all
'''
# See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html
# for a guide to using this module.
#
# FIXME: I really need to review and simpl... | {
"content_hash": "cc2740f3d71bc4b509ceb6fdefa7d1aa",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 89,
"avg_line_length": 34.510416666666664,
"alnum_prop": 0.5700774725827548,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "c306950e21c0c06e2a0d31cfab528cc1cfe... |
import warnings
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
from django import forms
from django.core import exceptions
from django.forms.widgets import HiddenInput, MultiWidget
from django.utils.deprecation import RemovedInDjango31Warning
from django.utils.translation import gettext_lazy as ... | {
"content_hash": "aa2c7fed9fd4fb00b65c189f7b40f35e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 97,
"avg_line_length": 32.0940170940171,
"alnum_prop": 0.6314247669773635,
"repo_name": "mdworks2016/work_development",
"id": "1e3011caad34f6f8bbe53414b39ce7fa670cc1d3",
"... |
import fcntl
import hashlib
import os
import shutil
import subprocess
import sys
# Allow use of this module even if termcolor is missing. There are many
# standalone python scripts in build_tools that can be run directly without
# PYTHONPATH set (i.e. not via build/python_wrapper that adds this path.
# TODO(sbc): we ... | {
"content_hash": "d1b3c7842de58ad85f8951c7786a4922",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 80,
"avg_line_length": 27.91294117647059,
"alnum_prop": 0.6584337857203069,
"repo_name": "Schibum/naclports",
"id": "ec5d5b1ee7f31dab983a5a8b4fed40220d09f0ef",
"size": "12... |
"""
Talon.One API
Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage ap... | {
"content_hash": "ddbbf4dec89cbcc052f4472667d5932a",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 732,
"avg_line_length": 34.4375,
"alnum_prop": 0.6140900841445306,
"repo_name": "talon-one/talon_one.py",
"id": "d9a7b8465a68776b99e7aeba4526c03a8b121219",
"size": "6078",... |
#coding:utf-8
__author__ = 'Jerry'
import sys
prefix = 'uro_'
"""
title comment
"""
def fileTitleComment():
return """ /**
*author:Jerry
*/\n"""
"""
help
"""
def showHelp():
print """help\n
example:
1:createObject.py obj:CWDemoObject 1 s:sName s:sTitle i:nID d:d... | {
"content_hash": "0259eaa96a01fa5e9ae2214be6b1f4fa",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 139,
"avg_line_length": 31.944099378881987,
"alnum_prop": 0.5012638537818394,
"repo_name": "Joey-Lee/Automation-Task-by-Ruby",
"id": "297c33a7aca167f6db8e60df47f3a4fca12898a... |
import unittest
from rename import process_file
class TestProcessFile(unittest.TestCase):
binary_file_path = 'tests/tests_files/binary_file'
def setUp(self):
"This will run before any test in this class"
self.create_binary_file()
def tearDown(self):
"This will run after any tes... | {
"content_hash": "5a63057847ee863be323608beaff1bcb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 68,
"avg_line_length": 27.08108108108108,
"alnum_prop": 0.6067864271457086,
"repo_name": "dkrikun/rename",
"id": "d6f8c980cf3a1309b8ee9a222c86022d84800970",
"size": "1026",... |
from django.contrib.auth import authenticate
from rest_framework import serializers
class AuthTokenSerializer(serializers.Serializer):
username = serializers.CharField()
password = serializers.CharField()
def validate(self, attrs):
username = attrs.get('username')
password = att... | {
"content_hash": "5b17f063d6a36c645df3e7c92df142d1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 95,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.6176470588235294,
"repo_name": "hfercc/mese2014",
"id": "d1296a26080caced238256bb5f2299d5d407c933",
"size": "884"... |
from __future__ import absolute_import
import json
import logging
from datetime import timedelta, datetime
import unityapiclient
from unityapiclient.client import UnityApiClient
from b2accessdeprovisioning.configparser import config
from b2accessdeprovisioning.user import User
from b2accessdeprovisioning.notifier i... | {
"content_hash": "185dbbef4bebd7bfce546f8ebeb29190",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 162,
"avg_line_length": 39.310344827586206,
"alnum_prop": 0.6457894736842106,
"repo_name": "EUDAT-B2ACCESS/b2access-deprovisioning",
"id": "dae7555f4acdfd81b95f727c6ac33c51a... |
import uuid
# generate
def generate():
return '{' + str( uuid.uuid1() ).upper() + '}' | {
"content_hash": "cb90937839640a3a364614a4dfdf3ab8",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 47,
"avg_line_length": 17.4,
"alnum_prop": 0.5977011494252874,
"repo_name": "dmsovetov/pygling",
"id": "32ade63f74c5f398f771247a22b60120ac7dbe4a",
"size": "1404",
"binary"... |
"""Supplies test data for the Seeing Monitor
History:
2010-09-24
2010-09-29 ROwen modified to use RO.Alg.RandomWalk
2010-10-18 ROwen Added guide offset information.
2012-07-09 ROwen Modified to use RO.TkUtil.Timer.
"""
import math
import RO.Alg.RandomWalk
from RO.TkUtil import Timer
import TUI.Base.TestDispat... | {
"content_hash": "2606d1985265c8965647548ac926cda6",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 173,
"avg_line_length": 41.83206106870229,
"alnum_prop": 0.6682481751824818,
"repo_name": "r-owen/TUI",
"id": "a98fd9198a75e3cf830a0aca848903825b9c197a",
"size": "5502",
... |
import os
import re
import logging
import datetime
import mimetypes
import time
import jinja2
import email.Utils
from Cookie import BaseCookie
from routes import url_for
from google.appengine.ext.webapp import Response
from google.appengine.api import memcache, users
from drydrop.lib.json import json_encode
from drydro... | {
"content_hash": "505808462fcb78cfeb0e826d7cc9effa",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 133,
"avg_line_length": 37.636963696369634,
"alnum_prop": 0.6011925640126271,
"repo_name": "harperreed/drydrop",
"id": "7a4b5859452cd763453b2b9dff1d5bf6863ce69e",
"size": ... |
import re
import urlparse
from hubcheck.pageobjects.basepagewidget import BasePageWidget
from hubcheck.pageobjects.basepageelement import Link
from selenium.webdriver.common.action_chains import ActionChains
# from hubcheck.pageobjects.widgets.search import Search
class Header(BasePageWidget):
def __init__(self,... | {
"content_hash": "7aa8d48db6f403aafd26c6425229427f",
"timestamp": "",
"source": "github",
"line_count": 634,
"max_line_length": 87,
"avg_line_length": 30.238170347003155,
"alnum_prop": 0.5495279328151896,
"repo_name": "codedsk/hubcheck",
"id": "762b5bc9fe619556a4fb502ff295f0eea8359d46",
"size": "19... |
"""Base class for classes that need modular database access."""
from oslo_utils import importutils
from oslo_db.sqlalchemy.session import *
import nova.conf
CONF = nova.conf.CONF
class Base(object):
"""DB driver is injected in the init method."""
def __init__(self, db_driver=None):
super(Base, sel... | {
"content_hash": "7288b2005f2317fbf0e548231747417c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 63,
"avg_line_length": 24.454545454545453,
"alnum_prop": 0.6394052044609665,
"repo_name": "xuweiliang/Codelibrary",
"id": "a18b2a2637263ba3aff836669f200574f968d6e6",
"size"... |
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
# -- Project information -----------------------------------------------------
project = u'DeepOBS'
copyright = u'2019, Frank Schneider'
author = u'Frank Schneider, Lukas Balles & Philipp Hennig'
# The short X.Y version
version = u'1.1'
# The full vers... | {
"content_hash": "f79acee059172be8123a9f1cf07e9471",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 78,
"avg_line_length": 28.872832369942195,
"alnum_prop": 0.6412412412412413,
"repo_name": "fsschneider/DeepOBS",
"id": "fc003343e2c1d3900e10c4170540611062370d7a",
"size": ... |
"""Utility to generate Redfish accessor classes.
This binary does not accept any command line arguments. The accessors are
generated based entirely upon embedded data.
"""
import argparse
import sys
from typing import Sequence
import jinja2
from ecclesia.lib.jinja2 import loader
from ecclesia.lib.redfish.toolchain.... | {
"content_hash": "427476a7f33f5f72098b9c262d0e9737",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 79,
"avg_line_length": 32.7962962962963,
"alnum_prop": 0.7049689440993789,
"repo_name": "google/ecclesia-machine-management",
"id": "f925390ca80d338e8776850b46db5ba3b803a008... |
class MyResponse:
def __init__(self, content, status_code=200, headers={}, final_url='http://www.google.ca/'):
self.content = content
self.content_was_truncated = False
self.status_code = 200
self.headers = headers
self.final_url = final_url
class MyOpener:
def __init__... | {
"content_hash": "90d79c4e843534f16eb69539df139f07",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 96,
"avg_line_length": 26,
"alnum_prop": 0.5791420118343196,
"repo_name": "blairconrad/LibraryLookup",
"id": "0b0df18ca38668b114072c2431cc04a3b0a1950f",
"size": "1352",
"... |
import mock
from rally.plugins.openstack.scenarios.magnum import utils
from tests.unit import test
class MagnumScenarioTestCase(test.ScenarioTestCase):
def setUp(self):
super(MagnumScenarioTestCase, self).setUp()
self.baymodel = mock.Mock()
self.scenario = utils.MagnumScenario(self.contex... | {
"content_hash": "7ab35269db328c23eaa0be67f846a09c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 79,
"avg_line_length": 38.58695652173913,
"alnum_prop": 0.632112676056338,
"repo_name": "vganapath/rally",
"id": "747a1edd4eb9f8abd9faa9285ad7462ed80f70bb",
"size": "2373",... |
from django.contrib import admin
from fileupload.models import File
class FileAdmin(admin.ModelAdmin):
readonly_fields = ('file_tag',)
list_display = ('file', 'file_tag_thumb', 'created')
admin.site.register(File, FileAdmin)
| {
"content_hash": "b9113020d0597b453925e13ee574febe",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 56,
"avg_line_length": 23.7,
"alnum_prop": 0.7257383966244726,
"repo_name": "stahlnow/stahlnow",
"id": "413a4014b82243c051a8524f7eb4dcf41e0db2aa",
"size": "237",
"binary"... |
from colander import MappingSchema, SchemaNode, String, Integer, Boolean
from colander import Length, DateTime, instantiate
from colander import SequenceSchema, OneOf, drop
import colander
from ode.models import TAG_MAX_LENGTH, SAFE_MAX_LENGTH
def default_schema_node():
return SchemaNode(String(), missing='',
... | {
"content_hash": "0bf149e56b70f9adcb779c21947c6f41",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 35.08759124087591,
"alnum_prop": 0.6527980029124194,
"repo_name": "makinacorpus/ODE",
"id": "51206f18ca7bfbbbcaba3445e2f595be60404ddc",
"size": "480... |
'''
Created on Mar 7, 2017
@author: Leo Zhong
'''
import csv
import random
import math
import operator
def loadDataset(filename, split, trainingSet = [], testSet = []):
#split data set to trainingSet and testSet
with open(filename, 'r') as csvfile:
lines = csv.reader(csvfile)
dataset = list(... | {
"content_hash": "a0bd4bf1b65ac38ca930fcf3e76b504f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 86,
"avg_line_length": 28.182795698924732,
"alnum_prop": 0.6104540251812285,
"repo_name": "LeoZ123/Machine-Learning-Practice",
"id": "f60fee354adc372bf852485c52dd2f3c02e2e316... |
from .lda import Lda
from .ldx import Ldx
from .ldy import Ldy
from .sta import Sta
from .stx import Stx
from .sty import Sty
| {
"content_hash": "9f751f036c7e6c685d79f160917e565b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 20,
"avg_line_length": 21,
"alnum_prop": 0.7619047619047619,
"repo_name": "Hexadorsimal/pynes",
"id": "cda716764cff64533e1bec2229850c45b4b46e35",
"size": "126",
"binary": ... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "060ae32815e89f85ada5fc3713cee9d0",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 143,
"avg_line_length": 30.621890547263682,
"alnum_prop": 0.714378554021121,
"repo_name": "mahabs/nitro",
"id": "5f8a30e6f8bbb493b0b151cb5e188e8c5695b720",
"size": "6769",... |
"""
Converts ClinVar XML into
RDF triples to be ingested by SciGraph.
These triples conform to the core of the
SEPIO Evidence & Provenance model
We also use the clinvar curated gene to disease
mappings to discern the functional consequence of
a variant on a gene in cases where this is ambig... | {
"content_hash": "20c4faff1febff92b569167fffa0bbc9",
"timestamp": "",
"source": "github",
"line_count": 1547,
"max_line_length": 91,
"avg_line_length": 43.61085972850679,
"alnum_prop": 0.5095751934307651,
"repo_name": "TomConlin/dipper",
"id": "7ad45db856e91a6b6405a70a54c322aa6a3efd20",
"size": "67... |
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.schema import Index, UniqueConstraint
from freight.config import db
class Deploy(db.Model):
__tablename__ = "deploy"
__table_args__ = (
Index("idx_deploy_task_id", "task_id"),
Index("idx_deploy_app_id", "app_id"),
... | {
"content_hash": "1ea904cbaee02c38688cc25855864296",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 88,
"avg_line_length": 37.23809523809524,
"alnum_prop": 0.659846547314578,
"repo_name": "getsentry/freight",
"id": "9fb8f7eeeb7a73eccc863545fcf46cef812a502f",
"size": "782"... |
"""The PHDI image path specification resolver helper implementation."""
from dfvfs.file_io import phdi_file_io
from dfvfs.lib import definitions
from dfvfs.resolver_helpers import manager
from dfvfs.resolver_helpers import resolver_helper
class PHDIResolverHelper(resolver_helper.ResolverHelper):
"""PHDI image reso... | {
"content_hash": "9efb8d74b34db19d671290626dbc98b7",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 71,
"avg_line_length": 29.925925925925927,
"alnum_prop": 0.7524752475247525,
"repo_name": "joachimmetz/dfvfs",
"id": "e73457908923993c9931de6d49fabd43ca7672b6",
"size": "83... |
from tempest.lib.common.utils import data_utils
from tempest import test
from neutron.tests.tempest.api import base
class MeteringTestJSON(base.BaseAdminNetworkTest):
"""
Tests the following operations in the Neutron API using the REST client for
Neutron:
List, Show, Create, Delete Metering lab... | {
"content_hash": "95c696127068d190dc5f80ef29f222eb",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 47.416,
"alnum_prop": 0.6367470895900118,
"repo_name": "bigswitch/neutron",
"id": "42b8e489320a8cea439f3800eb0f5bf59196f331",
"size": "6534",
"bin... |
"""
Compare the errors of some schemes.
"""
import numpy as np
import quadrature
from matplotlib import pyplot as plt
from matplotlib import style
style.use("ggplot")
def f(x):
return np.exp(x[0]) * np.exp(x[1])
schemes = (
[quadrature.triangle.Strang(6)]
+ [quadrature.triangle.Cubtri()]
+ [quadrat... | {
"content_hash": "1ade80109ecb17dda8380144a5a8c738",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 64,
"avg_line_length": 25.583333333333332,
"alnum_prop": 0.6406080347448425,
"repo_name": "nschloe/quadpy",
"id": "a5ee4e7da7930dab3f9f8d3596c28f1d4b353326",
"size": "921",... |
from tg import expose, redirect, flash, config, validate, request
from tg.decorators import with_trailing_slash, without_trailing_slash
from formencode import validators as V
from pylons import c
from webob import exc
import pymongo
from allura.lib import search
from allura.app import SitemapEntry
from allura import m... | {
"content_hash": "d38cec366d8e13f8710987b30a5bd243",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 110,
"avg_line_length": 38.009433962264154,
"alnum_prop": 0.6013899230578307,
"repo_name": "Bitergia/allura",
"id": "2b9ed25a5a782246bef029bfcd03e39a7644df31",
"size": "40... |
"Makes working with XML feel like you are working with JSON"
"Note: This is not our library. Kudos go to Martin Blech of https://github.com/martinblech/xmltodict"
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: # pragma no cover
from cString... | {
"content_hash": "fa6243fbf8f58f2ae87d67201580f8a2",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 101,
"avg_line_length": 34.55789473684211,
"alnum_prop": 0.558026195552848,
"repo_name": "norsecorp/ipviking-api-python",
"id": "9db7c1fc72e5d6ccbe1925f7cf902bfc2f9cce84",
... |
"""This is an experimental deployment script for Oppia. It should only be used
for experimental testing, since it omits several safeguards: for example, it
does not run tests and it does not use a 'deploy_data' folder.
USE THIS SCRIPT AT YOUR OWN RISK!
Note:
1. Before running this script, you must install third-par... | {
"content_hash": "77611eb5f5b3ad8dfda62080d90ba373",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 79,
"avg_line_length": 31.246268656716417,
"alnum_prop": 0.6782899450680678,
"repo_name": "terrameijar/oppia",
"id": "7fd729453cbb90c6ca4f26c761961fa130138de0",
"size": "4... |
import numpy as np
import pandas as pd
from scipy.stats import norm
from numpy.random import normal
import pytest
import sys
sys.path.append("..")
from chainconsumer.chain import Chain
from chainconsumer.chainconsumer import ChainConsumer
class TestChain(object):
d = normal(size=(100, 3))
d2 = normal(size=(10... | {
"content_hash": "8bd8c82de9a4d9465fcfd62949838051",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 99,
"avg_line_length": 35.29216867469879,
"alnum_prop": 0.6004950072544166,
"repo_name": "Samreay/ChainConsumer",
"id": "227de83da590cc6df67101a96aa5cc9641f73f8d",
"size":... |
from pythonforandroid.recipe import PythonRecipe
class PycryptodomeRecipe(PythonRecipe):
version = '3.6.3'
url = 'https://github.com/Legrandin/pycryptodome/archive/v{version}.tar.gz'
depends = ['setuptools', 'cffi']
recipe = PycryptodomeRecipe()
| {
"content_hash": "f4e7cfb05feabf62aec06ef4d59daf77",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 79,
"avg_line_length": 26.2,
"alnum_prop": 0.732824427480916,
"repo_name": "rnixx/python-for-android",
"id": "9418600a297662b5d464fb48ec151c72eb447d9b",
"size": "262",
"b... |
from datetime import datetime, timedelta
from xml.dom import minidom
import logging
from django.utils.timezone import now, utc
from celery.task import task
from celery.task.sets import subtask
from gargoyle import gargoyle
from eve_proxy.exceptions import *
from eve_proxy.models import CachedDocument
from eve_api.a... | {
"content_hash": "c4711ea671f3c1983e3b9dc182a5ff88",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 175,
"avg_line_length": 45.73529411764706,
"alnum_prop": 0.6394426580921758,
"repo_name": "nikdoof/test-auth",
"id": "4e87d1e6a59de9d76087f1fe6a47965f333f890c",
"size": "9... |
import models
from app import db
class Member(object):
__email = ""
__phone = ""
__reputation = ""
__password = ""
__name = ""
def __init__(self, name, password, email, phone):
self.__email = email
self.__phone = phone
self.__password = password
self.__name =... | {
"content_hash": "c7e0dac3ae60339f759735f90c8684a6",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 108,
"avg_line_length": 20.532467532467532,
"alnum_prop": 0.545224541429475,
"repo_name": "marcstreeter/ChatterBlog",
"id": "18f08eff87727fcf98a7baea84b934e71bcbf6ec",
"siz... |
import os
import sys
import fnmatch
import subprocess
import datetime
import argparse
import logging
import re
def isLeapYear(year):
'''Returns TRUE if the given year (int) is leap and FALSE otherwise'''
leapyear = False
if year % 4 != 0:
leapyear = False
elif year % 100 != 0:
leapyear = True
elif year % 400... | {
"content_hash": "4bf7d263c4730e83661e2726a18d2fd7",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 130,
"avg_line_length": 30.235668789808916,
"alnum_prop": 0.6043817147672214,
"repo_name": "albhasan/modis2scidb",
"id": "353fe4b1afe997d8fb83a3301aa1e41c7fa9a880",
"size"... |
from django.utils.functional import cached_property
from django.utils import six
from django.db.models import Transform, Lookup, CharField
class KeyTransform(Transform):
output_field = CharField()
def __init__(self, key, base_field, *args, **kwargs):
super(KeyTransform, self).__init__(*args, **kwarg... | {
"content_hash": "aba7f0e84ae7cce84d503b0ec0119f0d",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 79,
"avg_line_length": 31.77304964539007,
"alnum_prop": 0.6236607142857142,
"repo_name": "mamigot/django-pgjson",
"id": "5374a6c3a061a71287ea539d7d120c4cf9f8c782",
"size":... |
from django.conf.urls import url
import views
urlpatterns = [
url(r'^article/upload/', views.articleUpload, name='articleUpload'),
url(r'^article/download/(\w+)/', views.articleDownload, name='articleDownload'),
url(r'^article/all/(\d+)/(\d+)/', views.all, name='all'),
url(r'^article/mine/(\d+)/(\d+)/... | {
"content_hash": "51a51510d942481fea8b37dfab3fdb41",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 84,
"avg_line_length": 44.666666666666664,
"alnum_prop": 0.6253731343283582,
"repo_name": "zackszhu/hack_sjtu_2017",
"id": "ba8f17c03f1d72b72e499901637052d335f5e9bc",
"size... |
import http.client
import json
id = '495'
connection = http.client.HTTPConnection('api.football-data.org')
headers = { 'X-Auth-Token': '4b7b23a920a845188380e9408be81bee', 'X-Response-Control': 'minified' }
# connection.request('GET', '/v1/fixtures/?timeFrame=p99&league=PPL', None, headers ) # Past 99 days in the Port... | {
"content_hash": "aee370a0f1afd4dabdbf908b27768143",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 134,
"avg_line_length": 55.8,
"alnum_prop": 0.7120669056152927,
"repo_name": "jtmnf/FootballPredictionsArtificialIntelligence",
"id": "bbd8d280fc12176f858a618254bbffc39c2ce26... |
import pythonequations, pythonequations.EquationBaseClasses, pythonequations.ExtraCodeForEquationBaseClasses
import numpy
numpy.seterr(all = 'raise') # numpy raises warnings, convert to exceptions to trap them
class LinearLogarithmic3D(pythonequations.EquationBaseClasses.Equation3D):
RequiresAutoGeneratedGrowthAn... | {
"content_hash": "ef8d398e98a78e729b2256dc6e19d3cc",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 294,
"avg_line_length": 63.75297619047619,
"alnum_prop": 0.6492694085243452,
"repo_name": "JMoravec/unkRadnet",
"id": "e57ccef59a5f20497de309817ddc8d58f81bf80d",
"size": "... |
from fabric.api import run, env, cd, prefix, shell_env, local
from config import load_config
config = load_config()
host_string = config.HOST_STRING
def deploy():
env.host_string = config.HOST_STRING
with cd('/var/www/#{project}'):
with shell_env(MODE='PRODUCTION'):
run('git reset --hard ... | {
"content_hash": "3f49869a7384d96512eb49f70177880d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 61,
"avg_line_length": 30.76,
"alnum_prop": 0.5890767230169051,
"repo_name": "hustlzp/Flask-Boost",
"id": "89607f85deadb7a052cde6fcf4cf448dd851ccec",
"size": "785",
"bina... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_sigrix_slix_q2_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_tals_n","sigrix_slix_q2_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
r... | {
"content_hash": "5106dade6711bfe39e5787ebc8c6aa8f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.7018072289156626,
"repo_name": "obi-two/Rebelion",
"id": "4641a18a7acb978d2638778c1d649df744c07dc4",
"size": "477"... |
from django.contrib import admin
from customforms.models import Form, Question, Choice
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 0
fields = ('title', 'position', )
class QuestionAdmin(admin.ModelAdmin):
list_display = ('form', 'title', 'position')
list_filter = ('form', )
... | {
"content_hash": "35b18b7153372a705fddd844cc4ab33a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6715210355987055,
"repo_name": "cschwede/django-customforms",
"id": "93841bb20b229760d85e1706e2101c9cdc7477b6",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.