text stringlengths 4 1.02M | meta dict |
|---|---|
import itertools
import time
import traceback
import jsonschema
from novaclient import exceptions as nova_exc
import six
from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils
from rally import consts
from rally import exceptions
LOG = logging.getLogger(__name__)
de... | {
"content_hash": "c22d73e91f4d8ba1c02415fdfd4f02e2",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 79,
"avg_line_length": 37.25699745547074,
"alnum_prop": 0.6046305149569731,
"repo_name": "aforalee/RRally",
"id": "3a978def15169f69468f9a5561c295322c601103",
"size": "1527... |
def extractBackstage02PressbooksCom(item):
'''
Parser for 'backstage02.pressbooks.com'
'''
if 'Manga' in item['tags']:
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'P... | {
"content_hash": "cae1aff3cc2fa7d70ee14e07ad2238b7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 104,
"avg_line_length": 27.545454545454547,
"alnum_prop": 0.636963696369637,
"repo_name": "fake-name/ReadableWebProxy",
"id": "f3e5d382382a622f700c251aa270bc55a322e4c8",
"s... |
import sys
import argparse
import pyfastaq
import pymummer
import subprocess
import os
parser = argparse.ArgumentParser(
description = '''Compares FASTA files with blast or nucmer, writes input files for ACT.
Then start ACT. Files from top to bottom in ACT are same as order
li... | {
"content_hash": "6a14ca22586d987c364d5429a5409864",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 130,
"avg_line_length": 31.030864197530864,
"alnum_prop": 0.617863536900736,
"repo_name": "martinghunt/bioinf-scripts",
"id": "9ab6a74d75e664ed0847743fb9d4cdd2dafe19cf",
"... |
import unittest
import sys
from plumbum import local
import re
#WARNING: this unittest should be run within the integration test folder
class TestTimingBackAnnotation(unittest.TestCase):
def extractTiming(self,output):
#patterns for extracting the timing information
patternVpr = re.compile(r'Fi... | {
"content_hash": "fd1cf1853449c2e96e102c686113ee03",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 146,
"avg_line_length": 37.46153846153846,
"alnum_prop": 0.5855578370978781,
"repo_name": "adbrant/zuma-fpga",
"id": "e021272076ce9117143f480b2731ac79c6b309a3",
"size": "29... |
"""Concrete date/time and related types -- prototype implemented in Python.
See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
See also http://dir.yahoo.com/Reference/calendars/
For a primer on DST, including many current DST rules, see
http://webexhibits.org/daylightsaving/
For more about DST than you e... | {
"content_hash": "c80f49c7361b0c9790154d1216e40e62",
"timestamp": "",
"source": "github",
"line_count": 2147,
"max_line_length": 85,
"avg_line_length": 35.11970190964136,
"alnum_prop": 0.5572000742685871,
"repo_name": "MalloyPower/parsing-python",
"id": "f506e9ab22f9311628746f3eda3dcc8a9e9ac5ad",
"... |
"""
eor.py
Created by Thomas Mangin on 2010-01-16.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
# from struct import unpack
from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
from exabgp.bgp.message.message import Message
from exabgp.bgp.message.update.attribute import A... | {
"content_hash": "cb6faca3303d850885302fa7fd9cd3de",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 96,
"avg_line_length": 26.96875,
"alnum_prop": 0.6546929316338355,
"repo_name": "blablacar/exabgp",
"id": "6f10a78c9c382be02032f9d9737d2ce34afe77e5",
"size": "1744",
"bin... |
from keystone.common.validation import parameter_types
# Schema for Identity v2 API
_role_properties_v2 = {
'name': parameter_types.name,
'id': parameter_types.id_string,
'description': parameter_types.description
}
role_create_v2 = {
'type': 'object',
'properties': _role_properties_v2,
'requ... | {
"content_hash": "c3d2f72a5a145ec6e2ab2e8b8ac3b31e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 54,
"avg_line_length": 20.25,
"alnum_prop": 0.6474622770919067,
"repo_name": "rajalokan/keystone",
"id": "f93ba3ca49d931ed254400700038820d859baeb0",
"size": "1270",
"bina... |
from airflow.models import BaseOperator
from airflow.hooks.S3_hook import S3Hook
from airflow.contrib.hooks.ssh_hook import SSHHook
from tempfile import NamedTemporaryFile
from urllib.parse import urlparse
from airflow.utils.decorators import apply_defaults
class SFTPToS3Operator(BaseOperator):
"""
This opera... | {
"content_hash": "4a127313cf85cc1a5671ff9f3bf95390",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 76,
"avg_line_length": 33.986111111111114,
"alnum_prop": 0.6109521863506334,
"repo_name": "fenglu-g/incubator-airflow",
"id": "cefc838cf12d1aed626d7117d395e29a517e5fe4",
"s... |
from JumpScale import j
from EventHandler import EventHandler
from ErrorConditionHandler import ErrorConditionHandler
j.errorconditionhandler=ErrorConditionHandler()
j.events=EventHandler()
| {
"content_hash": "894eda45022d75aefd90b8dfef66179c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.8795811518324608,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "c21e55a577792d4f9f1a9e8497c6b8ad01d55fc1",
"siz... |
import unittest
import sys
from werkzeug.test import Client
from werkzeug.wrappers import Response
from profilomatic_analysis.wsgi_utils import not_found, returns_json
class NotFoundTest(unittest.TestCase):
def test_not_found(self):
client = Client(not_found, Response)
response = client.get('/hell... | {
"content_hash": "2660d3e43efcd1fddc9a20176bb41d24",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 77,
"avg_line_length": 35.40425531914894,
"alnum_prop": 0.6201923076923077,
"repo_name": "jamespic/eliot-profiler-analysis",
"id": "c2cd0f655e80df5855c8a2af69436a42e50fbf19",... |
import Skype4Py
import time
import re
class SkypeBot(object):
def __init__(self):
self.skype = Skype4Py.Skype(Events=self)
#self.skype.FriendlyName = "Skype Bot"
self.skype.Attach()
def AttachmentStatus(self, status):
if status == Skype4Py.apiAttachAvailable:
self.skype.Attach()
d... | {
"content_hash": "31a753ef235d69f39fa58b2b60a7e1a2",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 83,
"avg_line_length": 26.25,
"alnum_prop": 0.6246031746031746,
"repo_name": "davsebamse/skype4py",
"id": "458bb68eb6ec400919a3d98487b2cd0b49547964",
"size": "1283",
"bin... |
import json
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import get_model
from django.http import (HttpResponse, HttpResponseNotFound,
HttpResponseBadRequest, HttpResponseForbidden)
from django.views.decorators.clickjacking import xframe_options_sameorigin
from d... | {
"content_hash": "5693dffeddb4776bc93fe8c6a0406440",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 74,
"avg_line_length": 34.206896551724135,
"alnum_prop": 0.6629704301075269,
"repo_name": "iDTLabssl/kitsune",
"id": "fdf3fcf5a333c5e6e2c0f510548d7cf9967d7c5c",
"size": "29... |
import csv
from urllib.request import Request, urlopen
import urllib.error
import re
from sys import argv
from bs4 import BeautifulSoup
from dateutil import parser
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
base_url = base_url[:-1]
strip_char = ';,. \n\t$'
def get_sale_head(lin... | {
"content_hash": "f8db7a46b1a8f02edc68263c28c0cee4",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 86,
"avg_line_length": 28.12258064516129,
"alnum_prop": 0.5574673090158293,
"repo_name": "bansallab/roundup",
"id": "f3e34a286bfd799b84519599f390f7ed7b3921db",
"size": "43... |
"""
ACE object handling according to WebDAV ACP specification.
"""
from webdav.acp.Principal import Principal
from webdav.acp.GrantDeny import GrantDeny
from webdav import Constants
from webdav.Connection import WebdavError
__version__ = "$LastChangedRevision: 13 $"
class ACE(object):
"""
This class provi... | {
"content_hash": "6a2edaa2212197897239b06de17d1b96",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 105,
"avg_line_length": 36.02517985611511,
"alnum_prop": 0.5717423864203695,
"repo_name": "antont/tundra",
"id": "fc22ea2f63193ea9e3abece23752b164449ff662",
"size": "10610... |
from datetime import datetime
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.mail import send_mail
class Command(BaseCommand):
"""send mail test
"""
def message(self, message):
self.stdout.write("%s\n" % message.encode("ascii", "replace"... | {
"content_hash": "e8561d3570d33faf11c30ab392935eb8",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 22.48148148148148,
"alnum_prop": 0.6293245469522241,
"repo_name": "GeographicaGS/moocng",
"id": "1b6e09402068114aa5bf77bf224bba0f39868b47",
"size": "... |
"""
Copyright 2013 LinkedIn Corp. All rights reserved.
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... | {
"content_hash": "d20ecde35be8d3871e9fecc61e9b590d",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 137,
"avg_line_length": 40.82051282051282,
"alnum_prop": 0.684463986599665,
"repo_name": "kilink/naarad",
"id": "99af901ec4414d1a54e9a08de141f9aa195c0c7b",
"size": "4791",... |
from unittest import TestCase
from unittest.mock import Mock
from Orange.data import ContinuousVariable, DiscreteVariable, Domain
from Orange.widgets.data.contexthandlers import \
SelectAttributesDomainContextHandler
from Orange.widgets.settings import ContextSetting
from Orange.widgets.utils import vartype
Conti... | {
"content_hash": "c06ffb93d57d471a1db5b930de46520c",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 78,
"avg_line_length": 43.55140186915888,
"alnum_prop": 0.5023605150214592,
"repo_name": "marinkaz/orange3",
"id": "dacb0bddb7c503203b5ef4eacf458dec7de41f18",
"size": "466... |
from sqlalchemy import Column, Integer, String, Date, Boolean, DateTime
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String)
password = Column(String)
creation_... | {
"content_hash": "692917d947839ce5f9c708e8f8aecde6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 71,
"avg_line_length": 24.71794871794872,
"alnum_prop": 0.6732365145228216,
"repo_name": "mstojcevich/Lambda-Python",
"id": "d1c26afde939cb52a5f9d577ef030d0f850b2dee",
"siz... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib.patches import _Style, FancyArrowPatch
from matplotlib.transforms import IdentityTransform
from matplotlib.path import Path
import numpy as np
class _FancyAxislineStyle:
class S... | {
"content_hash": "ebb9eb7b8530de935e22594e536efee7",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 31.410714285714285,
"alnum_prop": 0.5209399279893879,
"repo_name": "uglyboxer/linear_neuron",
"id": "d87530444a6590171d144dee89260f0c81c4ed1b",
"siz... |
import sys
import os
from paddle.trainer_config_helpers import *
def seq_to_seq_data(data_dir,
is_generating,
dict_size=30000,
train_list='train.list',
test_list='test.list',
gen_list='gen.list',
ge... | {
"content_hash": "6b4b8de6b2372d2a157b395ec674a51b",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 79,
"avg_line_length": 42.74251497005988,
"alnum_prop": 0.5701877276548053,
"repo_name": "zuowang/Paddle",
"id": "edd6ad3f739b6cefc24d235be55c7a8f541e1ab7",
"size": "7767"... |
import myhdl as hdl
def clock_gen(clk_s, Ticks):
interval = hdl.delay(Ticks)
@hdl.always(interval)
def clk():
clk_s.next = not clk_s
return clk
| {
"content_hash": "f84a22fa0f353e2a5e6083ba21a821d5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 31,
"avg_line_length": 15.636363636363637,
"alnum_prop": 0.6046511627906976,
"repo_name": "mutalabs/instar",
"id": "e47ca7f08313f1a6fb8453bb9899ef7b3d82750a",
"size": "172"... |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import RTMPStream, HLSStream
STREAMS_URL = "https://piczel.tv:3000/streams/{0}?&page=1&sfw=false&live_only=true"
HLS_URL = "https://5810b93fdf674.streamlock.net:1936/live/{0}/playlist.m3u8"
RTMP_URL ... | {
"content_hash": "22d0d235dbfa5507dbb5ca47e5b3add8",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 108,
"avg_line_length": 25.75,
"alnum_prop": 0.5275080906148867,
"repo_name": "mmetak/streamlink",
"id": "e6bac79b74b7fb2aa2001d4cac613938cbc5f0e7",
"size": "1854",
"bina... |
"""
Django settings for pokepy project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | {
"content_hash": "d0d5a527f3aac86e2654008b461e63f1",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 71,
"avg_line_length": 25.457943925233646,
"alnum_prop": 0.6868575624082232,
"repo_name": "locolan/pokepy",
"id": "8193c5aa11bf4e7bdc1465a082fd932296209ca8",
"size": "2724... |
"""This code example gets all creative sets.
To create creative sets, run create_creative_sets.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information... | {
"content_hash": "a765723a26aa9629714164d4dee4c4ca",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 77,
"avg_line_length": 31.093023255813954,
"alnum_prop": 0.6843679880329095,
"repo_name": "losnikitos/googleads-python-lib",
"id": "09467cc504cb59c913291c7221a214570d8d2bec",... |
import time
from six.moves import range as xrange
from tempest.common.utils import data_utils
from tempest.lib import exceptions
from tempest import test
from monasca_tempest_tests.tests.api import base
from monasca_tempest_tests.tests.api import constants
from monasca_tempest_tests.tests.api import helpers
class ... | {
"content_hash": "36804165ecb6d5c7dbe5510d4d3a9d4a",
"timestamp": "",
"source": "github",
"line_count": 618,
"max_line_length": 95,
"avg_line_length": 48.90614886731392,
"alnum_prop": 0.5491662255161461,
"repo_name": "sapcc/monasca-api",
"id": "123a7609a72bca96e009ff1e5ea599e22766c2a7",
"size": "30... |
from datetime import timedelta
import logging
from restclients_core.exceptions import (
DataFailureException, InvalidNetID, InvalidRegID)
from uw_gws import GWS_DAO
from sis_provisioner.models import get_now
logger = logging.getLogger(__name__)
def get_dt_from_now(duration):
return get_now() - timedelta(min... | {
"content_hash": "59807a985c3037c40f214eef5bbc064d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.7344961240310077,
"repo_name": "uw-it-aca/bridge-sis-provisioner",
"id": "b2e88d9b7cfe9ebb85b3da8421e5dfea51d4e41d"... |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sitecheck', '0001_initial'),
('tlssite', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='sitecheck',
name='site',
field=models... | {
"content_hash": "c20faa234f5a4c08f06e5e2287726975",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 104,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.5783664459161147,
"repo_name": "tykling/tlsscout",
"id": "b4bb9d86989a0e91df09d899ff016e8d768e5014",
"size": "47... |
import os
from app import create_app, db
from app.models import User, Role, Permission
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('ZEEN_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():... | {
"content_hash": "f330b7e1554a8edc6cfde86779050829",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 25.620689655172413,
"alnum_prop": 0.7200538358008075,
"repo_name": "drinkyouroj/zeen",
"id": "81c459165dea266c268578e12542ea530e020995",
"size": "765... |
from django.test import TestCase
from wikipendium.wiki.models import Article, ArticleContent, User
from wikipendium.wiki.forms import NewArticleForm
from django.core.exceptions import ValidationError
import datetime
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 al... | {
"content_hash": "53373a1b9125f7e7a011163bb56f7bd6",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 75,
"avg_line_length": 37.10362694300518,
"alnum_prop": 0.577154028766932,
"repo_name": "stianjensen/wikipendium.no",
"id": "5f9cf91923467ec75f14c3f7860dd2a0ddb68cf3",
"si... |
import unittest
from datetime import datetime
from .fixtures import fixture_data, Witness, Witnesses, Account
from graphenecommon import exceptions
class Testcases(unittest.TestCase):
def setUp(self):
fixture_data()
def test_Witness(self):
w = Witness("1.6.1")
self.assertIsInstance(w.... | {
"content_hash": "fddfffd97cab866177851e25f389cf55",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 73,
"avg_line_length": 25.93103448275862,
"alnum_prop": 0.6382978723404256,
"repo_name": "xeroc/python-graphenelib",
"id": "44f56c1566a2a57058af997dedd69fd7ca375ab1",
"size... |
from django.utils.translation import trans_real, activate
def test_mkt_locale_not_in_django():
"""
We load gettext catalogs in this order:
django/locale/django.po
locale/django.po
If Django doesn't have a locale, it returns the en-us catalog as a
fallback. But then we take that catal... | {
"content_hash": "6d5bd2fbd70e24300cc5f2123cd88c57",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 32.7,
"alnum_prop": 0.6743119266055045,
"repo_name": "diox/zamboni",
"id": "8369602408515c88e753134fcf847f3d242df7d9",
"size": "654",
"binary": fal... |
from __future__ import annotations
import os
import sys
from .log import logger
__all__ = ["home", "files", "rm"]
def home(path: str | list) -> str:
if sys.platform == "win32":
_home = os.environ["USERPROFILE"]
elif sys.platform == "linux":
_home = os.environ["HOME"]
else:
raise ... | {
"content_hash": "c09cb3add21949f0f4159cbceba3ff91",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 24,
"alnum_prop": 0.6102941176470589,
"repo_name": "mlcdf/dotfiles",
"id": "5432f6b1294f2625d3a3a2f86b5f567c2b504358",
"size": "816",
"binary": fal... |
"""
test_faz
----------------------------------
Tests for `faz` module.
"""
import os
import glob
import time
import unittest
from faz import main, parser
from faz.task import Task, TaskFailedException
from faz.graph import CircularDependencyException
FILE = """file=file999
# Using bash as the interpreter
# file21,... | {
"content_hash": "00a30e5f8dc76382a52dbfdc563899e8",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 119,
"avg_line_length": 23.838532110091744,
"alnum_prop": 0.5604987684729064,
"repo_name": "hmartiniano/faz",
"id": "288523773b4238bf2c0a323ceb753c7f05dec872",
"size": "13... |
import argparse
import psycopg2
import re
class MacrobaseArgAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
arg = re.sub('_', '.', self.dest)
_attr_to_set = 'macrobase_args' if self.const is None else self.const
macrobase_args = getattr(namespace, _attr_to_set... | {
"content_hash": "9a55b8bc6222ded208b3801296412e48",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 31.46153846153846,
"alnum_prop": 0.6659535452322738,
"repo_name": "stanford-futuredata/macrobase",
"id": "e77ae6c3cb1194f23c3fea86cd9ec26826da656d",
... |
import threading
import serial
import time
import distutils.util
import math
from numpy import interp
import statistics
import config
class Arduino(threading.Thread):
"""docstring for Arduino"""
daemon = True
previously_sent = None
actioations_per_second = 15
time_between_ems = 30
def __init__... | {
"content_hash": "c62bf411924c5ae401cc4b82e189b828",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 157,
"avg_line_length": 37.02542372881356,
"alnum_prop": 0.49576562142366676,
"repo_name": "PedroLopes/affordance",
"id": "0486513973b0d9671dd4400f62a9186f4582d598",
"size... |
"""Support gathering ted5000 information."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, POWER_WATT
from homeassistant.helpers import... | {
"content_hash": "ed6b8f71a06abc43155bce492ae81c62",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 86,
"avg_line_length": 28.792792792792792,
"alnum_prop": 0.6182728410513142,
"repo_name": "leppa/home-assistant",
"id": "e0025a050c307d6d2f89c37f3152b825e129dd41",
"size":... |
"""Test the connection module."""
import datetime
import os
import sys
import time
import unittest
import warnings
sys.path[0:0] = [""]
from nose.plugins.skip import SkipTest
from bson.son import SON
from bson.tz_util import utc
from pymongo.connection import (Connection,
_parse_uri)
... | {
"content_hash": "f68fd0fe85cfac5ec14a2eb68151ac5c",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 120,
"avg_line_length": 38.109339407744876,
"alnum_prop": 0.5581589958158996,
"repo_name": "reedobrien/mongo-python-driver",
"id": "70f2a5f59ce4fe72dea4ffa190abe01147591050"... |
from __future__ import (absolute_import, division, unicode_literals)
import io
import logging
from binascii import b2a_hex
from .wsgidav import util
from .wsgidav.dav_error import DAVError, HTTP_FORBIDDEN
from .wsgidav.dav_provider import DAVProvider, DAVCollection, DAVNonCollection
logger = logging.getLogger(__name... | {
"content_hash": "5aacf4241b28d7a4a2177dd9ae74f916",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 26.554744525547445,
"alnum_prop": 0.6261682242990654,
"repo_name": "eavatar/avax.webdav",
"id": "9e3c2a3c6ad4181af2095273af68fa16049c30b9",
"size": ... |
"""Script to ensure a configuration file exists."""
import argparse
import os
from homeassistant.core import HomeAssistant
import homeassistant.config as config_util
# mypy: allow-untyped-calls, allow-untyped-defs
def run(args):
"""Handle ensure config commandline script."""
parser = argparse.ArgumentParse... | {
"content_hash": "88b91aaa0279abfa75606c2fc1b086a6",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 81,
"avg_line_length": 28.851063829787233,
"alnum_prop": 0.668141592920354,
"repo_name": "joopert/home-assistant",
"id": "c5cf69283e6f85b2227fb9e7772e374b007a2f48",
"size":... |
import functools
from .. import lists
from .. import documents
from .. import results
def _read_notes(note_type, element, body_reader):
def read_notes_xml_element(element):
note_elements = lists.filter(
_is_note_element,
element.find_children("w:" + note_type),
)
r... | {
"content_hash": "0a1b35347c7bf3731a1c2ff7d6cc2785",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 93,
"avg_line_length": 30.59375,
"alnum_prop": 0.634320735444331,
"repo_name": "mwilliamson/python-mammoth",
"id": "5e4ea4e92443565463213f35e1d12f1d1bd00569",
"size": "979"... |
import sys
import os
import mmap
import subprocess
from array import array
import logging
import logging.handlers
from datetime import datetime
from ConfigParser import SafeConfigParser
try:
import cPickle as pickle
except:
import pickle
# This is necessary because a MutationObject will
# be unserialized from... | {
"content_hash": "141babdbb972a8faa7f602e878970f24",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 86,
"avg_line_length": 32.142857142857146,
"alnum_prop": 0.5430409356725147,
"repo_name": "carlosgprado/BrundleFuzz",
"id": "cd9408bb2044385ea443e88c7c05458c4d785cf1",
"si... |
from __future__ import print_function
import os
import subprocess
base_dir = os.path.join(os.path.dirname(__file__), '..')
os.chdir(base_dir)
p = subprocess.Popen("python setup.py sdist".split(),
stdout=subprocess.PIPE)
out, err = p.communicate()
data = out.decode('utf-8').split('\n')
data = [l... | {
"content_hash": "e8509d17033a349b3b0c4ac790fcaf87",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 63,
"avg_line_length": 26.9375,
"alnum_prop": 0.5212683681361175,
"repo_name": "mltsp/mltsp",
"id": "df9dfc792ea40fbefc1e871196b0c314a088071b",
"size": "1316",
"binary": ... |
import importlib
import os
# automatically import any Python files in the models/ directory
models_dir = os.path.dirname(__file__)
for file in os.listdir(models_dir):
path = os.path.join(models_dir, file)
if (
not file.startswith("_")
and not file.startswith(".")
and (file.endswith(".p... | {
"content_hash": "49086aa6cd13fd094cc36848dedfe87c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 87,
"avg_line_length": 34.86666666666667,
"alnum_prop": 0.6462715105162524,
"repo_name": "pytorch/fairseq",
"id": "3532479e52a0e1f1ba204c6f5d51c71c98ee5df0",
"size": "701",... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from app.openapi_server.models.base_model_ import Model
from openapi_server import util
class Link(Model):
"""NOTE: This class is auto generated by the swagger code generator prog... | {
"content_hash": "94477f94be5fa2cf54f775f1d63627c6",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 80,
"avg_line_length": 22.568181818181817,
"alnum_prop": 0.5332326283987915,
"repo_name": "cliffano/swaggy-jenkins",
"id": "7f3f0c56a3c121e8c4a8e0e4a3b0233ea45568e4",
"size... |
import numpy as np
from PIL import Image
data = np.fromfile('data/float32.dat', dtype=np.float32)
data = data.reshape((360,720))
Image.fromarray(data*10**7).show()
| {
"content_hash": "b95a4929bcde2a9d5440736b901be836",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 56,
"avg_line_length": 27.5,
"alnum_prop": 0.7333333333333333,
"repo_name": "jsheedy/velotronheavyindustries.com",
"id": "ee005637e6a7388aa2bfb8b3664c054e428a1d5d",
"size": ... |
"""Lookup operations."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.pyth... | {
"content_hash": "b1cc1e12b7cc2009bf9b649b8b3f0e03",
"timestamp": "",
"source": "github",
"line_count": 1207,
"max_line_length": 80,
"avg_line_length": 36.6106048053024,
"alnum_prop": 0.6564077032745705,
"repo_name": "yufengg/tensorflow",
"id": "dade0535892492cd60f511674f42e9158c5e72a7",
"size": "4... |
"""
Join parts of URLs by ensuring that parts are separated by exactly one slash.
Because, unfortunately urllib.parse.urljoin is not for joining URLs.
"""
from functools import reduce
def _join_slash(a, b):
return a.rstrip('/') + '/' + b.lstrip('/')
def urljoin(*args):
return reduce(_join_slash, args) if args... | {
"content_hash": "2aebf21b94b733cccae0b6aa72ff01af",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 25.193548387096776,
"alnum_prop": 0.5697823303457106,
"repo_name": "cbare/Etudes",
"id": "87e4ed69c54d2a806bb25581e8049898650f070a",
"size": "781",
... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import logout
from django.urls import path, re_path
from . import views
urlpatterns = static('/compiled/', document_root=settings.BUILD_ROOT) + [
path('go/<path:path>', views.redirector, name='redirector'),
p... | {
"content_hash": "5400533683bc4335886bf11bbd8688fe",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 73,
"avg_line_length": 32.785714285714285,
"alnum_prop": 0.6797385620915033,
"repo_name": "citizenlabsgr/voter-engagement",
"id": "b56cab4e38c9bae2fa8b56055eb7585e52cf2cc7",
... |
from datetime import date
from workalendar.tests import GenericCalendarTest
from workalendar.america import UnitedStates
from workalendar.america import Brazil, BrazilSaoPauloState
from workalendar.america import BrazilSaoPauloCity
from workalendar.america import Mexico, Chile, Panama
class UnitedStatesTest(GenericCa... | {
"content_hash": "1cb403a10a07f18111b12b4c371c8c31",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 79,
"avg_line_length": 43.92814371257485,
"alnum_prop": 0.6499454743729552,
"repo_name": "ChrisStevens/workalendar",
"id": "e63fbfda106ea555da6f7e20b7a5bdd0330db5c6",
"siz... |
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1ComponentConfig(object)... | {
"content_hash": "96297c2ed68ce7182369c0fd21945e57",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 275,
"avg_line_length": 29.980132450331126,
"alnum_prop": 0.5886900817318312,
"repo_name": "kubevirt/client-python",
"id": "0cc370924591767b9aedfef218c2c58e92505e1b",
"siz... |
import os, os.path, sys, re
from fnmatch import fnmatch
from setuptools import setup
MODULE_NAME = 'django_mako_plus'
IGNORE_PATTERNS = [
'.*',
'__pycache__',
'*.pyc',
'__dmpcache__',
'node_modules',
'.vscode',
'.DS_Store',
]
def is_ignore(fn):
for pat in IGNORE_PATTERNS:
if fn... | {
"content_hash": "0e42b174f1d9a474333834beb192b472",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 124,
"avg_line_length": 30.12295081967213,
"alnum_prop": 0.6312925170068027,
"repo_name": "doconix/django-mako-plus",
"id": "d46ee989d55d3550fe3584077706199806c1035a",
"si... |
from cli import base
from core import data, container
from cement.core.controller import CementBaseController, expose
class PackageController(CementBaseController):
class Meta:
label = 'package'
stacked_on = 'base'
@expose(help='Package the AppDir into an AppImage.')
def package(self):
... | {
"content_hash": "ff8ecacc7b0e2f74b35838b78ce6b3b6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 135,
"avg_line_length": 36.88235294117647,
"alnum_prop": 0.6858054226475279,
"repo_name": "eloquentstore/appimager",
"id": "facf8826d7e79670f981d0de04541a5e10f3f02c",
"size... |
'''
From the original motif scanning, selects those events withing a particular window of a gene and outputs the
tgm, geneids and tf ids for final analysis
'''
__author__='sara jc gosline'
__email__='sgosline@mit.edu'
import re,os,sys
from optparse import OptionParser
from collections import defaultdict
import numpy a... | {
"content_hash": "adeb91c5221f6797c5abd8b01c57ddfd",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 167,
"avg_line_length": 41.38996138996139,
"alnum_prop": 0.5949626865671642,
"repo_name": "agitter/OmicsIntegrator",
"id": "c00553e4b96b29ca101500fb979ff9ae359f4b94",
"siz... |
from __future__ import annotations
import pickle
from datetime import timedelta
import pendulum
def test_pickle():
it = pendulum.duration(days=3, seconds=2456, microseconds=123456)
s = pickle.dumps(it)
it2 = pickle.loads(s)
assert it == it2
def test_comparison_to_timedelta():
duration = pend... | {
"content_hash": "e39f884b6318f3c9125125989a72356e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 18.238095238095237,
"alnum_prop": 0.7049608355091384,
"repo_name": "sdispater/pendulum",
"id": "a97bbde6bbf525b7c4e36e01fc5c35053743128b",
"size": "3... |
import requests
import datetime
import dateutil
import dateutil.parser
import logging
from plugins.packagetracker.provider import Package
__author__ = "tigge"
class DHLPackage(Package):
API_URL = "https://api-eu.dhl.com/track/shipments?trackingNumber="
apikey = None
@classmethod
def get_type(cls):... | {
"content_hash": "e37b652cd6e80742f767b4b04309559a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 88,
"avg_line_length": 27.06896551724138,
"alnum_prop": 0.5494692144373673,
"repo_name": "Tigge/platinumshrimp",
"id": "ed1d4ede55694b92c9c2b11f57d5d275ce627587",
"size": "... |
from date_conventions import *
class OvernightIndexSwap:
''' We define the product by its:
- startDate
- endDate
- floatingLegNominal: the nominal used to compute the flows of the floating leg:
if positive the flows are received, negative paid
- fixedLegDates: the union of the start and end d... | {
"content_hash": "d647f5aba7f075d918b2d94ffd00f28a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 120,
"avg_line_length": 47.578947368421055,
"alnum_prop": 0.6856194690265487,
"repo_name": "gabberthomson/fm_finpy",
"id": "79a11c17fd1550cdecc00ee90a776955e411489f",
"size... |
"""``lldp.py``
"""
import re
from .linux import lldp
class Tlv(object):
@staticmethod
def get_simple_tlv_row(row_name, value):
# zero lenght values return an empty list, convert to ''
return {row_name: value[0] if value else ''}
@staticmethod
def get_tlv_from_list(tlvs, predicate)... | {
"content_hash": "c16abe6428f0569ecd92c5823b774f9c",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 72,
"avg_line_length": 36.060317460317464,
"alnum_prop": 0.5141297649440972,
"repo_name": "taf3/taf",
"id": "de53019b35231a3ad546ef155e0809439e8253da",
"size": "11953",
... |
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
def main():
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
failures = test_runner.run_tests(['tests'])
... | {
"content_hash": "a2ffe06f1085cd136cab25bbb86f53e8",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.6752577319587629,
"repo_name": "algolia/algoliasearch-django",
"id": "4318d948382c030031c94eb6e54e9dfac3ec2cd8",
... |
"""Glow generative model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensor2tensor.layers import common_hparams
from tensor2tensor.layers import common_layers
from tensor2tensor.models.research import glow_init_hook
from tens... | {
"content_hash": "1aa61859ac77f4aa0cc6d6caa0234023",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 81,
"avg_line_length": 34.49738219895288,
"alnum_prop": 0.6691455456063136,
"repo_name": "mlperf/training_results_v0.5",
"id": "c3c01192b85f2158d97776844e528ebe7c2f76cf",
... |
##====================DICE========================
import random
die = [4, 6, 8, 10, 20]
print(die)
#prompt for die
print("Choose a Dice")
userdie = int(input())
while userdie not in die:
print("Choose a correct die")
userdie = int(input())
print()
print("How many times would you ... | {
"content_hash": "f4933f9cda727c01c8df24ee48011570",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 55,
"avg_line_length": 17.4375,
"alnum_prop": 0.5555555555555556,
"repo_name": "nirarin7/PythonPractice",
"id": "72fcc70f05cee0cafa8f7bdcd4e53573026c3b6b",
"size": "558",
... |
"""Plotting functions.
"""
from __future__ import division, absolute_import
import numpy as np
import pylab as pl
import seaborn as sb
sb.set(font_scale=0.7, style='white')
def recovery_performance(mixed, cost_func, true_bias, estimated_signal, true_signal, estimated_bias):
"""
Print recovery performance s... | {
"content_hash": "a65c3f8932cdef7553051884dcd63a82",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 184,
"avg_line_length": 41.34662576687116,
"alnum_prop": 0.5987832925291193,
"repo_name": "a378ec99/bcn",
"id": "f328a4d7eb96af18ec75a580ac3c91b56537178d",
"size": "13479"... |
from typing import Optional
from appium.options.common.supports_capabilities import SupportsCapabilities
VERBOSITY = 'verbosity'
class VerbosityOption(SupportsCapabilities):
@property
def verbosity(self) -> Optional[str]:
"""
The verbosity level of driver logging.
"""
return ... | {
"content_hash": "07df304dd0ec51f878d518e37b3d4ff8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 76,
"avg_line_length": 27,
"alnum_prop": 0.6570048309178744,
"repo_name": "appium/python-client",
"id": "9888ddf2d68c35a71ff60443c80bb122eeb99d8c",
"size": "1409",
"binar... |
"""
wakatime-cli
~~~~~~~~~~~~
Command-line entry point.
:copyright: (c) 2013 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import wakatime
if __name__ == '_... | {
"content_hash": "ed03421876fdaff313ecf5d2148d3cef",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 19.36842105263158,
"alnum_prop": 0.6277173913043478,
"repo_name": "AppVentus/AvTime-client",
"id": "8552075a5f144b602917afffea98c42b8265df29",
"size"... |
import os
import time
import datetime
import json
# parse inputs
print os.environ["TEXT"] | {
"content_hash": "e2f9d1bb695ddefbc772aed09f26094c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 24,
"avg_line_length": 11.375,
"alnum_prop": 0.7802197802197802,
"repo_name": "graboskyc/BasicCloudShellRobot",
"id": "84591dc698f0ab8316b37d6c81607aafc8e34e2a",
"size": "91... |
from oslo.config import cfg
import sqlalchemy as sa
from sqlalchemy.orm import exc as sa_exc
from neutron.common import exceptions as exc
from neutron.db import api as db_api
from neutron.db import model_base
from neutron.openstack.common import log
from neutron.plugins.common import constants as p_const
from neutron.... | {
"content_hash": "bcc5da96e6a99f94a9cf408886940116",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 79,
"avg_line_length": 40.20855614973262,
"alnum_prop": 0.5498071552068095,
"repo_name": "subramani95/neutron",
"id": "3e5d4756791f875b8e98588c99d5f5fafa6ea3f1",
"size": "... |
"""Test the flow classes."""
import asyncio
from unittest.mock import patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.core import HomeAssistant
from homeassistant.util.decorator import Registry
from tests.common import async_capture_events
@... | {
"content_hash": "e5b42d919b5bc187e4ff9260c1f3dbde",
"timestamp": "",
"source": "github",
"line_count": 532,
"max_line_length": 102,
"avg_line_length": 34.87218045112782,
"alnum_prop": 0.6177231565329884,
"repo_name": "toddeye/home-assistant",
"id": "18d5469a1621cb644242c58e9171bafadcdc055c",
"size... |
"""
==========================
kikola.contrib.basicsearch
==========================
Application to lightweight search over models, existed in your project.
Installation
============
1. Add ``kikola.contrib.basicsearch`` to your project's ``settings``
``INSTALLED_APPS`` var.
2. Set up ``SEARCH_MODELS`` var in yo... | {
"content_hash": "3099e17863eafb53d6bc21a4f9972dd1",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 76,
"avg_line_length": 26.825688073394495,
"alnum_prop": 0.5889192886456909,
"repo_name": "playpauseandstop/kikola",
"id": "92bb88f6fbfe7cd73aea4a4f37ffe70f2c5b5bda",
"siz... |
import commonware.log
import lib.iarc
import mkt
from mkt.translations.utils import find_language
log = commonware.log.getLogger('z.webapps')
def get_locale_properties(manifest, property, default_locale=None):
locale_dict = {}
for locale in manifest.get('locales', {}):
if property in manifest['loca... | {
"content_hash": "60e8ae72cdb3220f38cbc1c7fe72aefe",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 79,
"avg_line_length": 29.2125,
"alnum_prop": 0.6739409499358151,
"repo_name": "ngokevin/zamboni",
"id": "3f436a1e50f55b15ec0b1601205452d135a04fd9",
"size": "2361",
"bina... |
"""Tests for the jewish_calendar component."""
from collections import namedtuple
from contextlib import contextmanager
from datetime import datetime
from unittest.mock import patch
from homeassistant.components import jewish_calendar
import homeassistant.util.dt as dt_util
_LatLng = namedtuple("_LatLng", ["lat", "ln... | {
"content_hash": "dc668534a060bafe435a6dc493aa3c62",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 84,
"avg_line_length": 28.52777777777778,
"alnum_prop": 0.6455696202531646,
"repo_name": "adrienbrault/home-assistant",
"id": "2d42458cf1b437ea674757ec884d394c038e2225",
"s... |
from distutils.core import setup
setup(
name = "Daily Notices for Moodle",
packages = ['cli', 'notices', 'gns'],
version = "1.0",
description = "",
author = "Adam Morris",
author_email = "classroomtechtools.ctt@gmail.com",
keywords = ["moodle"],
install_requires = ['click', 'sqlalchemy',... | {
"content_hash": "a7c991e7702bd83ae162f7771bbfe7c0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 89,
"avg_line_length": 30.75,
"alnum_prop": 0.5981416957026713,
"repo_name": "classroomtechtools/moodle_daily_notices",
"id": "b2177a4e5643ee93b8fc178b68ae8ce5dde8f815",
"s... |
'''
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.
'''
# from nose import with_setup
# -*- coding: utf-8 -*-
from ..data_structures.sarray import SArray
import pandas as pd
import numpy as np
import ... | {
"content_hash": "df53a6eae2f944a3073e20e28606167e",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 104,
"avg_line_length": 41.491467576791806,
"alnum_prop": 0.5866578925721806,
"repo_name": "haijieg/SFrame",
"id": "750453f342edde055a3056df4ff1e2135ba73ee7",
"size": "121... |
import sys
import subprocess
import time
import start_craq_server
import start_craq_router
def main(args):
zookeeper_node = args[1]
zookeeper_addr = args[2]
craq_nodes = args[3:]
print "Starting zookeeper"
subprocess.Popen(['./cluster/zookeeper/start_zookeeper.sh', zookeeper_n... | {
"content_hash": "f10f7823431237490211638da4910aa6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6573426573426573,
"repo_name": "sirikata/sirikata",
"id": "cbf3f1c724e56999a6d283dd0528dee883ae80a1",
"size": "73... |
"""Generated message classes for dataproc version v1.
Manages Hadoop-based clusters and jobs on Google Cloud Platform.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
from apitools.base.py impor... | {
"content_hash": "ffaa432f9f2f0d8ed497cda0808472b2",
"timestamp": "",
"source": "github",
"line_count": 2084,
"max_line_length": 94,
"avg_line_length": 39.76439539347409,
"alnum_prop": 0.7297059213940074,
"repo_name": "KaranToor/MA450",
"id": "b4cfd8d555b30193a9b6d881102d6c411c8a3b46",
"size": "828... |
"""Data Equivalence Tests"""
from __future__ import print_function
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Martin Billinger <martin.billinger@tugraz.at>
#
# License: BSD (3-clause)
import os.path as op
import inspect
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_... | {
"content_hash": "27e292bbc19b0dd345aba54f83a7cf14",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 75,
"avg_line_length": 35.1256038647343,
"alnum_prop": 0.6248108925869894,
"repo_name": "agramfort/mne-python",
"id": "691b91701bfa0a70f63f767f3f769fcb2345db5f",
"size": "... |
"""
utils mino
"""
import os
import errno
import shutil
def str2num(string):
"""convert string to numbers"""
try:
return int(string)
except ValueError:
return float(string)
def get_suffix_file(dirname, suffix):
"""get all files in a dir recursively with specific suffix"""
files ... | {
"content_hash": "23dac1663905301cedd8471187b3fa33",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 65,
"avg_line_length": 21.76923076923077,
"alnum_prop": 0.5848056537102474,
"repo_name": "gongbudaizhe/bilib",
"id": "b64fb45bc9d89712bfeed185c88aa3c0f905953e",
"size": "12... |
from pyModbusTCP import constants
from setuptools import setup
with open('README.rst') as f:
readme = f.read()
setup(
name="pyModbusTCP",
version=constants.VERSION,
description="A simple Modbus/TCP library for Python",
long_description=readme,
author="Loic Lefebvre",
author_email="loic.cel... | {
"content_hash": "bc5d01f9205bde97cbf5dccf725e1898",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 57,
"avg_line_length": 25.5,
"alnum_prop": 0.690631808278867,
"repo_name": "sourceperl/pyModbusTCP",
"id": "3b42d32f845f87cbdb9501c9e6d5d12607347b46",
"size": "459",
"bin... |
"""Default variable filters."""
import random as random_module
import re
import types
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from operator import itemgetter
from pprint import pformat
from urllib.parse import quote
from django.utils import formats
from django.... | {
"content_hash": "e19db5207685265afc562054cdd4f171",
"timestamp": "",
"source": "github",
"line_count": 905,
"max_line_length": 101,
"avg_line_length": 28.678453038674032,
"alnum_prop": 0.6085767126454497,
"repo_name": "fenginx/django",
"id": "d8fb0a5396589757c1f04208989591cc3d668477",
"size": "259... |
import matplotlib.pyplot as plt
import numpy as np
import sounddevice as sd
import sys
from wav_rw import wavwrite, enframe
from pandas import Series
#################################################################
#################################################
#detector de actividad vocal usando log energia y un u... | {
"content_hash": "3aebbd2df912d55c4fa160acd0efa218",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 92,
"avg_line_length": 35.59322033898305,
"alnum_prop": 0.5942857142857143,
"repo_name": "miltonsarria/dsp-python",
"id": "bad34af0bd5139a59c5b0984536737244a7abbea",
"size"... |
from inspect import isclass, isfunction, ismodule
from functools import partial
is_func_or_partial = lambda f: isfunction(f) or isinstance(f, partial)
def write_docs_for_module(module, path, modules_to_skip=None,
generate_index=False):
if modules_to_skip is None:
modules_to_skip... | {
"content_hash": "e3e9302da7dff7a9eb92cab8bd487e5b",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 78,
"avg_line_length": 41.91860465116279,
"alnum_prop": 0.5478502080443828,
"repo_name": "grigorisg9gr/menpowidgets",
"id": "a872f45a8a7a69fef806eee7d41b8e67b317bcbb",
"siz... |
"""Functions for plotting graphs related to IAST calculations."""
import matplotlib as mpl
import matplotlib.pyplot as plt
from pygaps.graphing.mpl_styles import BASE_STYLE
from pygaps.utilities.string_utilities import convert_chemformula_ltx
@mpl.rc_context(BASE_STYLE)
def plot_iast(
p_data: list,
l_data: ... | {
"content_hash": "e8d7a2da0d23d69bbae7e2ce32ac7f2c",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 77,
"avg_line_length": 22.83783783783784,
"alnum_prop": 0.5936883629191322,
"repo_name": "pauliacomi/pyGAPS",
"id": "3bb323e808a9838c3d639aef2620ccda1f73b558",
"size": "50... |
"""Validation tests for JAX-CFD."""
import functools
from absl.testing import absltest
from absl.testing import parameterized
import jax.numpy as jnp
from jax_cfd.base import advection
from jax_cfd.base import diffusion
from jax_cfd.base import equations
from jax_cfd.base import funcutils
from jax_cfd.base import te... | {
"content_hash": "882d09b68e258a09b30e95addc2b6e04",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 80,
"avg_line_length": 39.522012578616355,
"alnum_prop": 0.6115531508593253,
"repo_name": "google/jax-cfd",
"id": "3009c13e8225cbe3af8813ce2a6225fb93e319a8",
"size": "6860... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import mock
from oslo_config import cfg
from oslo_log import log as logging
from congress.datalog import base as datalog_base
from congress.datalog import compile
from congress.datalog import database
from con... | {
"content_hash": "90ea04d0859ec4265b1c06a9bc0f532f",
"timestamp": "",
"source": "github",
"line_count": 1910,
"max_line_length": 79,
"avg_line_length": 41.31413612565445,
"alnum_prop": 0.5638702319097706,
"repo_name": "openstack/congress",
"id": "4b2cb7b53307ae3f1665100da8062ba7f923c436",
"size": "... |
__author__ = "Jerome Leclanche"
__email__ = "jerome@leclan.ch"
__version__ = "1.4.0"
class NotificationError(Exception):
pass
| {
"content_hash": "e722e700eafcc2bfd3590973a3ce750f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 35,
"avg_line_length": 18.428571428571427,
"alnum_prop": 0.6589147286821705,
"repo_name": "nnseva/django-push-notifications",
"id": "d7303fc882a1e1457402117538085d05baaa80f4",... |
import numpy
import math
cache = {}
def run(world):
global cache
# New iteration, free the cache
cache = {}
def query(world, matrix_name, initial_position, search_radius_in_zones=2, zone_size=8, search_for_max=True, wrap=False, return_value_if_same_zone=None):
global cache
matrix = world.get_matr... | {
"content_hash": "fbc598c8923c170115c80b43c0bc32d8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 201,
"avg_line_length": 47.67032967032967,
"alnum_prop": 0.5919778699861687,
"repo_name": "ofavre/cellulart",
"id": "3eb91aed3edfab3ecfa59c4061a69c152935aa8e",
"size": "439... |
from google.cloud.logging_v2.gapic import enums
import logging
import mock
import rdr_service.services.gcp_logging as gcp_logging
from tests.helpers.unittest_base import BaseTestCase
class GCPLoggingTest(BaseTestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.us... | {
"content_hash": "16c41d393c5548b4d45a3c6c9890ca73",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 103,
"avg_line_length": 39,
"alnum_prop": 0.6233711643547709,
"repo_name": "all-of-us/raw-data-repository",
"id": "afb723f8698b17b1ee7269e2d54c051b8aae6caf",
"size": "2379"... |
"""Infrastructure for registering and firing callbacks on application events.
Unlike :mod:`IPython.core.hooks`, which lets end users set single functions to
be called at specific times, or a collection of alternative methods to try,
callbacks are designed to be used by extension authors. A number of callbacks
can be r... | {
"content_hash": "302864e2fac46f03ac11a893ed5bec96",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 100,
"avg_line_length": 33.22360248447205,
"alnum_prop": 0.6318938119274631,
"repo_name": "ipython/ipython",
"id": "73fc181ae5ab0f300b9860b6538beddd0018e6f2",
"size": "534... |
""" Code for simulating proof and tally servers for split-vote election.
"""
# MIT open-source license.
# (See https://github.com/ron-rivest/split-value-voting.git)
import time
import sv
class SBB:
""" Implement secure bulletin board.
Messages are always lists: [ "msg_type", ... ]
Convention is that a ... | {
"content_hash": "7ab6d66c7b20cef4c48382cbe6c4ae29",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 30.64423076923077,
"alnum_prop": 0.580483213053028,
"repo_name": "msoltysik/split-value-voting",
"id": "2f001e5293bc5a3837d018c8ba959269f104e5b5",
"... |
from __future__ import print_function
import os
import sys
import shutil
import argparse
import subprocess
from distutils.dir_util import copy_tree
def main(argv):
arg_parser = argparse.ArgumentParser(
description='Update the Python Project Template using diff3.')
arg_parser.add_argument(
'gen... | {
"content_hash": "7e5b70608c77103b4406d841e0d3eb24",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 34.135802469135804,
"alnum_prop": 0.6759493670886076,
"repo_name": "shekkbuilder/python-project-template",
"id": "995671039aa725f0d9f563c8ad47543b16d83... |
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
from pocketlint.formatcheck import XMLChecker
from pocketlint.tests import CheckerTestCase
from pocketlint.tests.test_text import TestAnyTextMixin
good_markup = """\
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<root... | {
"content_hash": "0477047f7ed081237db1d5135ebe6225",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 78,
"avg_line_length": 25.84873949579832,
"alnum_prop": 0.6446684005201561,
"repo_name": "chevah/pocket-lint",
"id": "cf48aa28dc140abcbc3d5f95923e07319655e159",
"size": "3... |
"""ADB protocol implementation.
Implements the ADB protocol as seen in android's adb/adbd binaries, but only the
host side.
"""
import collections
import stat
import struct
import time
from . import adb_protocol
from . import usb_exceptions
# Default mode for pushed files.
DEFAULT_PUSH_MODE = stat.S_IFREG | stat.S_... | {
"content_hash": "5dcb4ffc581bdb6ae161a5639904c6d0",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 80,
"avg_line_length": 28.82587064676617,
"alnum_prop": 0.6487745944080083,
"repo_name": "chenm001/connectal",
"id": "8f2f658fb9dea8fb2fb4ed70eb3d7e8ed4ace8ed",
"size": "6... |
"""Convenience functions for dealing with instance templates."""
from googlecloudsdk.api_lib.compute import alias_ip_range_utils
from googlecloudsdk.api_lib.compute import constants
from googlecloudsdk.api_lib.compute import image_utils
from googlecloudsdk.api_lib.compute import utils
from googlecloudsdk.command_lib.c... | {
"content_hash": "0eeace963eae55aa61d855699b2bda63",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 85,
"avg_line_length": 36.26146788990825,
"alnum_prop": 0.6805819101834282,
"repo_name": "KaranToor/MA450",
"id": "1c67955e89507d6bb2be11e0c21e3b6b90a40bce",
"size": "8500... |
from rest_framework.permissions import IsAuthenticated
class IsAuthenticatedOwner(IsAuthenticated):
"""
Allows access only to authenticated users and also owners of the object.
"""
def has_object_permission(self, request, view, obj):
"""Return True if permission is granted to the user."""
... | {
"content_hash": "1fb53087a046074408c16c551632baf7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 32.45454545454545,
"alnum_prop": 0.7086834733893558,
"repo_name": "maru/fiubar",
"id": "139b30ca74d0e23898a8bda9fb66564812877b7c",
"size": "357",
"... |
import pytest
from concepts import matrices
@pytest.fixture(scope='module')
def relation():
xname = 'Condition'
yname = 'Symbol'
xmembers = 'TT', 'TF', 'FT', 'FF'
ymembers = '->', '<-'
xbools = [(True, False, True, True), (True, True, False, True)]
return matrices.Relation(xname, yname, xmemb... | {
"content_hash": "e7b170cd6ebfca329622ee857e95193c",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.6441717791411042,
"repo_name": "xflr6/concepts",
"id": "73f3361f00039a8248e479b1dbd1cb3af4ba2c9c",
"size": "652",... |
"""Add agent management extension model support
Revision ID: 511471cc46b
Revises: 363468ac592c
Create Date: 2013-02-18 05:09:32.523460
"""
# revision identifiers, used by Alembic.
revision = '511471cc46b'
down_revision = '363468ac592c'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugin... | {
"content_hash": "815e0fbcb3aed78235bf06502eb35d93",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 76,
"avg_line_length": 35.152542372881356,
"alnum_prop": 0.6933461909353905,
"repo_name": "wallnerryan/quantum_migrate",
"id": "fc6898e47659d659682afa3e861ad75bbffd350d",
"... |
from tastypie.resources import Resource, DeclarativeMetaclass, ResourceOptions
from tastypie import fields
from tastypie.paginator import Paginator
from tastypie.exceptions import InvalidFilterError, InvalidSortError
from haystack.query import SearchQuerySet, AutoQuery, SQ
from .utils import stemmer, uclean
from django... | {
"content_hash": "2c0a0d681699f8bb935f3ec80a862324",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 116,
"avg_line_length": 32.63076923076923,
"alnum_prop": 0.5823668081093824,
"repo_name": "Tatoeba/tatoeba-api",
"id": "fac6d2519162e716fa15426f0c674019f05d3279",
"size": ... |
"""
OpenStack Cinder driver - interface to Open vStorage
- uses Open vStorage library calls (VDiskController)
- uses Cinder logging
"""
import socket
import time
# External libs: Open vStorage
try:
from ovs.dal.hybrids import vdisk as vdiskhybrid
from ovs.dal.lists import pmachinelist
from ovs.dal.lists i... | {
"content_hash": "e2fa750638bf21e512859fce3839fbd5",
"timestamp": "",
"source": "github",
"line_count": 526,
"max_line_length": 79,
"avg_line_length": 40.42205323193917,
"alnum_prop": 0.5663625246919387,
"repo_name": "Akrog/cinder",
"id": "ee361c152ffba1a32b2380d1c7706565d5bf8998",
"size": "21843",... |
__author__ = 'baranbartu'
import logging
import threading
from memory_profiler import LineProfiler
from memgraph.profile import determine_memory_info
logger = logging.getLogger(__name__)
def observe(func=None, precision=1):
if func is not None:
def wrapper(*args, **kwargs):
prof = LineProfil... | {
"content_hash": "d78a3328ec3101e9972e9dcb1e1c022e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 28.928571428571427,
"alnum_prop": 0.5888888888888889,
"repo_name": "baranbartu/memgraph",
"id": "f624c31f709126e9a6d3c4d0da519e551ffd0589",
"size": "... |
from distutils.core import setup
setup(
name = 'django_lookup_dict',
packages = ['django_lookup_dict'],
version = '0.1',
description = 'Django Lookup Dict is a django app that enables you use a django model the Python dict way',
author = 'Mohamed Hendawy',
author_email = 'hendawy@outlook.com',
url = 'https://git... | {
"content_hash": "4f37856129dd580d69f09d2663bc7b2e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 108,
"avg_line_length": 27.142857142857142,
"alnum_prop": 0.6807017543859649,
"repo_name": "hendawy/django_lookup_dict",
"id": "3178e99d6cd1fbffd46b5d4853de33f71d66cb65",
"... |
import subprocess as sp
import os
class VideoWriter(object):
# Vid_start is passed in if the times the videos are taken at and the times generated
# from Tweet analytics have a constant offset from each other
def range_to_format(self, ranges, vidStart):
times = []
for i in xrange(len(ran... | {
"content_hash": "8707bda65b3cf024414c0f2bf8e8a159",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 173,
"avg_line_length": 31,
"alnum_prop": 0.5483870967741935,
"repo_name": "vrkrishn/FBHacks",
"id": "100473f8a3a8830f510a90dcade3e87f9afb0a49",
"size": "1674",
"binary":... |
import json
import pytest
from unittest import mock
from unittest.mock import ANY
from mlflow.entities.model_registry import ModelVersion
from mlflow.exceptions import MlflowException
from mlflow.store.artifact.databricks_models_artifact_repo import DatabricksModelsArtifactRepository
from mlflow import MlflowClient
... | {
"content_hash": "3c6c5b603bdfcb801db6dc22ecc63de2",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 142,
"avg_line_length": 45.233333333333334,
"alnum_prop": 0.6355522803569966,
"repo_name": "mlflow/mlflow",
"id": "bd8c8f6d331f6d0eda68ad9e04fd0188100da800",
"size": "1221... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.