text stringlengths 4 1.02M | meta dict |
|---|---|
"""'bad' is our exceptions module, here are our package specific exceptions defined."""
class City(Exception):
"""Cannot fetch weather forcast for city."""
class PluginExistsNot(Exception):
"""Plugin does not exist."""
pass
| {
"content_hash": "1639145af3358fc006204390a9810010",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 87,
"avg_line_length": 29.75,
"alnum_prop": 0.7016806722689075,
"repo_name": "BCCN-Prog/webscraping",
"id": "922cc927e6f1a88c65c902bc94c6b620c53602de",
"size": "238",
"bin... |
import tensorflow as tf
import numpy as np
class BB_CNN:
"""
Convolutional neural network to predict a bounding box around an object.
Network architecture
(Conv - ReLu - Max Pool) * M - (Fc - ReLu - Dropout) * N - Fc
Output
out[, 0]: score for probability, i.e. probability = sigmoid(score),
out[, 1]: rel... | {
"content_hash": "bcc43021191ec9027580e487db1fd5af",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 194,
"avg_line_length": 38.04867256637168,
"alnum_prop": 0.6742644493545761,
"repo_name": "TUM-AERIUS/Aerius",
"id": "54ad42878ee74455646b018e6fde5bb746825bf5",
"size": "8... |
import logging
import urllib
from pprint import pprint as pp
from flask import url_for
from flask_login import current_user
from flask_mail import Message
from scout.server.extensions import mail as ex_mail
from scout.server.links import external_primer_order_link
from .controllers import variant as variant_controll... | {
"content_hash": "7ff0e84db660dff9084ad07837e973b7",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 132,
"avg_line_length": 35.71986970684039,
"alnum_prop": 0.586996169979938,
"repo_name": "Clinical-Genomics/scout",
"id": "1596e56ba4c8595525ad4ae3cc344c83a401e28b",
"size... |
import datetime
import logging
from kombu import BrokerConnection
from kombu.common import maybe_declare
from kombu.pools import producers
import base
from entropy.queues import entropy_exchange
import libvirt
LOG = logging.getLogger(__name__)
class Audit(base.AuditBase):
def get_vm_count(self, **kwargs):
... | {
"content_hash": "32a8e34f8a0c15bcaa8ada827e5bf8b1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 37.130434782608695,
"alnum_prop": 0.569672131147541,
"repo_name": "ddutta/entropy",
"id": "9281f2f617eb9d50756d270349dd70a7f4d30505",
"size": "2305",... |
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
from Evaluator import Evaluator
from Constraint import Constraint
from VyPy.data import IndexableDict
from VyPy.data.input_output import flatten_list... | {
"content_hash": "4ecde22f210c443fa08c392c0c2d3db1",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 82,
"avg_line_length": 31.248062015503876,
"alnum_prop": 0.42222773505333666,
"repo_name": "aerialhedgehog/VyPy",
"id": "da309d48c48d8ba371803cf5a00c8bf25d18246b",
"size":... |
from Player import Player
from Gamemaster import Gamemaster
import random
def evolution(iterations=None, players=[]):
# Must have 2 or more players to play round robin!
if len(players) >= 2:
if iterations is None:
iterations = random.randint(100, 150)
gm = Gamemaster(iterations=ite... | {
"content_hash": "daf12b1f00b65c34062b6dc84ee65a1f",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 75,
"avg_line_length": 24.41304347826087,
"alnum_prop": 0.5467497773820125,
"repo_name": "jianyuan/prisoners-dilemma-compiler",
"id": "202daf40fd8b2ff762da6ae658a911980cf1153... |
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
| {
"content_hash": "a4f648208de8b1128a6b6bb52ffbebb9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 26,
"avg_line_length": 12.25,
"alnum_prop": 0.54421768707483,
"repo_name": "PyNSK/ArticlesCode",
"id": "d3b36628699f107cbb585594558687665ef09697",
"size": "174",
"binary"... |
"""
Fast Lomb-Scargle Algorithm, following Press & Rybicki 1989
"""
from __future__ import print_function, division
__all__ = ['LombScargleFast']
import warnings
import numpy as np
from .lomb_scargle import LombScargle
# Precomputed factorials
FACTORIALS = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]
... | {
"content_hash": "0ececf3a37ef57556e28faaaffe0dc1c",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 79,
"avg_line_length": 35.35224586288416,
"alnum_prop": 0.5741607596629664,
"repo_name": "nhuntwalker/gatspy",
"id": "7d2531466b71eb4be006e008d960b81532e872a8",
"size": "1... |
#!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this ... | {
"content_hash": "4c487a5c439cf3ac6f09962d2838d6b9",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 153,
"avg_line_length": 45.96666666666667,
"alnum_prop": 0.6290599595435289,
"repo_name": "hxxft/lynx-native",
"id": "944d2e614143189abbbc8b63b721c20be472eb72",
"size": "2... |
from zope.i18nmessageid import MessageFactory
# Set up the i18n message factory for our package
MessageFactory = MessageFactory('xdash.boards')
| {
"content_hash": "3dc2b7deb032fb73b2974bb2ea753ad4",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 49,
"avg_line_length": 36.25,
"alnum_prop": 0.8206896551724138,
"repo_name": "potzenheimer/xdash",
"id": "7b0e25c0166666a929e219b344eb2d88bcea4882",
"size": "145",
"binary... |
import sys
import os
# -- General configuration ------------------------------------------------
source_suffix = '.rst'
master_doc = 'index'
project = u'Document Title'
copyright = u'years, Author Name'
version = '0.0'
release = version
# -- Options for LaTeX output ---------------------------------------------
l... | {
"content_hash": "400937f86df5b98805e8c468e49366ba",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 95,
"avg_line_length": 20.12121212121212,
"alnum_prop": 0.5737951807228916,
"repo_name": "allisonrandal/sphinx-strat-doc-base",
"id": "785c5e24f32ff8f2c4c215ced091fd054f97904... |
# -*- coding: utf-8 -*-
"""
Organization Registry - Controllers
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index(... | {
"content_hash": "ae7ecf1edfd8716c4a439bab962f605d",
"timestamp": "",
"source": "github",
"line_count": 380,
"max_line_length": 113,
"avg_line_length": 31.81578947368421,
"alnum_prop": 0.4566583953680728,
"repo_name": "flavour/Turkey",
"id": "acbd83980ab708866200b48833b326a292ec6399",
"size": "1209... |
import os
import fixtures
from oslo_config import cfg
from oslo_policy import _parser
from oslo_policy import opts as policy_opts
from magnum.common import policy as magnum_policy
from magnum.tests import fake_policy
CONF = cfg.CONF
class PolicyFixture(fixtures.Fixture):
def __init__(self, compat=None):
... | {
"content_hash": "2efd17dab30a73c429f2f02ea2673da8",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 78,
"avg_line_length": 33.65625,
"alnum_prop": 0.6388115134633241,
"repo_name": "paulczar/magnum",
"id": "574a03a156ce52e6e264e3dc1deb758d839862d2",
"size": "1684",
"bina... |
"""
[path]
cd /Users/brunoflaven/Documents/01_work/blog_articles/extending_streamlit_usage/001_nlp_spacy_python_realp/
[file]
python 006_nlp_spacy_python.py
# source
Source: https://realpython.com/natural-language-processing-spacy-python/
"""
import spacy
# EN
nlp = spacy.load('en_core_web_sm')
# FR
# nlp = ... | {
"content_hash": "8172e3c084ca94a9341702f3cc5a2c00",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 346,
"avg_line_length": 26.041666666666668,
"alnum_prop": 0.7061333333333333,
"repo_name": "bflaven/BlogArticlesExamples",
"id": "e551639e538e1ba50f58c700690058843312859d",
... |
import unittest
from datetime import timedelta
import pytest
from airflow import models
from airflow.api.common.experimental.mark_tasks import (
_create_dagruns,
set_dag_run_state_to_failed,
set_dag_run_state_to_running,
set_dag_run_state_to_success,
set_state,
)
from airflow.models import DagRun
... | {
"content_hash": "35e8ae29a3cdbd94453400f26749692b",
"timestamp": "",
"source": "github",
"line_count": 666,
"max_line_length": 109,
"avg_line_length": 40.3963963963964,
"alnum_prop": 0.6148528099910794,
"repo_name": "dhuang/incubator-airflow",
"id": "49008d386ba200d3b0117a97aff10338b244546f",
"siz... |
"""
GPT2 SeeKeR Agent for Language Modeling.
"""
from typing import Optional, Tuple, List, Union
import torch
import torch.nn
from parlai.agents.fid.fid import (
FidModel,
FidAgent,
SearchQuerySearchEngineFiDAgent,
WizIntGoldDocRetrieverFiDAgent,
)
from parlai.agents.hugging_face.gpt2 import Gpt2Agent
... | {
"content_hash": "6add48e17f69960c5db21d2dd431dca4",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 88,
"avg_line_length": 31.990625,
"alnum_prop": 0.6283090749242942,
"repo_name": "facebookresearch/ParlAI",
"id": "83109363031a4bbb402ba4f6bdcf183ee9cbc235",
"size": "1043... |
from thumbor.filters import BaseFilter, filter_method
from thumbor.ext.filters import _sharpen
class Filter(BaseFilter):
@filter_method(
BaseFilter.DecimalNumber,
BaseFilter.DecimalNumber,
BaseFilter.Boolean,
BaseFilter.DecimalNumber
)
def conditional_sharpen(
... | {
"content_hash": "4ebea1781e469a52378e9ccc57ed5971",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 64,
"avg_line_length": 30.634146341463413,
"alnum_prop": 0.6035031847133758,
"repo_name": "wikimedia/thumbor-conditional-sharpen",
"id": "f0e48f3ad1d56bd61d4c6aa24b2f69a50ec0... |
from mixbox import fields
import cybox.bindings.win_hook_object as win_hook_binding
from cybox.objects.library_object import Library
from cybox.objects.win_handle_object import WinHandle
from cybox.common import ObjectProperties, String, NonNegativeInteger
class WinHook(ObjectProperties):
_binding = win_hook_bin... | {
"content_hash": "3ad44055cdb170b566842d142f310170",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 78,
"avg_line_length": 41.45,
"alnum_prop": 0.7611580217129071,
"repo_name": "CybOXProject/python-cybox",
"id": "55b66d4b5c08f8b2f6dd9d35552380c0d0a495c4",
"size": "934",
... |
import sys
import os
import codecs
import traceback
from xml.sax.saxutils import unescape
import untangle
def getFiles(directoryName):
fileNames = []
getFilesIter(directoryName, fileNames)
return fileNames
# return file names
def getFilesIter(directoryName, item_list):
if not os.path.isdir(director... | {
"content_hash": "c38c4ae9ff390810fe8726b9d4bfc19f",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 103,
"avg_line_length": 27.716666666666665,
"alnum_prop": 0.5640408899579074,
"repo_name": "kevinlee9/cnn-text-classification-tf",
"id": "b5dfa23e21cbe8a6626a2a5c414a969de50... |
from db_manager import db
import datetime
class Membership(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), unique=True)
password = db.Column(db.String(100))
email = db.Column(db.String(255), unique=True)
roles = db.Column(db.String(100))
created_at = db... | {
"content_hash": "043ee94b45b918c91c1e196f59a9cf25",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 37.93333333333333,
"alnum_prop": 0.6994727592267135,
"repo_name": "cackharot/ngen-milk-pos",
"id": "7b459c2f8061a994f50f5a0783dbaf83a414e3e7",
"size"... |
from basic_context import BasicGameWorld
from basic_context import BasicGameEngine
from basic_context import NORTH, SOUTH, EAST, WEST, UP, DOWN, RIGHT, LEFT, IN, OUT, FORWARD, BACK, NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST, NOT_DIRECTION
from basic_context import Object
world = BasicGameWorld()
puffy_cloud = w... | {
"content_hash": "2b3f3c7561a335a5e6166266b952eb7a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 342,
"avg_line_length": 48.702127659574465,
"alnum_prop": 0.7391874180865007,
"repo_name": "sleepinghungry/wwif",
"id": "f58d07ee8e5b854d8ba6038718bdb3254a23b0c3",
"size": ... |
from fastapi import FastAPI
from fastapi.middleware.gzip import GZipMiddleware
app = FastAPI()
app.add_middleware(GZipMiddleware, minimum_size=1000)
@app.get("/")
async def main():
return "somebigcontent"
| {
"content_hash": "521990ca21d73f30b49d003391ebbbe5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 53,
"avg_line_length": 19.363636363636363,
"alnum_prop": 0.7605633802816901,
"repo_name": "tiangolo/fastapi",
"id": "b99e3edd19bffe5f96a85399555a6a660b1ac129",
"size": "213... |
import json
import operator
import logging
import re
import time
from socket import socket, AF_INET, SOCK_DGRAM
logger = logging.getLogger(__name__)
def ip():
"""Find default IP"""
ip = None
s = socket(AF_INET, SOCK_DGRAM)
try:
s.connect(('239.255.0.0', 9))
ip = s.getsockname()[0]
... | {
"content_hash": "87090b683edb654bf67996d5f6acfbb4",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 87,
"avg_line_length": 31.773480662983424,
"alnum_prop": 0.524604416623196,
"repo_name": "rs/zkfarmer",
"id": "8c9e997111be8ef007bcbfa3a2b62a56aee89ed0",
"size": "5751",
... |
"""
Data structures for representing market data.
"""
import datetime
from string import Template
from emds import __version__
from emds.exceptions import ItemAlreadyPresentError
from emds.common_utils import check_for_naive_dtime
class MarketOrderList(object):
"""
A list of MarketOrder objects, with some adde... | {
"content_hash": "b8d2a23b4f31413bc38d6e62138f6462",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 100,
"avg_line_length": 36.97865353037767,
"alnum_prop": 0.5972912966252221,
"repo_name": "gtaylor/EVE-Market-Data-Structures",
"id": "7414e66d25e8dc6f1727e4dc9b47eeab4e2c30... |
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np
from IPython import embed
from helper import color
def get_surface_data():
Y = np.arange(-5, 5, 0.25)
X = np.arange(-5, 5, 0.25)... | {
"content_hash": "004f9610d5c26af43d943d5548ffb9f2",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 93,
"avg_line_length": 32.857142857142854,
"alnum_prop": 0.6758893280632411,
"repo_name": "usantamaria/ipynb_para_docencia",
"id": "41e82cd68188e33ffd9480e3a6d3dd6ff7e822d9",... |
from ...errors.httpconflictexception import HttpConflictException
import saklient
# module saklient.cloud.errors.deleteipv6netsfirstexception
class DeleteIpV6NetsFirstException(HttpConflictException):
## 要求された操作を行えません。ルータを削除する前に、IPv6ネットワークの割当を解除してください。
## @param {int} status
# @param {str} code=None
... | {
"content_hash": "3dfd46ae13fd97ce1a2064e1faebafaa",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 173,
"avg_line_length": 41.714285714285715,
"alnum_prop": 0.7397260273972602,
"repo_name": "hnakamur/saklient.python",
"id": "fc918637d5c54e3cdbc5f0c3f595eed17500a8e6",
"si... |
"""
This code implements the streaming version of scikit learn's IPCA algorithm -
https://github.com/scikit-learn/scikit-learn/blob/7813f7efb/sklearn/decomposition/incremental_pca.py
"""
import numpy as np
import random
import pickle as p
from scipy import linalg
from sklearn.utils.extmath import svd_flip
import sys... | {
"content_hash": "78fb55f5af3c144f23bfadff1c5692e5",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 100,
"avg_line_length": 33.63354037267081,
"alnum_prop": 0.5397968605724839,
"repo_name": "AssembleSoftware/IoTPy",
"id": "f0a50e639770d0f143cc946baf594fab5fbdb5b7",
"size... |
import flask
import functools
import redis
import time
from discograph import exceptions
redis_client = redis.StrictRedis()
def limit(max_requests=10, period=60):
def decorator(f):
@functools.wraps(f)
def wrapped(*args, **kwargs):
# For testing error handlers:
# max_req... | {
"content_hash": "be084bdae390fdb2d21a584eddc09015",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 82,
"avg_line_length": 26.382978723404257,
"alnum_prop": 0.5241935483870968,
"repo_name": "josiah-wolf-oberholtzer/discograph",
"id": "9d38b09b4535e28b31548ddec5848c73ddb4933... |
import bisect
def find_highest_lesser(item, seq):
index=bisect.bisect_right(seq, item)
if index==0:
return None
else:
return seq[index-1]
def find_lowest_higher(item, seq):
index=bisect.bisect_right(seq, item)
if index==len(seq):
return None
else:
return seq[ind... | {
"content_hash": "965970de36700e6f960ac0f2b6c2c1ae",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 40,
"avg_line_length": 21.733333333333334,
"alnum_prop": 0.6196319018404908,
"repo_name": "Bolt64/my_code",
"id": "32094ea90b28224aa8c0e885bf1c237364a21fa6",
"size": "350",... |
import logging
logger = logging.getLogger(__name__)
from objbrowser.utils import cut_off_str
# Maximum number of characters used in the __str__ method to represent the underlying object
MAX_OBJ_STR_LEN = 50
def name_is_special(method_name):
"Returns true if the method name starts and ends with two underscores"
... | {
"content_hash": "cd61827a1be890bd0d94d9f1308c69a6",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 99,
"avg_line_length": 30.548387096774192,
"alnum_prop": 0.5874692009855684,
"repo_name": "titusjan/objbrowser",
"id": "94c174aa00368a4132dc7bb09d230a5c1fe11d41",
"size": "... |
from oslo_config import cfg
import oslo_messaging as messaging
from oslo_messaging import rpc
from oslo_messaging import target
CONF = cfg.CONF
TRANSPORT = None
class ApiClient(object):
def __init__(self, transport):
client_target = target.Target('murano', 'results')
self._client = rpc.RPCClient... | {
"content_hash": "04d52ebdee076dac03d7acde78fef453",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 74,
"avg_line_length": 29.017857142857142,
"alnum_prop": 0.6443076923076924,
"repo_name": "DavidPurcell/murano_temp",
"id": "1167e11bda93ff3014c3459f1cda6efa92e6e6ac",
"siz... |
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
from group import Group
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unittest.TestCase):
def setUp(self):
self.wd = WebDriver()
... | {
"content_hash": "eba01f809fee524c63f1e4605bd81b71",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 78,
"avg_line_length": 35.05263157894737,
"alnum_prop": 0.6073573573573574,
"repo_name": "VladimirShvidler/python_training",
"id": "84a1fe8b6c7b884597b629054ec3f2b9ee202ecc",... |
from unittest import mock
from openstack import proxy
from openstack.network.v2 import floating_ip
from openstack.tests.unit import base
IDENTIFIER = 'IDENTIFIER'
EXAMPLE = {
'created_at': '0',
'fixed_ip_address': '1',
'floating_ip_address': '127.0.0.1',
'floating_network_id': '3',
'id': IDENTIFIE... | {
"content_hash": "2b5abcc7f5bed3845fa8d6649fc45e09",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 38.8494623655914,
"alnum_prop": 0.6324384168281206,
"repo_name": "stackforge/python-openstacksdk",
"id": "d443884b596559d9870c0d6ec1612c324cbf2fc3",
... |
"""
Provides classes for handling soap multirefs.
"""
from logging import getLogger
log = getLogger(__name__)
soapenc = (None, 'http://schemas.xmlsoap.org/soap/encoding/')
class MultiRef:
"""
Resolves and replaces multirefs.
@ivar nodes: A list of non-multiref nodes.
@type nodes: list
@ivar cat... | {
"content_hash": "46e9ac73bb2d721f87c84d0d2b75a2c1",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 29.954954954954953,
"alnum_prop": 0.553984962406015,
"repo_name": "ronreiter/interactive-tutorials",
"id": "9f82e16aa9c59eb7727027f336f39c5f5e03c5b4",... |
import os
import sys
import signal
import logging
from optparse import OptionParser
import crypt
from twisted.internet import reactor, ssl, task
from twisted.application.internet import TCPServer
from twisted.application.service import Application
from twisted.web import server, resource, http, guard, static
from twis... | {
"content_hash": "cfa8af4010a3eb70cc07df3feedc6fbc",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 120,
"avg_line_length": 37.86938775510204,
"alnum_prop": 0.6376374218581591,
"repo_name": "MediaMath/qasino",
"id": "21626e9cab15826b7825c121edb1035d5a962f3a",
"size": "99... |
import alsaaudio, time
from array import array
from itertools import izip_longest
def _chunks(n, iterable, padvalue=None):
return izip_longest(*[iter(iterable)]*n, fillvalue=padvalue)
class PlayFloatBuffer:
CHUNK = 32
FORMAT = alsaaudio.PCM_FORMAT_FLOAT_LE
CARD = "default"
def __init__(self, buffer, f... | {
"content_hash": "299b5e5577a561979f9a28634f7c7dd5",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 101,
"avg_line_length": 29.121951219512194,
"alnum_prop": 0.6490787269681743,
"repo_name": "DominikAuras/pyUnnenberg",
"id": "e3fc0733e3bc6ab1c762990bf200686bc68d235a",
"si... |
"""
Django settings for postero project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
#... | {
"content_hash": "a009fd5a6d9ae313aeba862f99a8defa",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 91,
"avg_line_length": 27.649006622516556,
"alnum_prop": 0.6905389221556886,
"repo_name": "PosteroCompany/postero.com.br",
"id": "4e8bb0825d302ed6d94ad4cb1bd236ce59483890",
... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.domain import Domain
from twilio.rest.verify.v2 import V2
class Verify(Domain):
def __init__(self, twilio):
"""
Initialize the Verify Domain
:returns: Domain for Ver... | {
"content_hash": "9b89990743b00e9e66f1ad3350a36d4a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 99,
"avg_line_length": 22.804597701149426,
"alnum_prop": 0.5554435483870968,
"repo_name": "twilio/twilio-python",
"id": "1dae555fd8f5d0e945a731fc31276c5e9888046e",
"size": ... |
import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
if __name__ == '__main__':
moveit_commander.roscpp_initialize(sys.argv)
rospy.init_node('move_group_python_interface_tutorial',
anonymous=True)
robot = moveit_commander.RobotComm... | {
"content_hash": "54911c4b27c1f35a8300f892dc8637e0",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 59,
"avg_line_length": 31.304347826086957,
"alnum_prop": 0.6763888888888889,
"repo_name": "pouyaAB/ros_teleoperate",
"id": "f23565be43c973b6f8fd3b0865a65f6e12ba14b7",
"size... |
from django.urls import re_path
from .views import (
ArchivedView,
CaseCRUDL,
CaseExportCRUDL,
ClosedCasesView,
FlaggedView,
InboxView,
OpenCasesView,
PartnerCRUDL,
PingView,
SentView,
StatusView,
UnlabelledView,
)
urlpatterns = CaseCRUDL().as_urlpatterns()
urlpatterns ... | {
"content_hash": "0b8e145eb0dced43fe2381390119f61f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 33.21875,
"alnum_prop": 0.6613358419567262,
"repo_name": "rapidpro/casepro",
"id": "7b762a7ccc4c6ea5c0d815b33b937a8001b3a411",
"size": "1063",
"bin... |
from kivy.clock import Clock
from kivy.event import EventDispatcher
from kivy.logger import Logger
from functools import partial
from jnius import autoclass, PythonJavaClass, java_method, cast
from android import activity
from android.runnable import run_on_ui_thread
Builder = autoclass('android.app.AlertDialog$Buil... | {
"content_hash": "05e5b5404a6133d982c38e77773c5742",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 77,
"avg_line_length": 34.013513513513516,
"alnum_prop": 0.6249503377036154,
"repo_name": "knappador/kivy-dialog",
"id": "0cbf8e8c38448fa1f40dbb1014358350cc1a23c8",
"size":... |
import glob
import os
import sys
os.chdir("/global/projecta/projectdirs/cosmo/work/legacysurvey/dr7-attic/logs/")
dirlist = glob.glob("./*")
for dirs in dirlist:
dirname = dirs[2:]
filename = "legacysurvey_dr7_logs_"+dirname+".tar.gz"
cmd = "tar -czvf "+filename+" "+dirname
#print(cmd)
#sys.exit()
... | {
"content_hash": "b5a7812acd9d02cfa7708a096f07f90e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 24.285714285714285,
"alnum_prop": 0.6617647058823529,
"repo_name": "legacysurvey/legacypipe",
"id": "3ae5d1ce14236e247425d54b96acfa6e7cba9632",
"size... |
import datetime
import threading
import json
import hashlib
import time
import codecs
import urllib
import os
import io
import random
import re
import string
import sys
import unicodedata
import logging
import roman
import requests
from num2words import num2words
from fuzzywuzzy import fuzz, process
from ConfigParser i... | {
"content_hash": "5475eef846415195954278e8d365e5c5",
"timestamp": "",
"source": "github",
"line_count": 1712,
"max_line_length": 230,
"avg_line_length": 40.78621495327103,
"alnum_prop": 0.6627760433076505,
"repo_name": "m0ngr31/kodi-voice",
"id": "c5e6f3e4cf5c2bdce7c6a1730679775145b7338b",
"size": ... |
from time import sleep
import time
import sys
import os
sys.path.insert(0, os.path.realpath(".."))
import swood
assert(os.path.realpath(swood.__file__) ==
os.path.realpath("../swood/__init__.py"))
def find_program(prog):
for path in os.environ["PATH"].split(os.pathsep):
prog_location = os.path.joi... | {
"content_hash": "b9eaebfd44ca7538d474543ad16f4d53",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 122,
"avg_line_length": 35.885714285714286,
"alnum_prop": 0.5935509554140127,
"repo_name": "milkey-mouse/swood",
"id": "b1d68cdf704007a91d0f0da189b55c91d35a0634",
"size": "... |
import xml.etree.ElementTree as ET
data = '''
<person>
<name>Chuck</name>
<phone type="intl">
+1 734 303 4456
</phone>
<email hide="yes"/>
</person>'''
tree = ET.fromstring(data)
print 'Name:',tree.find('name').text
print 'Attr:',tree.find('email').get('hide')
| {
"content_hash": "04c86bce4b6c5885fa4cc5e94debd457",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 44,
"avg_line_length": 19.857142857142858,
"alnum_prop": 0.6223021582733813,
"repo_name": "johanfrisk/Python_at_web",
"id": "4fea58ebc2b7eda1a77935f262c2529a2bbad74b",
"siz... |
from django.db import models
from django.contrib.auth.models import User
from course.models import Course
class News(models.Model):
user = models.ForeignKey(User)
course = models.ForeignKey(Course)
text = models.TextField(blank=True, default='')
pub_date = models.DateTimeField(auto_now_add=True) | {
"content_hash": "4dd87116ad64ba9b01f8d86e25500ac1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 54,
"avg_line_length": 28.636363636363637,
"alnum_prop": 0.7492063492063492,
"repo_name": "starkdee/courseware",
"id": "d8fc74fcc869b3453b14f6d33d3dbf4e1915acff",
"size": "... |
from __future__ import print_function
import collections
import logging
import os
import platform
import re
import subprocess
import types
import util
import json
from ebstall.versions import Version
from ebstall.util import normalize_string
logger = logging.getLogger(__name__)
CLI_DEFAULTS_DEFAULT = dict(
packa... | {
"content_hash": "25f343afab5c8e8efdfd30b635233cc7",
"timestamp": "",
"source": "github",
"line_count": 662,
"max_line_length": 114,
"avg_line_length": 27.71752265861027,
"alnum_prop": 0.5760531909095864,
"repo_name": "EnigmaBridge/ebstall.py",
"id": "5ceac0030f36df09f41ec05f7d5af93d85e49034",
"siz... |
__all__ = ['constants','ising','models','phi','core','utils','plotting']
from .core import *
__author__ = "Alan R. Lowe"
__email__ = "[email protected]"
__version__ = constants.VERSION
| {
"content_hash": "6b847b12b8bbdd2b44caca2f873f6c7d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 72,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.6021505376344086,
"repo_name": "quantumjot/PyFolding",
"id": "d5728088c698b82ce48372822b9452d821bc2b9b",
"size": "... |
from flask import Blueprint
info = Blueprint('alert_system', __name__, url_prefix='/alert')
@info.context_processor
def reuse_config():
# return dict(coordinator=current_user.coordinator)
return
@info.route('/', methods=['GET', 'POST'])
def index():
return | {
"content_hash": "a1b835a6b013c210f699d00ed3332365",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 63,
"avg_line_length": 22.583333333333332,
"alnum_prop": 0.6863468634686347,
"repo_name": "leitelm/RISE_scada",
"id": "3651a709a355b95cbb82aa0776775fb4ce6b6090",
"size": "2... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'crawler.views.home', name='home'),
# url(r'^crawler/', include('crawler.foo.urls')),
# Unc... | {
"content_hash": "4a9996d5383473a6e702c03c1a557e7b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 35.56,
"alnum_prop": 0.6546681664791901,
"repo_name": "seraph0017/max-x.net",
"id": "1127831d399b6b869b9a1ebf62fd0cf41049227f",
"size": "889",
"bin... |
import psycopg2
import networkx as nx
# Connect to the MusicBrainz database and load graph from disk
connection = psycopg2.connect(database="musicbrainz", user="musicbrainz", password="", host="musicbrainz", port="5432")
cursor = connection.cursor()
graph = nx.read_gexf("graph/sdn-unweighted.gexf")
# Prepare the data... | {
"content_hash": "38eea6ef26fa350e3eedebde0544c4ad",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 139,
"avg_line_length": 38.4390243902439,
"alnum_prop": 0.7017766497461929,
"repo_name": "basimr/snoop-dogg-number",
"id": "d6d4963b67d8067d78bbbe32d026ae2a20bc60f7",
"size... |
from pyexcel_io.sheet import SheetReader
from pyexcel_io.plugins import NEW_READERS
from pyexcel_io._compact import OrderedDict
def clean_keywords(keywords):
sheet_keywords = {}
native_sheet_keywords = {}
args_list = [
"start_row",
"row_limit",
"start_column",
"column_limit... | {
"content_hash": "e23812fbaa92ca8fc392f9d45c4d6b9f",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 72,
"avg_line_length": 33.17460317460318,
"alnum_prop": 0.6035885167464115,
"repo_name": "chfw/pyexcel-io",
"id": "f0276fac849e5bd88a4323b0f19cb1b22ef8eb36",
"size": "4180... |
"""
Fine-tuning XLNet for question answering with beam search using a slightly adapted version of the 🤗 Trainer.
"""
# You can also adapt this script on your own question answering task. Pointers for this are left as comments.
import logging
import os
import sys
from dataclasses import dataclass, field
from typing im... | {
"content_hash": "9e87eb9bc875f30dd29d0c7411d5d613",
"timestamp": "",
"source": "github",
"line_count": 699,
"max_line_length": 119,
"avg_line_length": 46.379113018598,
"alnum_prop": 0.632283537431753,
"repo_name": "huggingface/transformers",
"id": "0c5d69629364f290b44e9b54453edd8b3b697f9a",
"size"... |
import os
import tempfile
import sys
import codecs
RUN_SCRIPT = """
#!/bin/bash
{env}
python {file}
exit $?
"""
INIT_ENV = os.environ["__PY_T_SUBMIT_ENV"]
ROOT_DIR = os.environ["__PY_T_SUBMIT_DIRNAME"]
EXECUTOR = os.path.join(ROOT_DIR, 'torque_executor.py')
init_file = tempfile.NamedTemporaryFile(suffix=".sh", de... | {
"content_hash": "6646dd0224c91d557952e27b09fbc6ca",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 68,
"avg_line_length": 20.08,
"alnum_prop": 0.6892430278884463,
"repo_name": "jbzdak/torque-submitter",
"id": "48bbc6f64e0145d0c0e5861b18784b943e56ca03",
"size": "549",
"... |
"""
This file contains all the functions to extract DOIs of citations from arXiv
papers.
"""
from libbmc.citations import bbl
from libbmc.repositories import arxiv
def get_plaintext_citations(arxiv_id):
"""
Get the citations of a given preprint, in plain text.
.. note::
Bulk download of sources ... | {
"content_hash": "c4b0ede58dd4c1e725f6fdb15a0b4ce9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 32.88,
"alnum_prop": 0.6496350364963503,
"repo_name": "Phyks/libbmc",
"id": "1a86df696d30623fbc31ac8420473ec60dc701ad",
"size": "1644",
"binary": f... |
"""
fizzbuzz.py
Author: Daniel Wilson
Credit: Morgan M
Assignment:
Write a program that prints the numbers from 1 to 100. But for
multiples of three print “Fizz” instead of the number and for
the multiples of five print “Buzz”. For numbers which are multiples
of both three and five print “FizzBuzz”.
We will use a... | {
"content_hash": "3eb3b29ef587b04610e22d1a43b0695d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 77,
"avg_line_length": 20.033333333333335,
"alnum_prop": 0.6980033277870217,
"repo_name": "danielwilson2017/fizzbuzz",
"id": "8505fc547a08c137b9b60327a077c3207de4932e",
"si... |
from collections import namedtuple
from oslo_log import log
import sqlalchemy as sa
from sqlalchemy.ext import baked
from gbpservice.neutron.db.grouppolicy.extensions import (
apic_auto_ptg_db as auto_ptg_db)
from gbpservice.neutron.db.grouppolicy.extensions import (
apic_segmentation_label_db as seg_label_db... | {
"content_hash": "703e2290d668ba426aa939758a29d6ad",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 78,
"avg_line_length": 41.641379310344824,
"alnum_prop": 0.6298443193110301,
"repo_name": "noironetworks/group-based-policy",
"id": "b50c0ea36502d16b941f87a08c1a112191320eb9... |
from .class_aware_sampler import ClassAwareSampler
from .distributed_sampler import DistributedSampler
from .group_sampler import DistributedGroupSampler, GroupSampler
from .infinite_sampler import InfiniteBatchSampler, InfiniteGroupBatchSampler
__all__ = [
'DistributedSampler', 'DistributedGroupSampler', 'GroupSa... | {
"content_hash": "a93b7332611f166c5da254bda7983e05",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 77,
"avg_line_length": 45.22222222222222,
"alnum_prop": 0.8230958230958231,
"repo_name": "open-mmlab/mmdetection",
"id": "a4c7ea135af652712e5a9f14a2002c516c44a16b",
"size": ... |
from __future__ import print_function
from requests.auth import HTTPBasicAuth
import requests
from optparse import OptionParser
def subiterator(substats, master=False):
""" Second level of iterator, based on use or not of group in parameters"""
for subkey, subvalue in substats.iteritems():
for key, va... | {
"content_hash": "6c1ac9874f32c9b6bb78311802d2cbab",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 36.22222222222222,
"alnum_prop": 0.4368098159509202,
"repo_name": "reiven/python-couchdb-stats",
"id": "edaec624b5f3977b4a9c2bab243bcd41d8b9d454",
"s... |
from .common import *
MEDIA_URL = "{{ scheme }}://{{ host_fqdn }}/media/"
STATIC_URL = "{{ scheme }}://{{ host_fqdn }}/static/"
ADMIN_MEDIA_PREFIX = "{{ scheme }}://{{ host_fqdn }}/static/admin/"
SITES["front"]["scheme"] = "{{ scheme }}"
SITES["front"]["domain"] = "{{ host_fqdn }}"
SECRET_KEY = "taiga_localdomain"
D... | {
"content_hash": "a8361a053721ea27f922dddfe4a223fd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 30.866666666666667,
"alnum_prop": 0.6954643628509719,
"repo_name": "padajuan/taiga-deployer",
"id": "afe9968e698760e533136cc8882e6465ab083ae3",
"size... |
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
import datetime
class Command(BaseCommand):
help = 'Runs all build functions'
def add_arguments(self, parser):
parser.add_argument('-p', '--proc',
type=int,
... | {
"content_hash": "b73d1fcdb55e78bfa21ec8af4b90dbe7",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 137,
"avg_line_length": 42.51898734177215,
"alnum_prop": 0.47692765704078594,
"repo_name": "cmunk/protwis",
"id": "4ca1c7ed1efec2e1a68a58337c2fef512ed3a503",
"size": "3359"... |
"""Fichier contenant le paramètre 'liste' de la commande 'chantier'."""
from primaires.interpreteur.masque.parametre import Parametre
class PrmListe(Parametre):
"""Commande 'chantier liste'.
"""
def __init__(self):
"""Constructeur du paramètre"""
Parametre.__init__(self, "liste", "list"... | {
"content_hash": "fe4f31731334419681a1f311d93b7fe9",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 80,
"avg_line_length": 40.6,
"alnum_prop": 0.5316407730200834,
"repo_name": "vlegoff/tsunami",
"id": "7479061c719a18048d55133bbcdda1c37bc2ea38",
"size": "4221",
"binary":... |
"""
Withstand the test of time.
"""
from itertools import permutations
from enon import Enon, enon
def test_str():
assert str(enon) is ''
def test_int():
assert int(enon) == 0
def test_float():
assert float(enon) == 0.0
def test_iter():
count = 0
for entry in enon:
count += 1
a... | {
"content_hash": "9be7ae312898cfc254687d225e82ee4b",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 66,
"avg_line_length": 20.205479452054796,
"alnum_prop": 0.5454237288135593,
"repo_name": "ssangervasi/enon",
"id": "4642ffe38ca1bc85b1c083d0366d5adfcd99c494",
"size": "29... |
"""Tests for control_flow module."""
import collections
import numpy as np
from tensorflow.python.autograph.converters import break_statements
from tensorflow.python.autograph.converters import continue_statements
from tensorflow.python.autograph.converters import control_flow
from tensorflow.python.autograph.core i... | {
"content_hash": "e087070c12eb0fb2184e75ea07607807",
"timestamp": "",
"source": "github",
"line_count": 772,
"max_line_length": 77,
"avg_line_length": 23.496113989637305,
"alnum_prop": 0.5691603726776558,
"repo_name": "Intel-Corporation/tensorflow",
"id": "a66af59cea443d2e06e4d30a7d4c61402c1cb559",
... |
import io
import re
import jinja2
import os
import ruamel.yaml
import collections
import requests
import tempfile
import tarfile
from .utils import tmp_directory, render_meta_yaml
class Str(ruamel.yaml.scalarstring.ScalarString):
__slots__ = ('lc')
style = ""
def __new__(cls, value):
return ruame... | {
"content_hash": "2896002ac2868434223b24d530d10636",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 111,
"avg_line_length": 40.3377308707124,
"alnum_prop": 0.5232862375719518,
"repo_name": "shadowwalkersb/conda-smithy",
"id": "9c40a44da3565c8c473c2cdd57d3bcb646b5512a",
"... |
# xml.etree test. This file contains enough tests to make sure that
# all included components work as they should.
# Large parts are extracted from the upstream test suite.
#
# PLEASE write all new tests using the standard unittest infrastructure and
# not doctest.
#
# IMPORTANT: the same tests are run from "test_xml_... | {
"content_hash": "45e6af3d240f54e7266ef5de1cf14591",
"timestamp": "",
"source": "github",
"line_count": 2449,
"max_line_length": 137,
"avg_line_length": 30.14169048591262,
"alnum_prop": 0.560859964506821,
"repo_name": "MalloyPower/parsing-python",
"id": "da1ad0968686edcc9f11c65ff763ccd23f140924",
"... |
from cc_cedict import phrases_dict
class Counter:
def __init__(self):
self._data = {}
def add(self, item):
if item not in self._data:
self._data[item] = 0
self._data[item] += 1
def most_common(self):
items = self._data.items()
return sorted(items, key=... | {
"content_hash": "63962446c033730d8351e8952845c9f2",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 26.8,
"alnum_prop": 0.5190713101160862,
"repo_name": "mozillazg/pinyin-data",
"id": "5df3d97102cd2a87ca7501472765545cf9eee631",
"size": "1230",
"bi... |
from patterns.pattern_class import PatternClass
from exceptions import NotRegisteredPatternException
class PatternRepository(dict):
def add(self, pattern):
self[pattern.name] = pattern
return self
def find(self, pattern_name):
pattern = self.get(pattern_name)
if not pattern:
... | {
"content_hash": "b6d6fa92c93994bc518dabbc85d220f0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 61,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.6941340782122905,
"repo_name": "harukaeru/SimplePythonParser",
"id": "bee8c983f1d782823d8cfea3d6affe6a7f65fef7",
"... |
from __future__ import absolute_import
import wx
class Base(object):
def get_choices(self, partial_text):
raise NotImplementedError
def get_display_text(self, data):
raise NotImplementedError
class Model(Base):
def __init__(self, model=None, field=None, query=None, limit=None):
... | {
"content_hash": "7a96dffbf8ddb0d843d43fedaf755027",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 32.175,
"alnum_prop": 0.5843045843045843,
"repo_name": "Bouke/mvvm",
"id": "f4111c683f192b5d4450ca74d86590cbca77f391",
"size": "1287",
"binary": fa... |
from congress.api import versions
from congress.api import webservice
class APIRouterV1(object):
def __init__(self, resource_mgr, process_dict):
"""Bootstrap data models and handlers for the API definition."""
# Setup /v1/
version_v1_handler = versions.VersionV1Handler(r'/v1[/]?')
... | {
"content_hash": "d0dab0ce20fa8315f3cc11ef8b04fac1",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 79,
"avg_line_length": 43.86923076923077,
"alnum_prop": 0.6247588988251798,
"repo_name": "ekcs/congress",
"id": "9978304c51ace45ec5e9c3c73392a18f85bda816",
"size": "6322",... |
import pytest
import vcr
from django.core.management import call_command
from elvanto_sync import elvanto
from elvanto_sync.models import ElvantoGroup, ElvantoPerson
from elvanto_sync.tests.conftest import elvanto_vcr
@pytest.mark.django_db
class TestElvanto():
@elvanto_vcr
def test_pull_groups(self):
... | {
"content_hash": "cbfdbb7c39002a4f28a7da870f0469e8",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 89,
"avg_line_length": 36.04225352112676,
"alnum_prop": 0.6381398983978116,
"repo_name": "monty5811/elvanto_mail_sync",
"id": "61eb4ab0769640f548be51ff7b8e900ba61179cc",
"s... |
from decimal import Decimal
_ = lambda x:x
#from i18n import _
from electrum_cesc.wallet import WalletStorage, Wallet
from electrum_cesc.util import format_satoshis, set_verbosity, StoreDict
from electrum_cesc.bitcoin import is_valid, COIN, TYPE_ADDRESS
from electrum_cesc.network import filter_protocol
import sys, getp... | {
"content_hash": "c2121daf3814eb587da9bd86d61dc2af",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 147,
"avg_line_length": 33.23580786026201,
"alnum_prop": 0.5255551175929576,
"repo_name": "Marcdnd/electrum-cesc",
"id": "e0e7cc9de9ccb978483a46d221073831c7f90c1b",
"size"... |
from uuid import uuid4
import plistlib
from flask import current_app, render_template, abort, Blueprint, make_response, url_for, request, g
import os
from commandment.enroll import AllDeviceAttributes
from commandment.enroll.profiles import ca_trust_payload_from_configuration, scep_payload_from_configuration
from com... | {
"content_hash": "5d7dead44a56f0cf061b6b62c160e719",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 244,
"avg_line_length": 38.85,
"alnum_prop": 0.6718146718146718,
"repo_name": "mosen/commandment",
"id": "138629e4e45e9f2070b1434ff7e699579b199c7b",
"size": "7770",
"bin... |
from pyplatformerengine.utilities.Color import Color
from pyplatformerengine.models.SpritesheetLoader import SpritesheetLoader
import pygame
"""
Class utility to build sprites.
"""
class SpritesheetFactory:
"""
Creates a visual game object based on configuration.
"""
def createImages(self... | {
"content_hash": "d2126582653779fd56c55362cdd98355",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 110,
"avg_line_length": 31.96551724137931,
"alnum_prop": 0.5911542610571737,
"repo_name": "maximx1/PyPlatformerEngine",
"id": "8434d93630eb43cd35f1835537eec4a9b8c85603",
"s... |
"""Auth Components for Consoles."""
import time
from oslo.config import cfg
from nova.cells import rpcapi as cells_rpcapi
from nova.compute import rpcapi as compute_rpcapi
from nova import manager
from nova.openstack.common.gettextutils import _
from nova.openstack.common import jsonutils
from nova.openstack.common ... | {
"content_hash": "ee15819d0555e3d50c4e58b3aac19381",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 76,
"avg_line_length": 38.486486486486484,
"alnum_prop": 0.5894194756554307,
"repo_name": "plumgrid/plumgrid-nova",
"id": "021914b8fe103af98de0baeb44c5afd535d99fb2",
"size... |
from flask import url_for
import pytest
@pytest.fixture
def response(client):
return client.get(url_for('healthcheck.check_health'))
class WhenBrowsingToHealthcheckEndpoint(object):
def it_exists(self, response):
assert response.status_code == 200
def it_reports_site_ok(self, response):
... | {
"content_hash": "4c0a91ccaa70f9cf7f6e55fce49a6b36",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 22.4375,
"alnum_prop": 0.7186629526462396,
"repo_name": "crossgovernmentservices/csd-notes",
"id": "ad53db094746387fb98ce23d210027f33a211cff",
"size"... |
import hashlib
import base64
import re
import hmac
import os
import json
import ecdsa
import pyaes
from .util import bfh, bh2u, to_string
from . import version
from .util import print_error, InvalidPassword, assert_bytes, to_bytes, inv_dict
from . import segwit_addr
def read_json_dict(filename):
path = os.path.j... | {
"content_hash": "a31442fc6b267db1c9a536e5271100f9",
"timestamp": "",
"source": "github",
"line_count": 975,
"max_line_length": 133,
"avg_line_length": 30.575384615384614,
"alnum_prop": 0.6144040790312301,
"repo_name": "dabura667/electrum",
"id": "33ae75bd703c4d3bc54f09156edab13356df1958",
"size": ... |
import os
import json
import csv
from jinja2 import Markup
from db import export_sql
def render(vis, request, info):
info["message"] = []
reload = int(request.args.get("reload", 0))
table = request.args.get("table", '')
where = request.args.get("where", '1=1')
field = request.args.get("field", '... | {
"content_hash": "42e7984546fc06b3b0c002e0216e468c",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 94,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.5361757105943152,
"repo_name": "garthee/gnot",
"id": "722061b2698e75295a0980d09c1245baa29ec905",
"size": "2322",
... |
__author__ = 'Jwely'
from build_tex_figs_by_run import *
from build_tex_tables import *
from synthesize_piv_uncertainty_images import *
from test_piv_dynamic_plots import *
from test_piv_plots import *
| {
"content_hash": "a6452d85285359da2be151b5a949a031",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 47,
"avg_line_length": 29,
"alnum_prop": 0.7536945812807881,
"repo_name": "Jwely/pivpr",
"id": "e0c1adfa04a2d4aa9a6740497c34e6d35bf478a2",
"size": "203",
"binary": false,
... |
import pika
from subprocess import check_output, CalledProcessError
import json
import os
from pymongo import MongoClient
import logging
logging.basicConfig()
def create_channel(connection, exchange, queue, key, type = 'direct'):
channel = connection.channel()
channel.exchange_declare(exchange=exchange, type=t... | {
"content_hash": "1d21dc2d4f02238b9c1c1df976b4e5ef",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 97,
"avg_line_length": 28.616071428571427,
"alnum_prop": 0.6249609984399376,
"repo_name": "leibowitz/perfmonitor",
"id": "736337af931ba5eef1359da352707eddb47bd140",
"size"... |
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/hongkongcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
... | {
"content_hash": "bb8158daef17650c3e080a6705776880",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 85,
"avg_line_length": 25.929577464788732,
"alnum_prop": 0.5741444866920152,
"repo_name": "digiwhite/hongkongcoin",
"id": "55c245ba1ece33a71983a9c1a9aa372c6b9d4744",
"size"... |
import os
from setuptools import setup
LONG_DESCRIPTION = """
Django confirmaction is a battery for confirm actions via email, sms etc.
"""
def long_description():
try:
return open(
os.path.join(os.path.dirname(__file__), "README.md")
).read()
except IOError:
return LONG_D... | {
"content_hash": "1faed46d51e79b2c7c52e62a1a0be4b6",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 26.53488372093023,
"alnum_prop": 0.5977212971078002,
"repo_name": "Zapix/django-confirmaction",
"id": "b42fd0f5569032e424a53a9b28823d42885001d6",
"si... |
import copy
import json
import pytest
import tempfile
import subprocess
@pytest.fixture("session")
def built_json_file():
with tempfile.NamedTemporaryFile(mode="r") as f:
subprocess.call(["python", "scripts/build.py", "-V", "v1.0.1", "-f", f.name, "src"])
data = json.load(f)
return data
@py... | {
"content_hash": "788e2896a31c276a14e669e12a320747",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 92,
"avg_line_length": 18.681818181818183,
"alnum_prop": 0.6715328467153284,
"repo_name": "virtool/virtool-database",
"id": "4adf2a93592c8d3a2077f7b28a12f68907605abc",
"siz... |
"""Color functionality for Linux and Mac systems."""
| {
"content_hash": "2984f58f3996ea6bf595074a4815473c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 52,
"avg_line_length": 53,
"alnum_prop": 0.7358490566037735,
"repo_name": "MisanthropicBit/colorise",
"id": "22b23c70f47b1a30ab885295e1d7efa996bea5b6",
"size": "53",
"bina... |
people = 20
cats = 30
dogs = 15
if people < cats:
print("Too many cats! The world is doomed!")
if people > cats:
print("Not many cats! The world is saved!")
if people < dogs:
print("The world is drooled on!")
if people > dogs:
print("The world is dry!")
dogs += 5
if people >= dogs:
print("Peop... | {
"content_hash": "ed89f8aec27f7628101603d57ce1fe4d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 54,
"avg_line_length": 18.5,
"alnum_prop": 0.6340956340956341,
"repo_name": "davvi/Hardway3",
"id": "7bc5fa82f6d263b7f79d7b62f8e4115e66f62b81",
"size": "504",
"binary": f... |
import torch
from examples.speech_recognition.data.replabels import pack_replabels
from fairseq import utils
from fairseq.criterions import FairseqCriterion, register_criterion
@register_criterion("asg_loss")
class ASGCriterion(FairseqCriterion):
@staticmethod
def add_args(parser):
group = parser.add_... | {
"content_hash": "d5d2da38a1d3ad70238706b9fb6a0400",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 85,
"avg_line_length": 34.77300613496933,
"alnum_prop": 0.5730416372618208,
"repo_name": "pytorch/fairseq",
"id": "41f50bbd70388ce723f2d316d4e9776bcd6be3c9",
"size": "5870... |
from redhat_support_tool.helpers.confighelper import _
from redhat_support_tool.symptoms import AnalyzerPlugin
try:
from pyparsing import Word, Suppress, Combine, SkipTo, Regex, Literal
except ImportError:
from redhat_support_tool.tools.pyparsing import \
Word, Suppress, Combine, SkipTo, Regex, Literal
__a... | {
"content_hash": "9c244112eec5a09811fbd422a50ba1d9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 30.490909090909092,
"alnum_prop": 0.654144305307096,
"repo_name": "redhataccess/redhat-support-tool",
"id": "9f901cdb27066cc888a5c2b1962487f76ef743dc",... |
"""The setup script."""
from setuptools import find_packages, setup
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
with open('requirements_... | {
"content_hash": "42909df653d5d6a2dd17a512da4753a7",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 33.9344262295082,
"alnum_prop": 0.6280193236714976,
"repo_name": "DOV-Vlaanderen/pydov",
"id": "e52e52b2f48df71da8f2164c9217dba6e537c0e8",
"size": "2... |
from django.utils.translation import ugettext_lazy as _
import horizon
from horizon.dashboards.settings import dashboard
class Password(horizon.Panel):
name = _("Password")
slug = 'password'
dashboard.Settings.register(Password) | {
"content_hash": "c8d0aa3749ee298ee2f0d819372b61d5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 55,
"avg_line_length": 21.818181818181817,
"alnum_prop": 0.7708333333333334,
"repo_name": "kionetworks/openstack-dashboard-essex",
"id": "2820276ec62241c33eace1c554373f5e6fca... |
from setuptools import setup
setup_kwargs = {
'name': 'mach9',
'author': '38elements',
'url': 'https://github.com/silver-castle/mach9',
'description': 'a web application framework based ASGI and async/await.',
'version': '0.0.4',
'license': 'MIT License',
'packages': ['mach9'],
'classi... | {
"content_hash": "d905f9d377be56d7031b023fcf45f850",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 77,
"avg_line_length": 25.185185185185187,
"alnum_prop": 0.5558823529411765,
"repo_name": "silver-castle/mach9",
"id": "749b3a4e2b462cf635274dd29b5394b782c40f52",
"size": "... |
from functools import partial
# from ..config_new import BTE_FILTERS
BTE_FILTERS = ["nodeDegree", "ngd", "drugPhase", "survivalProbability"]
def filter_response(res, criteria):
"""
Filter API response based on filtering criteria
:param res: API Response
:param criteria: filtering criteria
"""
... | {
"content_hash": "1c968154d1f411ccc33c57c85047fd80",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 87,
"avg_line_length": 32.416666666666664,
"alnum_prop": 0.4370179948586118,
"repo_name": "biothings/biothings_explorer",
"id": "332e03ecc6051c0506ed891c5c653041cb38df1a",
... |
class SC2ReaderError(Exception):
pass
class SC2ReaderLocalizationError(SC2ReaderError):
pass
class CorruptTrackerFileError(SC2ReaderError):
pass
class MPQError(SC2ReaderError):
pass
class NoMatchingFilesError(SC2ReaderError):
pass
class MultipleMatchingFilesError(SC2ReaderError):
pass
... | {
"content_hash": "70da4ef643d19009377e76a02a437494",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 86,
"avg_line_length": 16.72093023255814,
"alnum_prop": 0.6981919332406119,
"repo_name": "ggtracker/sc2reader",
"id": "5dc20e81926971611cbcf34993e183ecc80e2002",
"size": "7... |
"""Behavioural FIFOs for myhdl.
"""
__author__ = 'Uri Nix'
__all__ = ['DCFifo', 'SCFifo']
### Module Globals ###########################################################
from Queue import Queue
from myhdl import always, instances
### Building Block Units #####################################################
class ... | {
"content_hash": "1cf95f1458d3e46a04130119007de5f7",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 78,
"avg_line_length": 28.118110236220474,
"alnum_prop": 0.49453934472136657,
"repo_name": "unixie/myhdl_arch",
"id": "5561d1c865c103ba6acd3a7ef2b50415eee370c8",
"size": "... |
from __future__ import absolute_import
from ruamel.yaml.emitter import Emitter
from ruamel.yaml.serializer import Serializer
from ruamel.yaml.representer import Representer, SafeRepresenter, BaseRepresenter, \
RoundTripRepresenter
from ruamel.yaml.resolver import Resolver, BaseResolver, VersionedResolver
if False... | {
"content_hash": "8a4e7cbee480d028dbea9c096468e3c5",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 181,
"avg_line_length": 56.06956521739131,
"alnum_prop": 0.5527295285359801,
"repo_name": "Samuel789/MediPi",
"id": "b43260c334b6d4e9a90bb8e5770f0b19f8b5b3ae",
"size": "64... |
import matplotlib.pyplot as plt
import numpy as np
# Carga los datos
data = np.loadtxt('room-temperature.csv', skiprows=1, usecols=[1,2,3,4],delimiter=',')
front_left = data[:,0]
front_right = data[:,1]
back_left = data[:,2]
back_right = data[:,3]
# Grafica los datos en funcion del tiempo
figur, axarr = plt.subplots(... | {
"content_hash": "1b9b3d401964338f59504f37fbf020cd",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 116,
"avg_line_length": 35.53465346534654,
"alnum_prop": 0.6642518807467261,
"repo_name": "ComputoCienciasUniandes/MetodosComputacionalesLaboratorio",
"id": "2ac46f043a5bd56... |
import deuce
from deuce.model import Block
from deuce.model import Vault
from deuce.util import log as logging
from deuce.drivers.metadatadriver import ConstraintError
import deuce.transport.wsgi.errors as errors
logger = logging.getLogger(__name__)
class BlockStorage(object):
@staticmethod
def get(vault_id... | {
"content_hash": "84ba3752e03cb53479bfe294069c5bdd",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 34.834782608695654,
"alnum_prop": 0.5184722915626561,
"repo_name": "rackerlabs/deuce",
"id": "2b5fa78cbde19c84d4f4af6ca56f6f17e0956087",
"size": "40... |
"""
cn_client.tests
~~~~~~~~~~~~~~~~~~~
Tests of the ConsumerNotebook client API
"""
import ConfigParser
import json
import unittest
from functions import get_products, get_lists, get_users
config = ConfigParser.ConfigParser()
config.read('tests.cfg')
API_KEY = config.get('Params', 'api_key')
BASE_URL = config.get(... | {
"content_hash": "52467983c4ecda11cf2bb7bc8e1cafc3",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 123,
"avg_line_length": 32.5921052631579,
"alnum_prop": 0.6378683891804602,
"repo_name": "consumerio/pycn",
"id": "dc83e421e173e4ee6283c46bf058e6e8bd5186db",
"size": "2502"... |
"""Post-processing operations on detected boxes."""
import tensorflow as tf
from object_detection.core import box_list
from object_detection.core import box_list_ops
from object_detection.core import standard_fields as fields
import sys
def multiclass_non_max_suppression(boxes,
sc... | {
"content_hash": "23298870b3b9eb8e309b3d7a342e297b",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 102,
"avg_line_length": 48.17363344051447,
"alnum_prop": 0.63082365505273,
"repo_name": "zbigniewwojna/text-rcnn",
"id": "e721066c298d4187d117f99211be0fde2a88ec21",
"size"... |
from netpyne import specs
from netpyne.batch import Batch
''' Example of adaptive stochastic descent algorithm optimization of a network using NetPyNE
'simple' network, 3 parameters are optimized to match target firing rates in 2 populations
To run use: mpiexec -np [num_cores] nrniv -mpi batchRun.py
'''
def batchASD... | {
"content_hash": "de88aafb6e8d1f7cc0e7043b3b8d4b6d",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 161,
"avg_line_length": 44.611111111111114,
"alnum_prop": 0.5880448318804483,
"repo_name": "Neurosim-lab/netpyne",
"id": "d21f1b1d6a476b31bfaa24bd5302dc8ca5d3db25",
"size":... |
"""Fichier contenant la classe Variable, détaillée plus bas."""
import re
from .expression import Expression
from .delimiteurs import DELIMITEURS
# Constantes
RE_VARIABLE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*$")
class Variable(Expression):
"""Expression variable."""
nom = "variable"
def __init... | {
"content_hash": "51486a289a42e7a288c38870ffb6016c",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 79,
"avg_line_length": 29.52238805970149,
"alnum_prop": 0.5733063700707786,
"repo_name": "vlegoff/tsunami",
"id": "c137e93bf40ee31f6d0921c07a3b27c53c978386",
"size": "3560"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.