text
stringlengths
4
1.02M
meta
dict
import os from settings.app_settings import AppSettings from settings.settings import Settings from utils.convert import Convert class Algorithm: def __init__(self, parent=None): self._children = [] self._output = None if parent is not None: parent.add_children(self) s...
{ "content_hash": "4c9d3081796c44ae7bc18297ea210059", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 95, "avg_line_length": 30.444444444444443, "alnum_prop": 0.6082725060827251, "repo_name": "fpohtmeh/loki", "id": "14cf47ccfb51471076f8dd545f7666728f2029be", "size": "1644",...
"""Make sure tests setup & fixtures are all fine""" import requests from .utils.http import check_response_ok # todo: we should check all fixtures in here! def test_site_read(ckan_url): """GET /site_read/ should return 200""" api_url = ckan_url('/api/3/action/site_read') response = requests.get(api_ur...
{ "content_hash": "c7ada70af8de4bcc2cc225054e85eca3", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 74, "avg_line_length": 26.636363636363637, "alnum_prop": 0.6877133105802048, "repo_name": "opendatatrentino/ckan-api-client", "id": "bce1f39fa960579110d9e95442e6cd33827175a8"...
from __future__ import unicode_literals import pytest @pytest.mark.models('en') def test_issue1959(EN): texts = ['Apple is looking at buying U.K. startup for $1 billion.'] # nlp = load_test_model('en_core_web_sm') EN.add_pipe(clean_component, name='cleaner', after='ner') doc = EN(texts[0]) doc_pip...
{ "content_hash": "413897f9f67c5dea3ea009dec3de9620", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 78, "avg_line_length": 36.31818181818182, "alnum_prop": 0.571964956195244, "repo_name": "aikramer2/spaCy", "id": "0787af3b75a8f0e4eaddbfc69dd828c8941b53c6", "size": "814", ...
"""Create sample PR curve summary data. We have 3 classes: R, G, and B. We generate colors within RGB space from 3 normal distributions (1 at each corner of the color triangle: [255, 0, 0], [0, 255, 0], and [0, 0, 255]). The true label of each random color is associated with the normal distribution that generated it....
{ "content_hash": "1d097e085cb79a3bead39268bcdfaed4", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 80, "avg_line_length": 35.733333333333334, "alnum_prop": 0.6671108742004265, "repo_name": "agrubb/tensorboard", "id": "5f9794fc248cbdf016068248086e4fb75f58bbbe", "size": "...
import urllib import hashlib from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.utils.encoding import force_bytes, force_text from readthedocs.projects.models import Project from readthedocs.core.resolver import resolve register = template.Library()...
{ "content_hash": "e41acbe94aebd85d94b7b9e31b903079", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 91, "avg_line_length": 27.395604395604394, "alnum_prop": 0.636983553951063, "repo_name": "techtonik/readthedocs.org", "id": "1c07fd27255b6f9f6dd7bb3fd27111cd4eec21eb", "siz...
import constants.main_window_constants as const import utils.utils as utils import tkinter as tk class MainGuiButtonsF(tk.Frame): """ Main GUI buttons.""" def __init__(self, parent, info_eh, create_data_set_eh, train_eh, t...
{ "content_hash": "2937e5197a0ffbc9a1213cc276931e4e", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 77, "avg_line_length": 28.246875, "alnum_prop": 0.4673083305675407, "repo_name": "dani-i/bachelor-project", "id": "1f0a07fc16081f7118001ea79792d5439ff6e54a", "size": "9039...
""" Module to manage dependencies between pythran types. """ import gast as ast import itertools import os from pythran.analyses import GlobalDeclarations from pythran.errors import PythranInternalError from pythran.passmanager import ModuleAnalysis from pythran.types.conversion import PYTYPE_TO_CTYPE_TABLE from pyth...
{ "content_hash": "2dfc0681a54b6fc8355fe6c027c66bc0", "timestamp": "", "source": "github", "line_count": 490, "max_line_length": 79, "avg_line_length": 31.569387755102042, "alnum_prop": 0.561380826168466, "repo_name": "pombredanne/pythran", "id": "ac93c9a4634f7b6d4cbb92d5ad2d5c39d2652ad6", "size": "...
__author__ = 'davidbyttow@google.com (David Byttow)' import hashlib import random import time import urlparse from types import ListType import data import http from opensocial import simplejson def generate_uuid(*args): """Simple method for generating a unique identifier. Args: Any arguments used to help ...
{ "content_hash": "228405ed3c7797c35cab89c5d08d2470", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 79, "avg_line_length": 27.291176470588237, "alnum_prop": 0.5870244638430865, "repo_name": "CollabQ/CollabQ", "id": "a41e773c42904c602f04b623456cf4674e21d3f7", "size": "988...
""" OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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.a...
{ "content_hash": "397d93fe240471d5ab3d92284c854abc", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 76, "avg_line_length": 25.03921568627451, "alnum_prop": 0.6985121378230227, "repo_name": "detiber/lib_openshift", "id": "51185206e6ff998fadd96700847c2c90f3ecae5e", "size": ...
import os import pytest import sqlalchemy as sa from sqlalchemy_continuum.dialects.postgresql import ( drop_trigger, sync_trigger ) from tests import ( get_dns_from_driver, get_driver_name, QueryPool, uses_native_versioning ) @pytest.mark.skipif('not uses_native_versioning()') class TestTrig...
{ "content_hash": "c8a2ddcc619820e3473f69e56b7d57d3", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 76, "avg_line_length": 33.52459016393443, "alnum_prop": 0.6327628361858191, "repo_name": "rmoorman/sqlalchemy-continuum", "id": "a9f96d6d630b2a0b3817086e41319cbf4f58ab0f", ...
import os, struct, datetime class HBNReader: """Reads a binary output file from an HSPF simulation.""" def all_occurences(self, s): """ Returns all the indices of 'PERLND', 'IMPLND', and 'RCHRES' in byte string "s". """ i = 0 while True: perlnd = s...
{ "content_hash": "0fd4fb20a4bc2c74e3e3783318b6a9f3", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 30.85135135135135, "alnum_prop": 0.49627682873412177, "repo_name": "kbrannan/PyHSPF", "id": "a8e7e7290c46729b6e8b1e5e7868a50457d789c0", "size": "477...
""" Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python S...
{ "content_hash": "65e86d1675853918628661315e2d65b1", "timestamp": "", "source": "github", "line_count": 3890, "max_line_length": 103, "avg_line_length": 38.139074550128534, "alnum_prop": 0.5710665201771356, "repo_name": "moonfruit/yyfeed", "id": "dc0e47f8400e9cb1ceceddd1bd8b679f526d37d5", "size": "...
import mock from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils try: from urllib import urlencode except ImportError: from urllib.parse import urlencode import webob from cinder import context from cinder import exception from cinder import objects from cinde...
{ "content_hash": "6fa48da71c624a5da67a1d97190ac741", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 79, "avg_line_length": 47.39087947882736, "alnum_prop": 0.607876830022682, "repo_name": "ge0rgi/cinder", "id": "17cc03b1edda327afa5115a67338c9c496dd0ff1", "size": "15208",...
import sys from pkg_resources import parse_version from httplib import HTTPConnection from xml.etree import ElementTree from util import cacheable, is_release PYTHON_HG_HOST = 'hg.python.org' PYTHON_HG_PATH = '/cpython/atom-tags' PYTHON_DOWNLOAD_URL = 'http://www.python.org/ftp/python/%(v)s/Python-%(v)s.tgz' ATOM_NS ...
{ "content_hash": "074ce7da85275d982fdd7a97e3642e29", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 28.34246575342466, "alnum_prop": 0.6283228612856452, "repo_name": "briancline/pyruse", "id": "1889c9ea5198f482ed7d7e6c49ba828362654fa2", "size": "206...
from rest_framework.parsers import JSONParser from drf_hal_json import HAL_JSON_MEDIA_TYPE from drf_hal_json.renderers import JsonHalRenderer class JsonHalParser(JSONParser): media_type = HAL_JSON_MEDIA_TYPE renderer_class = JsonHalRenderer
{ "content_hash": "ac6a2563c992b05eb942f50171eceadb", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 50, "avg_line_length": 28, "alnum_prop": 0.7976190476190477, "repo_name": "seebass/drf-hal-json", "id": "15f39f39c2656840b39c2ef5f0a4da90d5f18245", "size": "252", "binary"...
from google.cloud import aiplatform_v1 async def sample_import_feature_values(): # Create a client client = aiplatform_v1.FeaturestoreServiceAsyncClient() # Initialize request argument(s) avro_source = aiplatform_v1.AvroSource() avro_source.gcs_source.uris = ['uris_value_1', 'uris_value_2'] ...
{ "content_hash": "78e809638029e8b1d08d5cbe07937737", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 88, "avg_line_length": 29.4375, "alnum_prop": 0.7070063694267515, "repo_name": "googleapis/python-aiplatform", "id": "fb38d59f8bde2cb13b37f11cce310ce168156122", "size": "19...
import os from PIL import Image # VGG16 input size... compressionSize = 224, 224 # Delete a gif once it's been split into frames removeProcessedGifs = False def iter_frames(im): try: i= 0 while 1: im.seek(i) imframe = im.copy() if i == 0: palet...
{ "content_hash": "36d47392f57188a2bdcbd4c4965209c0", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 63, "avg_line_length": 26.15909090909091, "alnum_prop": 0.5082536924413553, "repo_name": "chcaru/gcnet", "id": "e9375eb478e63c59e6de7a8067e3249e5055fe2c", "size": "1152", ...
import m5 from m5.objects import * # This configuration shows a simple setup of a TrafficGen (CPU) and an # external TLM port for SystemC co-simulation # # Base System Architecture: # +-------------+ +-----+ ^ # | System Port | | CPU | | # +-------+-----+ +--+--+ | # | | | gem5 Worl...
{ "content_hash": "2549b22f922318cafc223d888d8085f5", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 33.82608695652174, "alnum_prop": 0.5649100257069408, "repo_name": "TUD-OS/gem5-dtu", "id": "ebf403fcbd2a03bf3b1f4f0af941b1dbe9d0abbf", "size": "3151"...
import math import numpy as np class Activation(object): def __init__(self): pass @staticmethod def get(name): if name == "sigmoid": return Activation.sigmoid if name == "np_sigmoid": return Activation.np_sigmoid return None @staticmethod ...
{ "content_hash": "07ab80dea95efef796f32bc2f8b7bf5b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 74, "avg_line_length": 22.375, "alnum_prop": 0.5631284916201117, "repo_name": "awlange/brainsparks", "id": "8bb04afaca74b22c564beaa04b9d543610e22a13", "size": "895", "bin...
from functools import wraps ''' class debug() : def __init__(self,*args,**kwargs) : self.args = args def __call__(self,func) : @wraps(func) def wrapper(*args,**kwargs) : print('entering ' + func.__name__) return(func(*args)) print('exiting ' + func.__name__) return wrapper class logs() : de...
{ "content_hash": "cc40daa450953c7f4d727d2d9e93c999", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 37, "avg_line_length": 21.25, "alnum_prop": 0.6091503267973856, "repo_name": "projectscara2014/scara", "id": "658b6fd3bdcefcf830c5b0ddee6fdcce3b383dfb", "size": "765", "b...
from __future__ import absolute_import, unicode_literals import celery import djcelery import sys from django.core.management.base import BaseCommand from djcelery.compat import setenv DB_SHARED_THREAD = """\ DatabaseWrapper objects created in a thread can only \ be used in that same thread. The object with alias ...
{ "content_hash": "abc27847b1ef617fa24701a1b791d8c5", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 78, "avg_line_length": 34.30714285714286, "alnum_prop": 0.5407037268373933, "repo_name": "axiom-data-science/django-celery", "id": "f8807af584855f692e69708f5e594e73859f38b7"...
import mock from openstack.tests.unit import base import uuid from openstack.message.v2 import queue FAKE1 = { 'name': 'test_queue', 'description': 'Queue used for test.', '_default_message_ttl': 3600, '_max_messages_post_size': 262144 } FAKE2 = { 'name': 'test_queue', 'description': 'Queue...
{ "content_hash": "649aaeb20995987bfc38463bb219073f", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 77, "avg_line_length": 35.13291139240506, "alnum_prop": 0.5694469464961268, "repo_name": "dtroyer/python-openstacksdk", "id": "1183076f12c5c36786aab6647d1fb270bc24b828", "...
"""Test longpolling with getblocktemplate.""" from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import get_rpc_proxy, random_transaction import threading class LongpollThread(threading.Thread): def __init__(self, node): threading.Thread._...
{ "content_hash": "b3c139e5d812f5d948e2e5f467f1266f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 112, "avg_line_length": 42.6231884057971, "alnum_prop": 0.666780006800408, "repo_name": "Flowdalic/bitcoin", "id": "1259754c5af154b1f0a3888e04b0f96b97811a32", "size": "3155...
"""The metrics module implements functions assessing prediction error for specific purposes.""" import numpy as np def trapz(x, y): """Trapezoidal rule for integrating the curve defined by x-y pairs. Assume x and y are in the range [0,1] """ assert len(x) == len(y), 'x and y need to be of same len...
{ "content_hash": "ec4725ad88977a25e891f2c38394f1fd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 95, "avg_line_length": 30.45, "alnum_prop": 0.5960591133004927, "repo_name": "likojack/isml15-thu", "id": "29d76b234ac0091b6b890697c4199e84a8019777", "size": "609", "bina...
''' Copyright 2015 Serendio Inc. Author - kshitij soni Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
{ "content_hash": "a18196989f4efc0082da02f66dd2ea0f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 168, "avg_line_length": 21.155172413793103, "alnum_prop": 0.7180114099429503, "repo_name": "serendio-labs-stage/diskoveror-data-preprocessing", "id": "7a403a9b88a4ecf14af7c0e...
on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') # Register the data for Spark SQL on_time_dataframe.registerTempTable("on_time_performance") # Check out the columns on_time_dataframe.columns # Check out some data on_time_dataframe\ .select("FlightDate", "TailNum", "Origin", "Dest", "Carr...
{ "content_hash": "180b80699986e32f5e5258f232e0cefe", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 88, "avg_line_length": 23.666666666666668, "alnum_prop": 0.6823161189358372, "repo_name": "rjurney/Agile_Data_Code_2", "id": "e4b03cf40260fa7f45f802e3723286dc9c536bb8", "si...
def tuplify(a): try: return tuple(a) except TypeError: return (a,)
{ "content_hash": "262dab360304831b1d99074ca39e6be2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 23, "avg_line_length": 13.285714285714286, "alnum_prop": 0.5161290322580645, "repo_name": "JohnVinyard/zounds", "id": "1e26f0ed7ed6ceeaf4ad3336b4180d83485fc5aa", "size": "94...
import os import sys import click from . import server_backends from .util import honcho_parse_env try: import importlib except ImportError: click.echo('You do not have importlib installed. Please install a ' 'backport for versions < 2.7/3.1 first.') sys.exit(1) ENV_DEFAULT = '.env' APP_...
{ "content_hash": "8203fb1d8cdcca481ece7480fcfc9cef", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 79, "avg_line_length": 30.852941176470587, "alnum_prop": 0.592310136638068, "repo_name": "brettatoms/flask-appconfig", "id": "87fe4b5eb3c0caf08177b20fe646659b4c970d23", "s...
"""Flattens a HTML file by inlining its external resources. This is a small script that takes a HTML file, looks for src attributes and inlines the specified file, producing one HTML file with no external dependencies. This does not inline anything referenced from an inlined file. """ import os import re import sys ...
{ "content_hash": "6fb2de9970b3f9453d725b598ab00d5e", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 80, "avg_line_length": 32.61258278145695, "alnum_prop": 0.6649406031069144, "repo_name": "meego-tablet-ux/meego-app-browser", "id": "06805bb06a1497476a3d1c4b6b2e6e99dadeab1f...
import configparser from vent.helpers.errors import ErrorHandler class Template: """ Handle parsing templates """ def __init__(self, template=None): self.config = configparser.ConfigParser(interpolation=None) self.config.optionxform = str if template: self.config.read(tem...
{ "content_hash": "d2b9b261a8bd173cea7866c797818f47", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 79, "avg_line_length": 37.791666666666664, "alnum_prop": 0.5790150679897097, "repo_name": "Jeff-Wang93/vent", "id": "0f255a95a2ee127f0c32d3127dcd50804a755d1c", "size": "54...
from ipfs_connector import IPFSConnector, IPFSConfig from nn_loader import NNListener, NNLoader class ProcessorCallback: pass class Processor(NNListener): def __init__(self, callback: ProcessorCallback, ipfs_config: IPFSConfig): print("Connecting to IPFS server %s:%d..." % (ipfs_config.server, ipfs_c...
{ "content_hash": "3a158e3148cf4f019db88c372c3b6c70", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 92, "avg_line_length": 27.81967213114754, "alnum_prop": 0.6205067766647024, "repo_name": "Neurochain/neurowrk", "id": "fa41f630ad6ecf5ebacecc03d0167ea8afba836c", "size": "1...
__author__ = 'stamylew' from os.path import expanduser def assign_path(hostname): if hostname == "birdofprey": home1 = "/home/stamylew/" home2 = "/mnt/CLAWS1/stamilev/" ilp_folder = home2 + "ilastik_projects/" volumes_folder = home2 + "volumes/" ...
{ "content_hash": "209d1edf0bba2cb7889b8b0b8d4251c4", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 89, "avg_line_length": 37.57608695652174, "alnum_prop": 0.5788255713045993, "repo_name": "simonsgit/bachelor_stuff", "id": "0a525f4f210e527da51194ce2c991f1f758f5799", "size...
from django.db import models from pygments.lexers import get_all_lexers, get_lexer_by_name from pygments.styles import get_all_styles from pygments.formatters.html import HtmlFormatter from pygments import highlight LEXERS = [item for item in get_all_lexers() if item[1]] LANGUAGE_CHOICES = sorted([(item[1][0], item[0...
{ "content_hash": "40aa5bc45077f7af0c7af773d0b188be", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 91, "avg_line_length": 45.483870967741936, "alnum_prop": 0.7056737588652482, "repo_name": "whoww/PlaylistServer", "id": "6e5ee545958a20814579d2a3706f5f71e212f54e", "size": ...
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.agent import agent from lib.core.common import Backend from lib.core.common import Format from lib.core.data import conf from lib.core.data import kb from lib.co...
{ "content_hash": "d87c5ae3d938bafe1317662b9934bcee", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 109, "avg_line_length": 27.816176470588236, "alnum_prop": 0.5855141422151732, "repo_name": "JeyZeta/Dangerous", "id": "c808e6d6beecd1edbeb3ec22675c3faa4700ca67", "size": "...
import github3 from github3.issues.comment import IssueComment from github3.issues.event import IssueEvent from github3.issues.label import Label from github3.issues.milestone import Milestone from github3.issues import Issue import datetime from tests.utils import BaseCase, load, mock class TestLabel(BaseCase): ...
{ "content_hash": "58fd41a3c5fe4b331466b63065f42ce0", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 78, "avg_line_length": 30.533923303834808, "alnum_prop": 0.5731813351367018, "repo_name": "msabramo/github3.py", "id": "f5daeb1bd68ca7108e247f4a903ce67ae8441cee", "size": ...
""" Custom filters for use in openshift-ansible """ from ansible import errors def osmrq_get_existing_namespaces(oc_obj_namespaces_list): '''Take the output of the oc_obj namespaces list and return a list of namespaces that are foun - oc_obj ''' valid_namespace_list = [] for namespace in oc_obj_...
{ "content_hash": "fc9f52ecf2cfaf70ff0479665ec934a8", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 98, "avg_line_length": 26.666666666666668, "alnum_prop": 0.6575, "repo_name": "blrm/openshift-tools", "id": "f6a553909d2508141d963a8b145d8b8ef29681f7", "size": "875", "bi...
__revision__ = "test/CPPDEFINES/pkg-config.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify merging with MergeFlags to CPPPDEFINES with various data types. """ import TestSCons test = TestSCons.TestSCons() pkg_config_path = test.where_is('pkg-config') if not pkg_config_path: test.skip_tes...
{ "content_hash": "71bf45840ed92c58751d6fff4d760138", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 103, "avg_line_length": 28.0875, "alnum_prop": 0.6933689363595905, "repo_name": "EmanueleCannizzaro/scons", "id": "a3a69af90bba9e3864d819dae5d0fc89aa8f238d", "size": "3382"...
from __future__ import absolute_import from __future__ import unicode_literals import pytest from compose.config.environment import Environment from compose.config.interpolation import interpolate_environment_variables from compose.config.interpolation import Interpolator from compose.config.interpolation import Inva...
{ "content_hash": "03087ad3d1683b62faa1806abc5adb80", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 92, "avg_line_length": 29.89189189189189, "alnum_prop": 0.5825045207956601, "repo_name": "hoogenm/compose", "id": "018a5621a4cb1176c07ded48f314bb4f212b908b", "size": "4424...
import sys import locomatix import locomatix.lql as lql from _utils import * def query_location_history(): """docstring for query_location_history""" parser = locomatix.ArgsParser() parser.add_description("Query the location history of an object") parser.add_arg('query', 'LQL query to execute') parser.add_o...
{ "content_hash": "f817e1ca20a910ba1b22a7d1e24f9af7", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 107, "avg_line_length": 32.55844155844156, "alnum_prop": 0.6098923015556442, "repo_name": "locomatix/locomatix-python", "id": "79e3fde327885ab79848e3d817314fa03c200ca0", "s...
from psi.app.utils import get_name from psi.app import const from psi.app.models.data_security_mixin import DataSecurityMixin from psi.app.service import Info from psi.app.utils import date_util from sqlalchemy import Column, Integer, ForeignKey, String, Date, select, func, \ event from sqlalchemy.ext.hybrid import...
{ "content_hash": "fd3398cf633e90f648129b632bf13c59", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 87, "avg_line_length": 33.88297872340426, "alnum_prop": 0.6712715855572998, "repo_name": "betterlife/psi", "id": "905777999250345b6ab02db5d44855a74baefe5c", "size": "3203",...
from flask import Flask, render_template, redirect, url_for from flask_assets import Environment, Bundle try: from flask.ext.cors import CORS # The typical way to import flask-cors except ImportError: # Path hack allows examples to be run without installation. import os parentdir = os.path.dirname(os.p...
{ "content_hash": "e2c8e9c6b49f78cfefcb402401e3ea1a", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 114, "avg_line_length": 35.330708661417326, "alnum_prop": 0.662357922888344, "repo_name": "Ignotus/infoviz-project", "id": "08fa3934ce10ad7aae185456b5216b866664e85c", "siz...
from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.search.models import Query class SearchPromotion(models.Model): query = models.ForeignKey(Query, db_index=True, related_name='editors_picks', on_delete=models.CASCADE) page = models.ForeignKey('wagtailcore.Page'...
{ "content_hash": "99f268a56c1194d7a191348294365f0c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 107, "avg_line_length": 41.94444444444444, "alnum_prop": 0.6980132450331126, "repo_name": "mikedingjan/wagtail", "id": "a0d3c6c93287236942b0c9ec49992314102695b9", "size": "...
from abc import ( ABCMeta, abstractmethod, ) from errno import ENOENT from os import remove from os.path import exists import sqlite3 from bcolz import ( carray, ctable, open as open_ctable, ) from click import progressbar from numpy import ( array, int64, float64, floating, ful...
{ "content_hash": "ed7e9726f7c6177fb9ad9aceababa48e", "timestamp": "", "source": "github", "line_count": 911, "max_line_length": 79, "avg_line_length": 34.18770581778266, "alnum_prop": 0.5666720179804142, "repo_name": "grundgruen/zipline", "id": "dcd9b1352ff462400bd1a3d640c3223cf9fbb27a", "size": "3...
from courtreader import readers from courtutils.logger import get_logger from datetime import datetime, timedelta import csv import os import sys import time MONGO = False POSTGRES = True if MONGO: import pymongo from courtutils.databases.mongo import MongoDatabase if POSTGRES: from courtutils.databases.p...
{ "content_hash": "d90ec6a9b339f132db87eb092b0f5662", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 72, "avg_line_length": 26.945454545454545, "alnum_prop": 0.699055330634278, "repo_name": "bschoenfeld/va-court-scraper", "id": "a6414e09db0945bef8c897dc339977902c5f5f29", "...
""" Test suite for SocketServer.py. """ import contextlib import imp import os import select import signal import socket import select import errno import tempfile import unittest import SocketServer import test.test_support from test.test_support import reap_children, reap_threads, verbose try: import threading ...
{ "content_hash": "90da80eb2418ec181ae5c66a39b57434", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 79, "avg_line_length": 34.071005917159766, "alnum_prop": 0.5726814866273011, "repo_name": "mcking49/apache-flask", "id": "714ca4afb0a8f998d56e86d9e85651d30a9724da", "size"...
import frappe, unittest from frappe.defaults import * class TestDefaults(unittest.TestCase): def test_global(self): set_global_default("key1", "value1") self.assertEquals(get_global_default("key1"), "value1") set_global_default("key1", "value2") self.assertEquals(get_global_default("key1"), "value2") add...
{ "content_hash": "a47aa962e918f1bb6b1571a449998e15", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 34.20454545454545, "alnum_prop": 0.6970099667774087, "repo_name": "gangadhar-kadam/hrfrappe", "id": "2c0fbb4c615384a3dc9a04ed9246c42caa246857", "size...
from collections import deque import random class ReplayBuffer(object): def __init__(self, buffer_size): self.buffer_size = buffer_size self.num_experiences = 0 self.buffer = deque() def get_batch(self, batch_size): # Randomly sample batch_size examples return random.s...
{ "content_hash": "bed6585e5351dbfd28e790119f7de5d7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 29.88235294117647, "alnum_prop": 0.625, "repo_name": "jaesik817/programmable-agents_tensorflow", "id": "c3520abcc3c1050683acc109ba93ad97dcdbae1e", "s...
from django.conf.urls import url from api import views urlpatterns = [ url(r'stations/$', views.get_stations, name='api_stations'), url(r'entry/(?P<station_id>\d+)/$', views.make_entry, name='api_entry'), url(r'new/$', views.add_station, name='api_add_station'), # Booking api url(r'booking/(?P<res...
{ "content_hash": "7608e400e7857e9d0a0295974b945761", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 49.645833333333336, "alnum_prop": 0.6093159882501049, "repo_name": "boyombo/django-stations", "id": "318aeb5e61ddee206e058b93fe6b240d0db2332a", "size...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.5.1-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import sys import unittest import swaggyjenkins from swaggyjenkins.mo...
{ "content_hash": "04da989dc17934e8819f0e95190c2b0f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 25.18421052631579, "alnum_prop": 0.7136886102403344, "repo_name": "cliffano/swaggy-jenkins", "id": "0c876d88d201c7662992fe3c4cd1884b693403c0", "size"...
import os import logging logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) from mediafire.client import MediaFireClient APP_ID = '42511' MEDIAFIRE_EMAIL = os.environ['MEDIAFIRE_EMAIL'] MEDIAFIRE_PASSWORD = os.environ['MEDIAFIRE_PASSWORD'] client = MediaFireClient() client.login(app_id=APP_ID, email=...
{ "content_hash": "6df68fabc7c7e6fcf256a51effbfdbd2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 79, "avg_line_length": 26.8125, "alnum_prop": 0.7925407925407926, "repo_name": "MediaFire/mediafire-python-open-sdk", "id": "5f59b7cf644bb10e0a5cd7a62ebc28f6373a3149", "siz...
from .base import ObjectBase class Onboarding(ObjectBase): @classmethod def get_resource_class(cls, client): from ..resources import Onboarding as OnboardingResource return OnboardingResource(client) STATUS_NEEDS_DATA = "needs-data" STATUS_IN_REVIEW = "in-review" # Waiting for a val...
{ "content_hash": "7ec0c80761feee301a76896a65960c22", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 66, "avg_line_length": 26.307692307692307, "alnum_prop": 0.6498538011695907, "repo_name": "mollie/mollie-api-python", "id": "da9f5646b1f340e81f39bc2e6ee08fa08e67eb9f", "siz...
import logging # Import Third-Party # Import Homebrew from bitex.formatters.base import Formatter # Init Logging Facilities log = logging.getLogger(__name__) class GdaxFormatter(Formatter): @staticmethod def ticker(data, *args, **kwargs): return (data['bid'], data['ask'], None, None, None, None, d...
{ "content_hash": "f6650b5196133be11d120987a74a17fc", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 80, "avg_line_length": 22.294117647058822, "alnum_prop": 0.6596306068601583, "repo_name": "nlsdfnbch/bitex-crawler", "id": "1f51f5e3f3a3301f0c7ea7fb5cda587dce8f5945", "size...
from django.urls import include, re_path from django.views.i18n import JavaScriptCatalog urlpatterns = [ re_path(r'^', include('grade_conversion_calculator.urls')), re_path( r'^jsi18n/$', JavaScriptCatalog.as_view(packages=['grade_conversion_calculator']), name='javascript-catalog') ]
{ "content_hash": "c1caf6fe646e21aa29577e8306a34ef4", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 29.09090909090909, "alnum_prop": 0.684375, "repo_name": "uw-it-aca/grade-conversion-calculator", "id": "cd10c36f9a5c22012a7adc52616a2d5392e7f7ef", "s...
from __future__ import absolute_import import re from collections import namedtuple from ..exceptions import LocationParseError from ..packages import six url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"] # We only want to normalize urls with an HTTP(S) scheme. # urllib3 infers URLs withou...
{ "content_hash": "aa0f32a3b0875a42bfddfa041478151d", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 88, "avg_line_length": 32.47441860465116, "alnum_prop": 0.5443282727012317, "repo_name": "javier-ruiz-b/docker-rasppi-images", "id": "6ff238fe3cbd04f5a63862e8b6729e155e03360...
import socks import socket import stem.process import stem.control # Version check for STEM >= 1.3 assert(int(stem.__version__[0]) > 1 or (int(stem.__version__[0]) == 1 and int(stem.__version__[2]) >= 3)) SOCKS_PORT = 33419 CONTROL_PORT = 33418 class Tor: _instance = None def __new__(cls, *args, **...
{ "content_hash": "60298dbdd45b525471112e02a6f35590", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 111, "avg_line_length": 30.20472440944882, "alnum_prop": 0.6173096976016684, "repo_name": "jparyani/Mailpile", "id": "5b9061f984a3940d9b0ba2d8b78d0c44380ceffc", "size": "3...
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
{ "content_hash": "8bbc67d393dc1a4036a82f3a8f5dc764", "timestamp": "", "source": "github", "line_count": 438, "max_line_length": 146, "avg_line_length": 43.14383561643836, "alnum_prop": 0.5874477430279939, "repo_name": "gquirozbogner/contentbox-master", "id": "7d6fdc999ea58bdb8b2542131766972f2aec521b"...
from __future__ import absolute_import from __future__ import unicode_literals import io import os import unittest import tempfile try: from unittest import mock except ImportError: import mock from fs.archive import _utils class TestUtils(unittest.TestCase): @unittest.skipUnless(os.name == 'posix', '...
{ "content_hash": "d1077e4130ac7e00d24231611ab0ce36", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 30.372881355932204, "alnum_prop": 0.6166294642857143, "repo_name": "althonos/fs.archive", "id": "2e1774302b70917a57f5ee920e21f8b76b4ac707", "size": "...
"""Functions to construct sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag'] import numpy as np from sc...
{ "content_hash": "347027e3970846d420843b911e40e3ba", "timestamp": "", "source": "github", "line_count": 803, "max_line_length": 95, "avg_line_length": 30.29389788293898, "alnum_prop": 0.5539751705993587, "repo_name": "Shaswat27/scipy", "id": "cdff960d2fa488f25579aa5c5f3dee2551523584", "size": "2432...
"""Tool for mounting AFF4 datastore over FUSE.""" import datetime import errno import getpass import stat import sys # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order import logging from grr.lib import aff4 from grr.lib import co...
{ "content_hash": "5b8b0da7abe870a5ff3ca0d4b39d7059", "timestamp": "", "source": "github", "line_count": 624, "max_line_length": 80, "avg_line_length": 33.88621794871795, "alnum_prop": 0.6480018917001655, "repo_name": "defaultnamehere/grr", "id": "0f5234c1ed9777aed3ed6fc2262a23d8f5eaa0c2", "size": "...
from pymongo import ASCENDING, DESCENDING ENTRIES = 20 def validate(revision, revisions_count): if revision < 0 or revision >= revisions_count: raise ValueError("revision index out of bound! " + str(revision)) return revision class ArticlesParams(object): def __init__(self, from_revision, to_r...
{ "content_hash": "d89cab105f2edaa657f1b4f2eadf3657", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 110, "avg_line_length": 38.85271317829457, "alnum_prop": 0.5905826017557861, "repo_name": "code4hk/NewsdiffHK-Backend", "id": "3ee9d62e254bcabd65b0b96a7466cd4402ca2390", "...
"""Test hassbian config.""" from unittest.mock import patch import pytest from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from homeassistant.components.websocket_api.const import TYPE_RESULT from homeassistant.const import CONF_UNIT_SYSTEM, CONF_UNIT_SYSTEM_IMPERI...
{ "content_hash": "740aa5a5fb961e133dc5a5c2e79344c2", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 86, "avg_line_length": 31.7125, "alnum_prop": 0.6249507292077257, "repo_name": "postlund/home-assistant", "id": "8caa0f3e6fbe8033e803f850eb4c202b7970a3dc", "size": "5074",...
from datetime import datetime from dateutil.relativedelta import relativedelta from openerp.osv import fields,osv from openerp import tools class report_project_task_user(osv.Model): _inherit = "report.project.task.user" _columns = { 'hours_planned': fields.float('Planned Hours', readonly=True), ...
{ "content_hash": "aed488eac5a46477ae80ec189ecee6f4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 254, "avg_line_length": 52.45454545454545, "alnum_prop": 0.7027729636048526, "repo_name": "vileopratama/vitech", "id": "34f3e5eeef3ada1a4ea92cef772a0cc043b76968", "size": "...
import os import sys from fileparser import FileParser from common import File from easysub import EasySub class EasySubConsole(object): def __init__(self): super(EasySubConsole, self).__init__() self._file_parser = FileParser() self._easysub = EasySub() def _usage(self): return u"""Usage: main.py path [...
{ "content_hash": "a7a02b0311612a3a26983daa67ea4c57", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 81, "avg_line_length": 24.52112676056338, "alnum_prop": 0.6645605973578403, "repo_name": "scorpiontahir02/easysub", "id": "166abd48194f6aae660a0b6c51c8f12bc91e76f6", "size"...
"""Test the included examples. """ import pytest from conftest import get_example def test_nodeid(ctestdir): """Node ids """ with get_example("nodeid.py").open("rt") as f: ctestdir.makepyfile(f.read()) result = ctestdir.runpytest("--verbose") try: result.assert_outcomes(passed=6, ...
{ "content_hash": "8a98229e6e7eed5cfa8bd99ff8cca151", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 29.807692307692307, "alnum_prop": 0.5793548387096774, "repo_name": "RKrahl/pytest-dependency", "id": "7d45ba7f369baaef31e99b495117d47e7eb7e025", "siz...
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SpeciesPrompt(object): def setupUi(self, SpeciesPrompt): SpeciesPrompt.setObjectName("SpeciesPrompt") SpeciesPrompt.resize(325, 132) SpeciesPrompt.setFocusPolicy(QtCore.Qt.StrongFocus) self.centralwidget = QtWidgets.QWidget(Species...
{ "content_hash": "39b253963aa53c7b26cd963197a29fe8", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 114, "avg_line_length": 58.87931034482759, "alnum_prop": 0.7352855051244509, "repo_name": "DanielWinklehner/py_particle_processor", "id": "8603086d88a9c472189d0fb579a436f6935...
from azure.identity import DefaultAzureCredential from azure.mgmt.elasticsan import ElasticSanManagement """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-elasticsan # USAGE python volume_groups_get_minimum_set_gen.py Before run the sample, please set the values of the client ID, t...
{ "content_hash": "06a4b4e1f421082723ded84aa233bf88", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 157, "avg_line_length": 34.11764705882353, "alnum_prop": 0.728448275862069, "repo_name": "Azure/azure-sdk-for-python", "id": "f05e5ff0bb068b8483bad802789b32eae640e4d7", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('assessment', '0003_remove_surveytranslation_slug'), ] operations = [ migrations.AlterField( model_name='question', name='of_...
{ "content_hash": "57cf7801d6275e90946d4ba428de49e9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 163, "avg_line_length": 29.82608695652174, "alnum_prop": 0.5889212827988338, "repo_name": "vandorjw/django-assessment", "id": "8dcec75275b90e0c2c4657ed9f94b637f7fe05aa", "s...
import utils from copy import copy def cache_transform(transformation): cache = {} def fn(domain): cached = cache.get(domain) if cached is None: cached = transformation(domain) cache[domain] = cached return cached return fn class Domain(object): """ ...
{ "content_hash": "8ff1939c9dea272be942b84d337538cd", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 79, "avg_line_length": 28.904545454545456, "alnum_prop": 0.5496933480106935, "repo_name": "Kobzol/haydi", "id": "619bee6dcdd2f96dbe3e9a03fcca8728e1979851", "size": "12718"...
"""empty message Revision ID: 5e737138aae2 Revises: b26756ac7225 Create Date: 2017-08-08 16:53:04.953458 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '5e737138aae2' down_revision = 'b26756ac7225' branch_labels = None...
{ "content_hash": "c9825775dfecc1bea42c256406bb8025", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 98, "avg_line_length": 27.9, "alnum_prop": 0.6953405017921147, "repo_name": "TailorDev/pauling", "id": "8501570f799011e06da223396f52ec7b7924f5a1", "size": "837", "binary"...
""" Krakrobot Python Simulator Simulator which runs the simulation and renders SVG frames. """ from Queue import Queue import time import numpy as np import datetime from math import ( pi ) import traceback from map import load_map from misc.defines import * from robot import Robot from robot_controller ...
{ "content_hash": "f949e7f094146694f085f5054baf517a", "timestamp": "", "source": "github", "line_count": 426, "max_line_length": 136, "avg_line_length": 42.04694835680751, "alnum_prop": 0.5227221974095578, "repo_name": "uj-robotics/krakrobot2016-online", "id": "4ecbc7f7482b8c0cc5e1df08cbc992d212952fbe...
""" Set of functions that streamline controller initialization process """ import json import os from copy import deepcopy import numpy as np from .interpolators.linear_interpolator import LinearInterpolator from .joint_pos import JointPositionController from .joint_tor import JointTorqueController from .joint_vel im...
{ "content_hash": "15ba187f819665f16c9df8c8c1a59166", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 119, "avg_line_length": 37.226190476190474, "alnum_prop": 0.6874000639590662, "repo_name": "ARISE-Initiative/robosuite", "id": "12eac96736b0dd4d181bf690b460cbf302b52162", ...
import re import os import sys from inspect import ismethod from time import sleep from OSEncryptionState import * class EncryptBlockDeviceState(OSEncryptionState): def __init__(self, context): super(EncryptBlockDeviceState, self).__init__('EncryptBlockDeviceState', context) def should_enter(self): ...
{ "content_hash": "3b63aa120ee6b1cca2c9b021a3ee6266", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 147, "avg_line_length": 45.525252525252526, "alnum_prop": 0.597293099622809, "repo_name": "soumyanishan/azure-linux-extensions", "id": "87cf31d7e04023da732cc625e0bf2cb0baaab6...
import asyncio import datetime import json import logging import os import socket import sys import traceback import warnings import psutil from typing import List, Optional, Tuple import ray import ray._private.services import ray._private.utils from ray.dashboard.consts import ( GCS_RPC_TIMEOUT_SECONDS, CO...
{ "content_hash": "62e08fe33767d4cfc409e523aeb78750", "timestamp": "", "source": "github", "line_count": 945, "max_line_length": 88, "avg_line_length": 35.81269841269841, "alnum_prop": 0.5368613893567356, "repo_name": "ray-project/ray", "id": "38826aa41be45130e0bf45ce3b223dda334c5193", "size": "3384...
""" ====================================================== Out-of-core classification of text documents ====================================================== This is an example showing how scikit-learn can be used for classification using an out-of-core approach: learning from data that doesn't fit into main memory. ...
{ "content_hash": "75aced925337c4f03947f330e63925e8", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 79, "avg_line_length": 33.58894230769231, "alnum_prop": 0.6186216274243184, "repo_name": "rahul-c1/scikit-learn", "id": "61e899053a6a3980015e3ceb5935b481e4b4aa53", "size":...
"""The tests for the sun automation.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components import sun import homeassistant.components.automation as automation from homeassistant.const import ( ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF, SE...
{ "content_hash": "1cacbf32374192ce8a00056efa8bd4ff", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 86, "avg_line_length": 31.88235294117647, "alnum_prop": 0.553690036900369, "repo_name": "lukas-hetzenecker/home-assistant", "id": "f100fb53dc8a80ab41dc4fb921efcc11904d880b",...
"""Project action implementations""" import six from keystoneauth1 import exceptions as ks_exc from eclcli.common import command from eclcli.common import parseractions from eclcli.common import utils from eclcli.i18n import _ # noqa from eclcli.identity import common class CreateProject(command.ShowOne): """...
{ "content_hash": "3cc8dc7b4ecae6d5dd16ad7b9991844d", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 76, "avg_line_length": 32.77743902439025, "alnum_prop": 0.5081387777881128, "repo_name": "anythingrandom/eclcli", "id": "25c995d302f24e4607e928b3d074cb985d5e0c32", "size":...
import json import logging from django.utils.functional import wraps from django.utils.translation import ugettext as _ from desktop.conf import USE_NEW_EDITOR from desktop.lib.exceptions_renderable import PopupException from desktop.models import Document, Document2 from oozie.models import Job, Node, Dataset LOG...
{ "content_hash": "167176df8dd6000a0056209b0fde3458", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 118, "avg_line_length": 32.51801801801802, "alnum_prop": 0.6566006372073694, "repo_name": "todaychi/hue", "id": "04e106cb5e530c309373c7c81f851cec263c85ed", "size": "8011",...
import logging from binascii import hexlify from typing import Sequence, List from ledger import error from ledger.tree_hasher import TreeHasher from ledger.util import STH class MerkleVerifier(object): """A utility class for doing Merkle path computations.""" def __init__(self, hasher=TreeHasher()): ...
{ "content_hash": "20ca103fce80fb238a26e91a87a1a31a", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 42.52671755725191, "alnum_prop": 0.5201938610662359, "repo_name": "evernym/ledger", "id": "48c0d77e4c18105d350a5d8df66a83f1b978d687", "size": "11142...
"""Module implementing RNN Cells. This module provides a number of basic commonly used RNN cells, such as LSTM (Long Short Term Memory) or GRU (Gated Recurrent Unit), and a number of operators that allow adding dropouts, projections, or embeddings for inputs. Constructing multi-layer cells is supported by the class `M...
{ "content_hash": "707ed7bac25aacba85b4e35bcff4e660", "timestamp": "", "source": "github", "line_count": 1131, "max_line_length": 80, "avg_line_length": 39.37577365163572, "alnum_prop": 0.650648942381102, "repo_name": "alivecor/tensorflow", "id": "25a0ad0a37e33b0732e2ec038615e93d843a7def", "size": "...
''' The resources module provides the Resources class for easily configuring how BokehJS code and CSS resources should be located, loaded, and embedded in Bokeh documents. Also provides some pre-configured Resources objects: Attributes: CDN : load minified BokehJS from CDN INLINE : provide minified BokehJS fr...
{ "content_hash": "59907ba9e95c1bb109477dcba5b3ce31", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 172, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6065754633715799, "repo_name": "sahat/bokeh", "id": "0812bceb26eb6040cb827d1a7d256550ff7c6bd7", "size": "9064", ...
from __future__ import unicode_literals from wex.iterable import flatten from operator import methodcaller strip = methodcaller('strip') def partition(separator, **kw): """ Returns a function that yields tuples created by partitioning text using `separator`. """ normalize_head = kw.pop('normalize_...
{ "content_hash": "65f0194b26ac23fb9ec1a1c548f0da8e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 32.86363636363637, "alnum_prop": 0.6127247579529738, "repo_name": "eBay/wextracto", "id": "7bf57e76139b4f00a3f2599919dc5dd485839e95", "size": "723", ...
""" Classes for interpolating values. """ from __future__ import division, print_function, absolute_import __all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp', 'ppform', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly', 'RegularGridInterpolator', 'interpn'] import itertools imp...
{ "content_hash": "16b950252219f953481d89a124380550", "timestamp": "", "source": "github", "line_count": 2855, "max_line_length": 111, "avg_line_length": 35.33345008756567, "alnum_prop": 0.5487970498726171, "repo_name": "pyramania/scipy", "id": "35f1735dbff718c94feba253a085be03dff326e0", "size": "10...
class RemoveTable: """ Generates an SQL command to drop a table """ def __init__(self, table_name): if type(table_name) != str: self._table_name = table_name.name else: self._table_name = table_name @property def table_name(self) -> str: """ Returns the n...
{ "content_hash": "1f0034b6209811c647a852d6b47430b5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 52, "avg_line_length": 30.066666666666666, "alnum_prop": 0.549889135254989, "repo_name": "cmancone/mygrations", "id": "31f781c0e0a0bd7507df99b66fbe171ecb474247", "size": "4...
from __future__ import annotations import json import logging from collections import defaultdict from functools import partial from typing import Any, Callable, Dict, List, Set, Tuple, Type, Union import sqlalchemy as sqla from flask_appbuilder import Model from flask_appbuilder.models.decorators import renders from...
{ "content_hash": "36011ee0d8fda28b5b889ee2ef10cb05", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 88, "avg_line_length": 36.54157303370786, "alnum_prop": 0.6404280179570752, "repo_name": "mistercrunch/panoramix", "id": "d74efa72cde8f7a2be92c2c0257423fd1fbf23a7", "size"...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("airports", "0003_auto_20190321_1026"), ] operations = [ migrations.AlterField( model_name="airport", name="id", field=models.AutoField(auto_created=True,...
{ "content_hash": "a522599f9dbf4479b5bd1572b0af58f2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 108, "avg_line_length": 24.5625, "alnum_prop": 0.5979643765903307, "repo_name": "bashu/django-airports", "id": "0917ee0d174e96c58b80bdaef75e39d1462ab429", "size": "443", ...
from __future__ import with_statement, absolute_import import sys import time from contextlib import closing import psycopg2 from psycopg2.extensions import QuotedString from . import print_row_progress, status_logger from .postgres_writer import PostgresWriter class PostgresDbWriter(PostgresWriter): """Class u...
{ "content_hash": "e5e9e280c87adba2fb81a3f6994dd03c", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 144, "avg_line_length": 37.056994818652846, "alnum_prop": 0.5573266219239373, "repo_name": "anentropic/py-mysql2pgsql", "id": "5ebace1c06ac06257a9425c2ec736b222c04b566", "...
import json import time import unittest2 from unittest2 import SkipTest import test.functional as tf from copy import deepcopy from test.functional.tests import Base, Base2, BaseEnv, Utils from test.functional import cluster_info from test.functional.swift_test_client import Account, Connection, \ ResponseError ...
{ "content_hash": "b1f6b327aebcfd87a32c7c3ac42bf0f1", "timestamp": "", "source": "github", "line_count": 775, "max_line_length": 79, "avg_line_length": 42.36387096774194, "alnum_prop": 0.6251218323586745, "repo_name": "psachin/swift", "id": "f09e43e956f940994ad5b9b72e72926f28527240", "size": "33448"...
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor from sklearn.linear_model import LinearRegression, RANSACRegressor from sklearn.cross_validation import train_test_split, cross_val_score from sklearn.grid_search import GridSearchCV from sklearn.preprocessing import StandardScaler import mat...
{ "content_hash": "7950c4779dafa19c9b95c7dd52ed8197", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 109, "avg_line_length": 37.62068965517241, "alnum_prop": 0.5976168652612283, "repo_name": "marwin-ko/projects", "id": "78924849da70045a0ea10dd66702f89e34fc09b6", "size": "...
import ocw.utils as utils import numpy as np from scipy.stats import percentileofscore, linregress class Downscaling: def __init__(self, ref_dataset, model_present, model_future): ''' :param ref_dataset: The Dataset to use as the reference dataset (observation) :type ref_dataset: Dataset ...
{ "content_hash": "0231390a86902d26a8e4ebf09ee9f53a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 131, "avg_line_length": 41.12903225806452, "alnum_prop": 0.6739869281045752, "repo_name": "MBoustani/climate", "id": "75e2adc8ac9bc52e1afd066eca6d57d43d499bbd", "size": "46...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('taxbrain', '0012_auto_20141020_1540'), ] operations = [ migrations.AlterField( model_name='outputurl', name='slug', ...
{ "content_hash": "8cee9948052dc5bbea57f3297d19c1db", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 51, "avg_line_length": 21.166666666666668, "alnum_prop": 0.5931758530183727, "repo_name": "talumbau/webapp-public", "id": "bae99a0bf84c44a23b0ee3cfb5b35d3d49466434", "size"...
"""This example adds an HTML5 ad to a given AdGroup. To get ad_group_id, run get_ad_groups.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication information" se...
{ "content_hash": "1ca7267568d718760e100f1fb41daa6f", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 80, "avg_line_length": 25.43617021276596, "alnum_prop": 0.5938937682977834, "repo_name": "Aloomaio/googleads-python-lib", "id": "d0f2810fcd44408add600f074c87752e894fca0b", ...
from __future__ import print_function __license__ = """ Copyright (c) 2012-2014, Uwe Schmitt, ETH Zurich, all rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the...
{ "content_hash": "084f35386ffe479ff180f8e9c8155f5a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 79, "avg_line_length": 42.673469387755105, "alnum_prop": 0.733142037302726, "repo_name": "hendrik-cliqz/autowrap", "id": "fcc69e51be96127dc914ac71c151c681b3b5f68d", "size":...
import logging from importer.management.commands._import_base_command import ImportBaseCommand logger = logging.getLogger(__name__) class Command(ImportBaseCommand): help = "Import any oparl object by its id" def add_arguments(self, parser): super().add_arguments(parser) parser.add_argument...
{ "content_hash": "9854858bba8403af70b612831fa3c84f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 82, "avg_line_length": 31.333333333333332, "alnum_prop": 0.6773049645390071, "repo_name": "meine-stadt-transparent/meine-stadt-transparent", "id": "ce110892f3d95fb8b5929d54b9...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('plataforma', '0005_auto_20170710_1346'), ] operations = [ migrations.AddField( model_name='historicalnodo', name='contato_fa...
{ "content_hash": "bec873cca62c054912d24c4e89a28aba", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 82, "avg_line_length": 32.27906976744186, "alnum_prop": 0.5720461095100865, "repo_name": "bodedev/prospera", "id": "7879c7dad2304b70f50f48bd52ed7912deddf37c", "size": "1461...
from trac.tests.functional import * #TODO: split this into multiple smaller testcases class TestPreferences(FunctionalTwillTestCaseSetup): def runTest(self): """Set preferences for admin user""" prefs_url = self._tester.url + "/prefs" tc.follow('Preferences') tc.url(prefs_url) ...
{ "content_hash": "c2fb790ebe618e1357e2f947fcde826f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 70, "avg_line_length": 35.18840579710145, "alnum_prop": 0.6293245469522241, "repo_name": "dafrito/trac-mirror", "id": "968d2346597e492ef6a3b70eeb158269beaea7e5", "size": "2...
from angr.storage.file import SimFile from angr.storage.memory import SimMemory from angr.storage.memory_object import SimMemoryObject from angr.storage.paged_memory import SimPagedMemory
{ "content_hash": "05c445f8eeb0e630fd9092941bb011ef", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 54, "avg_line_length": 47, "alnum_prop": 0.8617021276595744, "repo_name": "Ruide/angr-dev", "id": "7aa6f4301a3ed985770f5a2e475ec4bddfbab59f", "size": "188", "binary": fals...
import unittest import gopay from tests.unit.utils import Utils class TestCreatePayment(unittest.TestCase): """TestCreatePayment class To execute test for certain method properly it is necessary to add prefix 'test' to its name. """ def setUp(self): self.payments = gopay.payments( ...
{ "content_hash": "77a5b66104d500c06bc548080c852a1a", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 97, "avg_line_length": 28.852941176470587, "alnum_prop": 0.5800203873598369, "repo_name": "gopaycommunity/gopay-python-api", "id": "ff2fdf07db56bab601e3b3c5c934fe7f81db7841",...
import os, shutil import glob, zipfile import re import pprint from xml.etree.ElementTree import ElementTree from collections import OrderedDict from operator import itemgetter import logging import datetime dateTimeInfo = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") loggingName = "aids_export" + dateTimeInfo + "...
{ "content_hash": "779d50a6fa500c75504b8e83cc4a4b5b", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 151, "avg_line_length": 39.87719298245614, "alnum_prop": 0.6110866695996481, "repo_name": "rochester-rcl/islandora-import-scripts", "id": "1527c84f2d47a6f4fbd2d1f9f8038d60b4...
""" Copyright 2014-2016 University of Illinois Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writ...
{ "content_hash": "2588cdd91ad0b671ea6cb3362700c843", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 28.53125, "alnum_prop": 0.764512595837897, "repo_name": "opena11y/fae2", "id": "51df7a9c38d1552784c5a68a379291a45472708b", "size": "913", "binary":...
import os import tensorflow as tf import numpy as np from tensorflow.contrib.tensorboard.plugins import projector import argparse def create_embeddings(sess, log_dir, embedding_file='', tensor_name='embedding'): """ Add the embeddings to input TensorFlow session and writes a metadata_file containing the words in ...
{ "content_hash": "9e8c0d186dee05560cdd3fc5264f7df8", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 120, "avg_line_length": 40.03603603603604, "alnum_prop": 0.614986498649865, "repo_name": "harkous/embeddingsviz", "id": "881948dec46245679d09a0be1b2d831cea1038c3", "size":...