text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
# Need different unic implementations for different Pythons because:
# 1) Importing unicodedata module on Jython takes a very long time, and doesn't
# seem to be necessary as Java probably already handles normalization.
# Furthermore, Jython on Java 1.5 doesn't even have unicodedata.normalize.
# 2) IronPyt... | {
"content_hash": "2599b26e501762cd39e1ec60a794ca33",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 80,
"avg_line_length": 31.75,
"alnum_prop": 0.6561679790026247,
"repo_name": "Senseg/robotframework",
"id": "dbf240a7f89cadc8452b360e7c1c2d1aaa21d2cb",
"size": "2511",
"b... |
import os
import zipfile
import shutil
from tempfile import gettempdir
from uuid import uuid4
from lagring import Asset, StorageException, AssetProcessingException
class DirectoryAsset(Asset):
"""
Asset type to store directory assets. Source can be a directory or zip archive which
is unpacked upon uploa... | {
"content_hash": "36164ff917cef9601393d868f362be50",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 88,
"avg_line_length": 31.6,
"alnum_prop": 0.5854430379746836,
"repo_name": "neoden/lagring",
"id": "5640345344fbf8e8bfcf6eefb4be1bfed09a742b",
"size": "1580",
"binary": ... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['LinearTrend'] , ['BestCycle'] , ['ARX'] ); | {
"content_hash": "4e616f983720044e1360c137b1a4b883",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 77,
"avg_line_length": 37.5,
"alnum_prop": 0.7,
"repo_name": "antoinecarme/pyaf",
"id": "c584a34d5c51c201367f583d13a7f283ca27e1c0",
"size": "150",
"binary": false,
"copi... |
'''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | {
"content_hash": "79cd9da07b21c1c8d605368a843fba6e",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 163,
"avg_line_length": 40.402255639097746,
"alnum_prop": 0.6331069135572718,
"repo_name": "barry-scott/git-workbench",
"id": "b6830989d07af080e909102c7b1ee3d75712822c",
"... |
import os
import unittest
import numpy as np
from sourcefinder import accessors
from sourcefinder.accessors.fitsimage import FitsImage
from sourcefinder.testutil.data import DATAPATH
from sourcefinder.testutil.data import fits_file
from sourcefinder.testutil.decorators import requires_data
from sourcefinder.testutil.m... | {
"content_hash": "d5e37da14f5b4dc0a655c8417d782d4c",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 89,
"avg_line_length": 40.75892857142857,
"alnum_prop": 0.5963855421686747,
"repo_name": "transientskp/pyse",
"id": "5f83fcd781caa72c2d3e2f9f155a1a7172b8714d",
"size": "18... |
from core import *
| {
"content_hash": "0abf8f657310478c4a5c3bcb33c8bb55",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.7368421052631579,
"repo_name": "breuleux/descr",
"id": "5f7bf5b224078fe840877dc1348a2275cd47b7b8",
"size": "20",
"binary": false... |
"""Unit tests for rbtools.diffs.tools.base.diff_file_result.DiffFileResult.
Version Added:
4.0
"""
import inspect
import io
from rbtools.testing import TestCase
from rbtools.diffs.tools.base.diff_file_result import DiffFileResult
class DiffFileResultTests(TestCase):
"""Unit tests for DiffFileResult."""
... | {
"content_hash": "cbb831a7f082b8f1c5d2bc62a960ef5f",
"timestamp": "",
"source": "github",
"line_count": 1052,
"max_line_length": 79,
"avg_line_length": 33.39923954372624,
"alnum_prop": 0.484375,
"repo_name": "reviewboard/rbtools",
"id": "67dce89edbc82bb5d40ed019fdb0c56c37a9feb1",
"size": "35136",
... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
"config.settings.development")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "12ab43368bb2c3ea18322bea21af5c6e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 64,
"avg_line_length": 23.272727272727273,
"alnum_prop": 0.671875,
"repo_name": "Alexx-G/django-project-template",
"id": "1881c3618b81330318e2b1e8f840a01d656b2cf9",
"size":... |
from test_framework import MonetaTestFramework
from monetarpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
def get_sub_array_from_array(object_array, to_match):
'''
Finds and returns a sub array from an array of arrays.
to_match should be a unique idetifier of a sub array... | {
"content_hash": "a4f8de15890769217d0aed97151bf60c",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 139,
"avg_line_length": 44.71875,
"alnum_prop": 0.610062893081761,
"repo_name": "habibmasuro/moneta-0.10.0",
"id": "7e4a6002c3e9c3d86e40aa60ef5e897cad08f959",
"size": "740... |
import logging
import os
from collections import defaultdict, deque
from copy import deepcopy
from random import shuffle
from sys import exit
from threading import Lock, Thread, Event
logging.basicConfig(level=logging.INFO, format='%(name)s %(threadName)s: %(message)s')
LOG = logging.getLogger('scheduler')
LOG.setLev... | {
"content_hash": "135284465f7676933d6fc4adea43dc47",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 96,
"avg_line_length": 40.76724137931034,
"alnum_prop": 0.6641996193698456,
"repo_name": "henryr/Impala",
"id": "bc98c587980141fe2dfb01ece9274223afe3db7a",
"size": "5583",... |
"""The File Upload integration."""
from __future__ import annotations
import asyncio
from collections.abc import Iterator
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
import shutil
import tempfile
from aiohttp import web
import voluptuous as vol
from homeassistant.... | {
"content_hash": "b87d4de37d47815e8b2492bcbb882019",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 90,
"avg_line_length": 31.126373626373628,
"alnum_prop": 0.6457193292144748,
"repo_name": "w1ll1am23/home-assistant",
"id": "9f548e1445939e5dda7c3357e9acbb6d6f2de949",
"si... |
from pymongo import MongoClient, MongoReplicaSetClient
from tapiriik.settings import MONGO_HOST, MONGO_REPLICA_SET, MONGO_CLIENT_OPTIONS, REDIS_HOST
# MongoDB
client_class = MongoClient if not MONGO_REPLICA_SET else MongoReplicaSetClient
if MONGO_REPLICA_SET:
MONGO_CLIENT_OPTIONS["replicaSet"] = MONGO_REPLICA_SET
_... | {
"content_hash": "151f6e849c1d2bf1d07f23a8ff3c3209",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 93,
"avg_line_length": 26.8125,
"alnum_prop": 0.7727272727272727,
"repo_name": "gavioto/tapiriik",
"id": "86b8a51528dc1f95592d3a021be3a8b4709ff5bd",
"size": "858",
"binar... |
#!/usr/bin/env python
"""
python %prog [options] <in_schema.xsd> <out_schema.xsd>
Synopsis:
Prepare schema document. Replace include and import elements.
Examples:
python %prog myschema.xsd
python %prog myschema.xsd newschema.xsd
python %prog -f myschema.xsd newschema.xsd
cat infile.xsd | pyth... | {
"content_hash": "e2f2c05eb2d560966280ead93d9cde58",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 78,
"avg_line_length": 31.833948339483396,
"alnum_prop": 0.5740697809203663,
"repo_name": "ricksladkey/generateDS",
"id": "a0902de74cb6a000027b783410a6b4b3103253cd",
"size... |
import unittest
if False:
import os, sys, imp
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../../../"))
imp.load_module('electroncash', *imp.find_module('lib'))
imp.load_module('electroncash_gui', *imp.find_module('gui/qt'))
imp.load_module('electroncash_plugins', *imp.find_module(... | {
"content_hash": "ce85164415f1c8b5f8f117b1a87029aa",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 101,
"avg_line_length": 36.56701030927835,
"alnum_prop": 0.6630955737242741,
"repo_name": "fyookball/electrum",
"id": "27031afb7a4a5b5e3a23cad231873e5a311ee667",
"size": "3... |
from ..constructs import Instruction
class Trie(object):
BUCKET_LEN = 1
BUCKET_MASK = (2**BUCKET_LEN)-1
def __init__(self):
self.children = [None for _ in range(2**Trie.BUCKET_LEN)]
self.value = None
def __setitem__(self, key, value):
assert type(value) == Instruction
... | {
"content_hash": "a3f78b9e1aa61bfdd526ac45f51bb8b6",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 84,
"avg_line_length": 33.421052631578945,
"alnum_prop": 0.494488188976378,
"repo_name": "isislab/dispatch",
"id": "e6de4d7db0a9316b047ba425c2692a42d9442369",
"size": "2540... |
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
# pylint: disable=too-many-lines
from __future__ import print_function
import atexit
import copy
import json
import os
import re
import shutil
import subprocess
import tempfile
# pylint: disable=import-error
try:
import ruamel.yaml as yaml
ex... | {
"content_hash": "07fefed3f875876e0d2b42e10fc169c5",
"timestamp": "",
"source": "github",
"line_count": 2714,
"max_line_length": 118,
"avg_line_length": 34.16691230655859,
"alnum_prop": 0.5456976781805045,
"repo_name": "twiest/openshift-tools",
"id": "c00eee381b696fe4611af9f9f9e8573cdee069ea",
"siz... |
"""
==============================
Test for qplotutils.chart.view
==============================
Autogenerated package stub.
"""
import unittest
import logging
import sys
import os
import numpy as np
from qtpy.QtCore import *
from qtpy.QtGui import *
from qtpy.QtOpenGL import *
from qtpy.QtWidgets import *
from qp... | {
"content_hash": "14608cb4f3801a80a09f0dcd7577ce52",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 73,
"avg_line_length": 20.705882352941178,
"alnum_prop": 0.5648243801652892,
"repo_name": "unrza72/qplotutils",
"id": "4928957a2d20d839d131cb9540f6d2936874d3a9",
"size": "... |
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
typos={'feature':'features','sources':'source','targets':'target','include':'includes','export_include':'export_includes','define':'defines','importpath':'includes','installpath':'install_path',}
meths_typos=['__call__','program','shlib','stlib','ob... | {
"content_hash": "a59cff99fd5c46902e242a0db008351a",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 195,
"avg_line_length": 34.83221476510067,
"alnum_prop": 0.666281310211946,
"repo_name": "dproc/trex_odp_porting_integration",
"id": "be501299f9ec2d1f18e181dd4bd5abb720a24e2... |
""" Cloud API asynchronous "PDF To Text" job example.
Allows to avoid timeout errors when processing huge or scanned PDF documents.
"""
import os
import requests # pip install requests
import time
import datetime
# The authentication key (API Key).
# Get your own by registering at https://app.pdf.co
API_KEY = "***... | {
"content_hash": "cc83d6477ecac9c0ae9c34d4ac37b182",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 110,
"avg_line_length": 34.68,
"alnum_prop": 0.5628604382929643,
"repo_name": "bytescout/ByteScout-SDK-SourceCode",
"id": "67ac1a64851f93367116969a3518bf424e0e7e51",
"size... |
''' author @ esilgard '''
#
# Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center
#
# 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... | {
"content_hash": "183aa19f989f06bb9ab9e677b0874e42",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 139,
"avg_line_length": 58.73856209150327,
"alnum_prop": 0.49371314120396126,
"repo_name": "esilgard/argos_nlp",
"id": "9f39bcbe7f51b69a0d0b91bfce11abe29c548c9a",
"size": ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserKey.last_used'
db.add_column('sshkey_userkey', 'last_used', self.gf('django.db.models.fields.DateTimeFie... | {
"content_hash": "67e77cd43d4c79813dc294296cf5326e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 182,
"avg_line_length": 66.7,
"alnum_prop": 0.5564360676804455,
"repo_name": "ClemsonSoCUnix/django-sshkey",
"id": "68903ce03b8cba91b56da051af5b845b82528643",
"size": "4687... |
from __future__ import absolute_import
import unittest
from unittest import skipIf
import numpy as np
try:
import pandas as pd
is_pandas = True
except ImportError as e:
is_pandas = False
class TestBokehJSONEncoder(unittest.TestCase):
def setUp(self):
from bokeh._json_encoder import BokehJS... | {
"content_hash": "a9bad01f8cd391a7b36fd7fa37953016",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 84,
"avg_line_length": 34.23275862068966,
"alnum_prop": 0.5817174515235457,
"repo_name": "gpfreitas/bokeh",
"id": "a351bb8baa8ce60d634978fe4c3b2b23076cfe48",
"size": "3971... |
import numpy as np
from jax.util import safe_map, safe_zip
from jax.core import Primitive
from jax.interpreters import ad, xla, batching, numpy_eval
from jax.lax import dynamic_update_slice_p
map = safe_map
zip = safe_zip
inplace_dynamic_update_slice_p = Primitive('inplace_dynamic_update_slice')
inplace_dynamic_updat... | {
"content_hash": "bd303d698db87f71c350bb313e61d1b6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 86,
"avg_line_length": 41.76923076923077,
"alnum_prop": 0.7707182320441989,
"repo_name": "j-towns/fastar",
"id": "f10ebf7713d70345c61827454dab1e807016ca19",
"size": "1086",... |
import rgplot
| {
"content_hash": "0b5fe660760c0be6929838f2fd9ddbe6",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 13,
"avg_line_length": 14,
"alnum_prop": 0.8571428571428571,
"repo_name": "vjuranek/rg-offline-plotting",
"id": "a08f452881e2e561a36ca7367631555bf4f12b85",
"size": "14",
"... |
from __future__ import unicode_literals, print_function
import frappe
import hashlib
from frappe.model.db_schema import DbManager
from frappe.installer import get_root_connection
from frappe.database import Database
import os
from markdown2 import markdown
from bs4 import BeautifulSoup
import jinja2.exceptions
from s... | {
"content_hash": "edfba66c884b1979b824a893476d1fa0",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 109,
"avg_line_length": 30.738255033557046,
"alnum_prop": 0.6354803493449782,
"repo_name": "tmimori/frappe",
"id": "45971820c0c91f8d35cdaba0834fc93548b9c0a2",
"size": "928... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.node import PipeUnderground
log = logging.getLogger(__name__)
class TestPipeUnderground(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstemp()... | {
"content_hash": "69f8f8e91f575fbc3255043ab6fb37fd",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 139,
"avg_line_length": 42.36486486486486,
"alnum_prop": 0.6889952153110048,
"repo_name": "rbuffat/pyidf",
"id": "2e951d342ca9df4737920641062aed282e12cb49",
"size": "3135",... |
from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter
from allauth.account.models import EmailAddress
class MyAccountAdapter(DefaultAccountAdapter):
def pre_social_login(self, request, sociallogin):
"""
Invoked just after a user successfully authenticates via a
... | {
"content_hash": "0fdf5edaf16a68e52653586005c6e2d6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 80,
"avg_line_length": 40.04081632653061,
"alnum_prop": 0.663098878695209,
"repo_name": "c24b/playlab",
"id": "6520070f55ad1281630c486f1b2f2a95511497d5",
"size": "1990",
... |
__credits__ = ["Daniel McDonald", "Greg Caporaso", "Doug Wendel",
"Jai Ram Rideout"]
| {
"content_hash": "977f8edb1965566c03e194da08d6bd7e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 65,
"avg_line_length": 50,
"alnum_prop": 0.56,
"repo_name": "biocore/pyqi",
"id": "87fe705947355ce3e5afe5bf02d0e8553bff9737",
"size": "473",
"binary": false,
"copies": "... |
"""
.. module:: utilities
:platform: Unix
:synopsis: Helpful function for ScatterBrane
.. moduleauthor:: Katherine Rosenfeld <krosenf@gmail.com>
.. moduleauthor:: Michael Johnson
"""
from __future__ import print_function
import numpy as np
from scipy.interpolate import RectBivariateSpline
from scipy.ndimage.... | {
"content_hash": "f2fb37230de161ebe2fb3bc20451a8ea",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 132,
"avg_line_length": 32.58201058201058,
"alnum_prop": 0.6295875284183177,
"repo_name": "krosenfeld/scatterbrane",
"id": "318109b52f59f97f58544d578401e4239d639a0e",
"siz... |
"""This module is deprecated. Please use `airflow.providers.databricks.hooks.databricks`."""
import warnings
# pylint: disable=unused-import
from airflow.providers.databricks.hooks.databricks import ( # noqa
CANCEL_RUN_ENDPOINT, GET_RUN_ENDPOINT, RESTART_CLUSTER_ENDPOINT, RUN_LIFE_CYCLE_STATES, RUN_NOW_ENDPOINT,... | {
"content_hash": "684cf857b774e98b61bc1889501dedb0",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 109,
"avg_line_length": 39.86666666666667,
"alnum_prop": 0.7725752508361204,
"repo_name": "wileeam/airflow",
"id": "3c610e316c21aef4add7d0c700646411e19ba55a",
"size": "1385... |
"""
Esercizio 1: ricerca dei percorsi dei file a partire da una cartella
python3 23_03_es1.py <cartella_di_partenza>
"""
import os
import sys
import pathlib
import stat
def insert_dict(dictlink, key, value):
"""
Inserisce un nuovo elemento nel dizionario rispettando il default
"""
if key not in dictlin... | {
"content_hash": "bd912e94cf8a374f1e9904da880609cd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 77,
"avg_line_length": 28.959183673469386,
"alnum_prop": 0.6102889358703312,
"repo_name": "sb00nk/PythonExercises",
"id": "212dd8a58dfb985a587916989bfe2380afe6a785",
"size"... |
import re
from enum import Enum
from knack.log import get_logger
from knack.util import CLIError
from msrestazure.azure_exceptions import CloudError
from azure.cli.core.azclierror import (
ArgumentUsageError,
BadRequestError,
InvalidArgumentValueError,
RequiredArgumentMissingError,
ResourceNotFoundE... | {
"content_hash": "05499451ea105c2ed3fde1d3f30b88ed",
"timestamp": "",
"source": "github",
"line_count": 1660,
"max_line_length": 210,
"avg_line_length": 55.76144578313253,
"alnum_prop": 0.6766669547556285,
"repo_name": "yugangw-msft/azure-cli",
"id": "678605da12485347c5b123681ed2df29534c1807",
"siz... |
"""
AUTO-GENERATED BY `scripts/generate_protocol.py` using `data/browser_protocol.json`
and `data/js_protocol.json` as inputs! Please do not modify this file.
"""
import logging
from typing import Any, Optional, Union
from chromewhip.helpers import PayloadMixin, BaseEvent, ChromeTypeBase
log = logging.getLogger(__na... | {
"content_hash": "6f1ad6947b0b4384eef63da5f3b27d6d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 121,
"avg_line_length": 32.27777777777778,
"alnum_prop": 0.6075731497418244,
"repo_name": "chuckus/chromewhip",
"id": "010839aeddb6fc580438c259bcecbea9c1b0722e",
"size": "1... |
from mistral.db.v2.sqlalchemy import models
from mistral.engine import tasks
from mistral.tests.unit import base
from mistral.workflow import states
# TODO(rakhmerov): This test is a legacy of the previous 'with-items'
# implementation when most of its logic was in with_items.py module.
# It makes sense to add more t... | {
"content_hash": "c12de4cde106045dcf044d0fdeb7ae6e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 71,
"avg_line_length": 32.5625,
"alnum_prop": 0.581573896353167,
"repo_name": "StackStorm/mistral",
"id": "9ba5dda565b9de6571b3252cfc148db853e335dc",
"size": "2172",
"bin... |
"""The gateway tests for the august platform."""
from unittest.mock import MagicMock, patch
from august.authenticator_common import AuthenticationState
from homeassistant.components.august.const import DOMAIN
from homeassistant.components.august.gateway import AugustGateway
from tests.components.august.mocks import ... | {
"content_hash": "a14edeb48cae907e2ac82a1888376ebb",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 91,
"avg_line_length": 38.81132075471698,
"alnum_prop": 0.7578998541565386,
"repo_name": "partofthething/home-assistant",
"id": "ced073600082da14ffcb9818acd17b942156dc03",
... |
import array
import binascii
import zmq
import struct
port = 25332
zmqContext = zmq.Context()
zmqSubSocket = zmqContext.socket(zmq.SUB)
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashbrick")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawbrick")
zmqSubSocket.setsockopt(zmq.SU... | {
"content_hash": "833c94ce3aa0333d25820c388b39e7f2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 56,
"avg_line_length": 31.025641025641026,
"alnum_prop": 0.6016528925619835,
"repo_name": "magacoin/magacoin",
"id": "93bf0354d2774b04fcb57be91f2dc5f19211bffd",
"size": "14... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('callback_request', '0006_auto_20161123_2118'),
]
operations = [
migrations.AddField(
model_name='callbackrequest',
name='err... | {
"content_hash": "e612304d324771055458c288fafcb523",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 151,
"avg_line_length": 29.25,
"alnum_prop": 0.5925925925925926,
"repo_name": "steppenwolf-sro/callback-schedule",
"id": "20583d8980cfc02f29b9c692159ab23868d00fdf",
"size":... |
import unittest
from libsaas import http
from libsaas.filters import auth
class BasicAuthTestCase(unittest.TestCase):
def test_simple(self):
auth_filter = auth.BasicAuth('user', 'pass')
req = http.Request('GET', 'http://example.net/')
auth_filter(req)
self.assertEqual(req.header... | {
"content_hash": "9911d5cb65e26de35d3a75bfc5751f41",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 32.833333333333336,
"alnum_prop": 0.5930626057529611,
"repo_name": "ducksboard/libsaas",
"id": "c59071625e151f70b55c3654646a1fd975fc3cd0",
"size": "1... |
"""
Unit tests for the da.cli module.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache License, Version 2.0 (the License);
you may not use this file exc... | {
"content_hash": "0238f2c6cb62334d14948bd43b1ef631",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 22.78174603174603,
"alnum_prop": 0.47709458282529177,
"repo_name": "wtpayne/hiai",
"id": "74d415356671793d8b0771fb9156fd5ebe35c3ae",
"size": "5765",... |
"""
Classes for making VMware VI SOAP calls.
"""
import httplib
from oslo.config import cfg
import suds
from nova.openstack.common.gettextutils import _
from nova import utils
from nova.virt.vmwareapi import error_util
RESP_NOT_XML_ERROR = 'Response is "text/html", not "text/xml"'
CONN_ABORT_ERROR = 'Software cause... | {
"content_hash": "6ad91b22c7271683b608eaa05f733d8a",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 76,
"avg_line_length": 38.92342342342342,
"alnum_prop": 0.5747020020830922,
"repo_name": "sacharya/nova",
"id": "b860586e912f5f4749c43430b3bf00d1d6c1583b",
"size": "9375",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('acelibraryapp', '0008_auto_20161120_2040'),
]
operations = [
migrations.AlterField(
model_name='resources',
name='URL',
... | {
"content_hash": "dc56dcd9cde89ba55ff28198e46b5133",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 21.38888888888889,
"alnum_prop": 0.5974025974025974,
"repo_name": "ashishpahwa7/Library-Portal",
"id": "cfc66d055cf0e10bbca8b146433da2ca26fd69c4",
"s... |
from __future__ import absolute_import
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
from copy import deepcopy
import logging
import random
import string
# Import Salt Testing libs
from salttesting.unit import skipIf, TestCase
from salttesting.mock import (
MagicMock,... | {
"content_hash": "75f50bf0211fa755afd4a1ae6ff4d19c",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 199,
"avg_line_length": 34.52987012987013,
"alnum_prop": 0.5130886114036407,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "4049e9ae20c79dc954af4e0b1b9eee5a02c... |
"""
Runs the SPARQL 1.1 test suite from.
"""
from test.data import TEST_DATA_DIR
from test.utils import ensure_suffix
from test.utils.dawg_manifest import MarksDictType, params_from_sources
from test.utils.iri import URIMapper
from test.utils.sparql_checker import (
SKIP_TYPES,
SPARQLEntry,
check_entry,
... | {
"content_hash": "3bce9e6b5bd530fbd8aa7a809d8709d4",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 87,
"avg_line_length": 39.3041825095057,
"alnum_prop": 0.6775660249588855,
"repo_name": "RDFLib/rdflib",
"id": "6bfcb31f1ba6a4c9eb4b8734d3dbe2588d846760",
"size": "10337",... |
from django.conf import settings
STAR_RATINGS_RANGE = getattr(settings, "STAR_RATINGS_RANGE", 5)
| {
"content_hash": "15d9aaf2aa8277944490e0b7c850fa60",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 63,
"avg_line_length": 24.75,
"alnum_prop": 0.7676767676767676,
"repo_name": "citizenline/citizenline",
"id": "1df914d19f4e44417be872b6fbe3012660d769fb",
"size": "99",
"bi... |
import mock
from neutron.openstack.common import jsonutils
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.common import utils as nsx_utils
from neutron.plugins.vmware import nsxlib
from neutron.plugins.vmware.nsxlib import l2gateway as l2gwlib
from neutron.plugins.vmware.nsxlib imp... | {
"content_hash": "6df6bd207ee9af4f648c27ae20acc68d",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 45.20996441281139,
"alnum_prop": 0.5576983627204031,
"repo_name": "samsu/neutron",
"id": "006ad38648dd021b3f056ff324388fafd473c748",
"size": "13288"... |
import datetime
import itertools
import unittest
from copy import copy
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.fields import (
BigIntegerField, BinaryField, BooleanField, CharField, DateTimeField,
Intege... | {
"content_hash": "4f9fc5bb0ea1712c25b0c7fee8491ce6",
"timestamp": "",
"source": "github",
"line_count": 1508,
"max_line_length": 125,
"avg_line_length": 43.28978779840849,
"alnum_prop": 0.6144513717620748,
"repo_name": "shtouff/django",
"id": "5128c9ec1e1960d945d9d78b7af11d233c628ab7",
"size": "652... |
import boto
from boto.connection import AWSQueryConnection
from boto.regioninfo import RegionInfo
from boto.exception import JSONResponseError
from boto.cloudsearch2 import exceptions
from boto.compat import json
class CloudSearchConnection(AWSQueryConnection):
"""
Amazon CloudSearch Configuration Service
... | {
"content_hash": "a56c42dfc8fb4bf59f566e29f6eb48fd",
"timestamp": "",
"source": "github",
"line_count": 757,
"max_line_length": 79,
"avg_line_length": 41.093791281373846,
"alnum_prop": 0.611996913977112,
"repo_name": "kyleknap/boto",
"id": "fdc9d4c625026531e6e2f682971895817f6e3c0b",
"size": "32232"... |
from enum import Enum
from typing import Iterable, List, Set, Tuple, Type, Union
def enum_to_choices(enumeration: Type[Enum]) -> Iterable[Tuple]:
return tuple((e.value, e.value) for e in enumeration)
def enum_to_set(enumeration: Type[Enum]) -> Set:
return set(e.value for e in enumeration)
def values_to_ch... | {
"content_hash": "d2d46694ddfd16574c0739a795cc2d91",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 30.785714285714285,
"alnum_prop": 0.7122969837587007,
"repo_name": "polyaxon/polyaxon",
"id": "eadf572bb2424b92d487d54a9e9bb0f58a12ac40",
"size": "10... |
'''
@author Angel -Ote- Cortes
@version 0.1
Anonymizer is a class based on the requests package to simplify the use of proxies and Tor.
The class automatically select a proxy from a list, change headers randomly and keep control of not working proxies.
Copyright (C) 2012 Angel Cortés
All rights reserved.
Redistrib... | {
"content_hash": "c9c8e4efc094de6449c7fafb5b31813d",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 158,
"avg_line_length": 43.45703125,
"alnum_prop": 0.6314606741573033,
"repo_name": "OteCortes/Anopymizer",
"id": "362998b22aa4236ae7c6fd7aebe46c56727579c8",
"size": "1115... |
"""Tests for record_input_op."""
import os
from tensorflow.python.framework import test_util
from tensorflow.python.framework.errors_impl import NotFoundError
from tensorflow.python.lib.io import tf_record
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import variables
from tensorflow.pyth... | {
"content_hash": "66183f1f7518593d9a4db19cffce6647",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 80,
"avg_line_length": 32.06547619047619,
"alnum_prop": 0.6047893075923519,
"repo_name": "gautam1858/tensorflow",
"id": "8ab4e45bf09bcfa968e00d41be256d69b98cca5a",
"size":... |
"""Ops and optimizations for using BLAS calls
BLAS = Basic Linear Algebra Subroutines
Learn more about BLAS here:
http://www.netlib.org/blas/blast-forum/
The standard BLAS libraries implement what is called "legacy BLAS" in that
document.
This documentation describes Theano's BLAS optimization pipeline.
Where th... | {
"content_hash": "6e57160e5f3a110fe682cbef2e44d17b",
"timestamp": "",
"source": "github",
"line_count": 2443,
"max_line_length": 118,
"avg_line_length": 37.79410560785919,
"alnum_prop": 0.5099587354193066,
"repo_name": "surgebiswas/poker",
"id": "c63bf6dd68e35c05b4b8bd12de2b1fb88c6410e2",
"size": "... |
"""
Testing for pipeline_grid_search module.
"""
from __future__ import print_function
from __future__ import division
import time
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin
from sklearn.cross_validation import StratifiedKFold
from sklearn.datasets import make_class... | {
"content_hash": "f506edad0c8435d84382c80f8a6b272c",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 176,
"avg_line_length": 37.17625899280576,
"alnum_prop": 0.5707789066279633,
"repo_name": "tkerola/pipeline_grid_search",
"id": "08f99bf099b509bb037360e36725eb363dadd17f",
... |
"""
async requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
"""
import logging
__title__ = 'requests-futures'
__version__ = '0.9.7'
__build__ = 0x000000
__author__ = 'Ross McFarland'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Ross McFarland'
# Set default logging handler to avoid "No handler found" warni... | {
"content_hash": "1fd0f36f4dec862f543a97fe32f537b5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 67,
"avg_line_length": 21.8,
"alnum_prop": 0.6422018348623854,
"repo_name": "eenchev/idea-note-taking-app",
"id": "9ac9cd31585cf5bded7298b92a726cbed1572432",
"size": "590",... |
import time, parallel, threading, Tkinter
from optparse import OptionParser
class parallelBuffer(threading.Thread):
def __init__(self, pwmHertz = 60.0):
"""
Initilization.
@param pwmHertz Optional parameter to set PWM frequency.
"""
threading.Thread.__init__(self, name='ParallelBufferThread')
self.pwmTot... | {
"content_hash": "dd663cbcb67ffc2d3864613ece6aed15",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 114,
"avg_line_length": 27.77948717948718,
"alnum_prop": 0.6479601255307366,
"repo_name": "JoshuaJB/pyParallel-PWM",
"id": "697e21924c67c522c725b3dc52d7dd7a67274786",
"siz... |
def is_preprocessed_formdata(valuelist):
if len(valuelist) != 1:
return False
value = valuelist[0]
return isinstance(value, (dict, list))
| {
"content_hash": "58e4a826b9f77fecab5b8ee614b8d759",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 31.6,
"alnum_prop": 0.6582278481012658,
"repo_name": "ThiefMaster/indico",
"id": "487ac47216c8a71c020282c58ffdaf187dcf5909",
"size": "372",
"binary"... |
"""This example gets all custom targeting keys and the values. To create custom
targeting keys and values, run create_custom_targeting_keys_and_values.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are... | {
"content_hash": "41d65748b71e4d7223c8be7db40986ee",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 80,
"avg_line_length": 34.53030303030303,
"alnum_prop": 0.6375603334795963,
"repo_name": "caioserra/apiAdwords",
"id": "dccaed6457e2771b5545ddbc81c6e60b6258adf4",
"size": "... |
import unittest
import tempfile
import os
import shutil
from arena.local_arena import LocalIOArena
from arena.hand_log import HandLog
from pokeher.actions import GameAction
class PyArenaTest(unittest.TestCase):
def test_arena_methods(self):
"""Make sure the arena can do everything it needs to"""
... | {
"content_hash": "0099edcae5a3a19ecb5cb843f38863b1",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 133,
"avg_line_length": 33.92537313432836,
"alnum_prop": 0.6159260888693356,
"repo_name": "gnmerritt/poker",
"id": "e9c6308bc1ce08ad03912fb1895c18c098ed2594",
"size": "2273... |
import BaseHTTPServer
import bisect
import cgi
import cmd
import codecs
import ctypes
import datetime
import disasm
import mmap
import optparse
import os
import re
import sys
import types
import urllib
import urlparse
import v8heapconst
import webbrowser
PORT_NUMBER = 8081
USAGE="""usage: %prog [OPTIONS] [DUMP-FILE]... | {
"content_hash": "c6b855b279f96d17118862df20287f44",
"timestamp": "",
"source": "github",
"line_count": 3165,
"max_line_length": 81,
"avg_line_length": 33.95608214849921,
"alnum_prop": 0.6333522531659703,
"repo_name": "nekulin/arangodb",
"id": "8986a91b5c318302c0f8ee8601d8919df675d9d6",
"size": "10... |
import sys
import config_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
class Skia(config_util.Config):
"""Basic Config class for the Skia repository."""
@staticmethod
def fetch_spec(_props):
solution = {
'name' : 'sk... | {
"content_hash": "91cd64ea3449c40cb4f58bd2413c9a88",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 71,
"avg_line_length": 20.405405405405407,
"alnum_prop": 0.5894039735099338,
"repo_name": "junhuac/MQUIC",
"id": "930173a0c22e07732143fc3abcc0ff44d69486fb",
"size": "918",
... |
from unittest import mock
from oslotest import base
from monasca_api.common.rest import exceptions
from monasca_api.common.rest import utils
class TestRestUtils(base.BaseTestCase):
def setUp(self):
super(TestRestUtils, self).setUp()
self.mock_json_patcher = mock.patch('monasca_api.common.rest.u... | {
"content_hash": "35be15991a7f5ef91ea6bba151f2520a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 81,
"avg_line_length": 31.159420289855074,
"alnum_prop": 0.6576744186046511,
"repo_name": "openstack/monasca-api",
"id": "33e60066c6c2117e0895af01a1004f9b04497e18",
"size":... |
import argparse
import re
# Taken from http://genomewiki.ucsc.edu/index.php/Hg19_Genome_size_statistics
HG19_NON_N_GENOME_SIZE = 2897310462
def scrape_bamstat(statsfile, threshold=7):
proper_exp = re.compile(r'Proper pairs\s*(\d+)')
insert_exp = re.compile(r'Actual FR median insert size:\s*(\d+)')
dev_ex... | {
"content_hash": "1ba2426dc979bc6a8b5e3349965a31c2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 40.32727272727273,
"alnum_prop": 0.6172227231740307,
"repo_name": "talkowski-lab/Holmes",
"id": "66fc230f5ca571dc561970ea569b6b9185cbec8d",
"size": "... |
"""
pyinotify
@author: Sebastien Martini
@license: MIT License
@contact: seb@dbzteam.org
"""
class PyinotifyError(Exception):
"""Indicates exceptions raised by a Pyinotify class."""
pass
class UnsupportedPythonVersionError(PyinotifyError):
"""
Raised on unsupported Python versions.
"""
def _... | {
"content_hash": "7f75902de17ff3886c320b8903e4b434",
"timestamp": "",
"source": "github",
"line_count": 2108,
"max_line_length": 80,
"avg_line_length": 37.28795066413662,
"alnum_prop": 0.5553477602636032,
"repo_name": "dunkfordyce/pyinotify",
"id": "467a5217664794b280ea8b059c8243fe9295018e",
"size"... |
from __future__ import division
# Local RGZ modules
import rgz
import consensus
from load_contours import get_contours,make_pathdict
# Default packages
import json
import cStringIO
import urllib
import time
import random
import os
from ast import literal_eval
from collections import Counter
# Other packages
impor... | {
"content_hash": "09fca722b8fc4017b1d631bbef9edc06",
"timestamp": "",
"source": "github",
"line_count": 1288,
"max_line_length": 176,
"avg_line_length": 34.34549689440994,
"alnum_prop": 0.5834030336596062,
"repo_name": "willettk/rgz-analysis",
"id": "3ea925c2f64b73425edc6066e63356d8e728dd80",
"size... |
"""Tests for classes and methods relating to user rights."""
from core.domain import collection_services
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import rights_manager
from core.domain import user_services
from core.tests import test_utils
class ExplorationRightsTests(... | {
"content_hash": "30b2cbc4319a99a3e82049d4822e3b63",
"timestamp": "",
"source": "github",
"line_count": 860,
"max_line_length": 78,
"avg_line_length": 45.78139534883721,
"alnum_prop": 0.6604947678553287,
"repo_name": "AllanYangZhou/oppia",
"id": "6983dcd2540be7c55340e31dd64c73ddf32ef6a8",
"size": "... |
__author__ = "Fabio Tea <ft2011@gmail.com>"
import feedparser
from urllib.request import urlopen
from sopel.tools import SopelMemory, SopelMemoryWithDefault
from sopel.module import commands, example, NOLIMIT, require_privilege, OP, require_admin
from sopel.config.types import (StaticSection, ValidatedAttribute,... | {
"content_hash": "549494610b8cd6496aed2fac4c4d895f",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 89,
"avg_line_length": 30.42063492063492,
"alnum_prop": 0.6146621445343073,
"repo_name": "f4bio/sopel-rss",
"id": "5623a88f64b146f7f85e15a1de23ef1c4490ffdc",
"size": "3833... |
import errno
import logging
import os
from ceph_deploy import hosts, exc
from ceph_deploy.lib import remoto
LOG = logging.getLogger(__name__)
def distro_is_supported(distro_name):
"""
An enforcer of supported distros that can differ from what ceph-deploy
supports.
"""
supported = ['centos', 'red... | {
"content_hash": "8228d6ec6d5dfc6301c4b636cf4a267f",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 95,
"avg_line_length": 29.055555555555557,
"alnum_prop": 0.5984703632887189,
"repo_name": "codenrhoden/ceph-deploy",
"id": "9bbea65ce29d1a6edec9c41d5141d7a83b58cdea",
"siz... |
"""
Common functions
Marco Lui, January 2013
"""
from itertools import islice
import marshal
class Enumerator(object):
"""
Enumerator object. Returns a larger number each call.
Can be used with defaultdict to enumerate a sequence of items.
"""
def __init__(self, start=0):
self.n = start
def __call_... | {
"content_hash": "cfca8098af0a19ebce260945e4d1f69b",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 97,
"avg_line_length": 24.25,
"alnum_prop": 0.655081001472754,
"repo_name": "plamenbbn/XDATA",
"id": "e7b2d18fb5b70865966d23fe7e62eba8fd88b6ce",
"size": "3395",
"binary"... |
"""
Django settings for rbe project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths insi... | {
"content_hash": "899b7d40d5d651c7d8a7455433117b72",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 71,
"avg_line_length": 25.634615384615383,
"alnum_prop": 0.6864216054013503,
"repo_name": "install-logos/RiceBE",
"id": "2284cc3f337cba60db061c0f05b751838237b684",
"size":... |
import os
import shutil
import snapcraft
class WafPlugin(snapcraft.BasePlugin):
@classmethod
def schema(cls):
schema = super().schema()
schema['properties']['configflags'] = {
'type': 'array',
'minitems': 1,
'uniqueItems': True,
'items': {
... | {
"content_hash": "bc36d7f0d3673b74ec59236558b739b4",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 85,
"avg_line_length": 34.13157894736842,
"alnum_prop": 0.5169622205088666,
"repo_name": "Zap123/snappy-playpen",
"id": "01771c957103ca618daa4c8a5cb62f9b0e8d1078",
"size": ... |
from setuptools import setup, find_packages
# Get the long description from the relevant file
# with codecs_open('README.rst', encoding='utf-8') as f:
# long_description = f.read()
setup(name='mica',
version='0.0.1',
description=u"Matplotlib Improved Color Abbreviations",
#long_description=lon... | {
"content_hash": "ab89848cec3f45b4f6c4efabc60f0fbb",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 28.806451612903224,
"alnum_prop": 0.6136618141097424,
"repo_name": "julianirwin/mica",
"id": "fe49d3b079b6661b4e72caa469d3545b551e756b",
"size": "934... |
import os
import unittest
import imath
import IECore
import Gaffer
import GafferTest
import GafferScene
import GafferSceneTest
class SubTreeTest( GafferSceneTest.SceneTestCase ) :
def testPassThrough( self ) :
a = GafferScene.SceneReader()
a["fileName"].setValue( os.path.dirname( __file__ ) + "/alembicFiles/... | {
"content_hash": "c36108af9b3f88f446aa30fa30f49966",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 128,
"avg_line_length": 29.547169811320753,
"alnum_prop": 0.6330353341847594,
"repo_name": "ImageEngine/gaffer",
"id": "7cc4f8c5f13f6860deb0c678632443afc64818e1",
"size": ... |
"""Database setup and migration commands."""
from nova import utils
IMPL = utils.LazyPluggable(
'baremetal_db_backend',
sqlalchemy='nova.virt.baremetal.db.sqlalchemy.migration')
INIT_VERSION = 0
def db_sync(version=None):
"""Migrate the database to `version` or the most recent version."""
... | {
"content_hash": "71f1eef4038a0520b445c13c645a2b32",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 71,
"avg_line_length": 22.7,
"alnum_prop": 0.6916299559471366,
"repo_name": "houshengbo/nova_vmware_compute_driver",
"id": "40631bf45c8218121b847352d19865a54773c20c",
"size... |
import logging
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import sys
import cv2
import math
class ClassifyEnv(gym.Env):
def __init__(self, trainSet, target, batch_size=1000, accuracy_mode=False):
"""
Data set is a tuple of
[0] input data: [nSamples x ... | {
"content_hash": "68f659b33636b54e3d946c630c2a5c9f",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 79,
"avg_line_length": 26.45,
"alnum_prop": 0.6021653205018044,
"repo_name": "google/brain-tokyo-workshop",
"id": "742610c1e79b207175c68ba587616f42c9621553",
"size": "5820... |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='oeis',
version='0.1',
description='OEIS utilities and sequence generation',
long_description=readme(),
classifiers=[
'Programming Language :: Python :: 2.7.3',
]... | {
"content_hash": "1ba677ae98548f5a92851122c06fc0b5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 59,
"avg_line_length": 25.107142857142858,
"alnum_prop": 0.5803698435277382,
"repo_name": "GuySrinivasan/oeis",
"id": "7c794f9e2339589a161df8c62ca1720302cab9e1",
"size": "7... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('farmwork', '0008_auto_20170608_1217'),
]
operations = [
migrations.CreateModel(
name='Job',
... | {
"content_hash": "b1b09877be5325ef1f86517792be72e4",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 571,
"avg_line_length": 42.765957446808514,
"alnum_prop": 0.5308457711442786,
"repo_name": "ianmilliken/rwf",
"id": "88f1c0847242b2f8da02c2dba37226b135206a8e",
"size": "208... |
import os
class DefaultConfig(object):
INSTANCE_FOLDER_PATH = '/usr/lib/camus'
# Get app root path, also can use flask.root_path.
# ../../config.py
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DEBUG = False
TESTING = False
ADMINS = ['youremail@yourdomain.co... | {
"content_hash": "4028d251f5b13ef14809935910b053af",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 85,
"avg_line_length": 29.210526315789473,
"alnum_prop": 0.6732732732732732,
"repo_name": "kindly/camus",
"id": "af0e2bee43a0cb0c7bc245617a83d10913d099f3",
"size": "1690",
... |
"""Tests for tensorflow.ops.io_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os.path
import time
import contextlib
import shutil
import tempfile
import tensorflow as tf
import numpy as np
import six
from google.protobuf.any_pb2... | {
"content_hash": "7338f57963d079673f63b9dc759412d6",
"timestamp": "",
"source": "github",
"line_count": 1217,
"max_line_length": 80,
"avg_line_length": 39.75842235004109,
"alnum_prop": 0.6402265118009342,
"repo_name": "ibab/tensorflow",
"id": "88839d421e1a83b7f795075c1af213534f05f6f6",
"size": "490... |
import os
from build_swift.build_swift.constants import MULTIROOT_DATA_FILE_PATH
from . import cmark
from . import foundation
from . import libcxx
from . import libdispatch
from . import libicu
from . import llbuild
from . import llvm
from . import product
from . import swift
from . import swiftpm
from . import xctes... | {
"content_hash": "8513a767127484219f7bb47ea7a81ff7",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 28.990384615384617,
"alnum_prop": 0.5887230514096186,
"repo_name": "CodaFi/swift",
"id": "00cdef0dd0c5c7007e9e6395b230cc285d963783",
"size": "3523",... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_attunement_grid.iff"
result.attribute_template_id = -1
result.stfName("item_n","attunement_grid")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "7a4f2a095273d9e7d4801410d7549074",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 24.23076923076923,
"alnum_prop": 0.7015873015873015,
"repo_name": "anhstudios/swganh",
"id": "ddf605b5d2e37eb365cbf7a0808f0e7b443f5323",
"size": "460... |
import buildtool.command
COMMAND = 'test_command_example'
CUSTOM_ARG_NAME = 'custom_test_arg'
CUSTOM_ARG_DEFAULT_VALUE = 'Custom Default Value'
class TestCommand(buildtool.command.CommandProcessor):
@property
def calls(self):
return self.__calls
def __init__(self, factory, options):
super(TestCommand,... | {
"content_hash": "766e227184e84795193e766bba101df1",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 68,
"avg_line_length": 29.5,
"alnum_prop": 0.722457627118644,
"repo_name": "skim1420/spinnaker",
"id": "1cdba67ec569eb9c0a4646a9fe8e83c5d5042a89",
"size": "1578",
"binary... |
from __future__ import absolute_import
from __future__ import with_statement
import errno
import os
import resource
import signal
from mock import Mock, patch
from celery import current_app
from celery import platforms
from celery.platforms import (
get_fdmax,
shellsplit,
ignore_EBADF,
set_process_ti... | {
"content_hash": "ee0b18c4868471e02c116884d9069f31",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 76,
"avg_line_length": 33.209726443769,
"alnum_prop": 0.5417810726706938,
"repo_name": "couchbaselabs/celery",
"id": "de5494414af49fba2ed3642acfc5cfc9952f56f0",
"size": "2... |
"""Sensor from an SQL Query."""
import datetime
import decimal
import logging
import re
import sqlalchemy
from sqlalchemy.orm import scoped_session, sessionmaker
import voluptuous as vol
from homeassistant.components.recorder import CONF_DB_URL, DEFAULT_DB_FILE, DEFAULT_URL
from homeassistant.components.sensor import... | {
"content_hash": "9a4f14e2d508fa1e7bf008a633c25919",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 88,
"avg_line_length": 30.528089887640448,
"alnum_prop": 0.5901729849098271,
"repo_name": "sander76/home-assistant",
"id": "1b0ae5a9076af075c29e4ff63678f62c932a33d0",
"siz... |
import urllib
import pytest
from mitmproxy.test import taddons
from mitmproxy.test import tflow
import mitmproxy.test.tutils
from mitmproxy.addons import serverplayback
from mitmproxy import options
from mitmproxy import exceptions
from mitmproxy import io
def tdump(path, flows):
w = io.FlowWriter(open(path, "w... | {
"content_hash": "f7bd8dadf8b2e5365e9ffe64464267ed",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 79,
"avg_line_length": 27.094444444444445,
"alnum_prop": 0.5952429772401067,
"repo_name": "xaxa89/mitmproxy",
"id": "7078b66e35af392762c8ab07d327deaf24637f4d",
"size": "97... |
"""Global registry for OpDefs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.framework import op_def_pb2
_registered_ops = {}
def register_op_list(op_list):
"""Register all the ops in an op_def_pb2.OpList."""
if not isinsta... | {
"content_hash": "991e33a3ecdd5c11b6714e66a1230a21",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 58,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6639566395663956,
"repo_name": "kcartier/tensorflow-toe-in-the-water",
"id": "28e55a47a444909185d74890734c49147a76a... |
import zasim
import sys
ca_init, display_init, histogram_init = sys.argv[1:]
if ca_init == "constructor":
binrule = zasim.ca.BinRule(
rule = 110,
initial = zasim.conf.RandomConfiguration)
# this API must support setting the size manually and then initializing it
# from random data,... | {
"content_hash": "2a532d0cd31886cacec42d3f37535495",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 82,
"avg_line_length": 30.398058252427184,
"alnum_prop": 0.7304375598850208,
"repo_name": "timo/zasim",
"id": "b1ef79f0f897afce4502489d1369a3a35ec2c6da",
"size": "3131",
... |
from neutron.tests.tempest.api import base
class BaseRouterTest(base.BaseAdminNetworkTest):
# NOTE(salv-orlando): This class inherits from BaseAdminNetworkTest
# as some router operations, such as enabling or disabling SNAT
# require admin credentials by default
def _cleanup_router(self, router):
... | {
"content_hash": "e79b61497d566e346448b3f5aa64998b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 72,
"avg_line_length": 41.46666666666667,
"alnum_prop": 0.655144694533762,
"repo_name": "igor-toga/local-snat",
"id": "8b0b5a477051b70151f956c5512214212294be72",
"size": "1... |
import decimal
import datetime
import logging
from pyramid.renderers import JSON
from pyramid.events import NewRequest
logger = logging.getLogger('seth.tenancy')
class ValidationError(Exception):
pass
def _register_resource(config, view, path, *args, **kwargs):
route_name = getattr(view, '__qualname__', ... | {
"content_hash": "6b8972f63054956981dee3355f1b4c6d",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 78,
"avg_line_length": 27.348214285714285,
"alnum_prop": 0.6173685928827947,
"repo_name": "jnosal/seth",
"id": "71007895cc58768979df1eea8bf8de304d900ea7",
"size": "3063",
... |
"""
This is a module that contains the tool for python to interact with our JFrog
artifactory API.
"""
import hashlib
import json
import os
import requests
class JFrogArtifactory(object):
"""
This is a class that holds the interacting method for JFrog Artifactory
"""
def __init__(self, user_cred,
... | {
"content_hash": "c809671eb4fee8419ba03e823e8d1b94",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 194,
"avg_line_length": 34.61802575107296,
"alnum_prop": 0.5771138110587651,
"repo_name": "sunnyqianzhang/on-build-config",
"id": "c20396215f29c822928f207c704ad1307c971faf",... |
import warnings
from sympy.matrices.expressions import Identity
from ..utils import PyDyUserWarning
from .visualization_frame import VisualizationFrame
__all__ = ['PerspectiveCamera', 'OrthoGraphicCamera']
warnings.simplefilter('once', PyDyUserWarning)
class PerspectiveCamera(VisualizationFrame):
"""Creates a ... | {
"content_hash": "5afef5f7d5b88478e7877f9ea97ee988",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 80,
"avg_line_length": 33.86829268292683,
"alnum_prop": 0.5774161025493303,
"repo_name": "Shekharrajak/pydy",
"id": "8eb86b71515766d800b2893d598cd3b83d5ec6e3",
"size": "13... |
"""MetaGraph and related functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os.path
import re
from collections import OrderedDict, deque
import six
from google.protobuf.any_pb2 import Any
from google.protobuf import text_format... | {
"content_hash": "665a98244db58d05bc479058fceb8693",
"timestamp": "",
"source": "github",
"line_count": 974,
"max_line_length": 80,
"avg_line_length": 37.84907597535934,
"alnum_prop": 0.6518106605181067,
"repo_name": "thjashin/tensorflow",
"id": "0c1303edcaef36f90521355aa95dd4b5215aff41",
"size": "... |
from __future__ import absolute_import
input_name = '../examples/homogenization/linear_elastic_mM.py'
output_name = 'test_linear_elastic_mM.vtk'
from tests_basic import TestInput
class Test( TestInput ):
pass
| {
"content_hash": "d8cbdac713921d92c541177e63cb3d78",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.7523364485981309,
"repo_name": "lokik/sfepy",
"id": "5ac80deb276cf8a4d6ec9f4a633b5250cbc3ba48",
"size": "214",
"... |
import mysql.connector
'''
(C)2015 chenbingfeng@TurnroGame.com
'''
class Dmdb:
""" DB operation of drinking running server"""
#class variables
USER = "root"
PASSWORD = "123456"
DATABASE = "db_drinking_man"
ADD_DRINK = '''
INSERT INTO `db_drinking_man`.`drinks`
(
`id_string`,
`name`,
`i... | {
"content_hash": "581aca09864eb40ad31c039fe9d42999",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 110,
"avg_line_length": 27.10900473933649,
"alnum_prop": 0.5145104895104895,
"repo_name": "arisecbf/dringkingrun_server",
"id": "4358527f67dc285c170fdab4c13650d14b43fffa",
... |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
"""Make sure json library being used does not lose precision converting BTC values"""
n = Decimal("20000... | {
"content_hash": "b0843ed2cdcd8a68577844e6f899a6a2",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 111,
"avg_line_length": 38.392857142857146,
"alnum_prop": 0.6155038759689923,
"repo_name": "GENESISCOIN/GENESISCOIN_SCRYPT",
"id": "758889b8c6ea37f183b7393492cdeea5633e8b24"... |
direct_links = r'meta property="og:image" content="(.+?)"'
# same_filename (default=False): if True, uses filename specified on remote link. Otherwise, creates own filename with incremental index.
| {
"content_hash": "7ee9b0be6688549fac525e44c2e16e3e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 139,
"avg_line_length": 66.66666666666667,
"alnum_prop": 0.74,
"repo_name": "regosen/gallery_get",
"id": "1a448621d4b418cb598fdeecb0d893637a5db8a9",
"size": "1032",
"binar... |
import turtle
def draw_square():
window = turtle.Screen()
window.bgcolor('red')
joe = turtle.Turtle()
joe.shape('turtle')
joe.color('green')
joe.speed(1) # on a scale of 1 to 10, where 10 is fastest
for i in range(0,4):
joe.forward(100)
joe.right(90)
window.exitonclic... | {
"content_hash": "97cd87cc45765fea54c1a2cb56e8748a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 61,
"avg_line_length": 18.77777777777778,
"alnum_prop": 0.6035502958579881,
"repo_name": "tai271828/courses",
"id": "c547dc9b49e43f325d6faf9ec0ddb3b0bb68dec8",
"size": "338... |
"""
Created on Sun May 28 14:51:28 2017
@author: azkei
Using lxml library to read XML data
"""
# We want to take the data structure inside the XML file and convert it into
# a DataFrame.
# For that, we need objectify.
from lxml import objectify
# Now we can do the parser of the XML file using parse()
xml = objectify.... | {
"content_hash": "b6087e4ca55112694d2b608d1157b0ef",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 32.57142857142857,
"alnum_prop": 0.6944444444444444,
"repo_name": "jjsalomon/python-analytics",
"id": "b3307ae810705dd8b51397264612c60b8c7642cf",
"si... |
__author__="Ashish Hunnargikar"
__date__ ="$Jun 13, 2014 12:33:33 PM$"
import time
import os
import subprocess
from datetime import date, timedelta
from elasticsearch.transport import Transport
from elasticsearch import (Elasticsearch, RoundRobinSelector, ImproperlyConfigured, ElasticsearchException,
Serializatio... | {
"content_hash": "9750582c0e19524d8991ff3342513d28",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 223,
"avg_line_length": 41.54253308128544,
"alnum_prop": 0.6260921004732435,
"repo_name": "misho-kr/elasticsearchindex",
"id": "98b260ed06c14414edfe4f282aeb420ebf5156b0",
... |
"""
Script to get read counts distribution
@author: Alicia Schep
"""
##### IMPORT MODULES #####
# import necessary for python
import os
from pyatac.chunk import ChunkList
from pysam import AlignmentFile
import numpy as np
def _between(x,start,end):
if x >= start and x < end:
return True
else:
... | {
"content_hash": "00275bb90c55549833720a90cb0cc253",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 147,
"avg_line_length": 31.14,
"alnum_prop": 0.5555555555555556,
"repo_name": "GreenleafLab/NucleoATAC",
"id": "978b1440d0a1bbfec857059660f058206b6abd68",
"size": "1557",
... |
"""This module provides the TimeSeq class.
"""
import logging, csv, copy
from Transforms import SeqXform
class TimeSeq:
"""A class for representing data indexed by time.
"""
def __init__(self,columnNames,data):
self.__colIndexByName = {}
self.__columnNames = list... | {
"content_hash": "82d4b127e30778db2826b815ed8c3520",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 80,
"avg_line_length": 38.979123173277664,
"alnum_prop": 0.539606876974988,
"repo_name": "eiriks/pyvol",
"id": "638856db6ba3005e493f6f0aed688d3ac2b84cc7",
"size": "18671",... |
import json
import os
import socket
import time
import uuid
from django.conf import settings
from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.html import escape
import requests
from urllib.parse import quote, urlencode
from hc.accounts.models import Profile
from ... | {
"content_hash": "dd65955edbed6677ddf24309e6bfce59",
"timestamp": "",
"source": "github",
"line_count": 889,
"max_line_length": 87,
"avg_line_length": 34.514060742407196,
"alnum_prop": 0.5966496105335202,
"repo_name": "iphoting/healthchecks",
"id": "248bcf3c2e8927cc64f3252a9fbadf45fb5ba5e2",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.