text
stringlengths
4
1.02M
meta
dict
import logging import asyncio import json from typing import Dict, List, Any from .socks_http import urlopen CURRENCIES = [ "USD", "EUR", "GBP", "AUD", "CAD", "JPY", "CNY" ] # type: List[str] async def fetch_from_api(base_url: str, chain_1209k: str, loop=None) -> Dict[str, Any]: fiats = ",".join(CURREN...
{ "content_hash": "f707a676f1af914fc8f6c939f38ae8d7", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 87, "avg_line_length": 32.24528301886792, "alnum_prop": 0.6079578700994733, "repo_name": "metamarcdw/nowallet", "id": "31397dcd3f2c292958c4913823910daef8aa142e", "size": "1...
"""A module that provides support for the Covariance Matrix Adaptation Evolution Strategy. """ import numpy import copy from math import sqrt, log, exp import tools class Strategy(object): """ A strategy that will keep track of the basic parameters of the CMA-ES algorithm. :param centroid: An iterab...
{ "content_hash": "662173885c235663b92c5c9ffb47490a", "timestamp": "", "source": "github", "line_count": 521, "max_line_length": 130, "avg_line_length": 48.4299424184261, "alnum_prop": 0.47217818642993026, "repo_name": "GrimRanger/GeneticAlgorithm", "id": "5dd7b43483f1a1d27308662094d12a3cc37eda94", ...
matplotlib_installed = True try: import matplotlib.pyplot as plt import matplotlib.transforms as transforms except ImportError: matplotlib_installed = False class Plot(object): def __init__(self, result_set): if result_set.finalised: self.result_set = result_set else: ...
{ "content_hash": "ae321beea762efb23820bb91208891bf", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 105, "avg_line_length": 32.84158415841584, "alnum_prop": 0.6059692493216762, "repo_name": "drvinceknight/Axelrod", "id": "b4ef0b96dc2fd88029e2c565474f69e5b5a01655", "size"...
"""Voluptuous schemas for the KNX integration.""" import voluptuous as vol from xknx.devices.climate import SetpointShiftMode from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE_CLASS, CONF_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_PORT, CONF_TYPE, ) import homeassistant.helpers.config_...
{ "content_hash": "0940fe3c9206c2314ca20d192a4add79", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 86, "avg_line_length": 38.774025974025975, "alnum_prop": 0.6241961414790996, "repo_name": "tchellomello/home-assistant", "id": "a436f2dcdc8e7a2a667e0498811f76b1d924ffd3", ...
from .baseClass import BaseClass __all__ = ['BaseClass']
{ "content_hash": "52fe25b28288c858bd7e1307a377cd16", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 32, "avg_line_length": 19.333333333333332, "alnum_prop": 0.6896551724137931, "repo_name": "chrisbrake/PythonSandbox", "id": "107a7a998f2f96f6e3f7b90ff8f3a2126e3a8b5b", "size...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-std=gnu99', '-I', './', '-isystem', '/home/konrad/Programming/eb/...
{ "content_hash": "f9a6d2ac7e567e2df87f4f9bb6f9c8bb", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 123, "avg_line_length": 33.7563025210084, "alnum_prop": 0.6895693303460294, "repo_name": "stsrc/RFID", "id": "48e29aa2d38b0c8dcab673784937ef0994c65aa7", "size": "5417", ...
import requests import xml.dom.minidom # We need to import the JSON library just to handle our request to the APIC for login import json # We need to log in to the APIC and gather a token, before we can access any data # Let's construct a request with a body # We'll need to disable certificate warnings requests.pack...
{ "content_hash": "c741b0bc560900f8a5ddb730bbba4c90", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 163, "avg_line_length": 44.340425531914896, "alnum_prop": 0.7034548944337812, "repo_name": "CiscoDevNet/coding-skills-sample-code", "id": "93b1cfde90b5be0a24ab71d6ed70eea07a1...
import feedparser from functools import wraps from xml.sax import SAXException from cmsplugin_feed.utils import strip_tags, get_image, prioritize_jpeg import re def apply(f): @wraps(f) def wrapper(*args, **kwargs): feed = f(*args, **kwargs) if feed: for fproc in FEED_PROCESSORS: ...
{ "content_hash": "a2745faa0d3a682cce6ed3e4aa088e97", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 88, "avg_line_length": 30.893617021276597, "alnum_prop": 0.5420110192837465, "repo_name": "pbs/cmsplugin-feed", "id": "230202e7a0ee744aae083532d68b104cfb11886f", "size": "2...
"""Test specially formated cmdln_*.py files Each cmdln_*.py implemented a cmdln.Cmdln subclass and its module docstring is an 'expect' script to test running it. Usage: Run all cmdln_*.py tests: python test_cmdln.py As part of a large test suite: import test_cmdln test_cmdln.suite() #...
{ "content_hash": "aa9ba4707885d47ad479750ee695ce16", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 88, "avg_line_length": 32.24390243902439, "alnum_prop": 0.5273260211800302, "repo_name": "hfeeki/cmdln", "id": "87cded0df95cdf148daec4aa8408bd0ba8745d40", "size": "10654",...
import re import six from typing import ( Any, Iterable, Iterator, Tuple, Sized, List, Optional, Dict, Union, Callable, Pattern ) import numpy as np import scipy.sparse as sp class FeatureNames(Sized, Iterable): """ A list-like object with feature names. It allows feature names for unknown featur...
{ "content_hash": "bdcc5b9e4588b7ea94cf8d685849bba2", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 78, "avg_line_length": 37.494791666666664, "alnum_prop": 0.5542436449506876, "repo_name": "TeamHG-Memex/eli5", "id": "ff1fd80c34731751a8049402d44223037554a47b", "size": "7...
import burnGPIO as IO from time import sleep import sys, termios, atexit from intelhex import IntelHex from select import select from mydelay import mydelay class PIC16F8X: CpuTag=0 CpuId=0 CpuRevision=0 ProgramSize = 2048 ProgramBase = 0 DataSize = 256 DataBase = 0x2100 ConfigBase = ...
{ "content_hash": "459898c482b59d43bcd9b372ce6dd5da", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 105, "avg_line_length": 29.813953488372093, "alnum_prop": 0.594383775351014, "repo_name": "danjperron/burnLVP", "id": "8f111457eb62be2c2c34f4728b73caa1bab67421", "size": "...
import sys import importlib from .git import get_current_branch def import_from_str(module: str): return importlib.import_module(module) def get_current_task_type(): from gitbarry.config import settings current_branch = get_current_branch() for task_prefix in settings['TASKS'].keys(): if cu...
{ "content_hash": "061afeca61cc2b64fc9f90ad299c2c44", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 65, "avg_line_length": 26.166666666666668, "alnum_prop": 0.6878980891719745, "repo_name": "a1fred/git-barry", "id": "00c665536b155d3250551ce583955ba35f0003b0", "size": "628...
from tweepy import OAuthHandler class SaitanOAuthHandler(): def __init__(self, config): keys = config.OAuthKeys() self.oauth = OAuthHandler(keys['consumer_key'], keys['consumer_secret'], secure = True ) self.oauth.set_access_token(keys['access_token_key'], keys['access_token_secret']) def authenti...
{ "content_hash": "b659c1e96f034dbdfd87c39004c5b135", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 84, "avg_line_length": 27.076923076923077, "alnum_prop": 0.7017045454545454, "repo_name": "chris-x86-64/Saitan-bot-py", "id": "b3637b57c725f595b4928bffc845d8fc9e264682", "s...
import _plotly_utils.basevalidators class DomainValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__(self, plotly_name="domain", parent_name="layout.yaxis", **kwargs): super(DomainValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "a7153f7faa81ec73227caa74d8f602a1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 83, "avg_line_length": 37.8421052631579, "alnum_prop": 0.4965229485396384, "repo_name": "plotly/python-api", "id": "511ec578d2d082258261ed54e5d80ff4dbd55eda", "size": "719"...
from flask import Flask, render_template, request, session, redirect, url_for from helpers import register_account, get_posts, make_post, get_post, login_user import datetime import re app = Flask(__name__) app.debug = True app.secret_key = 'foobar' @app.route("/") def root(): if 'username' in session: return red...
{ "content_hash": "58f2e69adc1e0a6ea76d5452439ef157", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 80, "avg_line_length": 25.337349397590362, "alnum_prop": 0.6742748454588683, "repo_name": "NotBlizzard/journaler", "id": "9e9fb69a18748ac8d72634c9b07b6cee650be30c", "size":...
from hypothesis import given from hypothesis.strategies import integers, lists from src.Algorithms.quicksort import quicksort @given(lists(integers())) def test_quicksort(xs): assert quicksort(xs.copy()) == sorted(xs)
{ "content_hash": "c1d3deadf94aabd66ee2801ab4492a56", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 49, "avg_line_length": 25, "alnum_prop": 0.7733333333333333, "repo_name": "roghu/py3_projects", "id": "1e0c80bc8930a98f76fc443e6697f000017d4a26", "size": "225", "binary": ...
""" commands for blogtopoid script """ from __future__ import unicode_literals from __future__ import absolute_import import os import sys import codecs import logging try: import ConfigParser except ImportError: import configparser as ConfigParser import pkg_resources from .blogtopoid import (Config, generat...
{ "content_hash": "06fee0199c72cb4435aad1c9f22ed977", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 77, "avg_line_length": 31.07741935483871, "alnum_prop": 0.5982976956612, "repo_name": "hansenerd/blogtopoid", "id": "7df1fd6d63ba28dfbe240990bbc3cfbc3c9c0cf8", "size": "48...
import logging from django.conf import settings from django.db.models import Prefetch from django.shortcuts import redirect from django.views.generic import DetailView from rdmo.core.constants import VALUE_TYPE_FILE from rdmo.core.utils import render_to_format from rdmo.core.views import ObjectPermissionMixin from rd...
{ "content_hash": "86f3843247b19795fb0c0f6a0787c2c0", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 147, "avg_line_length": 46.16483516483517, "alnum_prop": 0.6779338252796953, "repo_name": "rdmorganiser/rdmo", "id": "54a0d096ebae8a0e7e87090767e041422c4943bd", "size": "42...
from django.contrib import admin from .models import Member @admin.register(Member) class AdminMember(admin.ModelAdmin): list_display = ('name', 'last_name', 'phone', 'email', 'address', 'personal_skills', 'team_skills', 'weakness', 'under_presure',) list_filter = ('emai...
{ "content_hash": "038807f6baf5a81355d4ca21f690262d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 36.111111111111114, "alnum_prop": 0.6123076923076923, "repo_name": "Jhonbeltran/information-layer8", "id": "7bdecec39001f313fd784a88b38d0e389c3a8a30", ...
"""Control Flow Operations. See the @{$python/control_flow_ops} guide. @@identity @@identity_n @@tuple @@group @@no_op @@count_up_to @@cond @@case @@while_loop @@logical_and @@logical_not @@logical_or @@logical_xor @@equal @@not_equal @@less @@less_equal @@greater @@greater_equal @@where @@is_finite @@is_inf @@is_nan...
{ "content_hash": "40e1948c32cef28ceb1c997c7133992e", "timestamp": "", "source": "github", "line_count": 3258, "max_line_length": 116, "avg_line_length": 38.85328422344997, "alnum_prop": 0.6601624217910637, "repo_name": "Mazecreator/tensorflow", "id": "b341eab7ce2de5adb2c8ae0cd0975370503619d7", "siz...
from django.template.defaultfilters import divisibleby from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_true(self): self.assertEqual(divisibleby(4, 2), True) def test_false(self): self.assertEqual(divisibleby(4, 3), False)
{ "content_hash": "c4df318ba0494130c17a099e1394d8bb", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 27.09090909090909, "alnum_prop": 0.7080536912751678, "repo_name": "yephper/django", "id": "59156853196d12f24a3bcfd9e932c61b29422c20", "size": "298", ...
from django.shortcuts import render, redirect from django.http import HttpResponse, Http404, JsonResponse from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required import random im...
{ "content_hash": "d7bfeff2568b1830813135a15f6de025", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 116, "avg_line_length": 44.19444444444444, "alnum_prop": 0.6239786297925832, "repo_name": "NickChapman/humangen", "id": "faec882d2319e56c5ff70f2a333b9436e39bff17", "size":...
from __future__ import unicode_literals def truncate_sentence(text, max_chars, break_words=False, padding=0): """Truncates a sentence. :param max_chars: The maximum characters of truncated sentence. :param break_words: If you wish to truncate given sentence strictly even if it bre...
{ "content_hash": "e6f8f519b2482a5d6a4facea7f4e38d0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 38.93103448275862, "alnum_prop": 0.5828166519043402, "repo_name": "tonyseek/html5lib-truncation", "id": "f9df93e02aecced1bcb1dc459babc0b14a00b252", "...
import saml2 from saml2 import SamlBase NAMESPACE = 'http://schemas.xmlsoap.org/wsdl/' class TDocumentation_(SamlBase): """The http://schemas.xmlsoap.org/wsdl/:tDocumentation element """ c_tag = 'tDocumentation' c_namespace = NAMESPACE c_children = SamlBase.c_children.copy() c_attributes = SamlB...
{ "content_hash": "a017ae94e8ecc0c85b23f2e34fc0e51d", "timestamp": "", "source": "github", "line_count": 895, "max_line_length": 112, "avg_line_length": 35.924022346368716, "alnum_prop": 0.6527743219706394, "repo_name": "rohe/pysaml2-3", "id": "99f22668049e6024b55211968208b990f8d121c4", "size": "323...
from __future__ import absolute_import, unicode_literals from django.contrib import messages from django.http import HttpResponseBadRequest, JsonResponse from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views....
{ "content_hash": "c9e089a76bfbef142aabb67f195119c9", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 109, "avg_line_length": 39.63470319634703, "alnum_prop": 0.6278801843317973, "repo_name": "dinoperovic/djangoshop-shopit", "id": "29b412bd11a20816b341f60bfc3f8ff467e89ba8", ...
def extractWwwNekoseireiCom(item): ''' Parser for 'www.nekoseirei.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Godly Alchemist', 'Godly Alchemist', 'translated...
{ "content_hash": "41b9839d7f0179a8616c909ab12b0bb3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 104, "avg_line_length": 36.541666666666664, "alnum_prop": 0.5438996579247435, "repo_name": "fake-name/ReadableWebProxy", "id": "9d329311b79237b2793ad2da708d36d4c62e3adb", "...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "df31f1321457b27fd166744634ecffae", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 23.75, "alnum_prop": 0.7221052631578947, "repo_name": "skuda/client-python", "id": "0d2050ef7a6a906fe1790b72e14755fedf8ff26f", "size": "967", "bin...
DOCUMENTATION = ''' --- module: bigip_provision short_description: Manage BIG-IP module provisioning description: - Manage BIG-IP module provisioning. This module will only provision at the standard levels of Dedicated, Nominal, and Minimum. While iControl SOAP additionally supports a Custom level, this level...
{ "content_hash": "78fb008b1780951a8a43087741e080b7", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 87, "avg_line_length": 28.64666666666667, "alnum_prop": 0.5609727717011869, "repo_name": "buzzsurfr/f5-ansible", "id": "cd644fa870104dfb92647ee0cc702830b4d9f2f1", "size": ...
import os from catapult_base import binary_manager from dependency_manager import base_config from dependency_manager import exceptions as dependency_manager_exceptions from devil import devil_env from telemetry.core import exceptions from telemetry.core import util TELEMETRY_PROJECT_CONFIG = os.path.join( util...
{ "content_hash": "e36735bc8b2c2610ce6d7f012ea668d3", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 80, "avg_line_length": 33.95238095238095, "alnum_prop": 0.7419354838709677, "repo_name": "SummerLW/Perf-Insight-Report", "id": "6af0c97c948266a9580bcba2cc12b8de28e4eb82", "...
from dallinger import nodes, information, models class TestEnvironments(object): def test_create_environment(self, db_session): """Create an environment""" net = models.Network() db_session.add(net) environment = nodes.Environment(network=net) information.State(origin=envi...
{ "content_hash": "cdd1d6decc536f291f4751a683119984", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 63, "avg_line_length": 32.214285714285715, "alnum_prop": 0.6504065040650406, "repo_name": "jcpeterson/Dallinger", "id": "61d790428fcebd2c1da8c56480371963ed672bfc", "size": ...
import math # external vertices selection def extPoints(pointsLayer): # read points from layer points = [x.geometry().asPoint() for x in pointsLayer.getFeatures()] angles = {} externalPoints = [] # start at the most bottom point currentVertex = startVertex = min(points, key=lambda x: x[1...
{ "content_hash": "b910cc066b6ff0ec8ddd0cdb404de8d9", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 98, "avg_line_length": 30.835164835164836, "alnum_prop": 0.6514611546685674, "repo_name": "marekstrzelecki/pyqgis-recipes", "id": "ec43e63d5309d99e336dd762721a78f671405c12", ...
"""Tests for the noisy 2D Rosenbrock loss function.""" import os import sys import unittest import tensorflow as tf import numpy as np sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from deepobs.tensorflow import testproblems class Two_d_RosenbrockTest(unittest.Tes...
{ "content_hash": "e629b7c028b6e4b2e5f56730ed3fb41d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 96, "avg_line_length": 36.142857142857146, "alnum_prop": 0.566699604743083, "repo_name": "fsschneider/DeepOBS", "id": "5a5ee5483a1446cc79d601ab54d206a150faa01f", "size": "2...
from openerp import tools import openerp.addons.decimal_precision as dp from openerp.osv import fields,osv class account_invoice_report(osv.osv): _name = "account.invoice.report" _description = "Invoices Statistics" _auto = False _rec_name = 'date' def _compute_amounts_in_user_currency(self, cr, u...
{ "content_hash": "744cb7e779f0e2033861c4b069558ad1", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 200, "avg_line_length": 56.39150943396226, "alnum_prop": 0.5424508573818486, "repo_name": "diogocs1/comps", "id": "0639bfca2039b3c29f1535eaffd562bd2c08d088", "size": "1293...
import collections # Settings Settings = collections.namedtuple('Settings', 'opts version rt name_to_address address_to_name binary capstone text_offset data_offset rodata_offset') Runtime = collections.namedtuple('Runtime', 'halfword word stack_register heap_register main_register arg_registers') WordDesc = collectio...
{ "content_hash": "2ecfe34a3fa63871fa89c99282dd27e0", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 150, "avg_line_length": 45.69767441860465, "alnum_prop": 0.7816793893129771, "repo_name": "gereeter/hsdecomp", "id": "cab69f1cf1e7e8ce06d0a258cb80378f6df993c3", "size": "19...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import know_me.models import permission_utils.model_mixins class Migration(migrations.Migration): initial = True dependencies = [migrations.swappable_dependency...
{ "content_hash": "6f6b622b9cc3fb76447206561e71e890", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 85, "avg_line_length": 33.54117647058823, "alnum_prop": 0.3910908453174325, "repo_name": "knowmetools/km-api", "id": "80e0c90c99edfcc642bc33c78c6e36f7e85b0ede", "size": "29...
import sys import os.path from libsbml import * def main (args): # Creates an SBMLNamespaces object with the given SBML level, version # package name, package version. sbmlns = SBMLNamespaces(3, 1, "qual", 1); # Creates an SBMLDocument object document = SBMLDocument(sbmlns); ...
{ "content_hash": "1e01be580c90cc8df2bca4bc934a6f68", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 73, "avg_line_length": 24.055555555555557, "alnum_prop": 0.6125866050808314, "repo_name": "TheCoSMoCompany/biopredyn", "id": "4dd710205f30939e3c87b7a9ff5f014265d19891", "si...
import os from setuptools import find_packages from setuptools import setup # lfs imports from lfs_theme import __version__ here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() setup(name='lfs-theme', version=__version__, description='The default theme ...
{ "content_hash": "a02cbf8bed081cb9d4d7bc7705713618", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 54, "avg_line_length": 28.96969696969697, "alnum_prop": 0.6182008368200836, "repo_name": "pigletto/lfs-theme", "id": "9ddf54436f50f1a30e8ce165e4a631a160b59eef", "size": "97...
'''OpenStack Keystone BVOX extension.''' __version__ = '0.0.4'
{ "content_hash": "ed1584d1edce87fe70e427fd658d72b4", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 40, "avg_line_length": 31.5, "alnum_prop": 0.6349206349206349, "repo_name": "bvox/keystone-bvox-extension", "id": "def516603d59595ac29db6fb404ac8d4c378ef88", "size": "107", ...
"""Utility functions with internet connections""" import socket import urllib.error from ftplib import FTP, all_errors, error_temp from time import sleep from typing import Tuple from urllib.request import urlopen import requests from tqdm.auto import tqdm from genomepy.exceptions import GenomeDownloadError def dow...
{ "content_hash": "29f50dda7d4a82c68cf9b423b7de9183", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 76, "avg_line_length": 25.89041095890411, "alnum_prop": 0.5703703703703704, "repo_name": "simonvh/genomepy", "id": "a6a7ae4cf2a01adaafe79d5a309aca1f79f55f35", "size": "378...
from setuptools import setup, find_packages setup( name='CFAnalyze', version='0.0.1', packages=find_packages(), install_requires=['boto>=2.5.2'], entry_points={ 'console_scripts': ['cfa = cfanalyze.__main__:main'] }, author='MinYoung Jung', author_email='[email protected]', ...
{ "content_hash": "65d1407f1aefd5ef2d2d5dd5db248dcf", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 33.523809523809526, "alnum_prop": 0.6377840909090909, "repo_name": "kkung/cfanalyze", "id": "dd9e4a98640b4e03db80a897bfb71ee725311ad3", "size": "704"...
""" sentry-ldap-auth ============== An extension for Sentry which authenticates users from an LDAP server and auto-adds them to the an organization in sentry. """ from setuptools import setup, find_packages with open("README.md", "r") as readme: long_description = readme.read() install_requires = [ 'django-a...
{ "content_hash": "b3c571ed285086eb392dd42ba7a923ca", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 108, "avg_line_length": 31.925, "alnum_prop": 0.6773688332028192, "repo_name": "Banno/getsentry-ldap-auth", "id": "7275c313afdb17dce6f44e357bdb04032b7e6595", "size": "1299"...
from pytest import raises from mio.errors import ImportError def test_importer(mio, tmpdir, capfd): with tmpdir.ensure("foo.mio").open("w") as f: f.write(""" hello = block( print("Hello World!") ) """) mio.eval("""Importer paths insert(0, "{0:s}")"""....
{ "content_hash": "104ffb112129cf03c07d186db172e417", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 73, "avg_line_length": 23.24137931034483, "alnum_prop": 0.5741839762611276, "repo_name": "prologic/mio", "id": "6189405207cb0a32323bdb15b2c2256bc0306010", "size": "674", ...
import os TEMP_TAR_GZ_FILENAME = '/tmp/fairing.layer.tar.gz' DEFAULT_IMAGE_NAME = 'fairing-job' DEFAULT_BASE_IMAGE = 'gcr.io/kubeflow-images-public/fairing:dev' DEFAULT_REGISTRY = 'index.docker.io' DEFAULT_DEST_PREFIX = '/app/' DEFAULT_CONTEXT_FILENAME = '/tmp/fairing.context.tar.gz' DEFAULT_GENERATED_DOCKERFILE_FILE...
{ "content_hash": "d6c43afcd770ddaaa003276a67d10998", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 97, "avg_line_length": 34.078947368421055, "alnum_prop": 0.7544401544401544, "repo_name": "kubeflow/fairing", "id": "c5f73e7221d4ecd07648ea3d1464b1829a12066a", "size": "259...
import time import cv2 from ev3control.rpc import Robot from rick.controllers import euclidian_move_to_brick, rotation_search_brick,move_to_brick_simple, move_to_brick_blind_and_grip from rick.core import State from rick.core import main_loop from detection.marker_localization import get_marker_pose, load_camera_params...
{ "content_hash": "55254c2da876c0b8d58ce991b37658f6", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 187, "avg_line_length": 32.51162790697674, "alnum_prop": 0.5536480686695279, "repo_name": "TheCamusean/DLRCev3", "id": "f67c45572b1891dd895575b68e4c928f0f2ebea4", "size": ...
from toscaparser.functions import GetInput from translator.hot.syntax.hot_resource import HotResource # Name used to dynamically load appropriate map class. TARGET_CLASS_NAME = 'ToscaBlockStorageAttachment' class ToscaBlockStorageAttachment(HotResource): '''Translate TOSCA relationship AttachesTo for Compute and...
{ "content_hash": "6471bcb1d1201e7c0b3734c3ba1f4c8f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 41.42857142857143, "alnum_prop": 0.6751724137931034, "repo_name": "obulpathi/cloud-translator", "id": "715d5b3d67aeb1364b1d0b7989a62dfa30bb8424", "si...
from django.core import serializers from djspace.core.models import GenericChoice, UserProfile from djspace.registration.models import Faculty from taggit.models import Tag, TaggedItem import django django.setup() #with open("profile.json", "w") as out: #with open("faculty.json", "w") as out: with open("generic_cho...
{ "content_hash": "c71e278d65e71b76849760f81ad1ba35", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 39.095238095238095, "alnum_prop": 0.7405602923264312, "repo_name": "carthagecollege/django-djspace", "id": "74022934cd7653f8cea45a90093522d8b6ee0a9e", ...
from marshmallow import pre_dump from marshmallow_jsonapi import SchemaOpts __all__ = [ 'IncludableViewMixin', 'IncludableSchemaMixin' ] def extract_requested_includes(query_key, request): requested_includes = [] for key, val in request.params.items(): if key == query_key: reque...
{ "content_hash": "e39cec3da8710f26cf7fe2428641f995", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 118, "avg_line_length": 36.68156424581006, "alnum_prop": 0.6286932683521169, "repo_name": "danpoland/pyramid-restful-jsonapi", "id": "1f7068fcdb158e988f1a7e2683c1012a22aad72...
from __future__ import print_function from backports.configparser import NoSectionError import logging import os import subprocess import textwrap import random import string from importlib import import_module import getpass import reprlib import argparse from builtins import input from collections import namedtuple...
{ "content_hash": "fb53183d9a96712672cc45294c8e26b6", "timestamp": "", "source": "github", "line_count": 1831, "max_line_length": 90, "avg_line_length": 36.73020207536865, "alnum_prop": 0.5264746554057068, "repo_name": "yk5/incubator-airflow", "id": "10c104a607a8fe6bd345f786d4552ef68c944ebf", "size"...
import sys import unittest from max_stack import MaxStack from max_stack2 import MaxStack2 __author__ = 'Hagay Onn' __version__ = '1.0' class StackTestCase(unittest.TestCase): def setUp(self): # choose one below :-) self.testStack = MaxStack() # more space effective #sel...
{ "content_hash": "a880701b0da2eb377bf0944e55446037", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 100, "avg_line_length": 54.229729729729726, "alnum_prop": 0.6459008223274358, "repo_name": "hagayo/MaxStack_o1_Python", "id": "54359d253ddaa2b4a9cc35f06dc9c1546d8f4e00", "s...
from __future__ import division import numpy as np import random import tempfile import unittest from chainer import serializers from chainer import testing from chainer.testing import condition from chainer import training @testing.parameterize( # iteration { 'iter_per_epoch': 5, 'interval': (2, 'i...
{ "content_hash": "e977dcf5de94f49fbff2f39e2999d7e6", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 71, "avg_line_length": 41.66386554621849, "alnum_prop": 0.6192012908430818, "repo_name": "aonotas/chainer", "id": "ea13f5f7d4b90e04beaefb0f865f6ce73ff1f0f4", "size": "4958...
"""Tests for volume and images.""" import datetime import mock import os import tempfile from oslo_utils import imageutils from oslo_utils import units from cinder import db from cinder import exception from cinder.message import message_field from cinder import objects from cinder.objects import fields from cinder ...
{ "content_hash": "0f3467245571867a986cd4fbfa5a01ee", "timestamp": "", "source": "github", "line_count": 679, "max_line_length": 79, "avg_line_length": 42.74521354933726, "alnum_prop": 0.5825523704520397, "repo_name": "eharney/cinder", "id": "435d707c325b6cbbfcf5863aa08ad03f3c4d2730", "size": "29755...
from __future__ import division, absolute_import, unicode_literals from collections import defaultdict from django.db.models.deletion import Collector, ProtectedError from django.db.models.sql.constants import QUERY_TERMS from django.utils import six from django.utils.encoding import force_bytes, force_text def loo...
{ "content_hash": "f1f1514a4c521bac38efbc6429517b8d", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 94, "avg_line_length": 31.99033816425121, "alnum_prop": 0.6270009060706735, "repo_name": "andrewsmedina/django-admin2", "id": "a831864cfa8a9fa88897dbda8b493f198ce97119", "...
class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def deleteDuplicates(self, head): """ :type head: ListNode :rtype: ListNode """ if not head: return None dummy = ListNode(0) ...
{ "content_hash": "325473babebc79510eb6bbce3f5f4d53", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 93, "avg_line_length": 30.536585365853657, "alnum_prop": 0.4728434504792332, "repo_name": "kingsamchen/Eureka", "id": "f8a5e0dda86e584dfa46578b74580713c9468bc0", "size": "1...
from producteev import Producteev from optparse import OptionParser API_KEY = 'YOUR_API_KEY' SECRET_KEY = 'YOUR_SECRET_KEY' if __name__ == "__main__": # Parse options parser = OptionParser() parser.add_option("-u", "--username", dest="username", help="Set username", metavar="USERNAME...
{ "content_hash": "2dcadfe942a76b60129ddb6d2b2a6dae", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 71, "avg_line_length": 27.25531914893617, "alnum_prop": 0.6120218579234973, "repo_name": "magarcia/python-producteev", "id": "d86b9e09b59803b153e0c3b62fb756ff0d79cf70", "si...
def execfile(file, glob=None, loc=None): if glob is None: import sys glob = sys._getframe().f_back.f_globals if loc is None: loc = glob stream = open(file, 'rb') try: encoding = None #Get encoding! for _i in range(2): line = stream.readline() #...
{ "content_hash": "7f64abeb62251b2c10014f91ae54fb60", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 102, "avg_line_length": 33.189189189189186, "alnum_prop": 0.4771986970684039, "repo_name": "hinesmr/mica", "id": "d60d7ed94bb08736c9a2d1f9dcad1afc22c486ea", "size": "1283",...
''' tunepk urlresolver plugin Copyright (C) 2013 icharania updated Copyright (C) 2017 gujal updated Copyright (C) 2019 cache-sk This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the...
{ "content_hash": "ecf8acbb78e203e3efb85e1dcf1e36e0", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 101, "avg_line_length": 42.784946236559136, "alnum_prop": 0.584820306609701, "repo_name": "dbiesecke/dbiesecke.github.io", "id": "e20f28d36d172fa6098b2a7efde608d72836b683", ...
import logging from framework.celery_tasks.handlers import enqueue_task from website import settings logger = logging.getLogger(__name__) if settings.SEARCH_ENGINE == 'elastic': import elastic_search as search_engine else: search_engine = None logger.warn('Elastic search is not set to load') def requir...
{ "content_hash": "9ea82d8fd1263add7d3c48df283eea6a", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 89, "avg_line_length": 32.16326530612245, "alnum_prop": 0.6986040609137056, "repo_name": "monikagrabowska/osf.io", "id": "b6216289949d4e3c6e7f2657da58766b7e912dc6", "size":...
from django import forms from django.contrib.auth.models import User from .models import useradd, tweet, comment class UserForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput) profile_picture = forms.FileField(required=False) class Meta: model = useradd fields = ['...
{ "content_hash": "7cc057c4efb1201c87dd989fbaf6ed21", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 27.08695652173913, "alnum_prop": 0.666131621187801, "repo_name": "Udayraj123/dashboard_IITG", "id": "035158a8e952c77020c793a41bf976f53419c119", "size...
from PyQt4.QtGui import (QVBoxLayout, QHBoxLayout, QTableWidgetItem, QIcon, QGridLayout, QSplitter, QLineEdit, QFrame, QPushButton, QMenu, QComboBox) from PyQt4.QtCore import QDate, Qt, SIGNAL from configuration import Config from Common.ui.common import (FWidget, Int...
{ "content_hash": "b0bf801f1c33ce9c100286e9298ecf0e", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 116, "avg_line_length": 37.498525073746315, "alnum_prop": 0.5597073631214601, "repo_name": "fadiga/mstock", "id": "fa512fae417fc187b9df5f6ebaf23a9d2b25a921", "size": "1278...
import _plotly_utils.basevalidators class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="legendgroup", parent_name="waterfall", **kwargs): super(LegendgroupValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_na...
{ "content_hash": "b653945f9dd6b8825193e0607298f92e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 85, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6359223300970874, "repo_name": "plotly/plotly.py", "id": "8cfac6d85569a99eb7a78bfcbe2d62bc49501cd3", "size": "412"...
"""Tests the import_data.py script. Typical usage: python3 test_import.py """ import os import sys import unittest import pandas as pd # Allows the following module imports to work when running as a script sys.path.append( os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file_...
{ "content_hash": "4a6533350a659433be5e9922d3f3464d", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 42.19327731092437, "alnum_prop": 0.6004779924317865, "repo_name": "datacommonsorg/data", "id": "621a3396d6065c77e31b83cc9b797d47a0b3f9e3", "size": "...
from twisted.internet import defer from twisted.trial import unittest from twisted.internet import reactor from mock import Mock from cyclone import template class TestTemplates(unittest.TestCase): def test_simple_var(self): t = template.Template(r"My name is: {{ name }}") self.assertEqual(t.generate(name="Ali...
{ "content_hash": "06d62450ad5a1374c4c5cc2eee918064", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 138, "avg_line_length": 35.61363636363637, "alnum_prop": 0.6064667092108063, "repo_name": "dpnova/cyclone", "id": "b5dfe80ff2bec4f28437238f9b14fa20db259186", "size": "5283...
from nose.tools import assert_almost_equal, assert_equal, assert_raises, assert_true, assert_less_equal, assert_greater_equal, assert_greater from stationary.utils.bomze import bomze_matrices def test_bomze_matrices(): """ Check that the data file with the Bomze classification matrices is present and load...
{ "content_hash": "b35a18c456a97b414073140f7a93b000", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 141, "avg_line_length": 36.416666666666664, "alnum_prop": 0.7414187643020596, "repo_name": "marcharper/stationary", "id": "c69f47cf14f10d560699a93d3eb53a892c4ce2ed", "size"...
try: from setuptools import setup except ImportError: from distutils.core import setup import versioneer with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', '') requirements = [ # TO...
{ "content_hash": "7e28b8cf8cc2d2444ca3b09eeceefb1c", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 63, "avg_line_length": 27.37037037037037, "alnum_prop": 0.6244925575101489, "repo_name": "jeroyang/retools", "id": "2463bec1c4fbb3a2bc83d1b763a381d7f26af971", "size": "1526...
from rest_framework import viewsets, mixins, permissions from rest_framework.filters import OrderingFilter, SearchFilter, DjangoFilterBackend from rest_framework.permissions import DjangoModelPermissions, DjangoObjectPermissions from rest_framework.settings import api_settings from rest_framework.response import Respon...
{ "content_hash": "0896b5043fd1d0260de175ca7200db24", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 106, "avg_line_length": 36.30952380952381, "alnum_prop": 0.7072131147540983, "repo_name": "pycodi/django-kernel", "id": "c6b85919ecaa9151c3ac558d60b1462563278d3e", "size": ...
""" banopata - Banking Nordea Parse Transactions """ from common import * import re if __name__ == '__main__': PathToProperties = config["PathToProperties"] PathToTransactions = config["PathToTransactions"] errors = [] for line in open(PathToTransactions, encoding='utf-8').readlines(): field...
{ "content_hash": "810dd0fab9cae50431e29e2ab42d2bde", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 92, "avg_line_length": 39.53658536585366, "alnum_prop": 0.5181986428130784, "repo_name": "wittrup/crap", "id": "15e6123bf9d0817a68f5333f9b1c8f4bfc8f4e2b", "size": "1904", ...
import pkg_resources def version_string(): """ Return the current version number of MapProxy. """ try: return pkg_resources.working_set.by_key['mapproxy'].version except KeyError: return 'unknown_version' __version__ = version = version_string() if __name__ == '__main__': prin...
{ "content_hash": "975818e567562090b948e545efc2dfa1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 22.2, "alnum_prop": 0.6216216216216216, "repo_name": "Anderson0026/mapproxy", "id": "fdf834faaf64a3dfa07b70dafe8db8f9ccad6306", "size": "980", "bin...
"""Metrics.""" from tensorflow_recommenders.metrics.factorized_top_k import Factorized from tensorflow_recommenders.metrics.factorized_top_k import FactorizedTopK
{ "content_hash": "edcb2ff30cf996d3d3aeb43a223502db", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 41, "alnum_prop": 0.8353658536585366, "repo_name": "tensorflow/recommenders", "id": "51f3ee37af4d02079aced472cc9c44064e0e5348", "size": "765", "bina...
import sublime import sublime_plugin from vex import ex_location import ex_commands def compute_flags(view, term): flags = 0 # case sensitive search_mode = view.settings().get('vintage_search_mode') if search_mode == 'smart_case': if term.lower() == term: flags = sublime...
{ "content_hash": "ccfde8b481bdf1485815e8bf2a6c62b1", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 91, "avg_line_length": 41.97142857142857, "alnum_prop": 0.46807351940095304, "repo_name": "SublimeText/VintageEx", "id": "a1f9e4c372bd9942284be34c6bf1ddd6601a35ff", "size"...
from django.db import models from django.contrib.auth.models import User class League(models.Model): owner = models.ForeignKey(User) name = models.CharField(max_length=256) is_public = models.BooleanField(default=False) date_created = models.DateTimeField(auto_now_add=True) date_modified = models....
{ "content_hash": "73024d0f11c5c8c5ae7deecda7fdcb90", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 64, "avg_line_length": 30.4, "alnum_prop": 0.6776315789473685, "repo_name": "dylanseago/LeagueOfLadders", "id": "2f931e55e1287823762e26f06638edec629ead6d", "size": "760", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('saltstack', '0003_unique_spl'), ] operations = [ migrations.RemoveField( model_name='saltstackserviceprojectlink', name='err...
{ "content_hash": "cb06df333812ed0e7c6bd214a4b24b68", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 53, "avg_line_length": 22.523809523809526, "alnum_prop": 0.5940803382663847, "repo_name": "opennode/nodeconductor-saltstack", "id": "2622d156ef52907ce6cd463d24252e47a7ee9484"...
from django.contrib import admin from .models import Resume, ContactInfo, Aboutme, OpenSourceProject, ContributedProject class ResumeAdmin(admin.ModelAdmin): list_display = ('company', 'position', 'entry_time', 'time_of_separation') admin.site.register(Resume, ResumeAdmin) admin.site.register(ContactInfo) admin....
{ "content_hash": "bfbba45f2a31cc3983d2b6af344a7e05", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 35.166666666666664, "alnum_prop": 0.8056872037914692, "repo_name": "zhengxiaowai/Athena", "id": "cf37a6aa65aff5787091d739f568555f7a562f92", "size": "...
import modelingcounter import os, sys import SonicScrewdriver as utils import csv sourcedir = "/Volumes/TARDIS/work/US_NOVELS_1923-1950/" filelist = os.listdir(sourcedir) fileset = set([x for x in filelist if x.endswith(".txt")]) filelist = list(fileset) metafile = os.path.join(sourcedir, "US_NOVELS_1923-1950_META...
{ "content_hash": "1374660111a9dc4066e359800d1fe81b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 118, "avg_line_length": 24.589041095890412, "alnum_prop": 0.6512534818941504, "repo_name": "tedunderwood/GenreProject", "id": "21c870a1c9d744837ac0ad46e028954e3e4d6676", "s...
from . import _dbg from . import gs, sh, about from .margo_common import NS from os.path import basename, splitext import os import re import sublime actions = NS(**{k: {'Name': k} for k in ( 'QueryCompletions', 'QueryCmdCompletions', 'QueryTooltips', 'QueryIssues', 'QueryUserCmds', 'QueryTestCmds', 'ViewActiva...
{ "content_hash": "f980c9224a070974555b17e420945785", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 132, "avg_line_length": 22.808823529411764, "alnum_prop": 0.6230388996346443, "repo_name": "DisposaBoy/GoSublime", "id": "e225c5b246d41e4b2d7da0628c74bfeb6627c812", "size"...
from __future__ import unicode_literals import time import datetime import boto3 from botocore.exceptions import ClientError import sure # noqa from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs import functools import nose def expected_failure(test): @functools.wraps(test) def inner(*args...
{ "content_hash": "53d241ee22e2e2b9f6d38bbc89c7b0f1", "timestamp": "", "source": "github", "line_count": 868, "max_line_length": 116, "avg_line_length": 28.28917050691244, "alnum_prop": 0.5971492567705152, "repo_name": "whummer/moto", "id": "310ac0b48bff7848bde6fd4efa60347d30072167", "size": "24555"...
""" This script sets the contents of spark-defaults.conf and gpuDiscoveryScriptStub.sh for the purpose of integration testing. It does so based on the arg inputs, spark-base.conf which is static, and spark-custom.conf which is dynamically changed by tests. """ import argparse parser = argparse.ArgumentParser() pars...
{ "content_hash": "e45223ad8d4df45f0745614deb480bc4", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 29.19298245614035, "alnum_prop": 0.5997596153846154, "repo_name": "tensorflow/ecosystem", "id": "51ca6898c00c5473a6db1fc8028957f37f2b2467", "size": "...
__author__ = 'tivvit' import webapp2 from backend.model.game import Game class generateLeaderboardHandler(webapp2.RedirectHandler): def get(self): g = Game() g.generateLeaderboard() app = webapp2.WSGIApplication([ ('/generateLeaderboard', generateLeaderboardHandler) ], debug=True)
{ "content_hash": "76a6a7532418f81a1567eec07fda16f2", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 22.142857142857142, "alnum_prop": 0.7161290322580646, "repo_name": "gugcz/devfest-rpg", "id": "3441c20fff744962ac091c754ce1333014637b5d", "size": "31...
import os from collections import Counter from copy import copy import numpy as np import pytest from surprise import Dataset, Reader from surprise.model_selection import ( KFold, LeaveOneOut, PredefinedKFold, RepeatedKFold, ShuffleSplit, train_test_split, ) from surprise.model_selection.spli...
{ "content_hash": "f3cf09f5b5c879abcb3d9d5d6daa359b", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 82, "avg_line_length": 37.907051282051285, "alnum_prop": 0.6618753699162933, "repo_name": "NicolasHug/Surprise", "id": "1ca2502ed9a6e439c7dd51ebe6d259514c6a5a89", "size": ...
from __future__ import absolute_import import boto import boto.s3.connection import boto.s3.key import boto.s3.bucket import functools import itertools import os.path import posixpath from six import iteritems, itervalues import sys import s3pub.progress def _upload(bucket, local_path, remote_path, md5, pbar): '...
{ "content_hash": "e9f1816e2f808aabd8fe62b5ef9254d1", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 80, "avg_line_length": 31.983425414364643, "alnum_prop": 0.607877008118846, "repo_name": "marmida/s3pub", "id": "51367aa00c1d5717e7affd02c6a10fc258ddbcc5", "size": "5789",...
import os import pytest import json import pyethereum.processblock as processblock import pyethereum.blocks as blocks import pyethereum.transactions as transactions import pyethereum.rlp as rlp import pyethereum.trie as trie import pyethereum.miner as miner import pyethereum.utils as utils from pyethereum.db import DB ...
{ "content_hash": "c566036f165652487a1a0f381b9fb3c0", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 132, "avg_line_length": 32.267657992565056, "alnum_prop": 0.6400345622119815, "repo_name": "jnnk/pyethereum", "id": "cb94a706a0a2e8ee1c6381a9f02864a2b49b4a5d", "size": "17...
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^achievs/', include('achievs.urls')), # Example: # (r'^scoreboard/', include('scoreboard.foo.urls')), # Uncomment the admin/doc ...
{ "content_hash": "39ab16b311935176fbc74aa6fe8bd86f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 32.8125, "alnum_prop": 0.6914285714285714, "repo_name": "eawerbaneth/Scoreboard", "id": "84d036f25d2f3cc85158bb825484f78beeec8e20", "size": "525", ...
""" Run Regression Test Suite This module calls down into individual test cases via subprocess. It will forward all unrecognized arguments onto the individual test scripts, other than: - `-extended`: run the "extended" test suite in addition to the basic one. - `-win`: signal that this is running in a Windows...
{ "content_hash": "0a55185dd9d6b5a3bc5056e60a541680", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 163, "avg_line_length": 31.38888888888889, "alnum_prop": 0.6206489675516225, "repo_name": "totcoindev/totcoin", "id": "cf894e37b049b47c882f4dbe94eabae9b4e1cd05", "size": "...
import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union import pkg_resources import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth ...
{ "content_hash": "eef632d71e2b61e72d7fd9758988f2c5", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 101, "avg_line_length": 37.58918918918919, "alnum_prop": 0.5927523727351165, "repo_name": "googleapis/python-asset", "id": "66abbb1a915cf53090aca6338515dc01ea6bcdac", "siz...
import random import threading import time from org.apache.helix.agent.SystemUtil import SystemUtil from org.apache.helix.agent.SystemUtil import ProcessStateCode from org.apache.helix.util.logger import get_logger class ProcessMonitorThread(threading.Thread): """ Java modifiers: private final stati...
{ "content_hash": "0919505eda96822221e45c456512216d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 138, "avg_line_length": 22.915254237288135, "alnum_prop": 0.591715976331361, "repo_name": "davzhang/helix-python-binding", "id": "a12665479746c093cf849392bd5878c9bd80a182", ...
"""Base stuff for XAL resources.""" class Resource(object): """Base class for XAL resources.""" def __init__(self): """Constructor.""" #: Execution context which the resource belongs to. self.xal_session = None #: List of internal methods that provides diagnosis information. ...
{ "content_hash": "01eb1412997c1f81811561ca3c7334de", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 30.027027027027028, "alnum_prop": 0.6174617461746175, "repo_name": "benoitbryon/xal", "id": "c08367503e108a85c9eb87874ddf5757ecd2b005", "size": "1111...
import enum import logging from typing import Iterable, Union, Set, Tuple from collections import defaultdict, OrderedDict, deque import networkx from phasm.alignments import (LocalAlignment, AlignmentType, MergedReads, OrientedDNASegment, OrientedRead) from phasm.bubbles import find_sup...
{ "content_hash": "068ec0340fc43526d32f6aa248262698", "timestamp": "", "source": "github", "line_count": 743, "max_line_length": 79, "avg_line_length": 33.85868102288021, "alnum_prop": 0.5556306395834162, "repo_name": "AbeelLab/phasm", "id": "54cbad1581206d0314f62a580ae068e3cd4a2058", "size": "25159...
from __future__ import print_function from __future__ import with_statement from contextlib import contextmanager import subprocess import os import sys import time import imp import urllib2 import copy import fnmatch import re apt = None rpm = None try: import apt except: pass if apt is None: try: ...
{ "content_hash": "9674f037c7d4ff11f7e225c8a1a22d75", "timestamp": "", "source": "github", "line_count": 915, "max_line_length": 265, "avg_line_length": 39.05245901639344, "alnum_prop": 0.5663952089105309, "repo_name": "MSFTOSSMgmt/WPSDSCLinux", "id": "47c6c84caa870ec6c2d9ef7e794f825b8427e38a", "siz...
"""Heavy lifting geometry for IDF surfaces.""" from collections import MutableSequence from itertools import product from math import atan2, pi from typing import Any, List, Optional, Tuple, Union # noqa from eppy.geometry.surface import area from eppy.idf_msequence import Idf_MSequence # noqa import numpy as np fro...
{ "content_hash": "fcecee1c2ff5dcf37c626b49ecd0f95e", "timestamp": "", "source": "github", "line_count": 750, "max_line_length": 118, "avg_line_length": 33.910666666666664, "alnum_prop": 0.605630480084929, "repo_name": "jamiebull1/geomeppy", "id": "ce51e4673f426941bc30d583bb24cd3b35dd30bd", "size": ...
import pandas as pd import pandas.util.testing as tm from pandas import MultiIndex def check_level_names(index, names): assert [level.name for level in index.levels] == list(names) def test_slice_keep_name(): x = MultiIndex.from_tuples([('a', 'b'), (1, 2), ('c', 'd')], names=[...
{ "content_hash": "b11b1b15f45b7368482fcbc577d1330c", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 72, "avg_line_length": 33.57017543859649, "alnum_prop": 0.5798275411549516, "repo_name": "pratapvardhan/pandas", "id": "a9fbb55679173e6bc28a15bc1c5838e9c9acfe6a", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('applications', '0003_auto_20180309_2251'), ] operations = [ migrations.DeleteModel( name='ProjectApplication', ), migrat...
{ "content_hash": "71486f2522f16172a62d972668a16c22", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 193, "avg_line_length": 29.476190476190474, "alnum_prop": 0.5864297253634895, "repo_name": "hackerspace-ntnu/website", "id": "25b7009b283ec72be8e5d79ff07de88429ca800c", "si...
''' Stuff for driving MS office applications from Python using COM Currently just Excel but Word will come soon. ''' from win32com.client import Dispatch from types import * from string import uppercase class Excel: ''' Wrapper for MS Excel derived from that in Python Programming on Win32 ''...
{ "content_hash": "2a0be48218c40e9578b2754e3d8dbcd4", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 105, "avg_line_length": 38.31578947368421, "alnum_prop": 0.5574281487743026, "repo_name": "rangsimanketkaew/NWChem", "id": "f736b3c641da105cd867f21cb3c29970c91b52bd", "siz...
""" Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.agent import agent from lib.core.common import arrayizeValue from lib.core.common import Backend from lib.core.common import filterPairValues from lib.core.common import getLimitRange ...
{ "content_hash": "7b3e044a7fca497278d79883697089b7", "timestamp": "", "source": "github", "line_count": 604, "max_line_length": 183, "avg_line_length": 43.50993377483444, "alnum_prop": 0.5126331811263318, "repo_name": "glaudsonml/kurgan-ai", "id": "8686f9877acd552100ffee7afe8730d058cd9c94", "size":...
"""Example showing the joining and splitting of tuple streams.""" from pycascading.helpers import * @udf_map(produces=['ucase_lhs2', 'rhs2']) def upper_case(tuple): """Return the upper case of the 'lhs2' column, and the 'rhs2' column""" return [tuple.get('lhs2').upper(), tuple.get('rhs2')] def main(): ...
{ "content_hash": "03e8e1ccc4f8a04412d726c31ae76c8c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 82, "avg_line_length": 38.578947368421055, "alnum_prop": 0.5702592087312415, "repo_name": "twitter/pycascading", "id": "e08550d8602f81a7cd096146f1720ac79e90ea3e", "size": "...
import core PLUGINVERSION = 2 # Always name this variable as `plugin` # If you dont, module loader will fail to load the plugin! plugin = core.Plugin() @plugin.command(command="/hi", description="Says 'Hi, %username%'", inline_supported=True, hidden=False) def hi(bot, upd...
{ "content_hash": "0cf56d48a2f5b729d89801c635cc5194", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 58, "avg_line_length": 35.81818181818182, "alnum_prop": 0.631979695431472, "repo_name": "ProtoxiDe22/Octeon", "id": "8f7cbcc9ecd2de306328dd0eef1d50f5e6094aa6", "size": "394...
import pytest import salt.config import salt.loader import salt.client from utils.path import PathHelper # import watchdog # import time _config = '/etc/salt/minion' _opts = salt.config.minion_config(_config) _opts['pillar_raise_on_missing'] = True _grains = salt.loader.grains(_opts) _opts['grains'] = _grains _utils =...
{ "content_hash": "997ac6ea121e5ae250c695f36a0e10f7", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 94, "avg_line_length": 22.441176470588236, "alnum_prop": 0.6651376146788991, "repo_name": "yagnik/saltstack-template", "id": "417e8c09f7e650833842c45df928436ccad5bbe5", "si...
from tastypie.test import ResourceTestCase from django.utils.unittest import skip class UsersResourceTest(ResourceTestCase): fixtures = [ 'users_api_users.json' ] DETAIL_URL = '/users/%s/' LIST_URL = '/users/' USER_ID = 1 USERNAME = 'admin' PASSWORD = 'admin' ADMIN_RESPONS...
{ "content_hash": "ea9a3b66cf55beebb4280a2df2e29310", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 79, "avg_line_length": 30.080118694362017, "alnum_prop": 0.5241195620005918, "repo_name": "mohabusama/django-users-api", "id": "51317e709ce8c69b66451a223cb30221b23cb6b1", ...
""" WSGI config for mong project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` set...
{ "content_hash": "05ecc7e66b554401055b334038309ead", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 40.32142857142857, "alnum_prop": 0.7989371124889283, "repo_name": "tarvitz/djtp", "id": "8eefff5e8b752613156ce043e16e9fe4ed2948a5", "size": "1129", ...
import random from sys import maxsize mentionStrings = [ 'Also wirklich mal, {usr}!', '{usr}, was fällt dir ein?!', 'Falls du es nicht mitbekommen hast, {usr}...', 'Ey, {usr}!', 'Sag doch auch mal was, {usr}!' ] notTalkingStrings = [ 'Mich interessiert nicht, was du mir sagst, rede mit anderen...
{ "content_hash": "e26effd41ca931d6fddbdefe05e76e7a", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 79, "avg_line_length": 30.18, "alnum_prop": 0.6719681908548708, "repo_name": "h4llow3En/IAmTalkingToYouBot", "id": "210d821b014476688b12bb87dfecd18d6405a21f", "size": "1512...
import xml.etree.ElementTree as ET from decimal import Decimal import sys import os # Vendor Libraries import yaml from jinja2 import Template def build(iconset_id='fa', include_ids=[]): tree = ET.parse('res/fontawesome-webfont.svg') root = tree.getroot() namespaces = {'svg': 'http://www.w3.org/2000/svg'}...
{ "content_hash": "3f4006dda7fd7176d033fbe66fadad57", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 110, "avg_line_length": 28.227272727272727, "alnum_prop": 0.572866344605475, "repo_name": "philya/font-awesome-polymer-icons-generator", "id": "4b8a61d7946f3f16d1a6c49f7799e2...
from __future__ import unicode_literals from django.template import Library from ..admin import SuperInlineModelAdmin register = Library() @register.simple_tag(takes_context=True) def get_sub_inline_formsets(context, inline, original, index, is_template): if not isinstance(inline, SuperInlineModelAdmin): ...
{ "content_hash": "cf32fcf53fcf85d0964637d5deff971e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 75, "avg_line_length": 34.578947368421055, "alnum_prop": 0.6971080669710806, "repo_name": "BertrandBordage/django-super-inlines", "id": "54cc41ac5b2414461808ff20fc289898ad47b...