text
stringlengths
4
1.02M
meta
dict
from setuptools import setup import glob import versioneer d = 'Genome annotation data analysis and management implemented in pure Python' setup(name='tag', version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description=d, url='http://tag.readthedocs.io', author='Danie...
{ "content_hash": "52f86524e99cf801875a8af04a0329b4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 36.724137931034484, "alnum_prop": 0.6056338028169014, "repo_name": "standage/tag", "id": "a780b4178078c4eb86859a6557feac105d71f4ad", "size": "1440", ...
from django.http import Http404, HttpResponse from django.conf import settings from django.template.loader import render_to_string from django.core.files.storage import default_storage from django.core.files.base import ContentFile from PIL import Image import json from settings import FILES_DIR, PROJECT_DIR, IMAGE_Q...
{ "content_hash": "c8092bd25e01bc9cfda225498a81c5ce", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 97, "avg_line_length": 40.36363636363637, "alnum_prop": 0.5490990990990992, "repo_name": "dellax/django-files-widget", "id": "e818aa0804e1730cee423c1c21f47592d40abce4", "si...
from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" client = Client(account_sid, auth_token) data = {'number': "001", 'name': "Bulbasaur", 'attack': 50} list_item = client.sync \ .services(...
{ "content_hash": "e9bf5abbfd36e5ec215b48b77979d96d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 62, "avg_line_length": 29.125, "alnum_prop": 0.7145922746781116, "repo_name": "teoreteetik/api-snippets", "id": "42710f27de4a09af0ad39880e668410743ea2081", "size": "539", ...
"""This file contains integration tests for the semiparametric estimation routine.""" import numpy as np import pandas as pd import pickle from grmpy.estimate.estimate import fit from grmpy.grmpy_config import TEST_RESOURCES_DIR from grmpy.read.read import read from grmpy.simulate.simulate import simulate from grmpy.t...
{ "content_hash": "5bb2e78dd67d9ea14b825da3c6501826", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 88, "avg_line_length": 42.111111111111114, "alnum_prop": 0.7044854881266491, "repo_name": "grmToolbox/grmpy", "id": "a957ba1ee0b40b5ba51ddc5db7b2abb008908b65", "size": "227...
from uuid import UUID from graphscale.pent.pent import Pent from graphscale.grapple.grapple_utils import req_data_elem_invalid, req_data_elem_valid class TodoUserGenerated(Pent): @staticmethod # This method checks to see that data coming out of the database is valid def is_input_data_valid(data): ...
{ "content_hash": "a87ed9ca8457eed6309856de212f5808", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 94, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6369593709043251, "repo_name": "schrockntemp/graphscaletemp", "id": "01850d01a2315e04e6d82eaddc33e2816019deb8", "...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base...
{ "content_hash": "51d9a95121c9f5a5171542eb08e06cf1", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 122, "avg_line_length": 39.29392971246006, "alnum_prop": 0.6646881860313847, "repo_name": "twilio/twilio-python", "id": "fad7bfdf228255cfb76d25f0d20fc604df5ed0b3", "size":...
import sys from .client import MantridClient class MantridCli(object): """Command line interface to Mantrid""" def __init__(self, base_url): self.client = MantridClient(base_url) @classmethod def main(cls): cli = cls("http://localhost:8042") cli.run(sys.argv) @property ...
{ "content_hash": "fc5be68c363f3ee4e3fb4388f3eac1ea", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 88, "avg_line_length": 36.48951048951049, "alnum_prop": 0.4727865082407052, "repo_name": "epio/mantrid", "id": "f7308663c6efc7fb20c889452d367dd74dc0ad2d", "size": "5218", ...
import sys import numpy as np # ==================================================================== # Non-standard packages # ==================================================================== import esbltaylor.esbltaylor as esbltaylorbuilt # ==================================================================== # F...
{ "content_hash": "67b2fd5919d5b8d5b474ecadc1b54700", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 102, "avg_line_length": 31.12925170068027, "alnum_prop": 0.5168269230769231, "repo_name": "muLAn-project/muLAn", "id": "8695d0cf643c0e3c1de29a71b0a9f9c24e0e5c4f", "size": ...
"""Paralllel ``project'' from loooong chain/trees objects """ # ============================================================================= __version__ = "$Revision$" __author__ = "Vanya BELYAEV [email protected]" __date__ = "2011-06-07" __all__ = ( 'cproject' , ## parallel project from looong TChai...
{ "content_hash": "5c3e4030d901055537e51eecea1e0439", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 98, "avg_line_length": 39.02888086642599, "alnum_prop": 0.4969938026084543, "repo_name": "OstapHEP/ostap", "id": "2dd71b2c17c9b438ccd00d664530de402fcb4576", "size": "11188...
import tensorflow as tf def read_image_op(filename_queue, reader, height, width): # 画像読み込みのオペレーションです。 # TensorFlowのチュートリアルでもよく見かけるやつ。 _, raw = reader.read(filename_queue) read_image = tf.image.decode_jpeg(raw, channels=3) read_image = tf.to_float(read_image) / 255. read_image = tf.image.resize...
{ "content_hash": "bacb2ab28db776ce14415a2b354529c1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 68, "avg_line_length": 33.92307692307692, "alnum_prop": 0.7006802721088435, "repo_name": "YusukeSuzuki/tensorflow_minimum_template", "id": "b6b54d201e8ea938493752d323b9a52152...
__all__ = ['labels_to_matrix'] import numpy as np from ..core import ants_image as iio def labels_to_matrix(image, mask, target_labels=None, missing_val=np.nan): """ Convert a labeled image to an n x m binary matrix where n = number of voxels and m = number of labels. Only includes values inside the pro...
{ "content_hash": "ffc7eacd135c9c00d302d3c630b4b089", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 29.71875, "alnum_prop": 0.6235541535226078, "repo_name": "ANTsX/ANTsPy", "id": "4744a2cf4e94091c97e956b85ef29793a00e62c7", "size": "1903", "binary"...
class MockedClass: def __init__(self): pass @classmethod def mocked_class_method(a, b, c, d=10, *args, **kwargs): """This is a mocked class method""" pass def mocked_instance_method(self, a, b, c, d=10, *args, **kwargs): """This is a mocked instance method""" p...
{ "content_hash": "6969b27ae6256e40b6437db2294797cd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 23.166666666666668, "alnum_prop": 0.5731414868105515, "repo_name": "tohyongcheng/pipspect", "id": "32816af217922f7c5d0636eeef43008a80016474", "size":...
"""ask URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
{ "content_hash": "1fc4745d851a68fd72e378777f8fab98", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 36.54545454545455, "alnum_prop": 0.6902985074626866, "repo_name": "bugness/learning-django", "id": "ce62c33e9f54c2fcb61103171750a5ad2fc5b6e0", "size"...
import http.server import http.client import json import socketserver class testHTTPRequestHandler(http.server.BaseHTTPRequestHandler): OPENFDA_API_URL="api.fda.gov" OPENFDA_API_EVENT= "/drug/event.json" def get_main_page(self): html=""" <html> <head> <title>Op...
{ "content_hash": "99b6cee2e9ce97c56ddc5d04ffe16876", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 148, "avg_line_length": 30.548494983277592, "alnum_prop": 0.495511276549157, "repo_name": "cgomezh/openfda", "id": "12cb6d50b3ac7ed171d800fc8725f3700b609d36", "size": "102...
from typing import Any, List, TYPE_CHECKING import importlib import urllib.parse from ._recovery_services_backup_client import RecoveryServicesBackupClient as RecoveryServicesBackupClientGenerated from azure.core.pipeline.policies import SansIOHTTPPolicy if TYPE_CHECKING: from azure.core.credentials import TokenCr...
{ "content_hash": "2c53fa71f3a89a9776a329a65b9677e7", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 118, "avg_line_length": 40.64912280701754, "alnum_prop": 0.6952956409149763, "repo_name": "Azure/azure-sdk-for-python", "id": "41fd81d5f41ec3da1005149950fe267d70cca666", "s...
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson from __future__ import division, absolute_import, print_function import os, signal import warnings import sys fr...
{ "content_hash": "247643c7832b682a07c3c97c4711c17d", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 108, "avg_line_length": 37.20860215053764, "alnum_prop": 0.5105768119292567, "repo_name": "techtonik/numpy", "id": "0086e36328ca6de6535957f617265cec6802f4b4", "size": "173...
import sys import os __author__ = 'João Trevizoli Esteves' class ErrorInfo(object): def __init__(self): self.exc_type, self.exc_obj, self.exc_tb = sys.exc_info() self.file_name = self.get_file_name() self.line_number = self.get_line_number() def get_line_number(self): return ...
{ "content_hash": "eb8506cc64a8002f6dcf41f0210fdcac", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 73, "avg_line_length": 19.4, "alnum_prop": 0.6374570446735395, "repo_name": "joaoTrevizoli/climatemps-data", "id": "ce6304a50dbe1d507878624a8b19b94272501880", "size": "583"...
def test(verbose=False): import os, nose from . import tests directory = os.path.dirname(tests.__file__) argv = ['nosetests', '--exe', directory] try: return nose.main(argv=argv) except SystemExit as e: return e.code
{ "content_hash": "091d568bfc6289c62e0dbb658422c9e6", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 47, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6038461538461538, "repo_name": "tmerr/trevornet", "id": "7734daec827d54497ba1445959dba1afa060fe53", "size": "260"...
from flask import Flask, g from proxypool.storages.redis import RedisClient from proxypool.setting import API_HOST, API_PORT, API_THREADED, IS_DEV __all__ = ['app'] app = Flask(__name__) if IS_DEV: app.debug = True def get_conn(): """ get redis client object :return: """ if not hasattr(g, '...
{ "content_hash": "d36f79699e1b1b9b4c1c806c735d495f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 70, "avg_line_length": 18.420289855072465, "alnum_prop": 0.5814319433516916, "repo_name": "Python3WebSpider/ProxyPool", "id": "f7138c64854f49ece2c496eff5f4166bc32c8367", "s...
"""Provides basic modules of Rime. Basic package contains implementations of interfaces provided in core package, providing standard commands/targets like build/test of problem/solution etc. """
{ "content_hash": "ade7ec1bfddb515f92cdacb798f32d8a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 78, "avg_line_length": 39.2, "alnum_prop": 0.8112244897959183, "repo_name": "AI-comp/Orientation2015Problems", "id": "6299f76d55a49a062067628d314c358990cf77b6", "size": "131...
import subprocess as sp # Motivation: # It is often useful to have Python parse the output of a shell command. # The subprocess.call() and subprocess.check_output() functions only # return the status of the command that they execute. # # Consider the following command: # $ grep -r foo * # # It could be useful to par...
{ "content_hash": "ce75d721212c27a64a85936907173777", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 72, "avg_line_length": 32.59090909090909, "alnum_prop": 0.6471408647140865, "repo_name": "civissmith/python_examples", "id": "1f517fb8c8e71e436d21f61feb5c9c4cb6e049bc", "si...
"""Process flow The core process flow for managing the syncing of torrents to remote location. """ import logging from seedbox import db from seedbox.process import manager from seedbox.process import workflow from seedbox.torrent import loader LOG = logging.getLogger(__name__) def _get_work(dbapi): # search ...
{ "content_hash": "197afc7735ec7867cc662e398f0ef03f", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 78, "avg_line_length": 30.094594594594593, "alnum_prop": 0.5792546026044005, "repo_name": "shad7/seedbox", "id": "1039eb279df0939dc4d6de6a41a6466967270002", "size": "2227",...
from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import redirect, get_object_or_404 from django.urls import reverse from ...
{ "content_hash": "532630208e222bd606271ed7a1af0c22", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 111, "avg_line_length": 39.58441558441559, "alnum_prop": 0.6253280839895013, "repo_name": "bgroff/kala-app", "id": "75ab611f3ca6ce8563bbbea958132b82267460f0", "size": "3048...
from .pqdinstrument import * from .server import run_server
{ "content_hash": "45591638b829d043c04618a455b29975", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 30, "avg_line_length": 29.5, "alnum_prop": 0.8135593220338984, "repo_name": "guenp/PyQDInstrument", "id": "ac2fbcd52e53141ea3e02d453ab4ec725536f593", "size": "59", "binary...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class TxnMallTest(BitcoinTestFramework): def add_options(self, parser): parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true", help="Test double-spend...
{ "content_hash": "1e835a74d53d0eabfeb6e10d2232d8ab", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 111, "avg_line_length": 47.31578947368421, "alnum_prop": 0.5806451612903226, "repo_name": "vivocoin/vivo", "id": "2d6d11c82d4ccd33e55d4eca31dbe0d8af03389f", "size": "6567"...
from instabot.api.request import Request def is_id(smth): ''' checks if input string is a number ''' if str(smth).isdigit(): return True return False def get_user_info(user, user_id): if is_id(user_id): return Request.send(user.session, 'users/' + str(user...
{ "content_hash": "3e9edab06aa67433ecac740367a9e917", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 148, "avg_line_length": 37.943396226415096, "alnum_prop": 0.5683739433117851, "repo_name": "instagrambot/instapro", "id": "6363064d954241b2ef152ef3e65a9bcd0c9b7d97", "size"...
from django.db import models from django.conf import settings from django.core.urlresolvers import reverse from django.db.models.signals import pre_save from django.utils.text import slugify from django.contrib.contenttypes.models import ContentType from comments.models import Comment def upload_location(instance,...
{ "content_hash": "876142742a460d299b19e517b988144c", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 76, "avg_line_length": 28.138297872340427, "alnum_prop": 0.6294896030245747, "repo_name": "shawon922/django-blog-api", "id": "e6c6f10bcb5f0dcb0954dae1af242a6c433bdd42", "si...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'django_es_model.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^demo/', include('demo.urls'...
{ "content_hash": "b32144fc95b8b60b0c62c38f1ed9f7a4", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 29.636363636363637, "alnum_prop": 0.6319018404907976, "repo_name": "jxstanford/django_es_model", "id": "59a797d79e91c88f4e4ae06727776fd8fd843e0b", "s...
from __future__ import absolute_import import mock from sentry.tasks.fetch_source import expand_javascript_source from sentry.testutils import TestCase class ExpandJavascriptSourceTest(TestCase): @mock.patch('sentry.models.Event.update') @mock.patch('sentry.tasks.fetch_source.fetch_url') @mock.patch('se...
{ "content_hash": "2d636410f42ec8c7b50a841d3fd3e12d", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 35.3125, "alnum_prop": 0.4920353982300885, "repo_name": "NickPresta/sentry", "id": "122d91cc2f10fde245e2fa5dee55f0684250d8f3", "size": "1720", "bin...
"""Session Handling for SQLAlchemy backend.""" from nova.db.sqlalchemy import session as nova_session from nova.openstack.common import cfg opts = [ cfg.StrOpt('sql_connection', default='sqlite:///$state_path/baremetal_$sqlite_db', help='The SQLAlchemy connection string used to conne...
{ "content_hash": "5dd54bfe0ee8cc4589b0f9b820a8be99", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 27.477272727272727, "alnum_prop": 0.6550868486352357, "repo_name": "houshengbo/nova_vmware_compute_driver", "id": "d6e2a533d970b1b5b2fa6185cf163782d23a...
from __future__ import unicode_literals from functools import wraps from django.contrib.auth.decorators import user_passes_test from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.urlresolvers import reverse_lazy from django.shortcuts import resolve_url from django.utils.decorators import available_att...
{ "content_hash": "feb89ab0e5385e046907af52a37fee9f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 98, "avg_line_length": 36.53623188405797, "alnum_prop": 0.6830622768742562, "repo_name": "SaturdayNeighborhoodHealthClinic/clintools", "id": "3c75e6d72267c616a5b0a610e26befc7...
from setuptools import setup project = "polichart" setup( name=project, version='0.1', url='https://github.com/cjmabry/PoliChart', description='Election projections, data visualization, and political rants.', author='Chris Mabry', author_email='[email protected]', packages=["polichart"], ...
{ "content_hash": "fec6d517561abc49b34adfda955a2a3c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 24.305555555555557, "alnum_prop": 0.5714285714285714, "repo_name": "cjmabry/PoliChart", "id": "09d530fcf18fb7fd44d798a96b55e0d139334cdf", "size": "90...
from datetime import datetime import pytest from sandglass import time from sandglass.time import utils from sandglass.time import guess_version def test_base(config): # Check app version generation version = guess_version('sandglass.time', time.__file__) assert version assert version == time.__vers...
{ "content_hash": "e5b215cad93918506578366e417c1453", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 78, "avg_line_length": 27.652582159624412, "alnum_prop": 0.6505942275042444, "repo_name": "sanglass/sandglass.time", "id": "746ca7e20c4e7ce671adb853e181d6cf12766fe6", "siz...
from django.db import models from django.db.models import Q from django.conf import settings #Python Imports import datetime #Local Imports import swapper from utils.models import TimeStampedModel,ForUserQuerySet import utils class ScheduleQuerySet(ForUserQuerySet): def pending(self,**kwargs): pending ...
{ "content_hash": "3102ebb4fb9c7636515bd7f236701856", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 121, "avg_line_length": 32.70542635658915, "alnum_prop": 0.6271628347949751, "repo_name": "I-TECH-UW/mwachx", "id": "d47d539c086a33b095f5dc8febd2babca50eb216", "size": "84...
from flask import Flask, request import os import smtplib import json import logging import gmail def send_email(user, pwd, recipient, subject, body): gmail_user = user gmail_pwd = pwd FROM = user TO = recipient if type(recipient) is list else [recipient] SUBJECT = subject TEXT = body # P...
{ "content_hash": "c83195cd16ddf9da4fa927fa1dc80373", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 105, "avg_line_length": 28.72463768115942, "alnum_prop": 0.6594349142280524, "repo_name": "miguelcastilho/BikeApp", "id": "1a84d1876d892e3ab6a42c50e62c8018410b2f1f", "size"...
from __future__ import print_function import pmisc def timer(num_tries, fpointer): with pmisc.Timer() as tobj: for _ in range(num_tries): fpointer() print("Time per call: {0} seconds".format(tobj.elapsed_time / (2.0 * num_tries))) def sample_func(): count = 0 for num in range(0, ...
{ "content_hash": "f44e4e410bf3c4f6d28596061142b587", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 85, "avg_line_length": 23.266666666666666, "alnum_prop": 0.6045845272206304, "repo_name": "pmacosta/pmisc", "id": "2076b40039856c46d60fcd7964f7b454e020dd2e", "size": "475",...
"""Compare Pulsar and HabCat coordinates""" import csv import astropy.units as u from astropy.coordinates import SkyCoord, Angle from astropy import coordinates as coord def flipra(coordinate): """Flips RA coordinates by 180 degrees""" coordinate = coordinate + 180 if coordinate > 360: coordin...
{ "content_hash": "7057826badf8a819a620904e8c442bee", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 35.51315789473684, "alnum_prop": 0.6391256020748425, "repo_name": "hippke/Pulsar-HabCat", "id": "8bd44a4693e67e14e58979499d1babf4d79e9cd5", "size": "...
import posixpath from fabric.api import settings, run, sudo, puts, warn, hide from . import system from .containers import conf from .task import Task __all__ = [ 'install', 'dump', 'execute', 'create_user', 'drop_user', 'create_db', 'drop_db', 'grant', ] class Install(Task): "...
{ "content_hash": "087c2bccd99dd37ff4c9dc489350e40e", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 79, "avg_line_length": 23.514792899408285, "alnum_prop": 0.5639154504277806, "repo_name": "vmihailenco/fabdeploy", "id": "3dd0db582f9a949ec472cbf30f3a830a163c0407", "size"...
from setuptools import setup setup( # GETTING-STARTED: set your app name: name='lister', # GETTING-STARTED: set your app version: version='0.1', # GETTING-STARTED: set your app description: description='OpenShift Lister App', # GETTING-STARTED: set author name (your name): author='Brian...
{ "content_hash": "c6e3f536f17d803a8a4781cf628658d6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 54, "avg_line_length": 30.5, "alnum_prop": 0.6406052963430012, "repo_name": "bolecki/lister", "id": "0d3d3ad44e0952b31bb0ce61c287de6ea28dc785", "size": "816", "binary": f...
""" Abstract pipeline interface definition. """ from . import StopPipeline class Message: """ Base class which represents information passed within the Pipeline. Implements dict-like interface, should be simple and extendable. Should allow subclasses to support data and schema (elasticsearch schema)...
{ "content_hash": "e1f111b69ca815f33c39469a0d99fdc8", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 26.865384615384617, "alnum_prop": 0.5869720830350752, "repo_name": "blaa/DataStalker", "id": "89909d2b1c91cf9c01379be92e45d6c38e541d6c", "size": "28...
""" Scraper for Indiana Supreme Court CourtID: ind Court Short Name: Ind. Auth: Jon Andersen <[email protected]> Reviewer: mlr History: 2014-09-03: Created by Jon Andersen """ from juriscraper.OpinionSite import OpinionSite import time from datetime import date class Site(OpinionSite): def __init__(self, *ar...
{ "content_hash": "7e22ca0088f0f5075d65c386b320c70c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 94, "avg_line_length": 34.125, "alnum_prop": 0.5834641548927263, "repo_name": "m4h7/juriscraper", "id": "5e5db1adecf876698765ac288e5babae5745ff88", "size": "1911", "binar...
import os import glob from lino.textprinter.plain import PlainTextPrinter from lino.textprinter.pdfprn import PdfTextPrinter from lino.textprinter.htmlprn import HtmlTextPrinter from lino.textprinter.winprn import Win32TextPrinter from lino import config PSPRINTER=config.win32.get('postscript_printer') ...
{ "content_hash": "3e525b1a0c5259a716a83c00abf0fcbf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 67, "avg_line_length": 25.79591836734694, "alnum_prop": 0.5909810126582279, "repo_name": "lsaffre/timtools", "id": "5949f0a150cc331df27dc68d171cb791ed5c609c", "size": "1264...
import wx, subprocess, dialog, strings, vars class Flasher: def __init__(self): self.version = ['--version'] self.title = ['--title'] self.format = ['--format'] self.delete01 = ['--delete','BANK','1'] self.delete02 = ['--delete','BANK','2'] self.read01 = ['-...
{ "content_hash": "55768c88cce87438ada0d4b57fde15bd", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 102, "avg_line_length": 34.125, "alnum_prop": 0.5631257631257631, "repo_name": "zeroerrequattro/ems-flasher-gui", "id": "781e25c40d690dadd2ed5b174e48c7d4a9fedf5c", "size":...
""" mbed CMSIS-DAP debugger Copyright (c) 2016 ARM Limited 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 o...
{ "content_hash": "9973bede41708bc25c972b082e172925", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 135, "avg_line_length": 32.43262411347518, "alnum_prop": 0.5415846636052191, "repo_name": "matthewelse/pyOCD", "id": "af176af5b2972389998915571d149e6c4d1babe7", "size": "1...
from common import * DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'djangoblog', # Or path to database file if using sqlite3. # The following s...
{ "content_hash": "08cb66535c4367a88fa0ee20d24981a0", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 127, "avg_line_length": 32.58064516129032, "alnum_prop": 0.6688118811881189, "repo_name": "NikhilKalige/DjangoBlog", "id": "af2e585490ca3a4ef8d20d0a924fcbd7a7240adf", "siz...
import requests from math import sqrt # from .yelp import find_yelp_posts from .sendsms import SMS # from .models import Route, Trip # from users.model import User def distance(point_m, point_n): d0 = point_n[0] - point_m[0] d1 = point_n[1] - point_m[0] return sqrt(d0**2 + d1**2) def scenic_trip_buil...
{ "content_hash": "a127d3b020b27861ecc651337e68b073", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 102, "avg_line_length": 26.87074829931973, "alnum_prop": 0.5939240506329114, "repo_name": "newtonjain/hacktheplanet", "id": "c0cda2fbf47320f0075bf21c605262af3cf675fd", "si...
from distutils import core from distutils import errors import logging import os import sys import warnings from pbr import util if sys.version_info[0] == 3: string_type = str integer_types = (int,) else: string_type = basestring # flake8: noqa integer_types = (int, long) # flake8: noqa def pbr(d...
{ "content_hash": "574a44c2a353d198d6fe3236d9acdcb9", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 78, "avg_line_length": 37.674157303370784, "alnum_prop": 0.6450939457202505, "repo_name": "ryfeus/lambda-packs", "id": "a93253baddf4796a1d3be3c80ef0f0979cf95d54", "size": "...
from twython import Twython import pandas as pd from loader import load_paths import time from shutil import rmtree, move from urllib.request import urlopen from zipfile import ZipFile import os import pickle def access_twitter_api(): """ Gets API keys from a hardcoded path and returns an initialized Twython twitter ...
{ "content_hash": "5a0aa6d38358a9bf5a55776633eb0dd7", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 166, "avg_line_length": 42.80152671755725, "alnum_prop": 0.7335473515248796, "repo_name": "pawarren/Fake-News-Echo-Chambers", "id": "d38a0b0a384455196f0688660e4133d538743421...
from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = '/' RELATIVE_URLS = False FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/%s...
{ "content_hash": "262f6dd282191ab7607b2e6171be625c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 53, "avg_line_length": 21.923076923076923, "alnum_prop": 0.7473684210526316, "repo_name": "ramaseshan/ramaseshan.github.io", "id": "e55ea526964d07b24a877485a5560e7c5dd14464",...
import datetime import hashlib import json import falcon USE_CACHE_CONTROL = 'USE_CACHE_CONTROL' USE_ETAG = 'USE_ETAG' def is_error(status): """Determine if the response has an error status :param status: HTTP Status string to inspect :return: True if the status code is 400 or greater, otherwise False...
{ "content_hash": "b5a907f2337013f43174f24e1ff823c8", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 77, "avg_line_length": 30.047619047619047, "alnum_prop": 0.628254471360652, "repo_name": "eve-basil/common", "id": "c356401c5a64d66c69278d0f30bbaa1203538117", "size": "441...
""" import custom loss here """
{ "content_hash": "d83bdd49f8db301fc2871cb63c1adeb1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 23, "avg_line_length": 10.666666666666666, "alnum_prop": 0.625, "repo_name": "FederatedAI/FATE", "id": "6e65894e2c5b9c175719865cffeb5db73645c7d7", "size": "647", "binary":...
import setuptools setuptools.setup( name = 'hetio', version = '0.1.0', author = 'Daniel Himmelstein', author_email = '[email protected]', url = 'https://github.com/dhimmel/hetio', description = 'Heterogeneous networks', license = 'CC0', packages = ['hetio'], )
{ "content_hash": "2b695a36d3f2a50fb6464aec1dd3c27f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 50, "avg_line_length": 25.75, "alnum_prop": 0.6245954692556634, "repo_name": "xypan1232/hetio", "id": "7d8645bbf933ed8f6fdd047ef65a6e2de577b417", "size": "309", "binary":...
import networkx as nx from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_0 from ryu.lib.mac import haddr_to_bin from ryu.lib.packet import packet from ryu.lib.packet im...
{ "content_hash": "e5e08fceefb9890f8d6d74addeecd1a3", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 80, "avg_line_length": 30.03271028037383, "alnum_prop": 0.5467558736580053, "repo_name": "TakeshiTseng/SDN-Work", "id": "da53e9c8f9419998867dda6c62a49aecc1211e0a", "size":...
from nose.tools import assert_greater from .... import make from ....core.mod import mod from ...ut import need_scrapyd from .. import name @need_scrapyd def test_spy_query(): app = make() with app.app_context(): d = mod(name).spy('language:chinese', 60) assert_greater(len(d.posts), 0) ...
{ "content_hash": "f6e67e6f69f304e79b4810c596ef7076", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 83, "avg_line_length": 29.133333333333333, "alnum_prop": 0.6384439359267735, "repo_name": "Answeror/torabot", "id": "f4389d21db9fed61e89a552e31171f3ff558ab70", "size": "437...
from collections import namedtuple import struct, math from panda3d.core import Geom, GeomVertexData, GeomVertexFormat, GeomVertexReader, GeomVertexRewriter from panda3d.core import Thread from panda3d.core import Point3 from direct.directnotify.DirectNotify import DirectNotify from simpleCircle import SimpleCircle ...
{ "content_hash": "75a157a386b6683894e478b7639e0994", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 119, "avg_line_length": 34.748936170212765, "alnum_prop": 0.6136419299534656, "repo_name": "jkcavin1/creepy-duck", "id": "581b7c01ae7593e48a50597d25a7c82cc6593b80", "size"...
""" Emphatic Temporal Difference Learning Algorithm (ETD), implemented in Python 3. """ import numpy as np class ETD: """Emphatic Temporal Difference Learning, or ETD(λ). Attributes ---------- n : int The number of features (and therefore the length of the weight vector). z : Vector[floa...
{ "content_hash": "48d4c87cf87aad00363a1ca15757b5a0", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 79, "avg_line_length": 29.73404255319149, "alnum_prop": 0.5488372093023256, "repo_name": "rldotai/rl-algorithms", "id": "10fb9a41e05107b58bad08e8a114ccc5cd9ad556", "size": ...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Quantization'] , ['MovingAverage'] , ['Seasonal_Hour'] , ['AR'] );
{ "content_hash": "4547b1d5d674678f03e5ba592398a7b5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 89, "avg_line_length": 40.5, "alnum_prop": 0.7160493827160493, "repo_name": "antoinecarme/pyaf", "id": "3e09db9347f501f0e2b43feecab2ed69e6423ddc", "size": "162", "binary":...
import os import sys import design try: from setuptools import setup except ImportError: from distutils.core import setup version = design.__version__ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') print("You probably want to also tag the version now:") print(" git tag ...
{ "content_hash": "084eebe9192f9e8be685aa287dddb691", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 73, "avg_line_length": 28.24137931034483, "alnum_prop": 0.6117216117216118, "repo_name": "audreyr/design", "id": "75f3b67c28e1c038d068e49b1e51d98e43085cc6", "size": "1685",...
import tempfile from pathlib import Path import bpy from bpy_extras.image_utils import load_image import gpu from gpu_extras.batch import batch_for_shader from mathutils import Matrix, Color from ..lib import asset from . import onscreen_text from .offscreen import draw_gems def srgb_to_linear(color) -> Color: ...
{ "content_hash": "fc5536cc1dce3bff3ed5a9c4f9b38953", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 122, "avg_line_length": 29.475806451612904, "alnum_prop": 0.573187414500684, "repo_name": "mrachinskiy/blender-addon-jewelcraft", "id": "ed1a8530f28b5f583351245a811e66e1ee43...
from direct.showbase.PythonUtil import randFloat, normalDistrib, Enum from toontown.toonbase import TTLocalizer, ToontownGlobals import random, copy TraitDivisor = 10000 def getTraitNames(): if not hasattr(PetTraits, 'TraitNames'): traitNames = [] for desc in PetTraits.TraitDescs: ...
{ "content_hash": "7fb17667e4d056d99e2fbbe862ae1c5f", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 92, "avg_line_length": 39.088, "alnum_prop": 0.589541547277937, "repo_name": "DedMemez/ODS-August-2017", "id": "770e9ef4ca3abe5ab5397f4f287ae86bf9883b0f", "size": "9856", ...
""" This script converts a set of SWC files into an HDF5 file """ import h5py import numpy as np from glob import glob # assumption # the ids are ordered starting from 1, root node has parent -1 # the swc files are from neuromorpho.org # http://neuromorpho.org/neuroMorpho/dableFiles/turner/Source-Version/l71.swc # h...
{ "content_hash": "934487acc63df567f39c42a6eefd151e", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 30.79310344827586, "alnum_prop": 0.6338185890257558, "repo_name": "fos/fos-legacy", "id": "97ef1e737b2c8d2bf26584e20cb3045a7c59ae40", "size": "1786",...
class Meta(dict): pass
{ "content_hash": "36c45a13e27c72e1042e73cb1b745986", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 17, "avg_line_length": 13.5, "alnum_prop": 0.6296296296296297, "repo_name": "mjdominus/suxsom", "id": "24f6def960e0790310cd2589a7033ab88afad07f", "size": "28", "binary": f...
import StringIO from telemetry.internal.backends.chrome_inspector import websocket class InspectorConsole(object): def __init__(self, inspector_websocket): self._inspector_websocket = inspector_websocket self._inspector_websocket.RegisterDomain('Console', self._OnNotification) self._message_output_stre...
{ "content_hash": "7264a96e1b28ea3b64f992da8c323677", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 36.91304347826087, "alnum_prop": 0.676678445229682, "repo_name": "endlessm/chromium-browser", "id": "445222ab9a403d37ae24b787079409d89ea4ad39", "size...
import requests import json import constants import sys import os from cloudify.exceptions import RecoverableError from cloudify import ctx from cloudify.decorators import operation import utils import auth import azurerequests @operation def creation_validation(**_): for property_key in constants.STORAGE_ACCOUNT...
{ "content_hash": "e44eae56a52ffcc5ff73b1b60dd634b5", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 229, "avg_line_length": 52.161764705882355, "alnum_prop": 0.7289258528333803, "repo_name": "anilveeramalli/cloudify-azure-plugin", "id": "3c10639fd74390b2790c48e15c0826f5a4e...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "d5372d405dc8113c25cb62971cdf3b37", "timestamp": "", "source": "github", "line_count": 870, "max_line_length": 377, "avg_line_length": 38.314942528735635, "alnum_prop": 0.5819283614327714, "repo_name": "napalm-automation/napalm-yang", "id": "c35c7e9ded992dd656dbe75dd604e492649cb50e",...
import numpy as np import tensorflow as tf import h5py from sklearn.preprocessing import OneHotEncoder import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import time import scipy.io # Functions for initializing neural nets parameters def weight_variable(shape, var_name): initial = ...
{ "content_hash": "47f508623f7fe859809386f62b93739c", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 97, "avg_line_length": 32.761702127659575, "alnum_prop": 0.6508637485387713, "repo_name": "Haunter17/MIR_SU17", "id": "79ccefe2a03ed9bdf694898fb051f52df263366a", "size": "...
""" # lixo unionmangas find . -type f -name 'bannernovo_1.png' -delete find . -type f -name 'bannernovo_2.png' -delete find . -type f -name 'bannernovo_3.png' -delete find . -type f -name 'banner_scan.png' -delete find . -type f -name 'promo-anime.png' -delete find . -type f -name 'Créditos.jpg' -delete # lixo hqultim...
{ "content_hash": "03aa45fa0385be3c2d85a23798b8a453", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 49, "avg_line_length": 30.214285714285715, "alnum_prop": 0.6784869976359338, "repo_name": "marcelomaia/manga_downloader", "id": "b5363d6d528e60fdaef5ac0129e541ae61eb4768", ...
from django.conf.urls import include, url from mothra.settings import LOGIN_URL from mothra.settings import DEBUG, STATIC_DOC_ROOT import workflows.views import django.contrib.auth.views as auth_views from django.views.static import serve # Uncomment the next two lines to enable the admin: from django.contrib import ...
{ "content_hash": "90859ae9aeee3dab3a5d5f7f1db7ec60", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 135, "avg_line_length": 38.03125, "alnum_prop": 0.6622843056696796, "repo_name": "xflows/clowdflows-backend", "id": "d344940613dcc34f8b5923febc5237527c139af8", "size": "243...
import os import json import logging import warnings from os.path import join, exists from queuelib import PriorityQueue from scrapy.utils.misc import load_object, create_instance from scrapy.utils.job import job_dir from scrapy.utils.deprecate import ScrapyDeprecationWarning logger = logging.getLogger(__name__) ...
{ "content_hash": "19707fa3eee9d5f52783c1383a45a336", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 83, "avg_line_length": 38.32967032967033, "alnum_prop": 0.5976204128440367, "repo_name": "starrify/scrapy", "id": "a18c26b1747eb6f2a705f260f4599db1ab64cdb2", "size": "6976...
import hashlib import urllib # Adapted from https://github.com/zzzsochi/Flask-Gravatar/blob/master/flaskext/gravatar.py def gravatar(user, use_ssl=False, d=None, r=None, size=None): if use_ssl: base_url = 'https://secure.gravatar.com/avatar/' else: base_url = 'http://www.gravatar.com/avatar/' ...
{ "content_hash": "e32f713896bc9a507a2b2b59b39149d7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 90, "avg_line_length": 29.77777777777778, "alnum_prop": 0.6281094527363185, "repo_name": "petermalcolm/osf.io", "id": "9c75b840145d78bcc250955450e06de47ea74c7d", "size": "8...
''' Miscellaneous helper functions and constants for the VamPy project ''' from os.path import dirname from sys import argv import math OWNPATH = dirname(argv[0]) SIDES = ['left','right','top','bottom'] DATWILDCARD = "Data files (TXT, CSV, DAT)|*.txt;*.TXT;*.csv;*.CSV;*.dat;*.DAT | All files (*.*)|*.*" C...
{ "content_hash": "87352d9bbf3bb8b8416e335e804e3a4b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 102, "avg_line_length": 30.58695652173913, "alnum_prop": 0.6048329779673063, "repo_name": "pshchelo/vampy", "id": "81fd709ab3c35551b29671ca4c0123ce58556e86", "size": "1407"...
from keystoneauth1.exceptions import base class AuthorizationFailure(base.ClientException): """Cannot authorize API client.""" pass
{ "content_hash": "bf34c3451beaba2901cef0a802f460aa", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 49, "avg_line_length": 23.666666666666668, "alnum_prop": 0.7676056338028169, "repo_name": "citrix-openstack-build/keystoneauth", "id": "3550d64ab78c2b619e6b9c362267783ab87dfbb...
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals from atomic_reactor.core import DockerTasker from atomic_reactor.inner import DockerBuildWorkflow fr...
{ "content_hash": "52412f1826e914f8f8aaf94bea5ae325", "timestamp": "", "source": "github", "line_count": 1062, "max_line_length": 100, "avg_line_length": 31.34463276836158, "alnum_prop": 0.5527817832251862, "repo_name": "vrutkovs/atomic-reactor", "id": "fc1fb57c6715d3bd6fa7d88e02958e2dd0e33e36", "si...
import csb.test as test from csb.bio.io import ClansParser from csb.bio.io.clans import Clans, ClansEntry, ClansParams, ClansSeqgroup,\ Color, ClansEntryCollection, ClansSeqgroupCollection, DuplicateEntryError,\ DuplicateEntryNameError @test.unit class TestClansColor(test.Case): def setUp(self): ...
{ "content_hash": "81fa5c6ba7c0c0d65f7d48e2428bfeb1", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 96, "avg_line_length": 35.46170212765958, "alnum_prop": 0.5795284094318114, "repo_name": "csb-toolbox/CSB", "id": "57b0f8693bf127053a18ad1ef6b41350da065f51", "size": "1666...
from glob import glob import numpy as np from .extern.six import string_types from . import _librootnumpy __all__ = [ 'root2array', 'root2rec', 'list_trees', 'list_branches', 'list_structures', 'list_directories', 'tree2array', 'tree2rec', 'array2tree', 'array2root', ] def _...
{ "content_hash": "f0f1db8e7e089018a3f61e5a8087cd44", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 79, "avg_line_length": 30.62704918032787, "alnum_prop": 0.5381372942593337, "repo_name": "ibab/root_numpy", "id": "af12da7450cd4f90055aa27c1fb77c7741b35951", "size": "1494...
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="width", parent_name="pie.marker.line", **kwargs): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "adb3b2daba239a4d67087dec68cd4a62", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 37.61538461538461, "alnum_prop": 0.5950920245398773, "repo_name": "plotly/plotly.py", "id": "a754a75ab103195ee22c7db6725638a6a9fb1a35", "size": "489"...
import subprocess import sys import setup_util import os def start(args, logfile, errfile): setup_util.replace_text("ninja/src/main/webapp/WEB-INF/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306") try: subprocess.check_call("mvn clean compile war:war", shell=True, cwd="ninja", ...
{ "content_hash": "14d5c471bc85932c5fd13c7494ceb8fa", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 139, "avg_line_length": 51.40625, "alnum_prop": 0.7045592705167173, "repo_name": "morrisonlevi/FrameworkBenchmarks", "id": "102b6dad7db1d3910f0f5da74eb797db4fca174d", "size...
from diskcache import Cache class GraphCache: inner = None disk_cache_file = None def __init__(self, inner, disk_cache): self.keys = {} self.row_pointer = -1 self.inner = inner if disk_cache is None: self.cache = {} else: self.disk_cache_fi...
{ "content_hash": "79d9d5edf04a256f0aef746ba6910d0b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 84, "avg_line_length": 26.21875, "alnum_prop": 0.5697258641239571, "repo_name": "MichSchli/QuestionAnsweringGCN", "id": "6781e921ed3be58bdd154b0e113378dc91ee0b1a", "size": ...
""" Created on 2013-1-19 @author: Administrator """ from string import Template t = Template('${village}folk send $$10 to $cause.') s = t.substitute(village='Nottingham', cause='the ditch fund') print(s) d = dict(village='Jinan') s = t.safe_substitute(d) print(s) basket = ['apple', 'orange', 'apple', 'pear', 'orange...
{ "content_hash": "8a7488b46ab09dcefe27daa9d16d5575", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 22.11764705882353, "alnum_prop": 0.6622340425531915, "repo_name": "quchunguang/test", "id": "7b3f870dfde3e3c281568477111aa2b018989ebd", "size": "376"...
from django.db import models from django.contrib.auth.models import User class AbstractEntry(models.Model): user = models.ForeignKey(User) title = models.CharField(max_length=255,blank=True,) slug = models.SlugField(unique=True) text = models.TextField(blank=True) class Meta: abstract...
{ "content_hash": "28ebc3ae9d4665b7de5d2e69296f238a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 81, "avg_line_length": 27.78787878787879, "alnum_prop": 0.6859323882224646, "repo_name": "hdknr/django-mediafiles", "id": "3d2619b4879a723e3441cd6410d7acd8a223689b", "size"...
from Base import Base class Callback(Base): """ Callbacks nodes, used for signals """ def parse_node(self): """ Parse the node """ self.parse_attributes_from_map({ 'name' : 'name', 'ctype' : (self.NS_C, 'type') }) self.parse_par...
{ "content_hash": "5ccdd8d590b58f48e2127e482d212af8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 28.333333333333332, "alnum_prop": 0.5411764705882353, "repo_name": "derAndreas/pyGtk3Docs", "id": "47182daea13e33be58b59d2af0d04890ffc9953c", "size":...
import unittest from StringIO import StringIO import sdv import sdv.errors as errors from sdv.validators.stix.profile import InstanceMapping STIX_NO_VERSION_XML = \ """ <stix:STIX_Package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stix="http://stix.mitre.org/stix-1" > <stix:STIX_Heade...
{ "content_hash": "f2393763808418139900adde8c3db6b9", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 85, "avg_line_length": 31.24137931034483, "alnum_prop": 0.6710816777041942, "repo_name": "pombredanne/stix-validator", "id": "9500d1aa1820032f52e855f94997f862530cfa91", "si...
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": "a0bcd9ecbddf6956af80afb0d1662467", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 111, "avg_line_length": 38.3968253968254, "alnum_prop": 0.6155436130632492, "repo_name": "emarketcoin/EMARKET", "id": "6198c4e62cfd576b9b242acea3161bb87c990a44", "size": "...
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( try_get, urljoin, ) class PhilharmonieDeParisIE(InfoExtractor): IE_DESC = 'Philharmonie de Paris' _VALID_URL = r'''(?x) https?:// ...
{ "content_hash": "e292b90024d90dea5e2390eb33e82854", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 148, "avg_line_length": 35.63809523809524, "alnum_prop": 0.5096205237840727, "repo_name": "yasoob/youtube-dl-GUI", "id": "03da64b116128f01893f047e747a1fb40af1e2df", "size"...
"""Package with general repository related functions""" import os from string import digits from git.compat import xrange from git.exc import WorkTreeRepositoryUnsupported from git.objects import Object from git.refs import SymbolicReference from git.util import hex_to_bin, bin_to_hex, decygpath from gitdb.exc import ...
{ "content_hash": "58c81ed82fd32e5ef5edcf5e0fa02c29", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 120, "avg_line_length": 33.55864197530864, "alnum_prop": 0.5428124712590822, "repo_name": "nvie/GitPython", "id": "39e55880f14400d16efc6a09761e11441b47c348", "size": "1087...
"""Testcase for cssutils imports""" before = len(locals()) # to check is only exp amount is imported from cssutils import * after = len(locals()) # to check is only exp amount is imported import unittest class CSSutilsImportTestCase(unittest.TestCase): def test_import_all(self): "from cssutils import *"...
{ "content_hash": "452f044de31dd373b84722d203573cef", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 67, "avg_line_length": 29.352941176470587, "alnum_prop": 0.5751503006012024, "repo_name": "hackatbrown/2015.hackatbrown.org", "id": "8674fe7c9168836dfe3c08a8b18b12323440278c"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0037_auto_20160121_1227'), ] operations = [ migrations.RemoveField( model_name='grade', name='subjects', ), ...
{ "content_hash": "737516ef3b1386082af7e41e8a974f65", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 59, "avg_line_length": 24.333333333333332, "alnum_prop": 0.536986301369863, "repo_name": "malaonline/Server", "id": "18ef8e9936796ded2b7b527d2726b38c6e07e18e", "size": "754...
from pybloom_live import BloomFilter from scrapy.utils.job import job_dir from scrapy.dupefilter import BaseDupeFilter class BLOOMDupeFilter(BaseDupeFilter): """Request Fingerprint duplicates filter""" def __init__(self, path=None): self.file = None self.fingerprints = BloomFilter(2000000, 0....
{ "content_hash": "9f41cfdffcc8fa9998ad265450857a9e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 57, "avg_line_length": 26.708333333333332, "alnum_prop": 0.6692667706708268, "repo_name": "nolram/news_crawler", "id": "426cc7ef14d20a11d026c208d2dbecd2558d0908", "size": "...
import os from solnlib.modular_input.checkpointer import FileCheckpointer import sys reload(sys) sys.setdefaultencoding('utf8') def get_file_checkpointer(dir): if not os.path.exists(dir): os.makedirs(dir) checkpointer = FileCheckpointer(dir) return checkpointer # initial kv helper user_path = os...
{ "content_hash": "5f3f3fb4ebe043315db7a25ed2b33641", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 121, "avg_line_length": 26.473118279569892, "alnum_prop": 0.644191714053615, "repo_name": "Teisei/TaxiRobot", "id": "60d4a537ef415fcd31d2047d14446d55b8d55f4a", "size": "250...
""" Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25. """ from . import util class ResultList(list): def __init__(self, li, start=0, total=0): self.extend(li) self.start = start if total == 0: total = len(li) self.total = tot...
{ "content_hash": "d18dbcb3f656aa0183fdf27755fe62b8", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 136, "avg_line_length": 42.27325581395349, "alnum_prop": 0.570072892311924, "repo_name": "ruohoruotsi/pyechonest", "id": "ba5d26db8092156d02a5a50c22f90bd6adb48c4b", "size"...
from celery.task import task @task def dummy(x, y): return x + y
{ "content_hash": "7a3f0ad1797986a0aae25da61d296c09", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 28, "avg_line_length": 14, "alnum_prop": 0.6571428571428571, "repo_name": "toopy/django-toopy-deployer", "id": "9ce1880c643b0bb0be513eb038a974b67d2760ba", "size": "86", "b...
def search(self,key): current = self.head found = False stop = False while not found and not stop: if current == None: stop = True else: if current.getNext() == None: current = current.getDown() else: if current.getNext(...
{ "content_hash": "7e6327ddd3b0ccfb081b962aa2e57a7c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 56, "avg_line_length": 30.363636363636363, "alnum_prop": 0.4491017964071856, "repo_name": "robin1885/algorithms-exercises-using-python", "id": "6b3c88fe1e004fe17ed4617a3e68ac...
from plex.objects.core.base import Property from plex.objects.directory import Directory from plex.objects.library.metadata.album import Album from plex.objects.library.metadata.artist import Artist from plex.objects.library.metadata.base import Metadata from plex.objects.mixins.playlist_item import PlaylistItemMixin f...
{ "content_hash": "5b81d177fd71fe35649f434679bf5595", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 92, "avg_line_length": 31.235294117647058, "alnum_prop": 0.5979284369114878, "repo_name": "fuzeman/plex.py", "id": "6f3cb3efc8e5aafdeb8a25cbcdf5e03ad4fbf73b", "size": "2124...
from django.urls import path from .views import ContactView, ContactSuccessView urlpatterns = [ path('success/', ContactSuccessView.as_view(), name='contact_success'), path('', ContactView.as_view(), name='contact'), ]
{ "content_hash": "07b0ac5053e69df9828b4a2336e70681", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 75, "avg_line_length": 25.555555555555557, "alnum_prop": 0.7130434782608696, "repo_name": "richardcornish/richardcornish", "id": "6ebb828644a395caaa92b534d1c724c0ce670e93", ...
"""Setup file for easy installation""" import os from setuptools import setup, find_packages from tests import test_cmd ROOT = os.path.dirname(__file__) setup( name="django-payzen", version="1.0.6", description="Django app to manage payments with Payzen ETP", license='MIT', author="Bertrand Sv...
{ "content_hash": "038be46251618c36891f7f4c99b004f1", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 64, "avg_line_length": 30.973684210526315, "alnum_prop": 0.6244689889549703, "repo_name": "zehome/django-payzen", "id": "4af5ce78619f451bcabe7cc4fa00b8672aaacb0b", "size": ...
""" Test Quantum Gradient Framework """ import unittest from test import combine import numpy as np from ddt import ddt from qiskit import QuantumCircuit from qiskit.algorithms.gradients import ( FiniteDiffEstimatorGradient, LinCombEstimatorGradient, ParamShiftEstimatorGradient, SPSAEstimatorGradient...
{ "content_hash": "7c611e7678539a2ea7a3bb3e38e2179d", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 98, "avg_line_length": 40.38770685579196, "alnum_prop": 0.5697728869117302, "repo_name": "QISKit/qiskit-sdk-py", "id": "e82383a56c47e53546cd3222c03694ea879303cb", "size": ...
import sys sys.path.append("..") # need to add the parent test path... yuck! import mrgeotest class MrGeoMetadataTests(mrgeotest.MrGeoTests): toblertiny = None roads = None @classmethod def setUpClass(cls): # cls.GENERATE_BASELINE_DATA = True super(MrGeoMetadataTests, cls).setUpCla...
{ "content_hash": "14d6d415b9012dd7bb43480cb33b1912", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 100, "avg_line_length": 43.231884057971016, "alnum_prop": 0.6540395574924572, "repo_name": "ngageoint/mrgeo", "id": "999312cec9753c440ddbac685fe595bba94a12b0", "size": "59...
import vtk def main(): colors = vtk.vtkNamedColors() # Set the background color. colors.SetColor("BkgColor", [26, 51, 77, 255]) # Create a plane planeSource = vtk.vtkPlaneSource() planeSource.SetCenter(1.0, 0.0, 0.0) planeSource.SetNormal(1.0, 0.0, 1.0) planeSource.Update() plan...
{ "content_hash": "60f2126e8b5b75864d5445c594261b56", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 60, "avg_line_length": 23.88157894736842, "alnum_prop": 0.7002754820936639, "repo_name": "lorensen/VTKExamples", "id": "c5b9fa688f2479aa7f2eb41071f2774887260483", "size": "...
"""autogenerated by genpy from zuros_environment_sensors/MSG_ZWAVE_SENSORS.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class MSG_ZWAVE_SENSORS(genpy.Message): _md5sum = "795e66ef3e1f1ec8b6e126177b5aefce" _type = "zuros_environment_sensors/MSG...
{ "content_hash": "0b20d34e01cbb63e5f217cbce285b0c6", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 95, "avg_line_length": 30.053475935828878, "alnum_prop": 0.5918149466192171, "repo_name": "robertjacobs/zuros", "id": "aa9f64aedd2c582dcb33b292a1e1387ae0c033a8", "size": "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0107_v370_workflow_convergence_api_toggle'), ] operations = [ migrations.AddField( model_name='unifiedjob', name='dependencies_processed', field=...
{ "content_hash": "f384715d5efba36041673fed6b9a0a26", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 167, "avg_line_length": 30.4375, "alnum_prop": 0.6509240246406571, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "6c10b11083a86bf056263af5fe44497f2c4298...