text stringlengths 4 1.02M | meta dict |
|---|---|
import os
from oslo_config import cfg
CONF = cfg.CONF
CONF.import_opt('policy_file', 'cinder.policy')
CONF.import_opt('volume_driver', 'cinder.volume.manager')
CONF.import_opt('xiv_ds8k_proxy',
'cinder.volume.drivers.ibm.xiv_ds8k')
CONF.import_opt('backup_driver', 'cinder.backup.manager')
CONF.impor... | {
"content_hash": "fdd7e770197c954fb6bf8214cd175cf8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 40.86486486486486,
"alnum_prop": 0.6732804232804233,
"repo_name": "tmenjo/cinder-2015.1.1",
"id": "009928cc148e8673f29dfc430c4b43ae420396a4",
"size":... |
from msrest.paging import Paged
class VirtualNetworkGatewayConnectionPaged(Paged):
"""
A paging container for iterating over a list of :class:`VirtualNetworkGatewayConnection <azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection>` object
"""
_attribute_map = {
'next_link': {'... | {
"content_hash": "26be49923fffc30b51f504edbb0c4ca0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 171,
"avg_line_length": 35.8125,
"alnum_prop": 0.6771378708551483,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "97a6b3ddcfe962b075c73048d0d9adfcd9d86129",
"size": "1... |
"""
Glue for Sphinx API.
"""
from inspect import getdoc
from functools import wraps
from traceback import format_exc
from os.path import join, dirname, abspath, exists
from jinja2.sandbox import SandboxedEnvironment
from sphinx.util.osutil import ensuredir
from sphinx.util.logging import getLogger
from sphinx.jinja2g... | {
"content_hash": "4cbd0e3f10b2e15463c4af92b9c121f8",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 78,
"avg_line_length": 27.146892655367232,
"alnum_prop": 0.5860561914672217,
"repo_name": "carlos-jenkins/autoapi",
"id": "3e574a9d66e206fbddff5fb653c4c47ca317a6ae",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='unicomrechargegenorder',
name='eid',
... | {
"content_hash": "c8d0a0917ae5646cb791051e2908f9a2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 202,
"avg_line_length": 29.555555555555557,
"alnum_prop": 0.6372180451127819,
"repo_name": "wxmgcs/devops",
"id": "0db775f804a451b0488e022dbf5da5c198bfe586",
"size": "604",... |
import sqlite3
from ipaddress import IPv4Address, IPv6Address
import iprir
from iprir.utils import get_logger
from iprir.record import RIRRecord, ip_to_key
class DB:
__CREATE_TALBLE__ = '''
CREATE TABLE IF NOT EXISTS iprir (
country CHAR(2) NOT NULL,
type CHAR(4) NOT NULL,
... | {
"content_hash": "3e0c498354a7d126f73d19f343a826f2",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 95,
"avg_line_length": 33.13559322033898,
"alnum_prop": 0.5478260869565217,
"repo_name": "account-login/iprir",
"id": "f67756ab975dba44185598122696856ef310dbd5",
"size": "... |
import os
import unittest
import xmlrpclib
from socket import socket
from nose.plugins.attrib import attr
import time
from time import sleep
# 3p
from mock import patch
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, load_check
PROCESSES = ["program_0", "program_1", "program_2... | {
"content_hash": "4a9383fbdbbc3463a3cb469990a99f02",
"timestamp": "",
"source": "github",
"line_count": 584,
"max_line_length": 145,
"avg_line_length": 38.28938356164384,
"alnum_prop": 0.5279728098027816,
"repo_name": "varlib1/servermall",
"id": "6cf9c82a9b14be29eeb529ef6a76b67d7bc7430f",
"size": "... |
"""Test functions manipulating config dicts."""
from __future__ import unicode_literals
# TODO
| {
"content_hash": "4b6c6a9abc987c647000f337cacea2bc",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 47,
"avg_line_length": 19.4,
"alnum_prop": 0.7319587628865979,
"repo_name": "catkin/xylem",
"id": "7263a04a5112f37a0f583d2cd6ad982ac238cd24",
"size": "695",
"binary": fals... |
from earo.event import Event
from earo.app import App
from earo.config import Config
import unittest
class TestApp(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_handler(self):
config = Config()
app = App(config)
class AEvent(Event)... | {
"content_hash": "db50db610823cbfb5597d649db7e5c99",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 75,
"avg_line_length": 24.823529411764707,
"alnum_prop": 0.5728672985781991,
"repo_name": "Everley1993/Laky-Earo",
"id": "643d12b20f3ce2f369bbd9163557c8227bba0d2f",
"size":... |
def estimate_pi_parallel(N, lview, N_per_trial=1E6):
result = lview.map(estimate_pi, [N_per_trial for i in range(N)])
while not result.ready():
print(result.progress)
time.sleep(0.5)
return np.mean(list(result))
estimate_pi_parallel(100, lview)
| {
"content_hash": "05d1626c942f8f0b65649269f7358742",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 68,
"avg_line_length": 34.25,
"alnum_prop": 0.6605839416058394,
"repo_name": "jakevdp/PythonLectures",
"id": "7905f3416d52bfdfea15dde1aab7a233aaf5554b",
"size": "274",
"bi... |
"""
WSGI config for StickyTempFile project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICA... | {
"content_hash": "6e875045227e866777486a04c668b8a7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 79,
"avg_line_length": 41.07142857142857,
"alnum_prop": 0.802608695652174,
"repo_name": "whitews/StickyTempFile",
"id": "c45f95b872eace633dafd832b53e5a6700b97045",
"size": ... |
import json
import jsonschema
import pkg_resources
from six.moves import urllib
from dcos import http, util
from dcos.errors import DCOSException, DCOSHTTPException
logger = util.get_logger(__name__)
def create_client(url, timeout):
return RpcClient(url, timeout)
def load_error_json_schema():
"""Reads a... | {
"content_hash": "1a37f93d097ef9fcbe6d2f2bf19a5a78",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 34.07142857142857,
"alnum_prop": 0.5976589797344515,
"repo_name": "mesosphere/dcos-cli",
"id": "1ff582a03cb1ef841663e2931b5546757ab2ec95",
"size": "... |
import os
from typing import List
import numpy as np
from gensim.corpora import Dictionary
from clustering_system.corpus.LineNewsCorpus import LineNewsCorpus
def idx2text(dictionary: Dictionary, idx: List):
return [dictionary[i] for i in idx]
class TestLineNewsCorpus:
def test_create(self):
# Cur... | {
"content_hash": "bebe00690c95966008f5f4d24435c60f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 125,
"avg_line_length": 28.926829268292682,
"alnum_prop": 0.6205733558178752,
"repo_name": "vanam/clustering",
"id": "59cc811d111dc0dbfb164a9f87f2bf92520e4288",
"size": "11... |
import logging
from django.core.management.base import BaseCommand
from tqdm import tqdm
from ....discount.utils import fetch_active_discounts
from ...models import Product
from ...utils.variant_prices import update_product_minimal_variant_price
logger = logging.getLogger(__name__)
class Command(BaseCommand):
... | {
"content_hash": "79d044add67dc2a510323c73bc02043b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 88,
"avg_line_length": 36.82608695652174,
"alnum_prop": 0.7131050767414404,
"repo_name": "maferelo/saleor",
"id": "94e52b92b63a79c2210c34f3917d558003ca2db7",
"size": "847",... |
import numpy as np
import numpy.testing as npt
import pandas as pd
from scipy.spatial.distance import pdist
from unittest import TestCase, main
from skbio import OrdinationResults
from skbio.stats.ordination import ca
from skbio.util import get_data_path, assert_ordination_results_equal
def chi_square_distance(data_... | {
"content_hash": "74227815e411ba7725bc95ea03167ab7",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 77,
"avg_line_length": 40.391304347826086,
"alnum_prop": 0.5469590958019376,
"repo_name": "anderspitman/scikit-bio",
"id": "79b2a887a58a1a1593410f315acde12ca82f8b4c",
"siz... |
from __future__ import absolute_import
from contextlib import contextmanager
import os
import sys
import re
import textwrap
import site
import shutil
import subprocess
import pytest
import scripttest
import six
import virtualenv
from tests.lib.path import Path, curdir
DATA_DIR = Path(__file__).folder.folder.join("d... | {
"content_hash": "b5fe274c520cad0225262a5e0ec1fd97",
"timestamp": "",
"source": "github",
"line_count": 775,
"max_line_length": 79,
"avg_line_length": 32.6658064516129,
"alnum_prop": 0.5712987833781008,
"repo_name": "zvezdan/pip",
"id": "ffa69640d1d62efb86b0487e8e1acea9ced02362",
"size": "25316",
... |
import json
import itertools
import numpy as np
class _UTF8Encoder(json.JSONEncoder):
def iterencode(self, obj, **kwargs):
for chunk in json.JSONEncoder.iterencode(self, obj, **kwargs):
yield chunk.encode('utf8')
def ljson_exporter(landmark_group, file_handle, **kwargs):
r"""
Given a... | {
"content_hash": "73f53a3e31312f78f308a5dc5e94408e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 37.4390243902439,
"alnum_prop": 0.6153094462540717,
"repo_name": "yuxiang-zhou/menpo",
"id": "99d760a9fd605bcecc00991f6faebc4004d90273",
"size": "307... |
import urllib.parse
import RawArchiver.ModuleBase
class BooksieRawModule(RawArchiver.ModuleBase.RawScraperModuleBase):
module_name = "BooksieRawModule"
target_urls = [
'http://www.booksie.com/',
]
target_tlds = [urllib.parse.urlparse(tmp).netloc for tmp in target_urls]
badwords = [
"/poetry",
"/poetry... | {
"content_hash": "2e1577be9fcef718e5834ba54bd1b0a9",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 95,
"avg_line_length": 27.40740740740741,
"alnum_prop": 0.6286486486486487,
"repo_name": "fake-name/ReadableWebProxy",
"id": "ebfc470ed62df0479e21bff447a967adc6b5f391",
"s... |
"""
=================================================
Lasso model selection: AIC-BIC / cross-validation
=================================================
This example focuses on model selection for Lasso models that are
linear models with an L1 penalty for regression problems.
Indeed, several strategies can be used t... | {
"content_hash": "7665f3b71e25ae8b6e31106cae39c6ca",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 87,
"avg_line_length": 35.36363636363637,
"alnum_prop": 0.7099586453559853,
"repo_name": "jakirkham/scikit-learn",
"id": "bf2111e32b427591e0c165b57d53793e844969ab",
"size"... |
"""Test IAM policies data."""
FAKE_ORG_IAM_POLICY_MAP = [{
'org_id': 666666,
'iam_policy': {
'bindings': [
{'role': 'roles/billing.creator', 'members': [
'domain:foo.com'
]},
{'role': 'roles/browser', 'members': [
'serviceAccount:55555... | {
"content_hash": "b307ef9b62414b0515886fbd7e067fba",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 109,
"avg_line_length": 40.81818181818182,
"alnum_prop": 0.6054724785237035,
"repo_name": "felixbb/forseti-security",
"id": "83d4ef2c4d198a5f78d10c3213e39f748d3a9a5a",
"si... |
import routes
from heat.api.openstack.v1 import stacks
from heat.api.openstack.v1 import resources
from heat.api.openstack.v1 import events
from heat.api.openstack.v1 import actions
from heat.api.openstack.v1 import build_info
from heat.common import wsgi
from heat.openstack.common import log as logging
logger = log... | {
"content_hash": "cb79df4902ee8fd518a08822fee5b4b6",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 77,
"avg_line_length": 44.456647398843934,
"alnum_prop": 0.4306332076452997,
"repo_name": "ntt-sic/heat",
"id": "b291f71d2ee271bcce1b2d51355c083974033258",
"size": "8311",... |
__all__ = ['CounterHashingVectorizer', 'ListHashingVectorizer', 'ListCountVectorizer', 'ListNGramAnalyzer', 'ListTfidfVectorizer', 'SpaceTokenizerTransformer', '_list_analyzer']
import logging
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
fro... | {
"content_hash": "7d756c9db79c4e1cc783db445914aa2d",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 177,
"avg_line_length": 30.129032258064516,
"alnum_prop": 0.6445396145610278,
"repo_name": "skylander86/ycml",
"id": "a1f797924c0c2571bc1d7fcbf7e1694ff7e54086",
"size": "3... |
import errno
import os
import platform
import subprocess
from subprocess import PIPE
import time
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common import utils
class Service(object):
def __init__(self, executable, port=0, log_file=PIPE, env=None, start_error_message=""):
... | {
"content_hash": "b228946538c5211ac0430f2fd0fdb946",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 92,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.5126760563380282,
"repo_name": "sunzhxjs/JobGIS",
"id": "5cfe1baf4a8d4ada22d3ad129db9034f7438b31e",
"size": "504... |
from ckan.model import Package, meta
from ckan.model.domain_object import DomainObject
from sqlalchemy import Column, ForeignKey, Table, types
from sqlalchemy.orm import backref, relation
doi_table = Table(
'doi',
meta.metadata,
Column('identifier', types.UnicodeText, primary_key=True),
Column('package... | {
"content_hash": "adfecbcde051ba1a17d4eb343b3a7f98",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 28.862068965517242,
"alnum_prop": 0.6786140979689367,
"repo_name": "NaturalHistoryMuseum/ckanext-doi",
"id": "d197fef4bd9a526cb276e3cf16862e252e406712"... |
"""
Unit tests for the lasso model class and associated functions.
"""
import numpy as np
import unittest
from AnniesLasso import lasso, utils
class TestLassoCannonModel(unittest.TestCase):
def setUp(self):
# Initialise some faux data and labels.
labels = "ABCDE"
N_labels = len(labels)
... | {
"content_hash": "47dbda58bca5be52339865d8f19d3853",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 73,
"avg_line_length": 29.26530612244898,
"alnum_prop": 0.6234309623430963,
"repo_name": "davidwhogg/AnniesLasso",
"id": "586dfe3e3cad70b40178d2458a4b66db68a6133f",
"size":... |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
class AppUser(models.Model):
user = models.OneToOneField(User)
age = models.IntegerField(null=True)
birthday = models.DateField(null=True)
profile_pi... | {
"content_hash": "5150b5507778b27b20fd0bd24b13170a",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 82,
"avg_line_length": 32.85820895522388,
"alnum_prop": 0.6745400863047922,
"repo_name": "maxprais/psoriassist",
"id": "9ac879ae58c1e833833826a6b050269872248b94",
"size": ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import sys
def main():
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'rb') as path_fd:
lines = path_fd.read().splitlines()
missing = True
if not lin... | {
"content_hash": "b4632093a87430b47c0b789327d4b1d2",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 93,
"avg_line_length": 30.697674418604652,
"alnum_prop": 0.5537878787878788,
"repo_name": "thaim/ansible",
"id": "28d06f363bc869003a9f42b3317046465a5bd8af",
"size": "1342",... |
"""
Wrappers can alter the way the build is run as well as the build output.
**Component**: wrappers
:Macro: wrapper
:Entry Point: jenkins_jobs.wrappers
"""
import logging
import pkg_resources
import xml.etree.ElementTree as XML
from jenkins_jobs.errors import InvalidAttributeError
from jenkins_jobs.errors impo... | {
"content_hash": "91524130f7a1f5d54dd398f8710cb6a4",
"timestamp": "",
"source": "github",
"line_count": 2337,
"max_line_length": 80,
"avg_line_length": 40.88532306375696,
"alnum_prop": 0.6228008665710787,
"repo_name": "joostvdg/jenkins-job-builder",
"id": "53e4750538d2d1364e881c49fc2eecd7db309fb0",
... |
from django.conf import settings
from django.conf.urls import url
from django.http import HttpResponsePermanentRedirect as perma_redirect
from django.views.generic.base import TemplateView
from olympia.amo.urlresolvers import reverse
from . import views
urlpatterns = [
url('^about$',
TemplateView.as_vie... | {
"content_hash": "b6b12f08d4ae8a98932f1b93b836fc98",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 73,
"avg_line_length": 42.15,
"alnum_prop": 0.6370106761565836,
"repo_name": "tsl143/addons-server",
"id": "e60f8357561a07056a6af0d6ce72d4e3e104e44f",
"size": "4215",
"b... |
import unittest
from support import lib,ffi
from qcgc_test import QCGCTest
class ShadowStackTestCase(QCGCTest):
def test_basic(self):
p = self.allocate(1)
q = self.allocate(1)
#
self.push_root(p)
self.assertEqual(self.ss_size(), 1)
#
self.push_root(q)
... | {
"content_hash": "bc626ffef57f16b666ad87750bcd4034",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 60,
"avg_line_length": 28.10810810810811,
"alnum_prop": 0.5875,
"repo_name": "ntruessel/qcgc",
"id": "81a70dea1cb93411e6861cbe672bdbd7a88d2fc2",
"size": "1040",
"binary":... |
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.core.validators import MaxValueValidator
from django.db.models import F
from django.core.urlresolvers import reverse
from django.dispatch import receiver
import hashlib
import random
import logging
logger = logging.getLog... | {
"content_hash": "c01c95e597bc53465b86a45b91a01039",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 102,
"avg_line_length": 38.101851851851855,
"alnum_prop": 0.6600243013365735,
"repo_name": "machinelady/dresden-files",
"id": "5752283a105f0786ec9eaf89f78f354dc74b3227",
"... |
"""
A MathML printer.
"""
from sympy import Basic, sympify, S
from sympy.simplify import fraction
from printer import Printer
from conventions import split_super_sub
class MathMLPrinter(Printer):
"""Prints an expression to the MathML markup language
Whenever possible tries to use Content markup and not Pres... | {
"content_hash": "bc7d3faf3b96fa5c02ab3f665f919ef7",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 100,
"avg_line_length": 33.92727272727273,
"alnum_prop": 0.5467769101209615,
"repo_name": "tarballs-are-good/sympy",
"id": "55a65f00d29e3d4e858625a8d344b4e415c0f036",
"siz... |
import argparse, os, shutil
from schedule import dept_scraper, section_scraper
VALID_SEMESTERS = [('Spring', 2014), ('Fall', 2014)]
def backup():
if os.path.isfile('schedule.db'):
shutil.copy2('schedule.db', 'schedule-backup.db')
parser = argparse.ArgumentParser(description="Scrape the UCB Schedule of Cl... | {
"content_hash": "6f2c78122cb23d536f18ac8cdc02f10f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 87,
"avg_line_length": 32.885714285714286,
"alnum_prop": 0.6125108601216334,
"repo_name": "rskwan/ucbschedule",
"id": "67d703a071a13ab13ca848ed35d100cfbf3f45cb",
"size": "1... |
import os.path
from json_parse import OrderedDict
from memoize import memoize
class ParseException(Exception):
"""Thrown when data in the model is invalid.
"""
def __init__(self, parent, message):
hierarchy = _GetModelHierarchy(parent)
hierarchy.append(message)
Exception.__init__(
self, 'Mod... | {
"content_hash": "6e4d9788fdd773ddb7020b993cca2fc2",
"timestamp": "",
"source": "github",
"line_count": 473,
"max_line_length": 80,
"avg_line_length": 37.059196617336156,
"alnum_prop": 0.6311826116720862,
"repo_name": "hujiajie/pa-chromium",
"id": "d6b6efc1a12f3519777d08b4995fa43d27e8c8ea",
"size":... |
if Reset == True:
agent_pts = []
agent_crvs = []
agents_v = []
if Initial_Boids:
Agents_run(Initial_Boids)
counter += 1
print counter
else:
Initial_Boids = Agents_Init(Agents_N)
print len(agent_pts),"flocking agents"
Agents_pos = agent_pts
Trails = ag... | {
"content_hash": "b3dd5b4a848980b3dd26586dc47b0810",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 46,
"avg_line_length": 21.7,
"alnum_prop": 0.5645161290322581,
"repo_name": "marios-tsiliakos/AgentsGHPython",
"id": "b6c34975c8ab04e01aff8c76223e249cad3bad0a",
"size": "45... |
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
class EvacuateHostForm(forms.SelfHandlingForm):
current_host = forms.CharField(label=_("Current Host")... | {
"content_hash": "58715fc0a58c6606049ce7ec7e7561b7",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 77,
"avg_line_length": 36.81987577639752,
"alnum_prop": 0.5355937921727395,
"repo_name": "openstack/horizon",
"id": "50ddcbfbc18989c746bbce3e2bb0c8b0877635db",
"size": "64... |
""" a basic script for importing student's POI identifier,
and checking the results that they get from it
requires that the algorithm, dataset, and features list
be written to my_classifier.pkl, my_dataset.pkl, and
my_feature_list.pkl, respectively
that process should happen at the end of poi_id... | {
"content_hash": "6dcf3212f97093ff837b37c55f0fec2a",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 146,
"avg_line_length": 43.802083333333336,
"alnum_prop": 0.6487514863258026,
"repo_name": "napjon/ds-nd",
"id": "09ffc2b1696ba09f276a2bf093f0f3d8e136684c",
"size": "4224",... |
"""Runtime NDArray API"""
import ctypes
import numpy as np
import tvm._ffi
from tvm._ffi.base import _LIB, check_call, c_array, string_types, _FFI_MODE
from tvm._ffi.runtime_ctypes import DataType, TVMContext, TVMArray, TVMArrayHandle
from tvm._ffi.runtime_ctypes import DataTypeCode, tvm_shape_index_t
try:
# pyli... | {
"content_hash": "95fd5cfbde33f0e9b297c1e8041821a7",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 87,
"avg_line_length": 24.552683896620277,
"alnum_prop": 0.5753846153846154,
"repo_name": "tqchen/tvm",
"id": "2f616ce879c97ea8cabebc5f1873c91dccb4c58c",
"size": "13181",
... |
"""Global database feature support policy.
Provides decorators to mark tests requiring specific feature support from the
target database.
External dialect test suites should subclass SuiteRequirements
to provide specific inclusion/exclusions.
"""
from . import exclusions
from .. import util
class Requirements(obj... | {
"content_hash": "ba67fa842b6a6017fc3615bd5d9dfcf7",
"timestamp": "",
"source": "github",
"line_count": 713,
"max_line_length": 86,
"avg_line_length": 28.011220196353435,
"alnum_prop": 0.6347386340877228,
"repo_name": "dstufft/sqlalchemy",
"id": "8b02f3e40504a8812b03193a8d0b0f91e23b4783",
"size": "... |
"""
flowfilter.propagation
----------------------
Module containing propagation methods.
:copyright: 2015, Juan David Adarve, ANU. See AUTHORS for more details
:license: 3-clause BSD, see LICENSE for more details
"""
import numpy as np
import scipy.ndimage as nd
__all__ = ['dominantFlowX', 'dom... | {
"content_hash": "3f506664c00ade232f0e5171bfc81bbc",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 94,
"avg_line_length": 27.144092219020173,
"alnum_prop": 0.5730969317337297,
"repo_name": "jadarve/optical-flow-filter",
"id": "c8b21d0dd8f45b6d577d6d1132d9a8f9b2febe1f",
... |
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General con... | {
"content_hash": "cb825ec02cd327a0ce54416a78f064b8",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 87,
"avg_line_length": 31.892241379310345,
"alnum_prop": 0.6926611704284362,
"repo_name": "Kayra/atlas",
"id": "bdd9452fd62bb461297375c58146010cc5b1c45b",
"size": "7787",
... |
from warnings import catch_warnings, simplefilter
from datetime import datetime
import operator
import pytest
import numpy as np
from pandas.core.dtypes.common import is_float_dtype
from pandas import (Series, DataFrame, Index, date_range, isna, notna,
MultiIndex)
from pandas.core.nanops import na... | {
"content_hash": "4f5b08b7cd11de1765456570b2075e02",
"timestamp": "",
"source": "github",
"line_count": 2612,
"max_line_length": 98,
"avg_line_length": 36.60145482388974,
"alnum_prop": 0.5192201081556018,
"repo_name": "harisbal/pandas",
"id": "775fcc2684f42a3166736d3c72cc0a5721de696f",
"size": "956... |
import sys
import praw
from pprint import pprint
def get_all_redditors_from_a_sub(praw_handle, sub, num_comments=None):
"""Return a list of users who submitted the last num_comments comments to sub"""
# if num_comments == None, get as many comments as possible
all_redditors = []
# Get hot submissions ... | {
"content_hash": "95a5138a515c0d13f4454ef5da3b92fc",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 130,
"avg_line_length": 48.306930693069305,
"alnum_prop": 0.5980733756917401,
"repo_name": "bruab/reddit_sna",
"id": "53a9e39dfaecb5adbecaeccfec2d9fb20f7b9a5b",
"size": "4... |
__author__ = 'Robert Meyer'
import numpy as np
import inspect
import os # For path names being viable under Windows and Linux
from pypet import Environment, Parameter, ArrayParameter, Trajectory
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Here we will see how we can write our own custo... | {
"content_hash": "8a2277317cfa96716fc3c6f76cde421a",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 105,
"avg_line_length": 40.06374501992032,
"alnum_prop": 0.6673627684964201,
"repo_name": "nigroup/pypet",
"id": "56923452fee326587109d3ccba971afc0091cef6",
"size": "10056... |
import unittest
from hamming import hamming
class HammingTest(unittest.TestCase):
def test_no_difference_between_identical_strands(self):
self.assertEqual(0, hamming.distance('A', 'A'))
def test_complete_hamming_distance_of_for_single_nucleotide_strand(self):
self.assertEqual(1, hamming.dist... | {
"content_hash": "0875fd9b78bd5724727cb6529f8d2d20",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 34.625,
"alnum_prop": 0.6859205776173285,
"repo_name": "willjharmer/exercism-python",
"id": "29a225816f79d8e49ad52406765a1d93327abf68",
"size": "1108... |
"""Problem 49
01 August 2003
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms
increases by 3330, is unusual in two ways: (i) each of the three terms
are prime, and, (ii) each of the 4-digit numbers are permutations of
one another.
There are no arithmetic sequences made up of three 1-, 2-, or 3-di... | {
"content_hash": "17ab00b03552f691406e7de65bb2b044",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 80,
"avg_line_length": 36.755102040816325,
"alnum_prop": 0.6163242642976124,
"repo_name": "feliposz/project-euler-solutions",
"id": "4bdd0159c0547de2bd209f22bd32b2fbc53f1774"... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 5, transform = "Quantization", sigma = 0.0, exog_count = 100, ar_order = 0); | {
"content_hash": "f12e367e1bb580c0bff374e1a7f3f8c6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 170,
"avg_line_length": 38.57142857142857,
"alnum_prop": 0.7111111111111111,
"repo_name": "antoinecarme/pyaf",
"id": "f0f7e859b32d35bd5eeaaf1f59a3b3ab61b7a5d8",
"size": "270... |
"""functions helper."""
from ast import literal_eval
import base64
import os
import hashlib
import random
import uuid
import time
import shutil
import re
import socket
import _thread
import OpenSSL
import subprocess
def addAppPath(path):
"""Add a path to sys path."""
os.sys.path.append(path)
def getCwd():
... | {
"content_hash": "625e784f99da911e9164f90bd46b0379",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 77,
"avg_line_length": 23.26775956284153,
"alnum_prop": 0.6176608736496008,
"repo_name": "yxwzaxns/cowry",
"id": "79b89e32b0fed0702c3657c5918c4ea3d076e5ab",
"size": "4258"... |
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import *
import unittest
import parameterized
from export_layers.pygimplib.tests import stubs_gimp
from export_layers import placeholders
class TestGetReplacedArgsAndKwargs(unittest.TestCase):
def test_get... | {
"content_hash": "8c9c02e93fc0bfd69f91234a539e3ceb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 95,
"avg_line_length": 36.520833333333336,
"alnum_prop": 0.7233314318311466,
"repo_name": "khalim19/gimp-plugin-export-layers",
"id": "eecbdab56e8a64ad3fcf1c6435efbd36008bae6... |
"""Support for SNMP enabled switch."""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PORT, CONF_PAYLOAD_ON, CONF_PAYLOAD_OFF,
CONF_USERNAME)
import homeassistant.helpers.config_va... | {
"content_hash": "eb8befdcb3b23b788ff601bfeb55cb6f",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 79,
"avg_line_length": 35.279620853080566,
"alnum_prop": 0.629768941429339,
"repo_name": "DavidLP/home-assistant",
"id": "5555f511272fd379a38fd9c1d30383ef2effafb9",
"size"... |
import os
import pathlib
import sys
sys.path.append(str(
pathlib.Path('./').resolve().parents[1]
))
# -- Project information -----------------------------------------------------
project = 'surgeo'
copyright = '2020, Theo Naunheim'
author = 'Theo Naunheim'
release = '1.1.0'
version = '1.1.0'
# -- General config... | {
"content_hash": "ffab360456994377503a5661212fc26f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 78,
"avg_line_length": 28.05263157894737,
"alnum_prop": 0.6454033771106942,
"repo_name": "theonaun/surgeo",
"id": "33b23b600fb377bc6fe9719d4717fffe83e0425d",
"size": "2152"... |
# Copyright 2014 Lukas Kemmer
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | {
"content_hash": "9ff29b2ac0caa158b9057c170a20e58a",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 126,
"avg_line_length": 38.13,
"alnum_prop": 0.6005769735116706,
"repo_name": "lukas-ke/faint-graphics-editor",
"id": "e08936311c8afb2799a7a3267fcfdad1fbcfc9c1",
"size": "... |
# -*- coding: latin-1 -*-
import random
import sys
import numpy as np
sys.path.append("..") #so other modules can be found in parent dir
from Player import *
from Constants import *
from Construction import CONSTR_STATS
from Ant import UNIT_STATS
from Move import Move
from GameState import addCoords
from AIPlayerUti... | {
"content_hash": "88d8d874a2a83d88f326fd33388293c9",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 112,
"avg_line_length": 36.04780114722753,
"alnum_prop": 0.5454834774306476,
"repo_name": "sundercode/AI-Homework",
"id": "627d3cdbb880791ec2f694530ea0a3d0a24e0d5d",
"size... |
from .command import Command
from .subcommand import Subcommand
__all__ = ["Command", "Subcommand"]
| {
"content_hash": "5506e158cce29aaea59a11ca4b012363",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 35,
"avg_line_length": 25.25,
"alnum_prop": 0.7326732673267327,
"repo_name": "vadim-ex/subcommand",
"id": "a96c7c34517d77245cd5c4cf21eca05545634507",
"size": "101",
"binar... |
import unittest
from werkzeug.exceptions import BadRequest
from .test_client import TestClient
from api.app import create_app
from api.models import db, User
from api.errors import ValidationError
class TestAPI(unittest.TestCase):
default_username = 'dave'
default_password = 'cat'
def setUp(self):
... | {
"content_hash": "4eef666a725f891c6c54d8cf54d0da7f",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 109,
"avg_line_length": 40.45751633986928,
"alnum_prop": 0.5576736672051696,
"repo_name": "miguelgrinberg/api-pycon2014",
"id": "f29afe35ff7fc4d9b216e8bfc11c2375697d2333",
... |
import httplib2
import warnings
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry
from django.test import TestCase
from haystack import connections
from haystack.exceptions import SpatialError
from haystack.query import SearchQuerySet
from haystack.utils.geo import Point, D, ensure_geome... | {
"content_hash": "835cf6d6deaf6a0dbcc12f851f6c69c3",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 175,
"avg_line_length": 51.24271844660194,
"alnum_prop": 0.6634141720348616,
"repo_name": "dionysio/django-haystack",
"id": "d2c0aea7987fc2efb7b93398e7817da6f08a109b",
"si... |
import web
import requests
import uuid
import json
import time
from config import *
#get secrets from config file
accesstoken = PB_ACCESS_TOKEN
clientid = PB_CLIENT_ID
clientsecret = PB_CLIENT_SECRET
#get client uuid and pushbullet key from ???
userpbkey = 'undefined'
wcuuid = 'undefined'
while True:
#Chloe, op... | {
"content_hash": "4cc35d6d70f368a818f3c590ed249db8",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 279,
"avg_line_length": 57.023809523809526,
"alnum_prop": 0.6087682672233821,
"repo_name": "Haxim/ShackBullet",
"id": "cef63b2599435fcaca64e18619990a4c8b2ddef7",
"size": "2... |
class ArrayContext(object):
"""
Array context stores the config and the state of an
array during job processing
"""
# array config
ID = "id"
API_TOKEN = "api_token"
NAME = "name"
HOST = "host"
PURITY_VERSION = "purity_version"
# collection config
FREQUENCY = "frequency" ... | {
"content_hash": "ec2e6d0479eb7a2b404199cca543df32",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 123,
"avg_line_length": 30.05732484076433,
"alnum_prop": 0.6278872642509006,
"repo_name": "pureelk/pureelk",
"id": "d216bada6b42113b05e33210b771dd5676fff5c6",
"size": "472... |
from django.apps import apps
from django.db import models
from django.db.models import Prefetch
class CommentPollQuerySet(models.QuerySet):
def unremoved(self):
return self.filter(is_removed=False)
def for_comment(self, comment):
return self.filter(comment=comment)
def with_choices(self... | {
"content_hash": "4fd31971d7bf940cb5bc72fd1010fbc4",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 96,
"avg_line_length": 26.267857142857142,
"alnum_prop": 0.6546566961250849,
"repo_name": "nitely/Spirit",
"id": "8300eea60cb2d733114489b6ceded78698ec5ad3",
"size": "1496",... |
from msrest.serialization import Model
class CheckSkuAvailabilityResult(Model):
"""Check SKU availability result.
:param kind: The Kind of the resource. Possible values include:
'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'C... | {
"content_hash": "a9370500f3da46bbc1fde3620a8e2b2c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 107,
"avg_line_length": 40.829268292682926,
"alnum_prop": 0.6278375149342891,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "38cdfb67bd1555efc9b6543a7a130964aed3db4a",
"s... |
from setuptools import setup
import os, sys
try:
# nose uses multiprocessing if available.
# but setup.py atexit fails if it's loaded too late.
# Traceback (most recent call last):
# File "...python2.6/atexit.py", line 24, in _run_exitfuncs
# func(*targs, **kargs)
# File "...python2.6/m... | {
"content_hash": "afd66696675cb3b5fb9465c2bac0ab85",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 80,
"avg_line_length": 29.13157894736842,
"alnum_prop": 0.6603432700993677,
"repo_name": "isotoma/KeenClient-Python",
"id": "8d865f6ef1c1e4dfa2f23a48940269d068bf432a",
"siz... |
"""AWS Auto Scaling Group related utilities."""
import logging
from ..utils.gate import gate_request
LOG = logging.getLogger(__name__)
def get_latest_server_group(env, app):
"""Finds the most recently deployed server group for the application.
Returns:
server_group (str): Name of the newest server ... | {
"content_hash": "5b986bb97482b70c44e6796f36b3b82e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 73,
"avg_line_length": 29.05,
"alnum_prop": 0.6729776247848537,
"repo_name": "gogoair/foremast",
"id": "b76141056411df3ed5978ff74ef3d892da57dde3",
"size": "1228",
"binary... |
import argparse
from functools import wraps
def parse_command(params, launch_invalid=True):
"""Decorator. Automatically parses the last argument of PRIVMSG, which is
the message itself, using argparse. If launch_invalid is True the function
will be launched if the parameters are invalid.
class Te... | {
"content_hash": "f576205d05716806b8ac85d1504ca979",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 80,
"avg_line_length": 33.982142857142854,
"alnum_prop": 0.5754072517078297,
"repo_name": "boreq/botnet",
"id": "8a121ea4eedff4545e958be463b7011ffa58a04b",
"size": "1903",
... |
from orbital_elements.rv.hamiltonian import Hamiltonian as rvHam
import orbital_elements.convert as convert
__author__ = "Nathan I. Budd"
__email__ = "nibudd@gmail.com"
__copyright__ = "Copyright 2017, LASR Lab"
__license__ = "MIT"
__version__ = "0.1"
__status__ = "Production"
__date__ = "20 Apr 2017"
class Hamilton... | {
"content_hash": "4cbcac9b6155952dd9f189b32327b9b9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 34.71666666666667,
"alnum_prop": 0.57177148343735,
"repo_name": "lasr/orbital_elements",
"id": "907cf53a7b8816c9698b009b0fe2dd554ee032fd",
"size": "2... |
'''
Created on 04.03.2012
@author: michi
'''
from datetime import date
from abc import ABCMeta, abstractmethod, abstractproperty
import datetime
class XType:
__metaclass__ = ABCMeta
CUSTOM = 1
NUMBER = 2
STRING = 3
BOOL = 4
COMPLEX = 5
TEMPORAL = 6
MIXED = 7
def... | {
"content_hash": "02dcc7f4a8cf6438601fd5b0bf1df19f",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 94,
"avg_line_length": 27.77061855670103,
"alnum_prop": 0.560092807424594,
"repo_name": "mtils/ems",
"id": "f9e48d8636e082e122c1c59fa822785b99c683a7",
"size": "10775",
"... |
import randomcity
import tempfile
import os
import pymongo
import time
import config
import subprocess
import threading
from queue import Queue
speechq = Queue()
def speechthr() :
while True :
t = speechq.get()
subprocess.call(("espeak", "-ven", "-s250", t), stderr=subprocess.PIPE)
def say(m) :
if config.speec... | {
"content_hash": "3778284a967dff5dd29036f67b061586",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 148,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.6364110589462703,
"repo_name": "Selfnet/plastikonf",
"id": "43e3b05c352a376b8a8d8d498eaace9efe39d846",
"size": "... |
import zope.deferredimport
zope.deferredimport.define(
product_config='zeit.workflow.testing:product_config',
WorkflowScriptsLayer='zeit.workflow.testing:WorkflowScriptsLayer')
| {
"content_hash": "88975b95a664586fa8485c78ea11abba",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 70,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.8128342245989305,
"repo_name": "ZeitOnline/zeit.cms",
"id": "b63fd50d728e798d865ab95ed644d768f549a550",
"size": "1... |
from datetime import datetime, timedelta
from netforce.model import Model, fields
class Schedule(Model):
_name = "hr.schedule.time"
_string = "Schedule Time"
def fmt_time(self, time_str):
time_str = time_str or ""
time_str = time_str.replace(".", ":")
if not time_str:
... | {
"content_hash": "8b162228600c248ef7a00067ada046ed",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 82,
"avg_line_length": 31.285714285714285,
"alnum_prop": 0.5707762557077626,
"repo_name": "sidzan/netforce",
"id": "ad7cbb9987c0e65005c95205d416ab4decc5217a",
"size": "2200... |
from fastapi import APIRouter, Depends, FastAPI, WebSocket
from fastapi.testclient import TestClient
router = APIRouter()
prefix_router = APIRouter()
native_prefix_route = APIRouter(prefix="/native")
app = FastAPI()
@app.websocket_route("/")
async def index(websocket: WebSocket):
await websocket.accept()
awa... | {
"content_hash": "e1a3839650d534ef77a860ac4c715727",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 83,
"avg_line_length": 28.84251968503937,
"alnum_prop": 0.6953316953316954,
"repo_name": "tiangolo/fastapi",
"id": "c312821e969064a53410cf93358dd04d1cd5d6f8",
"size": "366... |
import logging as log
import itertools
import json
import os
import string
import time
import requests
import formatter
class CardDB:
"""Wrapper around a PRAW reddit instance."""
DUELS_CMD = 'd!'
VANILLA_CMD = 'c!'
def __init__(self, *,
constants,
cardJSON='data/cards.json',... | {
"content_hash": "e3b5ad66ce3bd5a6ac502f3d89891cb2",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 80,
"avg_line_length": 32.505319148936174,
"alnum_prop": 0.5367370315823924,
"repo_name": "d-schmidt/hearthscan-bot",
"id": "16ae325334f50226f738a87c56d8c2aa86ae997a",
"si... |
from django import forms
from hackfsu_com.views.generic import ApiView
from hackfsu_com.util import acl, files
from api.models import Hackathon, HackerInfo
class ResponseForm(forms.Form):
approved = forms.BooleanField(required=False)
is_first_hackathon = forms.BooleanField(required=False)
is_adult = forms... | {
"content_hash": "74865cc6cc4d3b4b4d209f29f74a0954",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 95,
"avg_line_length": 38.97435897435897,
"alnum_prop": 0.6980263157894737,
"repo_name": "andrewsosa/hackfsu_com",
"id": "82cde1d53212eae36a85f2fd44371f07c6955d55",
"size":... |
import unittest
from snowplow_tracker.contracts import form_element, greater_than, non_empty, non_empty_string, one_of, satisfies
class TestContracts(unittest.TestCase):
def setUp(self) -> None:
pass
def test_greater_than_succeeds(self) -> None:
greater_than(10, 0)
def test_greater_tha... | {
"content_hash": "3fe6e99dbdfccbe33e14e5a04c143d9b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 113,
"avg_line_length": 28.33653846153846,
"alnum_prop": 0.5439429928741093,
"repo_name": "snowplow/snowplow-python-tracker",
"id": "98c4a15425a0b39f5ba3de8b3fe2408bb1480a14... |
from .tractography import Tractography
from .trackvis import tractography_from_trackvis_file, tractography_to_trackvis_file
from warnings import warn
import numpy
__all__ = [
'Tractography',
'tractography_from_trackvis_file', 'tractography_to_trackvis_file',
'tractography_from_files',
'tractography_fr... | {
"content_hash": "77aff570b178c8c19a03ce80cb8a883a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 84,
"avg_line_length": 33.80898876404494,
"alnum_prop": 0.6181455633100698,
"repo_name": "BRAINSia/tract_querier",
"id": "207034129de9544bc497c096dfa0ad7fb70f545f",
"size":... |
# Beware: the italian translation of the reStructuredText documentation
# at http://docit.bice.dyndns.org/static/ReST, in particular
# http://docit.bice.dyndns.org/static/ReST/ref/rst/directives.html, needs
# to be synced with the content of this file.
"""
Italian-language mappings for language-dependent featu... | {
"content_hash": "e1d114688c31491029cea6b647b51444",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 78,
"avg_line_length": 33.73626373626374,
"alnum_prop": 0.5853420195439739,
"repo_name": "ajaxsys/dict-admin",
"id": "48ffd53c03708ef0a736ab26884d85229e005b33",
"size": "32... |
import pygame
from projectileSinus import ProjectileSinus
#projectile suivant une courbe sinusoidale
class ProjectileSinusVert(ProjectileSinus):
image = pygame.Surface((10, 10))
pygame.draw.circle(image, (0,255,0), (5, 5), 5)
| {
"content_hash": "f2103f1b3bce74a70100a84a6122d5ad",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7552742616033755,
"repo_name": "PolySlug/polyslug",
"id": "bdeff80f538f387c699cdf670c8680534afe0295",
"size": "261... |
from pyramid.view import notfound_view_config
from pyramid.response import Response
@notfound_view_config(renderer='json')
def notfound_view(request):
return Response(status=404, json_body={'error':'Page not found'})
| {
"content_hash": "bafd89027e091d4ee0e7a3360b9fc1b2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 31.857142857142858,
"alnum_prop": 0.7713004484304933,
"repo_name": "web-masons/pyramid-zappa-api-boilerplate",
"id": "1957b6852dea78487a56ea32b15f75a129... |
from google.cloud import vision_v1p4beta1
def sample_async_batch_annotate_files():
# Create a client
client = vision_v1p4beta1.ImageAnnotatorClient()
# Initialize request argument(s)
request = vision_v1p4beta1.AsyncBatchAnnotateFilesRequest(
)
# Make the request
operation = client.async_... | {
"content_hash": "572aca6c5c366bd7db7f6e0b5a69e3d0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 25.954545454545453,
"alnum_prop": 0.7373029772329247,
"repo_name": "googleapis/python-vision",
"id": "04b23ce20fb12a715397d56e0cd2d6a4be12ec2f",
"siz... |
import unittest
import unittest.mock
import numpy as np
import phyre.simulation
import phyre.objects_util
from phyre import creator
from phyre import simulator
from phyre.creator import constants
@creator.define_task
def build_task_for_objects(C):
left = C.add('static bar',
scale=0.3).set_cente... | {
"content_hash": "22dbe0991229aa93f2b86cdc50d1d784",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 82,
"avg_line_length": 43.20224719101124,
"alnum_prop": 0.535630689206762,
"repo_name": "facebookresearch/phyre",
"id": "8cb05599e1a591ce4c16014cae6be2e17ad8dc54",
"size":... |
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
| {
"content_hash": "5ac29783434e4fe500bde5a257fa2b26",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 27,
"avg_line_length": 15.8,
"alnum_prop": 0.6835443037974683,
"repo_name": "Mirantis/pumphouse",
"id": "51023606f3448f8ddd42ab9611093ce1303d3a1f",
"size": "656",
"binary"... |
from logging import getLogger
from os import chdir, getcwd
from subprocess import PIPE, Popen, STDOUT, TimeoutExpired
log = getLogger("service")
class RemoteShell:
def __init__(self, platform, release):
self.__session_active = False
self.__platform = platform
self.__release = release
... | {
"content_hash": "959c2e4e609f8a81eb637d1245d073bb",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 134,
"avg_line_length": 45.10204081632653,
"alnum_prop": 0.5450226244343891,
"repo_name": "thingsboard/thingsboard-gateway",
"id": "56abc657f614eea624f4ab7703a7e45c7743be7a",... |
"""Unit tests for the `coveragespace` package."""
| {
"content_hash": "321a5b6ca59bf46296d9c372676e0739",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 49,
"avg_line_length": 50,
"alnum_prop": 0.7,
"repo_name": "jacebrowning/coverage-space-cli",
"id": "b10566fb32f15aef7e9e1932c628975d06bfc4e1",
"size": "50",
"binary": fal... |
from django.db import migrations
def populate_orders_shipping_price_net(apps, schema_editor):
Order = apps.get_model("order", "Order")
orders_with_shipping_price_gross = Order.objects.filter(
shipping_price_gross__isnull=False
).iterator()
for order in orders_with_shipping_price_gross:
... | {
"content_hash": "96f0a6d04d08c9ad0fb4926c4e32be50",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 31.32,
"alnum_prop": 0.6794380587484036,
"repo_name": "maferelo/saleor",
"id": "369fd2277dc5cff9a2dea781e37a34a21f8b3f17",
"size": "832",
"binary":... |
"""DXR's concept of version control systems
The main entry points are `tree_to_repos`, which produces a mapping of roots
to VCS objects for each version control root discovered under the provided
tree, and `path_to_vcs`, which returns a VCS object for the version control
system that tracks the given path. Currently su... | {
"content_hash": "c0ef31c1c9851ca78a5f88da212bf30f",
"timestamp": "",
"source": "github",
"line_count": 500,
"max_line_length": 102,
"avg_line_length": 36.982,
"alnum_prop": 0.5982910605159266,
"repo_name": "pelmers/dxr",
"id": "e36be58e4d37843725d154fdb05163adb91b56dc",
"size": "18491",
"binary"... |
"""This module contains Google Compute Engine configurations."""
from __future__ import print_function
from chromite.cbuildbot import constants
PROJECT = 'chromeos-bot'
DEFAULT_BASE_IMAGE = 'ubuntu-14-04-server-v20141016'
DEFAULT_IMAGE_NAME = 'chromeos-bot-v2'
DEFAULT_ZONE = 'us-east1-a'
DEFAULT_SCOPES = ('https://... | {
"content_hash": "1116636457044ce3c30aef341a27e4cd",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 27.96,
"alnum_prop": 0.7131616595135909,
"repo_name": "mxOBS/deb-pkg_trusty_chromium-browser",
"id": "bfe5fa3d0386f57226b70c9c0341cbf57b71f9d7",
"siz... |
"""mirdata annotation data types
"""
import logging
import re
from typing import List, Optional, Tuple
from deprecated.sphinx import deprecated
from jams.schema import namespace
import librosa
import numpy as np
import scipy
#: Beat position units
BEAT_POSITION_UNITS = {
"bar_index": "beat index within a bar, 1-i... | {
"content_hash": "17ab9562a2412fc34f65fcfd02747ab3",
"timestamp": "",
"source": "github",
"line_count": 1768,
"max_line_length": 100,
"avg_line_length": 34.76357466063349,
"alnum_prop": 0.5961732452572321,
"repo_name": "mir-dataset-loaders/mirdata",
"id": "c1d7bb58c172b67ef7599702c6e817ce00dbd2f9",
... |
"""Tests for the ironic driver."""
from ironicclient import exc as ironic_exception
import mock
from oslo.config import cfg
from nova.compute import power_state as nova_states
from nova.compute import task_states
from nova import context as nova_context
from nova import exception
from nova import objects
from nova.op... | {
"content_hash": "890317c3904a0f40a09a102f2688f149",
"timestamp": "",
"source": "github",
"line_count": 1148,
"max_line_length": 79,
"avg_line_length": 48.08101045296167,
"alnum_prop": 0.604652426762324,
"repo_name": "sajeeshcs/nested_quota",
"id": "cd21c3053e257aa2877447b2b299f09e177c3cd6",
"size"... |
"""
WSGI config for slack_toolbox project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | {
"content_hash": "20c18c8ea85aa42311a654e2f8e56ef0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.1875,
"alnum_prop": 0.771712158808933,
"repo_name": "BlizzardBlue/slack-toolbox",
"id": "577b05e7b5baea07e4f297b60b5f64c975546e57",
"size": "403",... |
class TestInput(object):
"""Groups information about a test for easy passing of data."""
def __init__(self, test_name, timeout_ms=None, requires_lock=None, reference_files=None,
should_run_pixel_test=None, should_add_missing_baselines=True):
# TestInput objects are normally constructed... | {
"content_hash": "10f632484fb206e4022bb8d4e98d0cd0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 92,
"avg_line_length": 48.370370370370374,
"alnum_prop": 0.6140888208269525,
"repo_name": "google-ar/WebARonARCore",
"id": "1b9082fbc3910d68569ef9d12ebb13f01109d4e5",
"size... |
from django.db import models
# Create your models here.
class Experiment(models.Model):
time_start = models.TimeField()
time_complete = models.TimeField(null=True, blank=True)
trials_completed = models.IntegerField(default=0)
class Trial(models.Model):
experiment = models.ForeignKey(Experiment)
time_start = mod... | {
"content_hash": "0e3f5a62b0081ad811bb0e44974feee8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 85,
"avg_line_length": 33.73684210526316,
"alnum_prop": 0.7737909516380655,
"repo_name": "algobunny/aed",
"id": "e15e3dda8c2da438cb8f777f56704f316e8f3a6b",
"size": "641",
... |
"""
WSGI config for django_gui project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "d6a90bfd15a2a8f09bc914c699a9c471",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.875,
"alnum_prop": 0.7688442211055276,
"repo_name": "Jasper-Koops/THESIS_LIFEBOAT",
"id": "f6502e851a55035683ccc38dfe2371c83ce16f0c",
"size": "398... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_lost_aqualish_marshal_male_01.iff"
result.attribute_template_id = 9
result.stfName("npc_name","aqualish_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "4d8b5762bd8e7460ec40f0e3b38c6503",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 24.615384615384617,
"alnum_prop": 0.703125,
"repo_name": "obi-two/Rebelion",
"id": "b0f77764a133819181ea291e034ac0ba6286b1a5",
"size": "465",
"bina... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineRespon... | {
"content_hash": "18806dd69c6cd046af9f1265a65dd749",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 229,
"avg_line_length": 42.97785977859779,
"alnum_prop": 0.6357860393234309,
"repo_name": "Azure/azure-sdk-for-python",
"id": "85afb5bd8ea56b5f35deff0c152b1d8f16e96ccd",
"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
cms_plugin_table_mapping = (
# (old_name, new_name),
('cmsplugin_filerteaser', 'cmsplugi... | {
"content_hash": "5bba372e5c1d617423654f140cd131b0",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 189,
"avg_line_length": 86.37777777777778,
"alnum_prop": 0.5581425263699511,
"repo_name": "alsoicode/cmsplugin-filer",
"id": "d15cb2ac40fe835a0fd2cae98e6f5731fe119dee",
"s... |
import mistune
from sys import stdin
import md2tex
if __name__ == "__main__":
renderer = md2tex.LatexRenderer()
mistune.escape = md2tex.escape_latex
markdown = mistune.Markdown(renderer=renderer, hard_wrap=True)
PREAMBLE = r"""\documentclass{{two-column-resume}}
\usepackage[hidelinks]{{hyperref}}
\us... | {
"content_hash": "5ae3949ce111b4ea3dbfb4ee1a71f814",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 66,
"avg_line_length": 21.65714285714286,
"alnum_prop": 0.6253298153034301,
"repo_name": "ekohilas/latex-resume-transpiler",
"id": "3e3f59b462b31df5de69b80925eaecb4a6629c7a",... |
from typing import Any
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.response import json_success
from zerver.lib.subdomains import get_subdo... | {
"content_hash": "f0a0dda7126910da83153756a5c956fb",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 100,
"avg_line_length": 44.3859649122807,
"alnum_prop": 0.6897233201581028,
"repo_name": "showell/zulip",
"id": "ad2295279b9d045fcb31b6991a11c9edcd5306dc",
"size": "2530",
... |
"""
Open Graph
==========
This plugin adds Open Graph Protocol tags to articles.
Use like this in your template:
.. code-block:: jinja2
{% for tag in article.ogtags %}
<meta property="{{tag[0]}}" content="{{tag[1]|striptags|e}}" />
{% endfor %}
"""
from __future__ import unicode_literals
import os... | {
"content_hash": "4389fe4826b4a51c89758e3a89ea072b",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 101,
"avg_line_length": 29.653333333333332,
"alnum_prop": 0.6002697841726619,
"repo_name": "M0nica/datalogues",
"id": "37997cca8df90738663bef48f44ee89a26571d74",
"size": "2... |
import weakref
from sqlalchemy.orm import attributes
class IdentityMap(dict):
def __init__(self):
self._mutable_attrs = set()
self._modified = set()
self._wr = weakref.ref(self)
def replace(self, state):
raise NotImplementedError()
def add(self, state):
raise NotI... | {
"content_hash": "170673b86f31eb52dd3e6cc1704ed1f5",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 88,
"avg_line_length": 30.068548387096776,
"alnum_prop": 0.5415046265254123,
"repo_name": "aurofable/medhack-server",
"id": "59d121de9865bd262fc231e6433a8b11bc228370",
"si... |
SIMPLE_PROTOCOL = """
protocol org.xlattice.fieldz.test.A
# We require (at least for the moment) that enums come first or
# not at all, except that nested enumSpecs and msgSpecs will need
# to be supported.
# yes, I'm playing around
enum OK
ok 1
enum ErrorCode
# we can see that this could easily be a list... | {
"content_hash": "0c27b7a99f8e99c365bd90d8ac8e206f",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 71,
"avg_line_length": 24.544117647058822,
"alnum_prop": 0.6375074895146795,
"repo_name": "jddixon/fieldz",
"id": "c8d2b29959b50a2dcec83ccf577630834ce39f70",
"size": "1669"... |
from readcsv import Read_CSV
from deleteduplicates import Delete_Duplicates
from jamaconfig import JamaConfig | {
"content_hash": "20def9a937ba021e845386e8ea90099c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 46,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.8807339449541285,
"repo_name": "JamaSoftware/deleteByDocumentKey",
"id": "04af240051d681eb8ad1c7a438dc313b8a34f2b8",... |
"""
demo template
Tested environment:
Mac OS X 10.6.8
http://doc.qt.nokia.com/latest/qlineedit.html
"""
import sys
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
from PyQt4 import QtCore
from PyQt4 import QtGui
class Demo(QtGui.QWidget):
def __init__(self):
... | {
"content_hash": "ae946f7be24db4747ed0fb3fd2ec5efd",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 89,
"avg_line_length": 22.74576271186441,
"alnum_prop": 0.6311475409836066,
"repo_name": "alexlib/Qt-Python-Binding-Examples",
"id": "aea444f6783ab058fbbc28e316c0ec32f6dd2cef... |
import argparse
import os
import json
import sys
from common.utils import Util
from common.kerberos import Kerberos
from common.kafka_client import KafkaTopic
import datetime
# get master configuration.
script_path = os.path.dirname(os.path.abspath(__file__))
conf_file = "{0}/ingest_conf.json".format(script_path)
mas... | {
"content_hash": "0609bf34fc33557d53ed0c81d40a2494",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 142,
"avg_line_length": 39.19718309859155,
"alnum_prop": 0.6798418972332015,
"repo_name": "kpeiruza/incubator-spot",
"id": "07c59251bf98da68beba49e883ead72b71d5488d",
"size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.