text stringlengths 4 1.02M | meta dict |
|---|---|
from pokemon_catch_worker import PokemonCatchWorker
from seen_fort_worker import SeenFortWorker
from move_to_fort_worker import MoveToFortWorker
from initial_transfer_worker import InitialTransferWorker
from evolve_all_worker import EvolveAllWorker
| {
"content_hash": "8225efe6cb985b653a62350452bcc637",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 57,
"avg_line_length": 49.8,
"alnum_prop": 0.8755020080321285,
"repo_name": "chadsaun/PokemonGo-Bot",
"id": "8f6653421c5f099cec07b92890c433f4224826f2",
"size": "274",
"bin... |
from distutils.core import setup
from setuptools import find_packages
setup(
name='D-Link DDNS IP-Updater',
version='1.0',
packages=find_packages(),
url='https://github.com/philip-raschke/D-Link-DDNS-IP-Updater',
license='MIT',
author='Philip Raschke',
author_email='philip@raschke.cc',
... | {
"content_hash": "44171455909c28241132c7747bb62936",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 97,
"avg_line_length": 34.07142857142857,
"alnum_prop": 0.7044025157232704,
"repo_name": "philip-raschke/D-Link-DDNS-IP-Updater",
"id": "8dd1a4e7da1aa278d8c64a914f47d8a5f635f... |
"""stringOps.py - Various String manipulation operations
by Giovanni Prinzivalli """
def fizz_buzz(length):
"""Prints all numbers between 1 and length, replacing multiples
of 3 with Fizz, multiples of 5 with Buzz, and multiples of 15 with FizzBuzz"""
arr = []
for i in range(1, length + 1):
... | {
"content_hash": "72976f2d8df5ff82e98a7c05a8496bee",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 108,
"avg_line_length": 27.62962962962963,
"alnum_prop": 0.6166219839142091,
"repo_name": "Gprinziv/Projects",
"id": "f6fae94076c0c973b1ad9a6ddc5b28835326697b",
"size": "14... |
import logging
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
class Lead(models.Model):
_inherit = "crm.lead"
def _default_website_id(self):
return self.env.context.get("website_id") or self.env.user.backend_website_id.id
... | {
"content_hash": "f2b35d01162ed0fff151c1613ae10c42",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 88,
"avg_line_length": 31.18421052631579,
"alnum_prop": 0.5949367088607594,
"repo_name": "it-projects-llc/website-addons",
"id": "e32c54bc5bb5a022ad654690a924860cc9dcae7f",
... |
from __future__ import division
from base64 import b16encode, b16decode
import copy
from itertools import izip
import time
from vistrails.core.modules.vistrails_module import Module, InvalidOutput, \
ModuleError, ModuleConnector, ModuleSuspended, ModuleWasSuspended
from vistrails.core.utils import xor, long2bytes... | {
"content_hash": "9c1c2e8ffc5ea4207b3394a1023f3064",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 86,
"avg_line_length": 40.59405940594059,
"alnum_prop": 0.49902439024390244,
"repo_name": "hjanime/VisTrails",
"id": "27b7b2e237581ff9c0eb063272e4b84a268cb97f",
"size": "1... |
import platform
if platform.system() != 'Windows':
import PySide2.QtSvg # Must import this before fast due to conflicting symbols
import fast # Must import FAST before rest of pyside2
from PySide2.QtWidgets import *
from PySide2.QtCore import Qt
from shiboken2 import wrapInstance
from random import random
fast.dow... | {
"content_hash": "b16fe712b013c66ea80b02734f7464eb",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 82,
"avg_line_length": 30.484848484848484,
"alnum_prop": 0.7818091451292246,
"repo_name": "smistad/FAST",
"id": "828cfe6c63cca97faa79ddd411f148021f332955",
"size": "2569",
... |
"""
Create an argparser from a Schema
>>>
"""
import argparse
import logging
from functools import singledispatch
from ..config import Config
from ..schema_section import SchemaSection
from ..times import DateTime, Date, Time, TimeDelta
from ..toolbox.unrepr import unrepr
from ..utils import get_validator_argument
f... | {
"content_hash": "e303ccca8c064c28bf4f9b3d57108261",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 116,
"avg_line_length": 31.944,
"alnum_prop": 0.6472994406878705,
"repo_name": "simone-campagna/zirkon",
"id": "805b8f70163492155080998d4e132f5f4ac7f9b8",
"size": "12587",... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.backend.android.targets.android_target import AndroidTarget
from pants.base.exceptions import TargetDefinitionException
class AndroidResources(... | {
"content_hash": "fcc76e034745f6e8990b9682fd0790be",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 93,
"avg_line_length": 37.8,
"alnum_prop": 0.6331569664902998,
"repo_name": "dturner-tw/pants",
"id": "44c5cecaa4fe85a877373aa7c45ddac7c70c2883",
"size": "1281",
"binary"... |
import random
from rally.plugins.common.scenarios.requests import utils
from rally.task.scenarios import base
class HttpRequests(utils.RequestScenario):
"""Benchmark scenarios for HTTP requests."""
@base.scenario()
def check_request(self, url, method, status_code, **kwargs):
"""Standard way to b... | {
"content_hash": "4e5f37d010c6d8c14a394f86c9061c93",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 33.58974358974359,
"alnum_prop": 0.6778625954198473,
"repo_name": "pyKun/rally",
"id": "50591eeb945d452aa2ea9fcd9e7c5b321d9fb24c",
"size": "1883",
... |
"""
@copyright Copyright (c) 2011 - 2016, Intel Corporation.
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 agr... | {
"content_hash": "7d28e4cab4ef09d18f698ab1b47e8b61",
"timestamp": "",
"source": "github",
"line_count": 399,
"max_line_length": 91,
"avg_line_length": 43.70175438596491,
"alnum_prop": 0.5418363250559156,
"repo_name": "taf3/testcases",
"id": "4c0d691cc90de5d21ff0de1a2f11e3c5197a6b31",
"size": "17437... |
from urllib.parse import urlparse
from .base import *
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True
DATABASES = {}
DATABASES['default'] = env.db()
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = env('ALLOWED_HOSTS... | {
"content_hash": "58076728f166920d9033a2160ba504e4",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 30.107692307692307,
"alnum_prop": 0.6801226366888095,
"repo_name": "gregazevedo/gregazevedo",
"id": "eef257e8b03223e89fe64022af82fb028009d5ae",
"size... |
"""
Outputs the page count of the wiki.
@copyright: 2007 MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details
"""
Dependencies = ['namespace']
from MoinMoin import wikiutil
def macro_PageCount(macro, exists=None):
""" Return number of pages readable by current user
R... | {
"content_hash": "11cd6e72590faf5e18bd72cfe6774ceb",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 27.766666666666666,
"alnum_prop": 0.6566626650660264,
"repo_name": "Glottotopia/aagd",
"id": "8d7e4cfd40d2f19c0ddf95d593427138b6b2496d",
"size": "863... |
import asyncio
import datetime
import functools
import logging
import os
try:
import ssl
except ImportError:
ssl = None
import gunicorn.workers.base as base
from aiohttp.wsgi import WSGIServerHttpProtocol as OldWSGIServerHttpProtocol
class WSGIServerHttpProtocol(OldWSGIServerHttpProtocol):
def log_acce... | {
"content_hash": "38f002df23170494f1fcebff4fcf41a2",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 86,
"avg_line_length": 30.374233128834355,
"alnum_prop": 0.5544334477883256,
"repo_name": "cloudera/hue",
"id": "fe378c351b9a4734f8d3c215ead69e31433aa465",
"size": "5079",... |
import subprocess as sp
from ..utils import *
from .. import _HAS_MEDIAINFO
def mprobe(filename):
"""get metadata by using mediainfo
Checks the output of mediainfo on the desired video
file. Data is then parsed into a dictionary and
checked for video data. If no such video data exists,
an empty ... | {
"content_hash": "651c2f99daf08a514b6b625f2359e05b",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 76,
"avg_line_length": 27.64516129032258,
"alnum_prop": 0.5869311551925321,
"repo_name": "beyondmetis/scikit-video",
"id": "4f301294ee51f5eeb69b264a9d66d4d4ea7d4f12",
"size... |
"""\
Worker
Provides classes and a decorator for using Redis as a task queue.
Run this script or start a TaskWorker instance to run background tasks.
Initial code can be found here: http://flask.pocoo.org/snippets/73/
"""
import logging
from threading import Thread
from pickle import dumps, loads
from uuid import uui... | {
"content_hash": "482fa9c0938b4ab21d9524ed122db03b",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 147,
"avg_line_length": 35.21290322580645,
"alnum_prop": 0.600403078050568,
"repo_name": "vals/google_devnull",
"id": "a213c0273c812d84c9df32f08ddc30d3318cf14f",
"size": "... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_dress_casual_09.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "dd78e9e64bb5009a2de28454a0638178",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 24.384615384615383,
"alnum_prop": 0.7003154574132492,
"repo_name": "anhstudios/swganh",
"id": "fb904a693fc0f2be30b7585c46be9e35a574ded1",
"size": "46... |
import os
import sys
import re
import subprocess
import requests
import simplejson
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
repo = 'getredash/redash'
def _github_request(method, path, params=None, headers={}):
if not path.startswith('https://api.github.com'):
url = ... | {
"content_hash": "e2b2b85f221dcc35666e8ab5316fdfbd",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 160,
"avg_line_length": 33.374149659863946,
"alnum_prop": 0.6300448430493274,
"repo_name": "alexanderlz/redash",
"id": "3d9b21c895228e83aaaacdc0d9686869f34fbb74",
"size": ... |
"""
Test some lldb command abbreviations.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ExecTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__fil... | {
"content_hash": "638472342b94ab5125d553e74b2534c5",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 152,
"avg_line_length": 38.1858407079646,
"alnum_prop": 0.6229432213209734,
"repo_name": "llvm-mirror/lldb",
"id": "019df21771371fd6e06254251a18d2ebba6526d9",
"size": "431... |
import os
import subprocess
from textwrap import dedent
from mock import patch, Mock
import pytest
from pretend import stub
import pip
from pip.exceptions import (RequirementsFileParseError)
from pip.download import PipSession
from pip.index import PackageFinder
from pip.req.req_install import InstallRequirement
from... | {
"content_hash": "a60b379b8de5db20aac1526099bcb25d",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 79,
"avg_line_length": 36.90515463917526,
"alnum_prop": 0.5869042963294039,
"repo_name": "prasaianooz/pip",
"id": "1e3dbbbe5ce97397343152d6dda86975083b502c",
"size": "1789... |
from typing import Union, TypeVar, Mapping, Any, List as TList, Callable, Tuple, Type
from numbers import Number
from uuid import UUID
from types import FunctionType
from amino import Either, List, L, _, Right, Lists, Maybe, Path, Map, Boolean, do, Do, Try, Dat
from amino.json.encoder import Encoder, encode_json, json... | {
"content_hash": "5af60e8e5214b40194bd54fb04f56ae0",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 119,
"avg_line_length": 32.74311926605505,
"alnum_prop": 0.6789016531241244,
"repo_name": "tek/amino",
"id": "a071d1b104cf15e0870baac207584347c2150932",
"size": "3569",
... |
""" Access and control log capturing. """
import logging
import re
from contextlib import contextmanager
from io import StringIO
from typing import AbstractSet
from typing import Dict
from typing import Generator
from typing import List
from typing import Mapping
from typing import Optional
import pytest
from _pytest ... | {
"content_hash": "57bd9b908981d3a5971145581adb1727",
"timestamp": "",
"source": "github",
"line_count": 787,
"max_line_length": 118,
"avg_line_length": 35.81829733163914,
"alnum_prop": 0.601546702614495,
"repo_name": "alfredodeza/pytest",
"id": "5e60a232172445f9b482faee7e94b1cb3794a081",
"size": "2... |
from auth import *
from database import *
from handler import *
from router import *
from settings import *
| {
"content_hash": "8a85ea369f46a44249d68c413060b84b",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 22,
"avg_line_length": 21.6,
"alnum_prop": 0.7685185185185185,
"repo_name": "lusionx/sae-lxpy-1",
"id": "a712a4117b587c2acdb0d2d85b1a48114766e53a",
"size": "125",
"binary"... |
import re
import threading
from neutron_lib import context as nl_context
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
import requests
from six.moves import html_parser
from networking_mlnx._i18n import _LI, _LE, _LW
from networking_mlnx.db import db
from net... | {
"content_hash": "57df3a0083022ccce0bdb97d7942410e",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 78,
"avg_line_length": 43.56363636363636,
"alnum_prop": 0.49561769616026713,
"repo_name": "openstack/networking-mlnx",
"id": "c83585ab3b2c12a8d997572034bd9a36f7c417be",
"s... |
from distutils.core import setup
setup(name='riffa',
version='2.0',
description='RIFFA 2.0 Python Library',
author='Matt Jacobsen',
author_email='mdjacobs@cs.ucsd.edu',
url='http://cseweb.ucsd.edu/~mdjacobs',
platforms='Linux,Windows',
license='Other/Proprietary License',
... | {
"content_hash": "d467128728d1787511aad24c928e868a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 70,
"avg_line_length": 44.81818181818182,
"alnum_prop": 0.7565922920892495,
"repo_name": "drichmond/riffa",
"id": "85f506303b83ace220f105292414b78f8ec52901",
"size": "3932"... |
'''
Focus Behavior
==============
The :class:`~kivy.uix.behaviors.FocusBehavior`
`mixin <https://en.wikipedia.org/wiki/Mixin>`_ class provides
keyboard focus behavior. When combined with other
FocusBehavior widgets it allows one to cycle focus among them by pressing
tab. In addition, upon gaining focus, the instance w... | {
"content_hash": "fbccb071f88e02e0b1d2a6d1802bc6d2",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 79,
"avg_line_length": 40.262877442273535,
"alnum_prop": 0.649594141521087,
"repo_name": "kived/kivy",
"id": "9108941ee78dc3387825f6039dcc205956b99bf8",
"size": "22668",
... |
from datapackage_pipelines.wrapper import process
from datapackage_pipelines_fiscal.processors.consts import ID_COLUMN_NAME
def process_row(row, row_index,
spec, resource_index,
parameters, stats):
row[ID_COLUMN_NAME] = row_index + 1
return row
def modify_datapackage(dp, *_)... | {
"content_hash": "2cb15657f0730bdb6c4af2f54291e88d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 73,
"avg_line_length": 26.52173913043478,
"alnum_prop": 0.6442622950819672,
"repo_name": "openspending/datapackage-pipelines-fiscal",
"id": "27c19f7129c29a6e4b6ec0d1f9f2f042b... |
"""Functions used by multiple converter files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.core.framework import graph_pb2 as _graph_pb2
from tensorflow.core.protobuf import config_pb2 as _config_pb2
from tensorflow.core.... | {
"content_hash": "4d87b6c4213e8b4929c2fdf21be3ba4c",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 84,
"avg_line_length": 33.0989010989011,
"alnum_prop": 0.6893536963258079,
"repo_name": "alsrgv/tensorflow",
"id": "4b8f2f76610934848fca517a47a9e287e533994a",
"size": "972... |
__author__ = 'Axion'
def _check_duplicates_in_path():
"""Check the $PATH environmental variable for duplicates."""
import os
path = os.environ['PATH']
path_list = [piece for piece in path.split(":")]
print('duplicates: {} items'.format(len(path_list)-len(set(path_list))))
path_count = {part... | {
"content_hash": "68c0209158808f9e417b6f753953cf99",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 293,
"avg_line_length": 31.61764705882353,
"alnum_prop": 0.6344186046511628,
"repo_name": "devinbarry/yellow-worktracker",
"id": "2081828cd5cbb15e2172b8cbccd0ab40537ac35e",
... |
import os
import locale
import time
from i3pystatus import IntervalModule
class Clock(IntervalModule):
"""
This class shows a clock.
format can be passed in four different ways:
- single string, no timezone, just the strftime-format
- one two-tuple, first is the format, second the timezone
... | {
"content_hash": "5b22fe6088adb99c72d883b239689a36",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 92,
"avg_line_length": 30.191304347826087,
"alnum_prop": 0.5532834101382489,
"repo_name": "claria/i3pystatus",
"id": "bb0780faa7ce8021d2c6e7ddfb44ba141e2a3c6f",
"size": "3... |
from vol import Vol
from net import Net
from trainers import Trainer
from sklearn.datasets import load_iris
iris_data = None
network = None
sgd = None
N_TRAIN = 120
def load_data():
global iris_data
data = load_iris()
xs = data.data
ys = data.target
inputs = [ Vol(list(row)) for... | {
"content_hash": "5bbffcfc8696fb42e05d55d970af49fa",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 23.508196721311474,
"alnum_prop": 0.5627615062761506,
"repo_name": "benglard/ConvNetPy",
"id": "3179939dbb88183401df41aae8fc35f9ded6de8e",
"size": "1... |
import time
import smbus
import math
bus = smbus.SMBus(1)
class MS5607:
"""
http://www.parallaxinc.com/sites/default/files/downloads/29124-APPNote_520_C_code.pdf
http://www.parallaxinc.com/sites/default/files/downloads/29124-MS5607-02BA03-Datasheet.pdf
Offset for humidity to provide better precision
... | {
"content_hash": "434b92377d6ee33672063dcaa76871f1",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 154,
"avg_line_length": 41.75308641975309,
"alnum_prop": 0.6404494382022472,
"repo_name": "llinear/MS5607",
"id": "e39b193e7b3fe254714a0a515b6ec12ba93f88be",
"size": "3382"... |
INDEX_DIR = "Films.index"
import sys
import os
import re
import lucene
from java.io import File
from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.queryparser.classic import QueryParser
from org.apache.lucene.index import IndexReader, IndexWriter, IndexWriterConfig, Term
from org... | {
"content_hash": "d3d2d51350c73f8e9c3472ba69e749a6",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 98,
"avg_line_length": 32.160493827160494,
"alnum_prop": 0.6898272552783109,
"repo_name": "dvalcarce/filmyou-web",
"id": "5d9b3273593ef84e0d558db818a7b75adad4d2f6",
"size":... |
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... | {
"content_hash": "0591726f60434751deebf14634628aa5",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 82,
"avg_line_length": 35.21649484536083,
"alnum_prop": 0.6595433255269321,
"repo_name": "SoftwareDefinedBuildings/smap",
"id": "b345d3ffa5e15748e089e59e2afdc2b8789cdcb5",
... |
import markdown
from django.utils import timezone
from flask import request
from api.caching.tasks import ban_url
from osf.models import Guid
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from modularodm import Q
from website import settings
from addons.base.signals import file_updated
from o... | {
"content_hash": "a966a729c517b990e68f2ac9dcb6bed1",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 156,
"avg_line_length": 43.69072164948454,
"alnum_prop": 0.654672015101463,
"repo_name": "acshi/osf.io",
"id": "e5a3df1bf38eb57b478cf31d8fc06b043dc62054",
"size": "8501",
... |
import time
from neutronclient.common import exceptions as neutron_client_exc
from oslo.config import cfg
import six
from nova.compute import flavors
from nova import conductor
from nova import context
from nova.db import base
from nova import exception
from nova.network import api as network_api
from nova.network im... | {
"content_hash": "687a3ea72c0369ad7c084f8b42887916",
"timestamp": "",
"source": "github",
"line_count": 1142,
"max_line_length": 79,
"avg_line_length": 45.175131348511385,
"alnum_prop": 0.5607482070168638,
"repo_name": "petrutlucian94/nova_dev",
"id": "edd66b36ddbcb12e71e3d88a07f7ed9345c326f6",
"si... |
import datetime
from django.utils import timezone
from django.test import TestCase
from django.core.urlresolvers import reverse
from polls.models import Poll
def create_poll(question, days):
"""
Creates a poll with the given `question` published the given number of
`days` offset to now (negative for poll... | {
"content_hash": "792c19985443cb9121ac279f72257cc5",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 80,
"avg_line_length": 34.85294117647059,
"alnum_prop": 0.6135021097046414,
"repo_name": "pinax-archives/django-discover-slowest-tests-runner",
"id": "3bc82b010afe17df09f152... |
import fitbit
from stravalib import Client, unithelper
from datetime import datetime, timedelta
from pytz import timezone
from config import *
debug = False
METERS_IN_A_MILE = 1609.34
pacific_timezone = timezone('America/Los_Angeles')
#mmf = MapMyFitness(api_key=MMF_CLIENT_KEY, access_token=MMF_ACCESS_TOKEN)
stra... | {
"content_hash": "453b55d1354217cff8c5dd41244bf5a4",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 129,
"avg_line_length": 32.39506172839506,
"alnum_prop": 0.7115091463414634,
"repo_name": "erikgranlund/mmr_to_fitbit_sync",
"id": "1d514cd3048ab4d7cb1b779b3ea820542d02d463",... |
import ast
import json
import hashlib
import urllib
import base64
from django.test import TestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from lrs import models, views
class ActivityProfileTests(TestCase):
test_activityId1 = 'act:act-1'
test_activityId2 = 'act:act-2'
... | {
"content_hash": "c1e8cc5e08270df96253873ce2055a88",
"timestamp": "",
"source": "github",
"line_count": 492,
"max_line_length": 759,
"avg_line_length": 68.15447154471545,
"alnum_prop": 0.6772635094834785,
"repo_name": "diagonalwalnut/Experience",
"id": "040bda4faaf74a4f5b89d4a621131687105f3434",
"s... |
"""
==============================
The :mod:`array_split` Package
==============================
.. currentmodule:: array_split
Python package for splitting a :obj:`numpy.ndarray` (or just an array shape)
into a number of sub-arrays.
The two main functions are:
:func:`array_split.array_split`
Similar to :... | {
"content_hash": "a4806d6a508c48d0ab97ce833d29e41d",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 90,
"avg_line_length": 32.8625,
"alnum_prop": 0.6899961962723469,
"repo_name": "array-split/array_split",
"id": "9bed6513d4d3c98ecec372922e7ba360eb599056",
"size": "2629",
... |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class CosOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsCosOptions(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = CosOptions()
x.Init(buf,... | {
"content_hash": "6e73066f33b1663757191800a1f998d0",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 114,
"avg_line_length": 26.037037037037038,
"alnum_prop": 0.6529160739687055,
"repo_name": "google-research/falken",
"id": "584442be62cb4eca61dc89218f39c5249c3c1fb1",
"size... |
import numpy as np
import sys
from collections import defaultdict, namedtuple
from operator import itemgetter
def parse_proj(scores, gold=None):
'''
Parse using Eisner's algorithm.
'''
nr, nc = np.shape(scores)
if nr != nc:
raise ValueError("scores must be a squared matrix with nw+1 rows")... | {
"content_hash": "49bb3b3c8fc35056ea7f222c9b843e7d",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 147,
"avg_line_length": 44.11764705882353,
"alnum_prop": 0.6015555555555555,
"repo_name": "elikip/bist-parser",
"id": "96205e8e0b6ef52adbeaa2354b4eb9c986001d7d",
"size": "... |
""" Generate a fake catalog of open cluster stars. """
# Assumptions:
# (0) Every cluster has a unique chemical fingerprint.
# (1) There is a underlying, single latent factor common to all abundances.
# (2) The abundances in every cluster star will have some intrinsic variance.
# (3) The abundances will have some... | {
"content_hash": "73210932796ac83e9bd294423bc9beb5",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 83,
"avg_line_length": 27.14814814814815,
"alnum_prop": 0.6638472032742155,
"repo_name": "andycasey/snob",
"id": "2d621c13359ca71d2c76a2a5816ce617fd846edf",
"size": "3666"... |
import pydoc
import os, sys
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
# https://gist.github.com/dvirs... | {
"content_hash": "295cb1ec0b35205f2e817bf5dee5ce4d",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 117,
"avg_line_length": 34.056603773584904,
"alnum_prop": 0.6426592797783933,
"repo_name": "helena-project/tockloader",
"id": "4e919795861efeff26a01124120b79a3613810bb",
"... |
from beritest_tools import BaseBERITestCase
class test_raw_bne_lt_back(BaseBERITestCase):
def test_before_bne(self):
self.assertRegisterEqual(self.MIPS.a0, 1, "instruction before backward bne missed")
def test_bne_branch_delay(self):
self.assertRegisterEqual(self.MIPS.a1, 2, "instruction in br... | {
"content_hash": "538139c5a87ddb64d22f80082ac89389",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 92,
"avg_line_length": 41.42857142857143,
"alnum_prop": 0.7224137931034482,
"repo_name": "8l/beri",
"id": "573ea48b1c9ec5968638281c96c0a0743d11b5bb",
"size": "1720",
"bin... |
""" List and set StaSh configuration options """
import sys
import argparse
_stash = globals()['_stash']
def main(args):
ap = argparse.ArgumentParser()
ap.add_argument('name', nargs='?', help='variable name')
ap.add_argument('value', nargs='?', type=int, help='variable value')
ap.add_argument('-l', '... | {
"content_hash": "da9820e5f70e86817aaaf23a03f44af9",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 29.69047619047619,
"alnum_prop": 0.5445068163592622,
"repo_name": "jsbain/stash",
"id": "e57a12bcec5c4a5e7748c784553310f187f052ad",
"size": "1247",
... |
from django.conf.urls import *
from corehq.apps.styleguide.views import *
urlpatterns = patterns('corehq.apps.styleguide.views',
url(r'^$', MainStyleGuideView.as_view(), name=MainStyleGuideView.urlname),
url(r'^forms/$', FormsStyleGuideView.as_view(), name=FormsStyleGuideView.urlname),
)
| {
"content_hash": "03ad38466c32a97836c520d6e374975e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 86,
"avg_line_length": 37.375,
"alnum_prop": 0.7491638795986622,
"repo_name": "SEL-Columbia/commcare-hq",
"id": "ec41e9d2db9c6ca4a1d1e877e4d65f6ee95fcf52",
"size": "299",
... |
import argparse
import tempfile
import os
import shutil
import serial
import serial.tools.list_ports as list_ports
import sys
import unittest
from kubos import init, target, build, flash, clean
from kubos.test.utils import get_arg_list, KubosTestCase
class SDKIntegrationTest(KubosTestCase):
uart_read_size = 8
... | {
"content_hash": "d40c55211d5a425d5c6b1e5ce48319e9",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 134,
"avg_line_length": 33.51685393258427,
"alnum_prop": 0.6325846463291988,
"repo_name": "kyleparrott/kubos-sdk",
"id": "a10a1f759912f8c9c30cbb85a08ef7ff26da5bc1",
"size":... |
from __future__ import braces
| {
"content_hash": "2aebb3fc8ecfa8dea10fb36085127e10",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 29,
"avg_line_length": 30,
"alnum_prop": 0.7333333333333333,
"repo_name": "iamwrm/coding",
"id": "1b01e42e4b213337d89b6b90d55dfdb1d8ea7642",
"size": "30",
"binary": false,... |
"""
This module contains a CloudTasksHook
which allows you to connect to Google Cloud Tasks service,
performing actions to queues or tasks.
"""
from __future__ import annotations
from typing import Sequence
from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
from google.api_core.retry import Retry
fro... | {
"content_hash": "7754e5aaaa5726917fabd4beedec3ff7",
"timestamp": "",
"source": "github",
"line_count": 577,
"max_line_length": 108,
"avg_line_length": 44.69844020797227,
"alnum_prop": 0.6244426350277229,
"repo_name": "nathanielvarona/airflow",
"id": "6d685c0506aaf6433ace48156744960fc82ffd9c",
"siz... |
import base64
import hashlib
import hmac
import requests
import sys
import time
import uuid
API_VERSION = "2010-12-30"
API_ENDPOINT = "https://cloudapi.atlantic.net/"
class AtlanticError(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return str(self.message... | {
"content_hash": "15f9f8c340e3c7cce372eb8fb51df3d8",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 88,
"avg_line_length": 33.61290322580645,
"alnum_prop": 0.6238003838771593,
"repo_name": "kbrebanov/atlantic-python",
"id": "41d6aa6a0380594f85887674c2cf00e70b931a17",
"siz... |
import ffgame.classes.warrior
warrior = ffgame.classes.warrior.Warrior("test")
def test_init():
assert warrior.get_name() == "test"
| {
"content_hash": "96e2eb5d61a7ba0d4435064f27b793bd",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 48,
"avg_line_length": 17.5,
"alnum_prop": 0.7071428571428572,
"repo_name": "FR13ND5/full-fight-game",
"id": "3dbd6b684cc3026ccf8cec3b2978c4da51163630",
"size": "140",
"bi... |
import logging
from oslo_config import cfg
from keystoneclient import _discover
from keystoneclient.auth.identity.generic import base
from keystoneclient.auth.identity import v2
from keystoneclient.auth.identity import v3
from keystoneclient import utils
LOG = logging.getLogger(__name__)
def get_options():
ret... | {
"content_hash": "22a5c81307f65bb1a859075feb043f6e",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 37.541666666666664,
"alnum_prop": 0.5878653348131706,
"repo_name": "ging/python-keystoneclient",
"id": "6790fe22c3d6dbef9c1f8883ead0ef5242970fed",
"s... |
import requests
import json
import bs4
from bs4 import BeautifulSoup
import urllib2
import lxml
import os
####I will try to get a list of the relevant URLs, then 'for loop' through them so I don't have to write a different script for each debate.####
##Saving home page as text file.##
res = requests.get('h... | {
"content_hash": "e95d5c5d4b6f1349fa292672e5814242",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 144,
"avg_line_length": 31.971830985915492,
"alnum_prop": 0.6925110132158591,
"repo_name": "pplatzman/RedBlue-Classifier",
"id": "c9ab6669907371d4de3092e3e7fb0f9697ecd98a",
... |
from abc import ABC, abstractmethod
import numpy as np
import scipy.stats as ss
class BaseLikelihood(ABC):
"""
This is an abstract class to serve as a template for future users to mimick
if they want to add new models for online bayesian changepoint detection.
Make sure to override the abstract meth... | {
"content_hash": "b5c395908367de0b73be451a4cd45a0b",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 117,
"avg_line_length": 36.73684210526316,
"alnum_prop": 0.5693409742120343,
"repo_name": "hildensia/bayesian_changepoint_detection",
"id": "02cab2e7f4c747d434ebddcbdeeac035... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="color", parent_name="histogram2dcontour.marker", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent... | {
"content_hash": "b60a48f9da9ad12055c8cf0cc3a76ff5",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 84,
"avg_line_length": 33.57142857142857,
"alnum_prop": 0.6,
"repo_name": "plotly/python-api",
"id": "3974bdfc3e7e78afa3f2d9ca4d81b0a4f6362be3",
"size": "470",
"binary": ... |
"""
Unit tests for the rebuildinitrd module
"""
import subprocess
import sys
import unittest
import mock
import moduletests.src.rebuildinitrd
try:
# Python 2.x
from cStringIO import StringIO
except ImportError:
# Python 3.x
from io import StringIO
if sys.hexversion >= 0x3040000:
# contextlib.red... | {
"content_hash": "9abf77d799e091953bdc1aa1565fd35e",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 120,
"avg_line_length": 57.62152777777778,
"alnum_prop": 0.636456764085568,
"repo_name": "gregbdunn/aws-ec2rescue-linux",
"id": "e3987de9daf761c3fff95d12e50db142ee71c782",
... |
import unittest
from stix.test import EntityTestCase
from stix.common import Names
class NamesTests(EntityTestCase, unittest.TestCase):
klass = Names
_full_dict = [
"foo",
"bar",
{'value': 'User Data Loss', 'xsi:type': 'stixVocabs:IncidentEffectVocab-1.0'},
]
if __name__ == '__m... | {
"content_hash": "ea5f503800badb82f065a9fed10e6c13",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 86,
"avg_line_length": 20.470588235294116,
"alnum_prop": 0.6235632183908046,
"repo_name": "chriskiehl/python-stix",
"id": "2c7b9d2be0c8aa29b6e9f7fc1a79c1f1342d98ef",
"size"... |
import unittest, sys
sys.path.extend(['.','..','../..','py'])
import string
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_browse as h2b
from h2o_test import find_file, dump_json, verboseprint
expectedZeros = [0, 4914, 656, 24603, 38665, 124, 13, 5, 1338, 51, 320216, 551128, 327648, 544044, 577981,
573487... | {
"content_hash": "ffc6c530cc774452bfe4e40b78412324",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 110,
"avg_line_length": 39.74626865671642,
"alnum_prop": 0.5906871948929778,
"repo_name": "bikash/h2o-dev",
"id": "7015c3ee65a3159fe18a1b93ae4af41cdaee6f10",
"size": "5326... |
import flask
import os
from werkzeug.utils import secure_filename
from donut.modules.uploads import blueprint, helpers
@blueprint.route('/lib/<path:url>')
def display(url):
'''
Displays the webpages that have been created by users.
'''
page = helpers.read_page(url.replace(' ', '_'))
if page == Non... | {
"content_hash": "eed3f05c4ddefb94f501bd5afccb3f16",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 76,
"avg_line_length": 29.568807339449542,
"alnum_prop": 0.6341917468197331,
"repo_name": "ASCIT/donut",
"id": "99bb7bfb4644b5a78a06bd768c5f456ee8c21291",
"size": "3223",
... |
import django
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms import widgets
from django import http
from mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.api import cinder
from openstack_dashboard.dashboards.project.volumes \
.vol... | {
"content_hash": "49b500d8ebcdb39c204e65d2de6ba028",
"timestamp": "",
"source": "github",
"line_count": 1017,
"max_line_length": 79,
"avg_line_length": 46.98623402163225,
"alnum_prop": 0.5121690907188449,
"repo_name": "shhui/horizon",
"id": "f4d8200ba4f5bba0c2d9acea3c71f33914edb392",
"size": "48594... |
import flakytests
from webkitpy.common.checkout.scm.scm_mock import MockSCM
from webkitpy.layout_tests.layout_package import bot_test_expectations
from webkitpy.tool.commands.commandtest import CommandsTest
from webkitpy.tool.mocktool import MockTool, MockOptions
from webkitpy.layout_tests.port import builders
class ... | {
"content_hash": "bb38882ac34c05458a640bf82dd9e529",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 113,
"avg_line_length": 39.57142857142857,
"alnum_prop": 0.6179849031834591,
"repo_name": "Pluto-tv/blink-crosswalk",
"id": "172e5ba97f248d56456262124c818396792cacc7",
"siz... |
from datetime import datetime
from collections import defaultdict
import emoji
class SpoofPhone():
"""This class provides methods to spoof tools to spoof SMS messages to a Shawk client"""
def __init__(self, mock_IMAP_instance, sender):
self.imap = mock_IMAP_instance
self.sender = sender
d... | {
"content_hash": "ab476f7078fc043a7e9e84b7eba07c7b",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 92,
"avg_line_length": 35.484848484848484,
"alnum_prop": 0.605465414175918,
"repo_name": "hawkins/Shawk",
"id": "b52855b2121a19ed26a109f644a3051774839571",
"size": "1172",
... |
{
'\n\nThank you!': 'Obrigado!',
'\n\nWe will wait and let you know when your payment is confirmed.': 'Nós iremos esperar e te avisaremos quando seu pagamento for confirmado.',
'\n- %s from %s to %s': '- %s de %s a %s',
'\nAmount: R$%.2f': 'Total: R$%.2f',
"\nSomething happened and we couldn't verify your payment.\n": ... | {
"content_hash": "c40063b1a425288da76d7f8e29d5a683",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 301,
"avg_line_length": 46.933035714285715,
"alnum_prop": 0.6977551602777513,
"repo_name": "juliarizza/web2courses",
"id": "5a88b0e4623fd78df99e4d1d64f2aa6923b02e3a",
"siz... |
"""A test to verify an implementation of the Face layer of RPC Framework."""
import abc
import unittest
import six
from grpc.framework.face import interfaces
from tests.unit.framework.common import test_constants
from tests.unit.framework.face.testing import callback as testing_callback
from tests.unit.framework.fac... | {
"content_hash": "2371aa8eba9e02bfb1db1657b7267065",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 83,
"avg_line_length": 40.713467048710605,
"alnum_prop": 0.6880146386093321,
"repo_name": "miselin/grpc",
"id": "98b61e492c9f340aaaa7a959dd0b62c1631ff335",
"size": "15738"... |
import os
import subprocess
from collections import namedtuple
from .tools import is_exe, NotExecutableError
# factory class for cd_hit class returned values
Results = namedtuple("Results", "command fastaout clusters " +
"stdout stderr")
class Cd_hit_Error(Exception):
"""Exception raised ... | {
"content_hash": "2f17455fa76322767b599f705cb554fa",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 79,
"avg_line_length": 33.45348837209303,
"alnum_prop": 0.5630865484880083,
"repo_name": "widdowquinn/THAPBI-pycits",
"id": "dc16fc1f9490d92088e56e8472a3a4c5362af77d",
"siz... |
from __future__ import unicode_literals
import uuid
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from .utils import update_glance
@python_2_unicode_compatible
class Integration(models.Model):
SCOPE_SEND_NOTIFICATIONS = 'send_notification'
SCOPES = [(SCOPE_SEND_... | {
"content_hash": "fedfa59838b2f37e77754ac1e671ef9f",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 79,
"avg_line_length": 33.0979020979021,
"alnum_prop": 0.6465244031269808,
"repo_name": "the-it-dude/django_rest_hipchat",
"id": "30c1607ab37c6863ad4d1277dce231d2045dbb1b",
... |
from books.model.VendorPayment import VendorPayment
from books.model.VendorPaymentList import VendorPaymentList
from books.model.Bill import Bill
class VendorPaymentsParser:
"""This class is used to parse the json response for Vendor payments."""
def get_list(self, resp):
"""This method parses the giv... | {
"content_hash": "fab341a30398822d53a894694bc7c642",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 42.12903225806452,
"alnum_prop": 0.6311893823379275,
"repo_name": "zoho/books-python-wrappers",
"id": "9ae76acaf2deefb8986e240d3f0f71c2a66aad2e",
"si... |
from rest_framework.routers import Route, DynamicRoute, SimpleRouter
class JobRouter(SimpleRouter):
'''
A dedicated router for UWS services. The main difference is that a POST on an instance
maps to update, not PUT. Also actions are removed.
'''
routes = [
Route(
url=r'^{prefi... | {
"content_hash": "35a36967146421da7ae3fd112a36ad55",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 90,
"avg_line_length": 27.394736842105264,
"alnum_prop": 0.4553314121037464,
"repo_name": "aipescience/django-daiquiri",
"id": "e0aa7c05c479c5ba2bc50b36bd7ca4c1ac55dd50",
"... |
"""
steamgames.py
Copyright 2013, Nate Collings
http://github.com/naiyt/steamgames
A small API wrapper intended to retrieve all available store information
for either a specific appid, or all appids.
Thanks for this SteamDB.info blog post for the idea on the best way to do this:
http://steamdb.info/blog/5/
This shou... | {
"content_hash": "98bf58c88f1e0721d3acc1d8c8c31846",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 100,
"avg_line_length": 30.44871794871795,
"alnum_prop": 0.6819649122807018,
"repo_name": "naiyt/steamplaytime",
"id": "c16e77d65c21def50c04ccd053d990688cbfad2e",
"size": ... |
import flask
import werkzeug.exceptions
from digits.webapp import app, scheduler, autodoc
from digits.utils.routing import request_wants_json
import images.views
import images as dataset_images
from digits.base_workspace import *
NAMESPACE = '/datasets/'
@app.route(NAMESPACE + '<job_id>.json', methods=['GET'])
@app.... | {
"content_hash": "c94b7c8507b13c15e8ebeb1c36c887b5",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 93,
"avg_line_length": 33.204081632653065,
"alnum_prop": 0.693300553165335,
"repo_name": "DESHRAJ/DIGITS",
"id": "be9c670a8ecf6d43bf7be9c38565e4686e93619b",
"size": "1697",... |
"""PyGotham user profiles."""
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from flask_login import current_user
from flask_security import login_required
from pygotham.core import db
from pygotham.frontend import route
from pygotham.models import Talk, Volunteer
__all__ ... | {
"content_hash": "0176f824cb31dc8cdc7d8c5e4ac17453",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 74,
"avg_line_length": 29.763157894736842,
"alnum_prop": 0.6777188328912467,
"repo_name": "PyGotham/pygotham",
"id": "0c05332dfdbe3d2976d617838021fd298bcf788e",
"size": "22... |
from daapserver.utils import parse_byte_range
import shutil
import gevent
import gevent.queue
def stream_from_remote(lock, remote_fd, target_file, chunk_size=32768,
on_cache=None):
"""
Spawn a greenlet to download and cache a file, while simultaniously stream
data to the receiver. ... | {
"content_hash": "8da4c93dfe07182b52b01a953d2f4636",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 79,
"avg_line_length": 31.581920903954803,
"alnum_prop": 0.5146690518783542,
"repo_name": "ties/SubDaap",
"id": "6a39ee4ca1f7ea8ce1c9afb9641d995c795b9cfe",
"size": "5590",... |
import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="box", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=kw... | {
"content_hash": "c57a29057e777d1299bc57896706be11",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 72,
"avg_line_length": 36.84615384615385,
"alnum_prop": 0.5887265135699373,
"repo_name": "plotly/python-api",
"id": "fe17f2cc81406cc887fe22f6de08d9c4d29b6c55",
"size": "479... |
import functools
import parsy
from public import public
import ibis.expr.datatypes.core as dt
from ibis.common.exceptions import IbisTypeError
from ibis.common.parsing import (
COLON,
COMMA,
FIELD,
LANGLE,
LPAREN,
NUMBER,
PRECISION,
RANGLE,
RAW_NUMBER,
RAW_STRING,
RPAREN,
... | {
"content_hash": "795d8f232c85f54c2cb4a7789284a63d",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 82,
"avg_line_length": 29.14,
"alnum_prop": 0.6024708304735759,
"repo_name": "ibis-project/ibis",
"id": "9ef758aa131647150fe0b7bb0b0e1e4e5bb1026a",
"size": "7285",
"bina... |
"""
Created on 18 Feb 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from scs_core.data.datetime import LocalizedDatetime
from scs_core.sample.climate_sample import ClimateSample
from scs_core.sampler.sampler import Sampler
# -------------------------------------------------------------------... | {
"content_hash": "152a12dc0ca1e8781873a065ca9f66fe",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 118,
"avg_line_length": 29.761904761904763,
"alnum_prop": 0.45653333333333335,
"repo_name": "south-coast-science/scs_dev",
"id": "63e782b36bfd5602d0bcc594b89599c7f559fb68",
... |
"""Mock implementations of OpenFlow vendor extension interfaces.
"""
import struct
from zope import interface
from openfaucet import ofaction
from openfaucet import ofproto
MOCK_VENDOR_ID = 0x4242
class MockVendorAction(ofaction.vendor_action(
'MockVendorAction', MOCK_VENDOR_ID, '!2xL', ('dummy',))):
su... | {
"content_hash": "5105b46cea7a462ac19a8ef147eb235a",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 32.774647887323944,
"alnum_prop": 0.6454662655779975,
"repo_name": "rlenglet/openfaucet",
"id": "5122030aa1126a07cd0ba4cee584c122c3489694",
"size": "... |
import os
import pytest
from keras.layers import *
from keras.models import Model
from zoo.models.textmatching import KNRM
from test.zoo.pipeline.utils.test_utils import ZooTestCase
np.random.seed(1337) # for reproducibility
resource_path = os.path.join(os.path.split(__file__)[0], "../../resources")
glove_path = os... | {
"content_hash": "dd45c5db547667c13b50ab9e05272002",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 91,
"avg_line_length": 38.31578947368421,
"alnum_prop": 0.5789835164835165,
"repo_name": "intel-analytics/analytics-zoo",
"id": "9b6e02f9c75e212e224216e24f6fd68454ef5c9b",
... |
import datetime
from operator import itemgetter
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
from unittest import mock
import orjson
from django.db import IntegrityError
from django.utils.timezone import now as timezone_now
from zerver.actions.message_delete import do_delete_messages
from... | {
"content_hash": "f8f9873e13916b6836cdc96262f4a91e",
"timestamp": "",
"source": "github",
"line_count": 3339,
"max_line_length": 130,
"avg_line_length": 40.74094040131776,
"alnum_prop": 0.5804210712027875,
"repo_name": "zulip/zulip",
"id": "87621ce598fd4ee9f6fe823e12c0ba645d13794a",
"size": "136048... |
from __future__ import unicode_literals, division, absolute_import#, print_function
class kvstore(object):
def __init__(self, db):
self.db = db
def __getitem__(self, k):
return self.db._config_value_get(k)
def __setitem__(self, k,v):
self.db._config_value_set(k,v)
def __del... | {
"content_hash": "0131ce302bc8907354bc1206ffb36cb2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 83,
"avg_line_length": 22.02127659574468,
"alnum_prop": 0.561352657004831,
"repo_name": "AYAtechnologies/Kasaya-esb",
"id": "c4c505a2d12f449b3eb3bfa29817d64526b8502d",
"siz... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: vultr_block_storage_facts
short_description: Gather fac... | {
"content_hash": "516c32471adbe73d3e677c6c9828f30b",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 99,
"avg_line_length": 27.78030303030303,
"alnum_prop": 0.6353967821107173,
"repo_name": "thaim/ansible",
"id": "2da66d1697651e18821451ef13ef80b7ae125b27",
"size": "3835",... |
from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag
import sys
# -- Example from Kuszmaul paper -- #
# STATUS ================================================ >
task = '2314_2413_3412'
patts = [ Permutatio... | {
"content_hash": "27723415ac00aeb045fc9e21b58d8cac",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.631004366812227,
"repo_name": "PermutaTriangle/PermStruct",
"id": "bba27e6b7af07c6aff08774fdc3e5e809d5d011d",
"si... |
from pyperf import perf_counter
from synapse.util.caches.lrucache import LruCache
async def main(reactor, loops):
"""
Benchmark `loops` number of insertions into LruCache without eviction.
"""
cache = LruCache(loops)
start = perf_counter()
for i in range(loops):
cache[i] = True
... | {
"content_hash": "de80d10a8f673889f8423b9419cd85c5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 19.263157894736842,
"alnum_prop": 0.6584699453551912,
"repo_name": "matrix-org/synapse",
"id": "9b4a4241493f89d7710be8849128f107e4b94b54",
"size": "9... |
from .models import get_environment, get_predictive_model, get_item_selector, get_active_environment_info, \
Answer, Item, PracticeContext, PracticeSet,\
get_filter, get_mastery_trashold, get_time_for_knowledge_overview, \
get_forbidden_items
from django.db import transaction, connection
from django.http im... | {
"content_hash": "d51cee0302316fcf0cf7ba2dab6b4037",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 179,
"avg_line_length": 42.25269978401728,
"alnum_prop": 0.6385012523641568,
"repo_name": "adaptive-learning/proso-apps",
"id": "6e14bac00cdd956fc28a6c9ae535031b681adc82",
... |
class IntegerCondition(object):
'''
classdocs
'''
def __init__(self, parent, conditionName, parameter):
self.parent = parent
self.conditionName = conditionName
self.parameter = parameter
| {
"content_hash": "ada636860dae7667da81d34e39142bc2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 57,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6271929824561403,
"repo_name": "theshammy/GenAn",
"id": "f450919a77e20baf027a619034b6920abf592730",
"size": "228",... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | {
"content_hash": "7028983982d8f742bc02f3aedde6893f",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 89,
"avg_line_length": 40.50592885375494,
"alnum_prop": 0.60724043715847,
"repo_name": "r39132/airflow",
"id": "209ccb63b6e0f341ba0e323a418707dcaa6008d1",
"size": "10248",... |
"""Simple object oriented graphics library
The library is designed to make it very easy for novice programmers to
experiment with computer graphics in an object oriented fashion. It is
written by John Zelle for use with the book "Python Programming: An
Introduction to Computer Science" (Franklin, Beedle & Associates).... | {
"content_hash": "745d8949fd5c0fa8a217a6c1e20ea226",
"timestamp": "",
"source": "github",
"line_count": 896,
"max_line_length": 105,
"avg_line_length": 31.733258928571427,
"alnum_prop": 0.577744170506102,
"repo_name": "inconceivable/tetris",
"id": "c95566da72f13e3d70d605e717cdde5e8c6ce55d",
"size":... |
"""Evaluate the ensemble of 8 CTC models (Librispeech corpus)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join, abspath
import sys
import yaml
import argparse
sys.path.append(abspath('../../../'))
from experiments.librispeech.da... | {
"content_hash": "82f7d2aaf461d4074814ceb676cd5617",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 84,
"avg_line_length": 39.892857142857146,
"alnum_prop": 0.6119068934646374,
"repo_name": "hirofumi0810/tensorflow_end2end_speech_recognition",
"id": "e6dc044dbc933e427b91aa... |
import math
from PyEngine3D.Utilities import *
def always_pass(*args):
return False
def cone_sphere_culling_actor(camera, actor):
to_actor = actor.transform.pos - camera.transform.pos
dist = length(to_actor)
if 0.0 < dist:
to_actor /= dist
rad = math.acos(np.dot(to_actor, -camera.tran... | {
"content_hash": "7d654fff64f75acace41d39b6938e04f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 120,
"avg_line_length": 36.141304347826086,
"alnum_prop": 0.6442105263157895,
"repo_name": "ubuntunux/GuineaPig",
"id": "a1bffa75a7067eefa91744eeba1a1720115dc7f2",
"size": ... |
import mock
import fixtures
from oslo_config import cfg
from oslo_log import log as logging
from nova import test
from nova.tests.functional.test_servers import ServersTestBase
from nova.tests.unit import fake_network
from nova.tests.unit.virt.libvirt import fake_libvirt_utils
from nova.tests.unit.virt.libvirt import... | {
"content_hash": "d496f2f9f9942c98dd6e71d225ca716b",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 78,
"avg_line_length": 39.6258064516129,
"alnum_prop": 0.5955714750895473,
"repo_name": "raildo/nova",
"id": "3aea72f04bdab372651809fc038a7b3a0bc0a4c3",
"size": "6774",
... |
from google.cloud import vision_v1p3beta1
def sample_delete_product_set():
# Create a client
client = vision_v1p3beta1.ProductSearchClient()
# Initialize request argument(s)
request = vision_v1p3beta1.DeleteProductSetRequest(
name="name_value",
)
# Make the request
client.delete_... | {
"content_hash": "4b37584174a863f165711cd2add130e5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 24.823529411764707,
"alnum_prop": 0.7298578199052133,
"repo_name": "googleapis/python-vision",
"id": "1bacb76328ac8e894f331dfd75674255a42ea87d",
"siz... |
import urllib2
from urllib import urlencode
try:
import simplejson as json
except ImportError:
import json
import sys, re
import datetime, logging
import dateutil.parser
import pycomicvine.error
import collections
_API_URL = "https://www.comicvine.com/api/"
_cached_resources = {}
api_key = ""
def str_to_dat... | {
"content_hash": "1872d4c9b322537f6915c9f4bb9f25c8",
"timestamp": "",
"source": "github",
"line_count": 1047,
"max_line_length": 99,
"avg_line_length": 38.10124164278892,
"alnum_prop": 0.587661686553695,
"repo_name": "authmillenon/pycomicvine",
"id": "7d1d449beb8410759d7e945996c7bee58991ede2",
"siz... |
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
from urllib.parse import parse_qs, urljoin, urlparse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,... | {
"content_hash": "be514e9b870897a853318324a36a30c9",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 229,
"avg_line_length": 47.317351598173516,
"alnum_prop": 0.6571531966224367,
"repo_name": "Azure/azure-sdk-for-python",
"id": "9c981b52316c714cdef1a1830506be801b749664",
... |
""" ib.ext.cfg.EWrapper -> config module for EWrapper.java.
"""
modulePreamble = [
'from ib.ext.AnyWrapper import AnyWrapper',
]
| {
"content_hash": "10ae7a3fef663b0b1a3cbca360e744ed",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 59,
"avg_line_length": 23,
"alnum_prop": 0.6666666666666666,
"repo_name": "lockdm/ibpy",
"id": "e5afc27d44c09c3f768333dbecc6c4181695c3d7",
"size": "184",
"binary": false,
... |
"""Adapter layer to distributed job manager server api
"""
import os
import os.path
import logging
import datetime
from fabric.api import *
from fabric.operations import put
import fabric.network
from file_locator import FileLocator
import utils
from dist_job_mgr.client import get_local_connection
from dist_job_mgr.v... | {
"content_hash": "7691239629fcdce28cf56c073bbf7c09",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 150,
"avg_line_length": 38.755102040816325,
"alnum_prop": 0.5875021941372652,
"repo_name": "mpi-sws-rse/datablox",
"id": "252501fc1fca149903a98d071d1ae837c502ddaa",
"size"... |
'''
baseline:
after: true
before: false
counts: 120
detector: H1
mass: 34.2
settling_time: 15.0
default_fits: nominal
equilibration:
eqtime: 0.0
inlet: R
inlet_delay: 3
outlet: O
use_extraction_eqtime: true
multicollect:
counts: 0
detector: H1
isotope: Ar40
peakcenter:
after: true
before... | {
"content_hash": "8f3d925c342903fcebf487cb5dd88514",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 98,
"avg_line_length": 25.032258064516128,
"alnum_prop": 0.6786941580756014,
"repo_name": "USGSDenverPychron/pychron",
"id": "614000f7a11a53ddd9f1d0d3e2cf8894624e26df",
"si... |
"""Runtime support code for executables created by Subpar.
1. Third-party modules require some PYTHONPATH manipulation.
2. Python can natively import python modules from a zip archive, but
C extension modules require some help.
3. Resources stored in a .par file may need to be exposed as OS-level
files instead... | {
"content_hash": "15d6b9edc6f8a7b447aa5253a723d6c5",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 78,
"avg_line_length": 36.06984126984127,
"alnum_prop": 0.6256820982221439,
"repo_name": "google/subpar",
"id": "e8ec253169ec51c620ef10bfa082bb40239d2f39",
"size": "11959"... |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem290.py
#
# Digital Signature
# =================
# Published on Friday, 30th April 2010, 05:00 pm
#
# How many integers 0 n < 1018 have the property that the sum of the digits of
# n equals the sum of digits of 137n?
import projecteuler as pe
def main():
... | {
"content_hash": "68c1990611fd61aea91106e0e7f7e928",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 79,
"avg_line_length": 21.41176470588235,
"alnum_prop": 0.6263736263736264,
"repo_name": "olduvaihand/ProjectEuler",
"id": "1ed0cd2e65d4f91e2188463cf2370a0ebd1e6724",
"size... |
class Event():
theme = ''
def __init__(self, theme, data):
self.theme = theme
self.data = data
EventBox = list()
class Publisher():
def __init__(self):
self.reigster(EventBox)
def send(self, theme, data):
self.sendEvent(Event(theme, data))
def sendEvent(self, ev... | {
"content_hash": "9942c99951acf74cf8dba3f90ccb3bf2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 52,
"avg_line_length": 20.85,
"alnum_prop": 0.5331734612310152,
"repo_name": "anokata/pythonPetProjects",
"id": "6ac850a1ec8fa33da354168906a03fd5b48a102a",
"size": "1279",
... |
import json
import os
import datetime
import time
import random
from copy import deepcopy
from bson import ObjectId, json_util
from itertools import chain
from flask_admin import BaseView, expose
from flask_babel import gettext as _
from flask_login import current_user
from mongoengine.queryset import Q
from flask impo... | {
"content_hash": "2c9edab57bbb800b2e6be6eae6d937da",
"timestamp": "",
"source": "github",
"line_count": 574,
"max_line_length": 130,
"avg_line_length": 38.893728222996515,
"alnum_prop": 0.5512653975363941,
"repo_name": "seasonstar/bibi",
"id": "184f1e18683f08619f4988c9da9da9f5c4d9f35d",
"size": "22... |
"""Recurrent layers backed by cuDNN.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from tensorflow.python.framework import constant_op
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import constraints
... | {
"content_hash": "debd31c89fb424db9c1a5767eeff679f",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 80,
"avg_line_length": 38.55238095238095,
"alnum_prop": 0.6507905138339921,
"repo_name": "hehongliang/tensorflow",
"id": "81f292817fd989ee0aa256ada64e09b32a79ac2b",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.