text stringlengths 4 1.02M | meta dict |
|---|---|
"""Test Environment Canada diagnostics."""
from datetime import datetime, timezone
import json
from unittest.mock import AsyncMock, MagicMock, patch
from homeassistant.components.environment_canada.const import (
CONF_LANGUAGE,
CONF_STATION,
DOMAIN,
)
from homeassistant.const import CONF_LATITUDE, CONF_LO... | {
"content_hash": "0acd535993fbeff6fa03cd13286c0cfc",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 86,
"avg_line_length": 32.89411764705882,
"alnum_prop": 0.6963519313304721,
"repo_name": "mezz64/home-assistant",
"id": "a1f3539a5e4d940df5a9214cbf073237fb5b67ce",
"size": ... |
import datetime
import uuid
from oslo.config import cfg
import webob
from nova.api.openstack.compute import plugins
from nova.api.openstack.compute.plugins.v3 import config_drive
from nova.api.openstack.compute.plugins.v3 import servers
from nova.compute import api as compute_api
from nova.compute import flavors
from... | {
"content_hash": "060e645f2ef7672de92b4a748e489436",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 77,
"avg_line_length": 38.8531746031746,
"alnum_prop": 0.5956490654682872,
"repo_name": "viggates/nova",
"id": "3ab3cf70186e5e9ad3c5a5d4690d2d4c496a5a4c",
"size": "10427",... |
import pandas as pd
from collections import OrderedDict
from pickle import dump, load
from backend.portfolio_model import PortfolioModels
from backend.robinhood_data import RobinhoodData
from backend.market_data import MarketData
class BackendClass(object):
"""
Backend wrapper class, provides wrappers to donw... | {
"content_hash": "95d2946cde80d343948ed5dedc488a9e",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 79,
"avg_line_length": 35.59753593429158,
"alnum_prop": 0.5062874942316566,
"repo_name": "omdv/robinhood-portfolio",
"id": "edc46132c53b0d5034ac0bc223fb0c4afdefbc8d",
"siz... |
from tempest import clients
from tempest.common.utils import data_utils
from tempest import config
from tempest.openstack.common import log as logging
import tempest.test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class BaseVolumeTest(tempest.test.BaseTestCase):
"""Base test case class for all Cinder... | {
"content_hash": "1807dddb0dbc0b59be81023a688731fa",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 79,
"avg_line_length": 37.01526717557252,
"alnum_prop": 0.5889874200866158,
"repo_name": "ntymtsiv/tempest",
"id": "de2b2403a89d3b6943b78f45c00154001976dde8",
"size": "548... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from fobi.base import BaseFormFieldPluginForm, get_theme
from fobi.helpers import validate_initial_for_multiple_choices
__title__ = 'fobi.contrib.plugins.form_elements.fields.select_multiple.forms'
__author__ = 'Artur Barseghyan <artur.b... | {
"content_hash": "0a4fbafc5ca03fe22eb0741aae5dd768",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 77,
"avg_line_length": 37.92929292929293,
"alnum_prop": 0.5158455392809588,
"repo_name": "mansonul/events",
"id": "c2307f1c03c59315225707488e354e3774a87e4d",
"size": "3755"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('linkcheck', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='url',
name='redirect_to',
field=m... | {
"content_hash": "19bfd09b7e9f9cd18a2e55a4c2907da9",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 21.22222222222222,
"alnum_prop": 0.5837696335078534,
"repo_name": "claudep/django-linkcheck",
"id": "560dd73243cd9297fffbb1c3f92a5eec8d3a7313",
"size... |
"""Integration tests for TensorBoard.
These tests start up a full-fledged TensorBoard server.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import base64
import gzip
import json
import numbers
import os
import shutil
import socket
import tempfile
imp... | {
"content_hash": "bb9e4b832326b202bebbfbf2612d4710",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 80,
"avg_line_length": 36.106542056074765,
"alnum_prop": 0.6493244292592018,
"repo_name": "abhitopia/tensorflow",
"id": "002709cd5b09ca4a2232b067af8fe9ed29573712",
"size":... |
from .rpmsection import Section
class RpmPrep(Section):
'''
Try to simplify to %setup -q when possible.
Replace %patch with %patch0
'''
def add(self, line):
line = self._complete_cleanup(line)
if not self.minimal:
line = self._cleanup_setup(line)
l... | {
"content_hash": "98570d4a1680d3017ee347eb5d331321",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 114,
"avg_line_length": 32.895833333333336,
"alnum_prop": 0.5465484483850538,
"repo_name": "plusky/spec-cleaner",
"id": "2551da553676dab80d7919ef338525e86d2e1ba9",
"size": ... |
import os
import sys
import time
import json
import ephem
import random
import socket
import httplib
import httplib2
import datetime
import calendar
from timerasp import gmail, flickr
from apiclient.discovery import build
from oauth2client.file import Storage
from apiclient.errors import HttpError
from apiclient.http ... | {
"content_hash": "c011afa8dc0edd3d0b4dfb264682453d",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 124,
"avg_line_length": 32.44549763033175,
"alnum_prop": 0.6570260005842828,
"repo_name": "ajmendez/timerasp",
"id": "d1d3381ec242938a8194fec01807a07a6e80d195",
"size": "1... |
import math
import pdb
import random
import numpy as np
import sys
import time
import Orange
sys.path.extend(['.', '..'])
from itertools import chain, repeat
from collections import defaultdict
from rtree.index import Index as RTree
from rtree.index import Property as RProp
from operator import mul, and_, or_
from skl... | {
"content_hash": "36eb70225f93f21be0ebc4526a5dd625",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 116,
"avg_line_length": 27.639240506329113,
"alnum_prop": 0.62651705976643,
"repo_name": "sirrice/scorpion",
"id": "ed07d18c08c0438db39c2f27e74ddb950ccccfe7",
"size": "873... |
from pyx import *
DEFAULT_LINE_HEIGHT = 200
DEFAULT_LINE_SPACE = 200
class TimeLine(object):
def __init__(self, name, start, end):
self.name = name
assert start <= end
self.global_start = start
self.global_end = end
self.lines = list()
self.canvas = canvas.canvas()... | {
"content_hash": "e9b0a2ab6d2431c4867491809a852dde",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 106,
"avg_line_length": 31.126984126984127,
"alnum_prop": 0.604793472718001,
"repo_name": "StanfordLegion/legion",
"id": "d4bbdc7c47c8a945bcdb3f288dfea91f94442094",
"size":... |
import numpy as np
from scipy.misc import imread, imresize, toimage
import cv2
from keras.preprocessing.image import img_to_array, load_img
def read_images(img_paths):
"""
Use the scipy imread function to read each image into a nunmpy array
:param img_paths: Numpy array of image paths to read
:return... | {
"content_hash": "f170d42763dba48e76f00c0d9813afc3",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 105,
"avg_line_length": 29.810126582278482,
"alnum_prop": 0.648619957537155,
"repo_name": "js1972/CarND-Behavioral-Cloning",
"id": "9b169b0d00745afa2d8019b7f7609f07895a8539"... |
"""Utilities to support packages."""
from functools import singledispatch as simplegeneric
import importlib
import importlib.util
import importlib.machinery
import os
import os.path
import sys
from types import ModuleType
import warnings
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_loader',
... | {
"content_hash": "cee70384a22799250b58527af2bdae6a",
"timestamp": "",
"source": "github",
"line_count": 632,
"max_line_length": 79,
"avg_line_length": 33.789556962025316,
"alnum_prop": 0.5918520252868181,
"repo_name": "batermj/algorithm-challenger",
"id": "9d1879a20c08d84ca0c6d259bd127dbc4e2f270c",
... |
"""
Zotero OAuth1 backends, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/zotero.html
"""
from .oauth import BaseOAuth1
class ZoteroOAuth(BaseOAuth1):
"""Zotero OAuth authorization mechanism"""
name = 'zotero'
AUTHORIZATION_URL = 'https://www.zotero.org/oauth/authorize'
RE... | {
"content_hash": "335452ecc6c1e2f0317fbe566849dc0a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 32.55172413793103,
"alnum_prop": 0.6334745762711864,
"repo_name": "IKholopov/HackUPC2017",
"id": "1ee2be386a3274ac14dcd1fbdcaa97c0a153b5b1",
"size": ... |
a.b
# OPEN_PAREN CLOSE_PAREN
x()
# OPEN_PAREN argument CLOSE_PAREN
x(a)
# OPEN_PAREN argument COMMA argument COMMA CLOSE_PAREN
x(a, b,)
# OPEN_PAREN argument COMMA argument COMMA argument CLOSE_PAREN
x(a, b, c)
# OPEN_BRACKET subscript CLOSE_BRACKET
x[a]
# OPEN_BRACKET subscript COMMA subscript COMMA CLOSE_BRACKE... | {
"content_hash": "15a6680590d14624640d7943bc8ce34b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 18.772727272727273,
"alnum_prop": 0.7457627118644068,
"repo_name": "antlr/grammars-v4",
"id": "1bc19351550ba356aa1bb9af32e2d97ff2a0e9a5",
"size": "59... |
"""
web2.dav interfaces.
"""
__all__ = [ "IDAVResource" ]
from twisted.web2.iweb import IResource
class IDAVResource(IResource):
"""
WebDAV resource.
"""
def isCollection():
"""
Checks whether this resource is a collection resource.
@return: C{True} if this resource is a colle... | {
"content_hash": "0389c4474d14ad70a23b50c26ca54c11",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 80,
"avg_line_length": 36.10526315789474,
"alnum_prop": 0.6226572261557685,
"repo_name": "santisiri/popego",
"id": "fccdc1d0581b6d5f3b7a4d6676c9d634409dc4c2",
"size": "597... |
import datetime
from typing import Dict, List, Optional, Union
from azure.core.exceptions import HttpResponseError
import msrest.serialization
from ._container_registry_management_client_enums import *
class ActivationProperties(msrest.serialization.Model):
"""The activation properties of the connected registry... | {
"content_hash": "4872c75d37ed2f1ac4f1aad53b16302e",
"timestamp": "",
"source": "github",
"line_count": 5102,
"max_line_length": 152,
"avg_line_length": 41.23206585652685,
"alnum_prop": 0.6474953176844167,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5e107e6cec76ce67a230d6da0ce83ed1e02ef8d1",
... |
r"""Functions for calculating relativistic quantities (:math:`v \to c`)."""
__all__ = ["Lorentz_factor", "relativistic_energy", "RelativisticBody"]
import astropy.units as u
import numpy as np
from astropy.constants import c
from numbers import Integral, Real
from numpy.typing import DTypeLike
from typing import Dict... | {
"content_hash": "b360545ca1a7d2c44e2ceddd12138a41",
"timestamp": "",
"source": "github",
"line_count": 506,
"max_line_length": 100,
"avg_line_length": 29.09881422924901,
"alnum_prop": 0.5785112741102961,
"repo_name": "StanczakDominik/PlasmaPy",
"id": "b0a488c45e05921f69a6261782a2d314e9e89b99",
"si... |
"""
Generic test utilities.
Based on scipy._libs._testutils
"""
from __future__ import division, print_function, absolute_import
import os
import sys
__all__ = ["PytestTester"]
class PytestTester(object):
"""
Pytest test runner entry point.
"""
def __init__(self, module_name):
self.modul... | {
"content_hash": "c528c5f37ed115f8025220aa351e3e62",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 23.247191011235955,
"alnum_prop": 0.5311744804253262,
"repo_name": "kwgoodman/bottleneck",
"id": "b83103df58ee0aec08f01767b805c74d0f7a7853",
"size": ... |
import numpy as np
import itertools as it
import pylab, sys
intervs=15
comps1=[(1.0*b/intervs, 1.0*c/intervs, 1.0*(intervs-a-b-c)/intervs, 1.0*a/intervs) for a in np.arange(0,intervs+1)[::-1] for b in np.arange(0,intervs+1-a) for c in np.arange(0, intervs+1-a-b)][::-1]
comps1=np.array(comps1)
ratio_target=2.
ratio_tol=... | {
"content_hash": "7cd51d70beebb6886cdb80779f7fb619",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 198,
"avg_line_length": 32.738461538461536,
"alnum_prop": 0.6567199248120301,
"repo_name": "johnmgregoire/JCAPGeneratePrintCode",
"id": "52988e009f86a5a0e3aa0aa0be47a81d8405... |
import logging
import os
import shutil
import time
from bzt.modules.gatling import GatlingExecutor, DataLogReader
from bzt.six import u
from bzt.utils import EXE_SUFFIX, get_full_path
from tests import BZTestCase, __dir__
from tests.mocks import EngineEmul
from bzt.modules.provisioning import Local
from bzt import Too... | {
"content_hash": "b8dbb58b004f49c24699deed0ebb222e",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 105,
"avg_line_length": 37.87019230769231,
"alnum_prop": 0.5103465786466929,
"repo_name": "itaymendel/taurus",
"id": "b164cfc17db0f11b14d0cda4349b0daf03caab68",
"size": "1... |
from testinfra.backend import base
class PodmanBackend(base.BaseBackend):
NAME = "podman"
def __init__(self, name, *args, **kwargs):
self.name, self.user = self.parse_containerspec(name)
super().__init__(self.name, *args, **kwargs)
def run(self, command, *args, **kwargs):
cmd = s... | {
"content_hash": "714212e046b8eb917cf183231b550422",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 63,
"avg_line_length": 32.714285714285715,
"alnum_prop": 0.5458515283842795,
"repo_name": "philpep/testinfra",
"id": "ed3723aea5ae79d544b209587499f16516f5d4f0",
"size": "12... |
from setuptools import setup
setup(
name='home',
packages=['home'],
include_package_data=True,
install_requires=[
'flask', 'flask-bootstrap','flask-nav'
,'RPi.GPIO','py-irsend', 'gpiozero'
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest',
... | {
"content_hash": "caefbe7a532d1abe597c2708d5739055",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 46,
"avg_line_length": 19.352941176470587,
"alnum_prop": 0.547112462006079,
"repo_name": "Ameeth/raspberry-pi-pocs",
"id": "755cd4556d7125c0f3815dc7cd3cccd88dfdd3d8",
"size... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ion_channel', '0003_auto_20150605_0908'),
]
operations = [
migrations.AlterField(
model_name='graph',
name='experiment',
... | {
"content_hash": "a81cd0d1297a993825b4508bdb16c754",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 88,
"avg_line_length": 26.869565217391305,
"alnum_prop": 0.5922330097087378,
"repo_name": "joebowen/ChannelWorm",
"id": "55191cb7238664c7ac1db29d637aa4ad7018c772",
"size": ... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path[0:0] = [os.path.abspath('..')]
# -- General configuratio... | {
"content_hash": "9b62b4ccbd9bd42d922ea6a0e34f5278",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 80,
"avg_line_length": 32.170212765957444,
"alnum_prop": 0.7013227513227513,
"repo_name": "charlesthomas/moth",
"id": "809dfdfb7b388294381190e415ce35a48b8fb2e2",
"size": "... |
from werkzeug.contrib.fixers import ProxyFix
import manage
__author__ = 'mkr'
myhoard = manage.create_app()
myhoard.wsgi_app = ProxyFix(myhoard.wsgi_app)
if __name__ == '__main__':
myhoard.run() | {
"content_hash": "97fa4fdf059e81cd69d7d8d996b11b14",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 45,
"avg_line_length": 18.363636363636363,
"alnum_prop": 0.6831683168316832,
"repo_name": "blstream/myHoard_Python",
"id": "ec2886271fa384e7a389580e62f49e80a84db7c6",
"size... |
"""Mrs Worker
The worker process executes the user's map function and reduce function.
That's it. It just does what the main slave process tells it to. The worker
process is terminated when the main process quits.
"""
import os
import traceback
from . import datasets
from . import tasks
from . import util
from lo... | {
"content_hash": "c6bf4dcd23e488ea596e1bafecc6fa71",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 78,
"avg_line_length": 32.47457627118644,
"alnum_prop": 0.5947286012526096,
"repo_name": "byu-aml-lab/mrs-mapreduce",
"id": "6826aebb8e6f497fa7f132e89bfabaf049bac782",
"si... |
import datetime
import json
from libcloud.container.base import (Container, ContainerDriver,
ContainerImage, ContainerCluster)
from libcloud.common.kubernetes import KubernetesException
from libcloud.common.kubernetes import KubernetesBasicAuthConnection
from libcloud.common.kuber... | {
"content_hash": "6bae3d53643cfc0e45abcc6471add13d",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 77,
"avg_line_length": 32.0448275862069,
"alnum_prop": 0.5439578177122565,
"repo_name": "Kami/libcloud",
"id": "b0b770592c6be329c4707a40b0c638888ea2eff2",
"size": "10075",... |
"""SCons.Tool.nasm
Tool-specific initialization for nasm, the famous Netwide Assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 ... | {
"content_hash": "e1972027f27764f63cecb691df6a839e",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 100,
"avg_line_length": 38.696969696969695,
"alnum_prop": 0.7235708692247454,
"repo_name": "rwatson/chromium-capsicum",
"id": "07df8f21be25cc4b38c2c04ac63f139407573edf",
"s... |
"""Interface to the vim archive to use with the other python file
Give an interface to the vim archivecture to hide all vim functionnality
from the python file.
"""
import vim
import string
def evaluate(a_instruction):
"""Evaluate the Vim instruction `a_instruction' and retuen a string
containing the result... | {
"content_hash": "f3f7bde60e8c1953a285ecdc53011712",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 79,
"avg_line_length": 30.872053872053872,
"alnum_prop": 0.6162067837277784,
"repo_name": "tioui/Vim_Eiffel_IDE",
"id": "fcb495ce69dbfdb0e09cd1cdf627dbbc10dffeaf",
"size":... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from gamechat import settings
from django.conf import settings as dcs
from django.conf.urls.static import static
from django.views.generic import RedirectView
from chat.chat_container import QueueContainer
QUEUES = QueueContainer()
... | {
"content_hash": "0a641f96a11f2e652337d7712d151b77",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 35,
"alnum_prop": 0.7111111111111111,
"repo_name": "nbeck90/game-chat",
"id": "9f20acf28e2b4b1dceb8e417117484fcae7f188d",
"size": "945",
"binary": ... |
'''
High-level functions and classes for solving a wide variety of economic models.
The "core" of HARK is a framework for "microeconomic" and "macroeconomic"
models. A micro model concerns the dynamic optimization problem for some type
of agents, where agents take the inputs to their problem as exogenous. A macro
mod... | {
"content_hash": "543c69ae14def198e225c883c3e2978d",
"timestamp": "",
"source": "github",
"line_count": 834,
"max_line_length": 111,
"avg_line_length": 36.460431654676256,
"alnum_prop": 0.5784004209418574,
"repo_name": "ganong123/HARK",
"id": "7d7c56d1d8ee91f8978d64717b6356c7722b4a8a",
"size": "304... |
from OpenGLCffi.GL import params
@params(api='gl', prms=['mode'])
def glProvokingVertex(mode):
pass
| {
"content_hash": "8a00b1b767b607aeebe043b75dc3d030",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 17.166666666666668,
"alnum_prop": 0.7281553398058253,
"repo_name": "cydenix/OpenGLCffi",
"id": "78418d0b7aa90c01fc37c4042e2de47305a1191c",
"size": "10... |
from functools import wraps
import logging
logger = logging.getLogger('peewee')
class _QueryLogHandler(logging.Handler):
def __init__(self, *args, **kwargs):
self.queries = []
logging.Handler.__init__(self, *args, **kwargs)
def emit(self, record):
# Counts all entries logged to the ... | {
"content_hash": "5eba50d2b28a0785c996bc65a3077138",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 28.96875,
"alnum_prop": 0.5792880258899676,
"repo_name": "coleifer/peewee",
"id": "83c1de7da44eac77cdeadba3986d614bad646fdd",
"size": "1854",
"bina... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "Fisher", sigma = 0.0, exog_count = 100, ar_order = 0); | {
"content_hash": "6aa8ba03dba0e1eb7a33b1c0760712f7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 165,
"avg_line_length": 37.857142857142854,
"alnum_prop": 0.7056603773584905,
"repo_name": "antoinecarme/pyaf",
"id": "f9bd976251b325bb26ba043295ebe9a4cfa7f2be",
"size": "26... |
"""Routines to help recognizing sound files.
Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.
The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- nu... | {
"content_hash": "29fb2a426dfe4e28be2f7fbf4dd16367",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 79,
"avg_line_length": 27.579766536964982,
"alnum_prop": 0.5660270880361173,
"repo_name": "yotchang4s/cafebabepy",
"id": "7ecafb40e821cdf082a2977ab2383ba2a9ac6c62",
"size"... |
import json
import sys
from utils.benchmark import get_value, parse_node_coords, get_matrix
# Generate a json-formatted problem from a CVRPLIB file.
CVRP_FIELDS = [
"NAME",
"TYPE",
"COMMENT",
"DIMENSION",
"EDGE_WEIGHT_TYPE",
"CAPACITY",
"VEHICLES",
]
def parse_cvrp(input_file):
with ... | {
"content_hash": "3542a84ce60eb715264aefc16bf15a61",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 82,
"avg_line_length": 29.2,
"alnum_prop": 0.5420091324200913,
"repo_name": "VROOM-Project/vroom-scripts",
"id": "b8c433486fad1864e3949bcf5ff4758fb9047eb5",
"size": "4426"... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "pyplearnr",
version = "1.0.11.1",
author = "Christopher Shymansky",
author_email = "CMShymansky@gmail.com",
description = ("Pyplearnr is a tool designed to ... | {
"content_hash": "a0c69ddb9f394b6b092573c30cc03d98",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 80,
"avg_line_length": 33.225806451612904,
"alnum_prop": 0.5951456310679611,
"repo_name": "JaggedParadigm/pyplearnr",
"id": "9a1163da04908d78fe547bb493470d421298838e",
"siz... |
"""Tests for molecular_data."""
import os
import unittest
import numpy.random
import scipy.linalg
import numpy as np
from openfermion.config import THIS_DIRECTORY, DATA_DIRECTORY
from openfermion.hamiltonians import jellium_model
from openfermion.chem.chemical_series import make_atom
from openfermion.chem.molecular_da... | {
"content_hash": "80389d357f0f19e3960c58d7e8ca9396",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 80,
"avg_line_length": 43.09855072463768,
"alnum_prop": 0.5594861792992132,
"repo_name": "quantumlib/OpenFermion",
"id": "c6776a70a6d592df4b928dc88584ff710e0aab1d",
"size"... |
"""Configuration and hyperparameter sweeps."""
from lra_benchmarks.listops.configs import base_listops_config
def get_config():
"""Get the default hyperparameter configuration."""
config = base_listops_config.get_config()
config.model_type = "sinkhorn"
return config
def get_hyper(hyper):
return hyper.pro... | {
"content_hash": "37c37001c37acb7616349baab8b03a5c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 23.5,
"alnum_prop": 0.7386018237082067,
"repo_name": "google-research/long-range-arena",
"id": "cf5386b30f08631f446757534cd182738ce3a15d",
"size": "9... |
__author__ = 'nathan'
from base import BaseNotifier
class MailNotifier(BaseNotifier):
"""use mail to send a notification"""
def _notify(self):
pass
| {
"content_hash": "e37e60e27e30755043739836325ecb78",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 41,
"avg_line_length": 16.8,
"alnum_prop": 0.6547619047619048,
"repo_name": "zhoubangtao/dbsync",
"id": "1092c0f4dd45d192ef60b3a06a5caac2b5c7fdd1",
"size": "191",
"binary... |
from setuptools import setup
try:
import enum # noqa
extra_requires = []
except ImportError:
extra_requires = ['enum34']
REQUIRES = ['marshmallow>=2.0.0'] + extra_requires
with open('README.md', 'r') as f:
readme = f.read()
with open('CHANGELOG', 'r') as f:
changelog = f.read()
if __name__ =... | {
"content_hash": "b2e6abee8ad5896c4ebcbc65ea3fb91c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 65,
"avg_line_length": 25.727272727272727,
"alnum_prop": 0.5948174322732627,
"repo_name": "justanr/marshmallow_enum",
"id": "0a4fdd13278f41378681abc4167a7e3789c20db6",
"siz... |
from setuptools import setup
from pdfminer import __version__
import sys
requires = ['six', 'pycryptodome']
if sys.version_info >= (3, 0):
requires.append('chardet')
setup(
name='pdfminer.six-mgh',
version=__version__,
install_requires=requires,
description='PDF parser and analyzer',
long_desc... | {
"content_hash": "35d2c0a3f7377b377742f192e541e209",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 97,
"avg_line_length": 35.527272727272724,
"alnum_prop": 0.6796315250767656,
"repo_name": "rotula/pdfminer",
"id": "85fb5b5bd05a1f25ae3278ca10330fd2d2c90f90",
"size": "1988... |
'''
Generates a contact list of SciELO journal editors.
'''
import sys
import xlsxwriter
from articlemeta.client import ThriftClient
import models
def journal_date_list():
scielo_fields = [
'ISSN SciELO',
'SciELO collection',
'Publisher country',
'Title',
'Status',
... | {
"content_hash": "347132f1d107f1c6d8838afa70ec3dd2",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 79,
"avg_line_length": 21.96875,
"alnum_prop": 0.543859649122807,
"repo_name": "scieloorg/journals-catalog",
"id": "f7c2a6557a45de9d3d075cd933bbf28215a5eb33",
"size": "2125... |
import re
from io import BytesIO
import openpyxl
import xlrd
from openpyxl import load_workbook
from openpyxl.styles import Font
from openpyxl.utils import get_column_letter
import frappe
from frappe.utils.html_utils import unescape_html
ILLEGAL_CHARACTERS_RE = re.compile(r'[\000-\010]|[\013-\014]|[\016-\037]')
# ... | {
"content_hash": "6ae79c8c0c7b4342dfbe52f96c3e8b0d",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 92,
"avg_line_length": 23.794871794871796,
"alnum_prop": 0.694683908045977,
"repo_name": "mhbu50/frappe",
"id": "38a076212ad2d90a829b2240a74c56032b8090b7",
"size": "2881",... |
"""
Copyright (C) 2010-2013, Ryan Fan
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the... | {
"content_hash": "c4b0461ba0c5c033b06fd0e63d90554d",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 126,
"avg_line_length": 34.74786324786325,
"alnum_prop": 0.574468085106383,
"repo_name": "rfancn/myprojects",
"id": "59029f8c7b4af606a92e3ebd47f2490dc11588c9",
"size": "81... |
import logging
import pymel.core as pymel
from maya import OpenMaya
#
# A PyNodeChain is a special pymel-related object that act exactly like a standard array.
# However it allow us to have more bells and whistles.
#
def is_valid_PyNode(val):
return (val and hasattr(val, 'exists') and val.exists()) if val else ... | {
"content_hash": "69c7f85db7872776d5dee298e82ae689",
"timestamp": "",
"source": "github",
"line_count": 472,
"max_line_length": 117,
"avg_line_length": 30.171610169491526,
"alnum_prop": 0.5911803946352082,
"repo_name": "SqueezeStudioAnimation/omtk",
"id": "2f2ffe66bca521e336fc34cf94ea72ef3362ec4a",
... |
'''Unit tests for the examples in the examples dir.'''
from bayesian.factor_graph import build_graph
from bayesian.examples.factor_graphs.cancer import fP, fS, fC, fX, fD
'''
Since one of the goals of this package
are to have many working examples its
very important that the examples work
correctly "out of the box".
... | {
"content_hash": "a54e425b3c05b46a2d3e03e9bc2011ee",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 69,
"avg_line_length": 40.90833333333333,
"alnum_prop": 0.5477694031370951,
"repo_name": "kamijawa/ogc_server",
"id": "c0617adff70eda1403866d9363b661c54ea5ac41",
"size": "... |
import csv
import itertools
import argparse
import importlib
import sys
from csvgroup.common import dump_as_csv
def cast_to_type(type, values):
return [type(value) for value in values if value]
def aggregate(function, values, type):
cast_values = cast_to_type(type, values)
return function(cast_values)... | {
"content_hash": "23aa848938b0176496556f6afac2cdda",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 77,
"avg_line_length": 23.88888888888889,
"alnum_prop": 0.5608527131782945,
"repo_name": "ceumicrodata/csvgroup",
"id": "0b6faf0056fb4d2eaf4cdf442668af90bf84eb0b",
"size":... |
def recover_message(input_string):
message = ""
lines = []
for line in input_string.split("\n"):
if line.strip() != "":
lines.append(line)
chars = zip(*lines)
for char_list in chars:
counts = {}
for char in char_list:
if char not in counts:
... | {
"content_hash": "76a8996d6ad8b7db858ad158ca60072f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 82,
"avg_line_length": 21.517241379310345,
"alnum_prop": 0.5112179487179487,
"repo_name": "mnestis/advent2016",
"id": "1dce15206aa5ad9afa7764815d3be9917986fe00",
"size": "6... |
from __future__ import print_function
#
# Import modules
#
import HTMLParser
import base64
import getpass
import optparse
import os
import httplib
import urllib
import urllib2
import sys
import time
class CalientController(object):
"""Abstract interface for all Calient Switch Controls"""
def __init__(self):
... | {
"content_hash": "1d935b996b728c91ec03eed3a37e63af",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 93,
"avg_line_length": 36.699208443271765,
"alnum_prop": 0.5530951182687468,
"repo_name": "eunsungc/gt6-RAMSES_8_5",
"id": "1e0bda227acd9a41f095894ffbe7541dc4f40dcc",
"siz... |
import logging
from userreport.models import UserReport
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.dates import DateFormatter
import matplotlib... | {
"content_hash": "86ca1b8f22c630acbc8b6487570cb231",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 31.033333333333335,
"alnum_prop": 0.6750805585392051,
"repo_name": "leyyin/stk-stats",
"id": "7ab8fa0f87945b7066cf71096d13d9f00869883e",
"size": "186... |
"""
Tests for the pandas.io.common functionalities
"""
import mmap
import pytest
import os
from os.path import isabs
import pandas as pd
import pandas.util.testing as tm
import pandas.util._test_decorators as td
from pandas.io import common
from pandas.compat import is_platform_windows, StringIO, FileNotFoundErro... | {
"content_hash": "90ceedfc3c18ea6b8151f5b52fb51d0e",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 79,
"avg_line_length": 34.395833333333336,
"alnum_prop": 0.5702604482132041,
"repo_name": "zfrenchee/pandas",
"id": "a0070dce6a7f1850d46c9de25386f6d0466ec163",
"size": "99... |
"""Tests for the main app."""
from __future__ import (
absolute_import, division, print_function, unicode_literals,
)
import itertools
import json
import logging
import os
import subprocess
from unittest import TestCase
import jupyter_core.paths
import nose.tools as nt
from jupyter_contrib_core.notebook_compat i... | {
"content_hash": "02a34333d549254a22c49692d40475dc",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 79,
"avg_line_length": 41.20198675496689,
"alnum_prop": 0.6047576950896086,
"repo_name": "RTHMaK/RPGOne",
"id": "155e11a93fdee204fd3cfe21cf824d881552b015",
"size": "12467"... |
from io import BytesIO
import tornado.web
from tornado import gen
from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError
from tornado.httputil import HTTPHeaders
from tornado.testing import AsyncHTTPTestCase, gen_test
from smart_sentinel.tornado_client import TornadoStrictRedis
from tornado_stale_client ... | {
"content_hash": "2f6092b369e1798b87911149d6cee0e2",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 94,
"avg_line_length": 35.668103448275865,
"alnum_prop": 0.6683987915407855,
"repo_name": "globocom/tornado-stale-client",
"id": "d034fc538897a775b09d72acc3325f9e02319186",
... |
class Solution(object):
def trap(self, height):
"""
:type height: List[int]
:rtype: int
"""
n = len(height)
l, r, water, min_height = 0, n - 1, 0, 0
while l < r:
while l < r and height[l] <= min_height:
water += min_height - height[... | {
"content_hash": "d1d280b96276e1c6dd27d2dd1e48e4d1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 118,
"avg_line_length": 48,
"alnum_prop": 0.6005434782608695,
"repo_name": "jigarkb/Programming",
"id": "936cbb4e818e0fdc6f4f4719708dc181e9410dfb",
"size": "1323",
"binar... |
'''This example shows a sample checkout form created using bokeh widgets.
.. bokeh-example-metadata::
:apis: bokeh.models.widgets.button, bokeh.models.widgets.checkbox, bokeh.models.widgets.groups, bokeh.models.widgets.inputs
:refs: :ref:`ug_interaction_widgets`
:keywords: form, widgets, form, inputs
'''
... | {
"content_hash": "24599e38cbafb3bc3cd558784f205aba",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 127,
"avg_line_length": 33.440677966101696,
"alnum_prop": 0.7100861632032438,
"repo_name": "bokeh/bokeh",
"id": "a8a0e4e213b79ba367aeea8fc8d4d6349acdb647",
"size": "1973",
... |
import wx
import armid
import ARM
from GoalRefinementDialog import GoalRefinementDialog
class GoalAssociationListCtrl(wx.ListCtrl):
def __init__(self,parent,winId,dp,goalList=False,boxSize=wx.DefaultSize):
wx.ListCtrl.__init__(self,parent,winId,size=boxSize,style=wx.LC_REPORT)
self.dbProxy = dp
self.goal... | {
"content_hash": "0c3bfd993233a2d6fcc41e0211abba61",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 140,
"avg_line_length": 39.424528301886795,
"alnum_prop": 0.7257717157214645,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "8a4a2ffe425eb9e7239330f2b5a50eb2d9f4c9f3",
"siz... |
print """
What do I know so far?
A lot of things... we're almost halfway. Python is fun!
"""
| {
"content_hash": "289c225d0b1a8cbdf971cffeb284ade9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 15.833333333333334,
"alnum_prop": 0.6421052631578947,
"repo_name": "darthbinamira/learn_python",
"id": "2e8b95e4bb91bf354db63c9dcc64b1605a8b132d",
"si... |
import sys
import json
import random
import time
import os
import CacheStats
import LRU
CACHE_ATIME = 0
CACHE_SIZE = 1
CACHE_FRESHER_ID = 2
CACHE_OLDER_ID = 3
class MRUCache(LRU.LRUCache):
"""
Most Recently Used (MRU): http://en.wikipedia.org/wiki/Cache_algorithms
Discards, in contrast to LRU, th... | {
"content_hash": "65560e42cdcd8f5b93d839dba1899c94",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 118,
"avg_line_length": 27.568627450980394,
"alnum_prop": 0.6194879089615932,
"repo_name": "zdvresearch/fast15-paper-extras",
"id": "bc33f02c49a070b9bf1d0737555014df5b58d9b4... |
from ...online_crowdsourcing import *
from part import *
import json
import math
import os
import pickle
from PIL import Image
PART_COLORS = [ '#FF0000', '#00FF00', '#008000', '#FFBF4A', '#000080', '#FFFF00', '#626200', '#00FFFF', '#006262', '#FF00FF', '#620062', '#FFFFFF', '#000000', '#44200F' ]
PART_OUTLIN... | {
"content_hash": "9fe76b79e4e686349770a5d465711be8",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 218,
"avg_line_length": 45.53198653198653,
"alnum_prop": 0.6247134511572876,
"repo_name": "sbranson/online_crowdsourcing",
"id": "98cf24d3921b9a8c2e91f5da3ccfee37366f8952",
... |
from omnilib.xmlrpc.client import make_client
from omnilib.frameworks.framework_base import Framework_Base
import os
import traceback
import sys
import time
class Framework(Framework_Base):
def __init__(self, config):
config['cert'] = os.path.expanduser(config['cert'])
if not os.path.exists(config[... | {
"content_hash": "111604513c9b0b51c5a35d393ac6cad1",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 185,
"avg_line_length": 35.68888888888889,
"alnum_prop": 0.5688044831880449,
"repo_name": "avlach/univbris-ocf",
"id": "95f165865d3f3bbac7d3c08afee4c17553d0c94d",
"size": "... |
kpa = float(input("Input pressure in kilopascals> "))
psi = kpa * 0.145038
mmhg = kpa * 760 / 101.325
atm = kpa / 101.325
print "The pressure in pounds per square inch: %.2f psi" % (psi)
print "The pressure in millimeter of mercury: %.2f mmHg" % (mmhg)
print "Atmosphere pressure: %.2f atm." % (atm)
| {
"content_hash": "d90adae08d6c4bab768710bc2971995d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 65,
"avg_line_length": 43,
"alnum_prop": 0.6744186046511628,
"repo_name": "dadavidson/Python_Lab",
"id": "95146ed210abfc7f5888ed406baa1ce058e4b8f6",
"size": "498",
"binary... |
"""
9. Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter``s, and each
``Article``-``Reporter`` combination (a ``Writer``) has a ``position`` field... | {
"content_hash": "bdca613eb70f723baad48ea67f84bf77",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 78,
"avg_line_length": 29.058823529411764,
"alnum_prop": 0.6700404858299596,
"repo_name": "rawwell/django",
"id": "0f93d5a154879cc19910a440ebd8ec34627b1832",
"size": "1976"... |
import os, sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from pprint import pformat
import json
import pytest
import lasio
import lasio.las_items
test_dir = os.path.dirname(__file__)
egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn)
stegfn = lambda vers, fn: os.path.... | {
"content_hash": "961e72006d1d66104cc18ff0c6ea8f45",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 87,
"avg_line_length": 27.2125,
"alnum_prop": 0.6311437758383096,
"repo_name": "kwinkunks/lasio",
"id": "50cd2d333e13ca6d517935fa06da28e88199c863",
"size": "2177",
"binar... |
import re
import sys
from tox.config import parseconfig
from tox.package import get_package
from tox.session import Session
def test_install_via_installpkg(mock_venv, initproj, cmd):
base = initproj(
"pkg-0.1",
filedefs={
"tox.ini": """
[tox]
install_cm... | {
"content_hash": "28fd137a0f0ddc4789fea75cce59287c",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 94,
"avg_line_length": 29.423529411764704,
"alnum_prop": 0.5133946421431428,
"repo_name": "tox-dev/tox",
"id": "5a196d56c154746bce674d1ce776b318e1fdb8a5",
"size": "5002",
... |
from collections import namedtuple
Size = namedtuple('Size', ['width', 'height'])
Location = namedtuple('Location', ['x', 'y'])
class Style(object):
"""
Allows getting and setting the CSS style.
"""
_elem = None
def __init__(self, elem):
self.__dict__.update({'_elem': elem})
def _... | {
"content_hash": "6d972de1e25976bbe4fd327f3e323acb",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 106,
"avg_line_length": 28.793650793650794,
"alnum_prop": 0.5848952590959207,
"repo_name": "tomchristie/webdriverplus",
"id": "eb721affbfa75a620fec5e4dff5b0703701abadd",
"s... |
from __future__ import print_function
import unittest
import numpy as np
import math
from op_test import OpTest
def quantize_max_abs(x, max_range):
scale = np.max(np.abs(x).flatten())
y = np.round(x / scale * max_range)
return y, scale
def dequantize_max_abs(x, scale, max_range):
y = (scale / max_r... | {
"content_hash": "4a7934d08c32d1b9a0e0f57bd955bc71",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 80,
"avg_line_length": 26.982142857142858,
"alnum_prop": 0.6207809397749835,
"repo_name": "reyoung/Paddle",
"id": "1bb4662e8d83ac0c34b209e4e7a605869fdb59d5",
"size": "2124"... |
from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResp... | {
"content_hash": "a3fef8c950b977143c65a4d34a47022e",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 164,
"avg_line_length": 41.449691991786445,
"alnum_prop": 0.630635093629248,
"repo_name": "Azure/azure-sdk-for-python",
"id": "33e4f3cab191b28d71ed4069cb5abe2a913d123d",
"... |
from oslo_config import cfg
from neutron._i18n import _
DEFAULT_DEVICE_MAPPINGS = []
DEFAULT_EXCLUDE_DEVICES = []
agent_opts = [
cfg.IntOpt('polling_interval', default=2,
help=_("The number of seconds the agent will wait between "
"polling for local device changes.")),
]
sri... | {
"content_hash": "efb35952678debd5abb511a0b2f4a428",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 44.63414634146341,
"alnum_prop": 0.5622950819672131,
"repo_name": "eayunstack/neutron",
"id": "679ac222f8eab391cbf2992eab3b12c3221e9357",
"size": "24... |
from collections import OrderedDict
from functools import partial
from django.db import models
from django.conf import settings
from django.template import Context
from django.template.loader import get_template
from django.templatetags.static import static
from django.utils.translation import ugettext_lazy as _
from... | {
"content_hash": "41cef6f7daeab162b4e784e0978ae0a7",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 104,
"avg_line_length": 33.96610169491525,
"alnum_prop": 0.6469560878243513,
"repo_name": "aldryn/aldryn-social-addthis",
"id": "1df5896115ece2ec9868bda9cc669fd5db04e17b",
... |
import sys
import django
from django.conf import settings
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.sites',
'django_nyt',
]
from django import VERSION
if VERSION <= (... | {
"content_hash": "745bb85aaef5f45aad4faf2e8a803ce2",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 64,
"avg_line_length": 27.123456790123456,
"alnum_prop": 0.6672735548475194,
"repo_name": "spookylukey/django-nyt",
"id": "9e0e2fc7bc0584c5ea642d70c8b514cc77e0aa78",
"size"... |
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['target', 'level', 'internalformat', 'width', 'height', 'depth', 'border', 'format', 'type', 'pixels'])
def glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels):
pass
@params(api='gles2', prms=['target', 'lev... | {
"content_hash": "71ff851da185cc104cdf6b6f2f2ff33f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 138,
"avg_line_length": 46.54838709677419,
"alnum_prop": 0.693000693000693,
"repo_name": "cydenix/OpenGLCffi",
"id": "a0ca237e4e2f686de7fe2db140c5fdc9218c2af7",
"size": "14... |
"""
Streaming utility for system and simulation data.
author: Jeff Kinnison (jkinniso@nd.edu)
"""
import json
import pika
class PikaAsyncConsumer(object):
"""
The primary entry point for routing incoming messages to the proper handler.
"""
def __init__(self, rabbitmq_url, exchange_name, queue_name, ... | {
"content_hash": "bd153e933722f147d17392e705b9722c",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 80,
"avg_line_length": 34.59605911330049,
"alnum_prop": 0.5850776021643173,
"repo_name": "machristie/airavata",
"id": "1c58687316c6a2cf1f7c3fe15b7968302d5ae66f",
"size": "... |
import os
import sys
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvesterconfig import harvester_config
if not hasattr(harvester_config.watcher, 'passphraseEnv'):
print ('ERROR: passphraseEnv is not defined in the watcher section of etc/panda/panda_harvester.cfg')
sys.exit(1)
envN... | {
"content_hash": "b11c5792627761199aa02a9f592d0814",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 105,
"avg_line_length": 32.107142857142854,
"alnum_prop": 0.7519466073414905,
"repo_name": "dougbenjamin/panda-harvester",
"id": "51bd1df2823f3079db0522760fcbeead9f6c19d2",
... |
import sys
import unittest
from mock import MagicMock
from libcloud.dns.base import Record, Zone
from libcloud.dns.types import RecordType
from libcloud.dns.types import ZoneDoesNotExistError, ZoneAlreadyExistsError
from libcloud.dns.types import RecordDoesNotExistError
from libcloud.test import LibcloudTestCase, Moc... | {
"content_hash": "e96e5b8174e434e72fd00ce4b345095b",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 79,
"avg_line_length": 49.54744525547445,
"alnum_prop": 0.5765689451974072,
"repo_name": "mgogoulos/libcloud",
"id": "5c0b041db074a37c45e2163d8475940473e007ad",
"size": "2... |
from collections import deque
class InboundPort:
inboundQueue = deque()
def receive(self, message):
self.inboundQueue.append(message)
def printAll(self):
sb = ''
for message in self.inboundQueue:
sb+=message
return sb
| {
"content_hash": "9f8400ad8b85e772864663bf6b67e3d5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 35,
"avg_line_length": 15.8,
"alnum_prop": 0.7215189873417721,
"repo_name": "terianil/epic",
"id": "3f37bd51793f46182500aace243823b8afd55b18",
"size": "237",
"binary": fa... |
import pandas as pd
import numpy as np
# In[5]:
# load the train data
data = pd.read_csv("TrainSet.txt",sep='\t')
# average the duplicates
data = data.groupby(['subject #','Compound Identifier','Intensity','Dilution']).mean() #need this to average the replicates
data.reset_index(level=[1,2,3,0], inplace=True)
# ... | {
"content_hash": "38f68205480a9bbbc6d970bd2d2c1880",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 302,
"avg_line_length": 24.721311475409838,
"alnum_prop": 0.6631299734748011,
"repo_name": "dream-olfaction/olfaction-prediction",
"id": "a68b09e5e5a5e8aeae835bbc14a102a8b54b... |
from __future__ import with_statement
import cPickle as pickle
import logging
import os
import sys
import unittest
import urlparse
import signal
from contextlib import contextmanager, nested, closing
from gzip import GzipFile
from shutil import rmtree
import time
from urllib import quote
from hashlib import md5
from te... | {
"content_hash": "f4eeae09dcbb80ccf7a0e9a5c5803e22",
"timestamp": "",
"source": "github",
"line_count": 6500,
"max_line_length": 99,
"avg_line_length": 46.21738461538462,
"alnum_prop": 0.5008538245681778,
"repo_name": "orion/swift-config",
"id": "b07166500889164a310da73f63269ceae180f92c",
"size": "... |
"""Tests for Adam."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.xla.experimental.xla_sharding import xla_sharding
from tensorflow.python.client import session
from tensorflow.python.eager import context
fro... | {
"content_hash": "043a0f2edb2f18f2863a20f6ac196ed8",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 80,
"avg_line_length": 43.06617647058823,
"alnum_prop": 0.6072505833475613,
"repo_name": "sarvex/tensorflow",
"id": "06cbc386e532419f8b4cebe1b0172b4252aff68d",
"size": "18... |
from pathlib import Path
from genopandas import GenomicDataFrame
import pytest
from pyim.model import Insertion, CisSite
from pyim.vendor.frozendict import frozendict
@pytest.fixture(scope='session')
def gtf_path():
"""Path to example GTF file."""
return Path(str(pytest.helpers.data_path('reference.gtf.gz')... | {
"content_hash": "15624b3d98f84a289c03c5a3dad47a53",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 75,
"avg_line_length": 32.3,
"alnum_prop": 0.6130030959752322,
"repo_name": "jrderuiter/pyim",
"id": "b6eb9f19806c4ce091520b67fa1f7232bfb592ea",
"size": "2261",
"binary":... |
"""
Messaging module
"""
module = "msg"
if deployment_settings.has_module(module):
# Settings
resourcename = "setting"
tablename = "%s_%s" % (module, resourcename)
table = db.define_table(tablename,
Field("outgoing_sms_handler"),
# Moved to de... | {
"content_hash": "d05c27081f82c34c8be527e881c5e6c3",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 164,
"avg_line_length": 50.135802469135804,
"alnum_prop": 0.4814495608634983,
"repo_name": "ptressel/sahana-eden-madpub",
"id": "0842a6f931eb694efef4707b220175d539c66327",
... |
CMarketRspInfoField = {
"ErrorID": "int",
"ErrorMsg": "string",
}
CMarketReqUserLoginField = {
"UserId": "string",
"UserPwd": "string",
"UserType": "string",
"MacAddress": "string",
"ComputerName": "string",
"SoftwareName": "string",
"SoftwareVersion": "string",
"AuthorCode": "s... | {
"content_hash": "20dbbc03de9f34e127478d90d088b9e2",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 44,
"avg_line_length": 24.445378151260503,
"alnum_prop": 0.5905809556548642,
"repo_name": "bigdig/vnpy",
"id": "63144a7d88b14f7dd7f990e80ac5846f044ea90e",
"size": "2909",
... |
from ctypes import *
try:
import _idaapi
except:
print("Please try me from inside IDA")
sys.exit(0)
try:
import pywraps
pywraps_there = True
print("Choose2: using pywraps")
_idaapi.choose2_create = pywraps.py_choose2_create
_idaapi.choose2_activate = pywraps.py_choose2_act... | {
"content_hash": "95fe30a4fbf687e2e4ab93fe16eeeb79",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 109,
"avg_line_length": 30.364963503649633,
"alnum_prop": 0.5667067307692307,
"repo_name": "nihilus/src",
"id": "ceb374564a0a95f00f04bdf0d307e0ade804a2f3",
"size": "8424",... |
"""Support for AquaLogic devices."""
from datetime import timedelta
import logging
import threading
import time
from aqualogic.core import AquaLogic
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistan... | {
"content_hash": "05703e399615b97e9f4b79211e12a245",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 82,
"avg_line_length": 28.72826086956522,
"alnum_prop": 0.6492622020431328,
"repo_name": "GenericStudent/home-assistant",
"id": "0c4ecaa16833b31a02db4d2c8f9433db010bb386",
... |
from collections import defaultdict
from devito.logger import info
__all__ = ['Executor']
class Executor(object):
"""
Abstract container class for a single benchmark data point.
"""
def setup(self, **kwargs):
"""
Prepares a single benchmark invocation.
"""
pass
... | {
"content_hash": "0af8aaf5d8c13825a81d3171ee6aa9b1",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 83,
"avg_line_length": 27.872340425531913,
"alnum_prop": 0.5320610687022901,
"repo_name": "opesci/devito",
"id": "878032f7a045386921c822a58eb568ace6a7db9a",
"size": "2620",... |
"""
Cool/specialized/interactive utilities which use
both STDIN and STDOUT utilities.
"""
# import sys
# import functools
from . import stdin
from . import stdout
from . import settings
from .utils import conversion
# def console_intermission(enable_on_call=True, clear=80*24):
# """
# Decorator to allow func... | {
"content_hash": "78ddddf3334b64e54425d24ea8ebbad3",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 124,
"avg_line_length": 30.796747967479675,
"alnum_prop": 0.5828933474128828,
"repo_name": "MattCCS/PyGetch",
"id": "97b9b786c3cf543dc8783fb712081b24650206b9",
"size": "37... |
import sys
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.v2 import attributes
from neutron.common import constants as q_const
from neutron.com... | {
"content_hash": "5fdffde6e1d1d031ca50449d4f201031",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 120,
"avg_line_length": 46.575182481751824,
"alnum_prop": 0.5652896188565697,
"repo_name": "wathsalav/xos",
"id": "abf0f806c241b20414f7f302105c4e826223d5aa",
"size": "3291... |
"""Runs all tests available in VisTrails modules by importing all of
them, stealing the classes that look like unit tests, and running
all of them.
runtestsuite.py also reports all VisTrails modules that don't export
any unit tests, as a crude measure of code coverage.
"""
import atexit
from distutils.version import... | {
"content_hash": "eb758fb7559c95855a767e155558700d",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 130,
"avg_line_length": 35.30314232902033,
"alnum_prop": 0.5875176710822556,
"repo_name": "minesense/VisTrails",
"id": "3e0e673a1929aa026fecb14604f5e49730cb6ec4",
"size": ... |
import os
import shutil
from ....utils import catkin_failure
from ....utils import catkin_success
from ....utils import in_temporary_directory
from ....utils import redirected_stdio
TEST_DIR = os.path.dirname(__file__)
RESOURCES_DIR = os.path.join(os.path.dirname(__file__), '..', '..', 'resources')
BUILD = ['build',... | {
"content_hash": "86c54d4c068c87e1c4c9ef39bbe04b7a",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 112,
"avg_line_length": 34.94047619047619,
"alnum_prop": 0.6616695059625213,
"repo_name": "rhaschke/catkin_tools",
"id": "ac7b9f9f58197b04c3d30b83c5a715fe625a2133",
"size":... |
import csv
import logging
SCIENCE_CSV = "missions_mission_titles_phases.csv" # Exported from CMS DB
COMBINED_TLES = "COMBINED.txt"
OUTPUT_CSV = "output.csv" # will be gratuitously, silently overwritten
OUTPUT_KEYS = [ # sucks these have to be hand-coded
'title', 'slug', 'tle_name',
'full_... | {
"content_hash": "2843a60c861e62e56a7e20cc64927f56",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 101,
"avg_line_length": 38.53703703703704,
"alnum_prop": 0.5559827006246997,
"repo_name": "koansys/isat",
"id": "710cbb846c9c382bf98fb56531255c6f3e4b0f47",
"size": "5101",... |
from setuptools import setup
__version__ = '0.5.0'
setup(name='pql',
version=__version__,
description='A python expression to MongoDB query translator',
author='Alon Horev',
author_email='alon@horev.net',
url='https://github.com/alonho/pql',
classifiers = ["Development Status :: 3 ... | {
"content_hash": "d4dee3c04152eea337f1958b296a8d64",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 95,
"avg_line_length": 42.22727272727273,
"alnum_prop": 0.5618945102260495,
"repo_name": "alonho/pql",
"id": "43d78e67c79706253898414786a7b5bf3fb2f703",
"size": "929",
"b... |
from __future__ import absolute_import
import logging
from sentry.utils.services import Service
from sentry.tasks.post_process import post_process_group
logger = logging.getLogger(__name__)
class ForwarderNotRequired(NotImplementedError):
"""
Exception raised if this backend does not require a forwarder p... | {
"content_hash": "73fefeedd5065b0b565209fe79333c8b",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 84,
"avg_line_length": 24.053097345132745,
"alnum_prop": 0.565121412803532,
"repo_name": "mvaled/sentry",
"id": "9ab3810e2231bc50904e71d8152f6ce2ca88bfbc",
"size": "2718",... |
from __future__ import annotations
from datetime import datetime
import boto3
from airflow.decorators import task
from airflow.models.baseoperator import chain
from airflow.models.dag import DAG
from airflow.providers.amazon.aws.operators.s3 import S3CreateBucketOperator, S3DeleteBucketOperator
from airflow.provider... | {
"content_hash": "5d8aa17dd18a1c2726c4691f4a5c624b",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 100,
"avg_line_length": 32.9041095890411,
"alnum_prop": 0.664654454621149,
"repo_name": "nathanielvarona/airflow",
"id": "b56efaf2ce1ba28c20ebe31b9e96c2e5327c5125",
"size"... |
from django.db import migrations
import saleor.webhook.models
class Migration(migrations.Migration):
dependencies = [
("webhook", "0005_drop_manage_webhooks_permission"),
]
operations = [
migrations.AlterField(
model_name="webhook",
name="target_url",
... | {
"content_hash": "d3818fe80ca84508907a2fb2931743c2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 72,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.6190476190476191,
"repo_name": "mociepka/saleor",
"id": "195ef0542f2f65fbffe8c6e24c01785fdbc5296e",
"size": "448"... |
"""
Functions for generating sigma algebras on finite sets.
Chetan Jhurani
http://users.ices.utexas.edu/~chetan/Publications.html
http://users.ices.utexas.edu/~chetan/reports/2009-03-ices-set_algebra_algorithms.pdf
"""
from collections import defaultdict
import numpy as np
from dit.utils import pow... | {
"content_hash": "1b300619dcf31f73c52ce220f430655c",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 88,
"avg_line_length": 29.788194444444443,
"alnum_prop": 0.5880638769087306,
"repo_name": "chebee7i/dit",
"id": "7c98779518699037f8be40609da184c1656f5405",
"size": "8579",... |
from .engine import Box2DEngine, Vec2
from nytram.engine import NytramEngine, LoopCallback
from ctypes import byref
class World:
""" Represents a World in the Box2D Engine """
def __init__(self, gravity=Vec2(0, 0), velocityIterations=10, positionIterations=10):
""" Initialize the world "... | {
"content_hash": "1c808e4005f8393f31b1a9e7db7513b6",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 112,
"avg_line_length": 37.16,
"alnum_prop": 0.6501614639397201,
"repo_name": "cloew/NytramBox2D",
"id": "d0b3f1f4ad82612b003fa0d349701628df0c9b2c",
"size": "929",
"binar... |
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundEr... | {
"content_hash": "dc017c802ba2e6db4e1f493ed8c1e56d",
"timestamp": "",
"source": "github",
"line_count": 1050,
"max_line_length": 136,
"avg_line_length": 47.56761904761905,
"alnum_prop": 0.6361670604252593,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d408f01f5c5364c9aa0f2f020847627f2a79b4c4",
... |
"""
Tests for HDBSCAN clustering algorithm
Shamelessly based on (i.e. ripped off from) the DBSCAN test code
"""
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from scipy import stats
from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils._testing import (
asser... | {
"content_hash": "e87bec0db55047116801e4f180645106",
"timestamp": "",
"source": "github",
"line_count": 654,
"max_line_length": 109,
"avg_line_length": 34.06880733944954,
"alnum_prop": 0.6540550244603025,
"repo_name": "scikit-learn-contrib/hdbscan",
"id": "9e3faa34da216bffcfaee23c34cd75f933470a67",
... |
import asyncio
from pydatacoll.protocols import BaseDevice
import pydatacoll.utils.logger as my_logger
logger = my_logger.get_logger('FORMULADevice')
class FORMULADevice(BaseDevice):
def __init__(self, device_info: dict, io_loop: asyncio.AbstractEventLoop):
super(FORMULADevice, self).__init__(device_inf... | {
"content_hash": "482932856410b0e0e49fff21ba2ff009",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.6822289156626506,
"repo_name": "timercrack/pydatacoll",
"id": "ffeaffd4252666c38abc3f71559c362a28ddd9ae",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.