text stringlengths 4 1.02M | meta dict |
|---|---|
from django import forms
from django.utils.translation import ugettext_lazy as _
class ReversionForm(forms.Form):
"""A form allowing a user to select which version to revert to."""
def __init__(self, blog, *args, **kwargs):
"""Create a version-selection form for the given blog.
Arguments:
blog -- a Blog inst... | {
"content_hash": "7683f7d931abdad366555903f2ea081b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 73,
"avg_line_length": 32.8,
"alnum_prop": 0.7027439024390244,
"repo_name": "oberlin/pressgang",
"id": "704c97fb238289c7a19c46ef33c30935fd3ad323",
"size": "657",
"binary"... |
print 'from relay_left'
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
device.wake()
# drag (tuple start, tuple end, float duration, integer steps)
# Left drag
device.drag((400,400),(100,400... | {
"content_hash": "de4836bd324694d3926eb7f06a176d91",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 25.384615384615383,
"alnum_prop": 0.7696969696969697,
"repo_name": "stanzheng/android-leapmotion",
"id": "6eb716c8c9c45f3f5d6c834fe5befe19fbed2de2",
... |
'''
Take picture
============
.. author:: Mathieu Virbel <mat@kivy.org>
Little example to demonstrate how to start an Intent, and get the result.
When you use the Android.startActivityForResult(), the result will be dispatched
into onActivityResult. You can catch the event with the android.activity API
from python-fo... | {
"content_hash": "f0f6206eedbf4317e93a1a442220543e",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 108,
"avg_line_length": 31.098765432098766,
"alnum_prop": 0.6776498610559746,
"repo_name": "Zen-CODE/kivy",
"id": "ecfbc55d2347d67cda2f02ab1e7c8c84378af789",
"size": "2519"... |
from behave import *
import urllib2
import urllib
import httplib
import json
import jsonpath_rw
###
### Helpers.
###
## The basic and critical remote collector.
## It defines:
## context.code
## context.content_type
## context.content
## context.content_length
def get_and_process(context, url, data):
## Buil... | {
"content_hash": "df1c66aa7b0c3245a090f985e78fb03b",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 80,
"avg_line_length": 29.253731343283583,
"alnum_prop": 0.6099489795918367,
"repo_name": "kshefchek/monarch-app",
"id": "413f98e662cf7e1a896fe51f0e9667d5d23750b4",
"size"... |
"""Test the wallet."""
from test_framework.test_framework import SarielsazTestFramework
from test_framework.util import *
class WalletTest(SarielsazTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
def setup_network(self):
self.add_nodes(4)
... | {
"content_hash": "316fbbae70ff0109926589619b1e5225",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 181,
"avg_line_length": 47.594847775175644,
"alnum_prop": 0.625695025340747,
"repo_name": "sarielsaz/sarielsaz",
"id": "5884517968865ea94d9cdabb7e9638cd00472d93",
"size": ... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
from urllib.parse import parse_qs, urljoin, urlparse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azur... | {
"content_hash": "229c632161dd3a224ad2767a634f3142",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 122,
"avg_line_length": 44.83892617449664,
"alnum_prop": 0.6591827570722946,
"repo_name": "Azure/azure-sdk-for-python",
"id": "bcc73df997534fd8aeeb5036e7970fe6abe2e166",
"... |
import json
from vnpy.trader.vtConstant import EMPTY_STRING
from vnpy.rpc import RpcServer
from vnpy.trader.vtFunction import getJsonPath
########################################################################
class RsEngine(object):
"""RPC服务引擎"""
settingFileName = 'RS_setting.json'
settingFilePat... | {
"content_hash": "a2fa56878dd8e1a8c1e48d5bb3b88d2e",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 75,
"avg_line_length": 31.439560439560438,
"alnum_prop": 0.41698706745893044,
"repo_name": "rrrrrr8/vnpy",
"id": "04faf346fcf22f6ad336f3e0aa66e8bf114b802f",
"size": "3098",... |
"""Defines the product data file input type contained within job data"""
from __future__ import unicode_literals
import os
from django.db import transaction
from django.utils.text import get_valid_filename
from django.utils.timezone import now
from job.configuration.data.data_file import AbstractDataFileStore
from j... | {
"content_hash": "9729d4cf0b9e073264be9ae7e05123a3",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 140,
"avg_line_length": 44.6,
"alnum_prop": 0.6328984916428863,
"repo_name": "ngageoint/scale",
"id": "bdb2820861f68c89de2c37bfe4a6e593d8bbda5c",
"size": "4906",
"binary... |
from __future__ import absolute_import, division, print_function
import re
from stripe import six
from stripe.multipart_data_generator import MultipartDataGenerator
class TestMultipartDataGenerator(object):
def run_test_multipart_data_with_file(self, test_file):
params = {
"key1": b"ASCII va... | {
"content_hash": "cb467dc1ac446dedbd4979a318b71baf",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 79,
"avg_line_length": 34.065934065934066,
"alnum_prop": 0.5593548387096774,
"repo_name": "stripe/stripe-python",
"id": "bdb6da830787a94e9871b387302b6bc9b9c20b29",
"size": ... |
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
extensions = []
source_suffix = '.txt'
master_doc = 'contents'
project = 'Wilson'
copyright = '2010 Chris Dickinson'
version = '0.0.1'
release = '0.0.1'
today_fmt = '%B %d, %Y'
exclude_patterns = ['_build']
add_funct... | {
"content_hash": "7f882bce62ecf6848402f4e918f257cf",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 81,
"avg_line_length": 26.576923076923077,
"alnum_prop": 0.683068017366136,
"repo_name": "chrisdickinson/wilson",
"id": "5a8f2e9b92d98a756ef30c3b185f11ce816559a6",
"size": ... |
"""Config flow to configure Agent devices."""
import logging
from agent import AgentConnectionError, AgentError
from agent.a import Agent
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.helpers.aiohttp_client import async_get_cl... | {
"content_hash": "955dd1ed2b6d2d5211dc353c5194e806",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 83,
"avg_line_length": 30.925925925925927,
"alnum_prop": 0.5736526946107784,
"repo_name": "tchellomello/home-assistant",
"id": "cc1d6355f3f97edd0ac76a3df510521bf0161a4c",
"... |
import os
import sys
import math
import time
import random
import string
import bintrees
sys.path.extend(['..', '../..'])
import banyan
def random_ints(num_items):
return list(set([random.randint(-999999, 999999) for _ in range(num_items)]))
def random_strings(num_items, len_):
return list(set([''.... | {
"content_hash": "362e55111356ee23725741357024b126",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 109,
"avg_line_length": 21.42105263157895,
"alnum_prop": 0.6805896805896806,
"repo_name": "cpcloud/banyan",
"id": "f17e89f36036bf195b80c8c46a16a325151afff6",
"size": "407",... |
from datetime import datetime
import math
import unittest
from src.pyglow import IRI
from src.pyglow import LocationTime
from src.pyglow.constants import DIR_FILE as pyglow_file
print("pyglow file: {}".format(pyglow_file))
class TestIri(unittest.TestCase):
def setUp(self):
self.iri = IRI()
# S... | {
"content_hash": "553c9b789b0d69bc563b73c4bc9de76b",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 61,
"avg_line_length": 26.102803738317757,
"alnum_prop": 0.5850340136054422,
"repo_name": "timduly4/pyglow",
"id": "caba890da4a2d904e713208a39f947ece44e31c7",
"size": "279... |
import numpy as np
from scipy.linalg import lstsq
from scipy._lib._util import float_factorial
from scipy.ndimage import convolve1d
from ._arraytools import axis_slice
def savgol_coeffs(window_length, polyorder, deriv=0, delta=1.0, pos=None,
use="conv"):
"""Compute the coefficients for a 1-D Sav... | {
"content_hash": "8ccf077e402c8f7cd7eec0d97667d3c1",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 79,
"avg_line_length": 37.53932584269663,
"alnum_prop": 0.6017659383418138,
"repo_name": "perimosocordiae/scipy",
"id": "b7beb9e1fe485be7da8d555963fb4d87ddaa7991",
"size":... |
from __future__ import unicode_literals
import os
import paramiko
from django.utils import six
from reviewboard.ssh.client import SSHClient
from reviewboard.ssh.errors import (BadHostKeyError, SSHAuthenticationError,
SSHError, SSHInvalidPortError)
from reviewboard.ssh.policy impor... | {
"content_hash": "68c03c48ba28ca8cf52ae403441e824a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 30.63302752293578,
"alnum_prop": 0.6678646301287811,
"repo_name": "davidt/reviewboard",
"id": "c53b6b1fcd9563f5bbc4e6eacb3a8663a4087126",
"size": "3... |
"""Test homekit_controller stateless triggers."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.homekit_controller.const import DOMAIN
from homeas... | {
"content_hash": "862949e4dd9f0fdb7bea80a3ee377d4c",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 85,
"avg_line_length": 32.32119205298013,
"alnum_prop": 0.5663354164532323,
"repo_name": "kennedyshead/home-assistant",
"id": "7c02c1a6456eb1ca0f3afdd3683201a761909441",
"... |
import numpy as np
import pytest
from pyspark.ml import Pipeline
from pyspark.mllib.evaluation import MulticlassMetrics, RegressionMetrics
from pyspark.sql.types import DoubleType
from tensorflow.keras import optimizers
from tensorflow.keras.activations import relu
from tensorflow.keras.layers import Dense
from tensorf... | {
"content_hash": "17f79f84784b17883b2587c90f8c0109",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 117,
"avg_line_length": 40.07713498622589,
"alnum_prop": 0.7105444047291724,
"repo_name": "maxpumperla/elephas",
"id": "d7a8cb32905e5c1d6835fc67329c13b23fb2dedb",
"size": ... |
from time import sleep
#--CORBA STUBS-----------------------------------------------------------------
import contLogTest__POA
import contLogTest
#--ACS Imports-----------------------------------------------------------------
from Acspy.Servants.ContainerServices import ContainerServices
from Acspy.Servants.ComponentL... | {
"content_hash": "55b5ccde3d3cc06ddf346b6b9484c18e",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 116,
"avg_line_length": 42.62222222222222,
"alnum_prop": 0.44629822732012514,
"repo_name": "csrg-utfsm/acscb",
"id": "d18be9587167be785dd4c8723632140a854c392b",
"size": "50... |
import operator
import re
import numpy as np
import pytest
import pandas._testing as tm
from pandas.core.api import (
DataFrame,
Index,
Series,
)
from pandas.core.computation import expressions as expr
_frame = DataFrame(np.random.randn(10001, 4), columns=list("ABCD"), dtype="float64")
_frame2 = DataFram... | {
"content_hash": "db851c65f7a5aefabaa9e8b18311ba7e",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 88,
"avg_line_length": 32.27431421446384,
"alnum_prop": 0.5222531293463143,
"repo_name": "gfyoung/pandas",
"id": "6ac85f9d36fdc252620e273db8a2a7fd0aee584e",
"size": "12942... |
import logging
import subprocess
import time
import unittest
import os
from skydive.graph import Node, Edge
from skydive.rest.client import RESTClient
from skydive.websocket.client import WSClient
from skydive.websocket.client import WSClientDebugProtocol
from skydive.websocket.client import WSMessage
from skydive.web... | {
"content_hash": "5fd1b596921117f6ec374cd34a5b5d09",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 78,
"avg_line_length": 36.83461538461538,
"alnum_prop": 0.5569593818523546,
"repo_name": "skydive-project/skydive",
"id": "776e387730ead73a3f05b08af31192001f1d0e5c",
"size... |
import os.path
from setuptools import setup, find_packages
from sys import version_info, platform
if version_info[:2] > (2, 5):
install_requires = []
else:
install_requires = ['simplejson >= 2.0.0']
# Python 2.6 and below requires argparse
if version_info[:2] < (2, 7):
install_requires += ['argparse']
... | {
"content_hash": "6639dc828e3e8cd1b236d3b6b3ed53f7",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 75,
"avg_line_length": 31.836363636363636,
"alnum_prop": 0.6567675613934895,
"repo_name": "cloudera/cm_api",
"id": "df8447af9884f8f2e493b5c172a7aea71696e09a",
"size": "2543... |
import logging
from concurrent import futures as cfutures
from ..errors import TimeoutError
from .scoring_system import ScoringSystem
logger = logging.getLogger(__name__)
class ProcessPool(ScoringSystem):
def __init__(self, *args, workers=None, **kwargs):
super().__init__(*args, **kwargs)
self.... | {
"content_hash": "6630ae1b52de554a96edcc974ecdffbd",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 81,
"avg_line_length": 38.45454545454545,
"alnum_prop": 0.5612293144208038,
"repo_name": "wiki-ai/ores",
"id": "ebb7bac3536be586f2a4722d1828ef5990de075c",
"size": "2115",
... |
import os
from typing import List, Type
from maya.api.OpenMaya import MFnPlugin, MSyntax
from pulse.plugins import PulseCmdBase, CmdArg, CmdFlag
from pulse.core import serialize_attr_value, deserialize_attr_value
# the list of all cmd classes in this plugin
_CMD_CLASSES: List[Type[PulseCmdBase]] = []
def maya_useN... | {
"content_hash": "862324929d88a3c82863b17f75458bee",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 102,
"avg_line_length": 32.86644951140065,
"alnum_prop": 0.664420218037661,
"repo_name": "bohdon/maya-pulse",
"id": "679e6e487e9c56358ad9f99ee11074cb8d619611",
"size": "10... |
'''
algorithm:
time_saving = max(calc_time_saving_matrix)
while time_saving > 0:
calc_time_saving_matrix <- this accounts for servers being full
pick video and server that gives biggest saving
add video to server
remove the request(s) that are satisfied by the current arrangement
'''
import os... | {
"content_hash": "763f8d2b874a2efe79c1bf8b2d5d6646",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 115,
"avg_line_length": 29.115151515151513,
"alnum_prop": 0.5928393005828476,
"repo_name": "marcrobinson/hc2017",
"id": "18a1dac82b4999fa60e6f80630590647ef38d015",
"size":... |
import igraph as ig
import numpy as np
import fastlayout as fl
import time
# load graph data
g = ig.load( filename='data/medium_example_network.txt', format='ncol' )
# set various constants
dimension = 2
max_it = 500
temp = 1
# get number of nodes
nodes = len(g.vs)
# get edges in the right format
edgelist = np.array... | {
"content_hash": "29ace082105a85eda1b776278dc1fc50",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 35.63963963963964,
"alnum_prop": 0.7196663296258847,
"repo_name": "sg-dev/pyFastLayout",
"id": "50383add52bc4a5258f29dbea836c334036d221e",
"size": "... |
from repyportability import *
import repyhelper
mycontext = repyhelper.get_shared_context()
callfunc = 'import'
callargs = []
"""
<Program Name>
time.repy
<Author>
Eric Kimbrel
<Started>
Jul 2, 2009
<Purpose>
replaces the previous time.repy by use of the active interface
time_interface.repy and the impleme... | {
"content_hash": "307960c91e36d2cd9c4527de8fcb4671",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 95,
"avg_line_length": 19.966666666666665,
"alnum_prop": 0.7495826377295493,
"repo_name": "toregreijer/horse-battery",
"id": "ed8c566cf12b56c9e1d759717cfceac6c56adf22",
"si... |
"""
flask.testsuite.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import flask
import unittest
from logging import StreamHandler
from flask.testsuite import FlaskTestCase, catch_warnings, catch_s... | {
"content_hash": "15dfd7234a1ba9c379c1501c368dd8fd",
"timestamp": "",
"source": "github",
"line_count": 622,
"max_line_length": 89,
"avg_line_length": 36.541800643086816,
"alnum_prop": 0.509525276079018,
"repo_name": "sparkmorry/flask",
"id": "7de70c0aeb0c3bb419985861c71036293e11cd21",
"size": "227... |
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This file specifically includes utilities for security.
"""
import threading
import struct
import uuid
import random
import time
import os
import re
impo... | {
"content_hash": "405f7127526959f7d226b6e8293b141b",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 97,
"avg_line_length": 32.28834355828221,
"alnum_prop": 0.607923237697131,
"repo_name": "maoxuxiang/termite_mallet_project",
"id": "dbffeb4f468d333056c879843120fe2d5b81f7f5"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0004_auto_20150623_1623'),
]
operations = [
migrations.AlterField(
model_name='machine',
name='manifest',
... | {
"content_hash": "7f92b3e6d680c411ba9c81aca4f5ad29",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 74,
"avg_line_length": 25.73913043478261,
"alnum_prop": 0.5861486486486487,
"repo_name": "macjustice/sal",
"id": "626d29ce7b01e80a24a9ada0b3491e0c4025b782",
"size": "616",
... |
import serial
import sonic
import glob
sonic_pi = sonic.SonicPi()
connection = serial.Serial(glob.glob('/dev/tty.usbmodem*')[0], 115200)
while True:
line = connection.readline()
command, argument = line.strip().split(' ', 1)
if command == 'pad':
number = int(argument)
sonic_pi.run('cue :p... | {
"content_hash": "f72cbf3653b11e751576b6aca5f7292a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 23.533333333333335,
"alnum_prop": 0.6430594900849859,
"repo_name": "CoderDojoScotland/coderdojo-sequencer",
"id": "02b35a54ef3a3921afdbf20a10e201965cb9... |
from .initialise import init, deinit, reinit, colorama_text, just_fix_windows_console
from .ansi import Fore, Back, Style, Cursor
from .ansitowin32 import AnsiToWin32
__version__ = '0.4.7dev1'
| {
"content_hash": "39c6df4fc473fadf93d7106f31ddc783",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 85,
"avg_line_length": 32.5,
"alnum_prop": 0.7589743589743589,
"repo_name": "tartley/colorama",
"id": "ab62b5328b8d915f9a9fbe75f3bfc50020ef62d8",
"size": "270",
"binary": ... |
"""Standalone helper functions"""
from maya import cmds, mel
def read(node):
"""Return user-defined attributes from `node`
"""
data = dict()
for attr in cmds.listAttr(node, userDefined=True) or list():
try:
value = cmds.getAttr(node + "." + attr)
except:
# S... | {
"content_hash": "fe6661e1ee89bc98abd0890f117a57d4",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 69,
"avg_line_length": 29.26086956521739,
"alnum_prop": 0.5720653789004457,
"repo_name": "pyblish/pyblish-starter",
"id": "f6f8003f46ffbc92d21b72aa6674b16418e83734",
"size"... |
from uai.operation.base_operation import BaseUaiServiceOp
from uai.api.modify_uai_srv_version_memo import ModifyUAISrvVersionMemoApiOp
class UaiServiceModifySrvVersionMemoOp(BaseUaiServiceOp):
"""
Base Modify Version Memo Tool Class with UAI
"""
def __int__(self, parser):
super(UaiServiceModify... | {
"content_hash": "91be5e9ddb9dedd095a73b7587f706e3",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 112,
"avg_line_length": 34.375,
"alnum_prop": 0.600909090909091,
"repo_name": "ucloud/uai-sdk",
"id": "9afcfce19778938f416b2d91c9929549fda56efd",
"size": "2887",
"binary"... |
import unittest
from app.schema_loader.schema_loader import load_schema
class SchemaLoaderTest(unittest.TestCase):
def test_load_schema(self):
self.assertIsNotNone(load_schema("1", "0203"))
def test_load_schema_with_different_form_type(self):
self.assertIsNotNone(load_schema("1", "0205"))
... | {
"content_hash": "d20417d6cc7a402b290f0bc324121b73",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 67,
"avg_line_length": 33.7037037037037,
"alnum_prop": 0.689010989010989,
"repo_name": "qateam123/eq",
"id": "28247e0054739c0ae9df59e0d62072673374a4f8",
"size": "910",
"b... |
"""
Tests for some things in L{loadtest.population}.
"""
from twisted.trial.unittest import TestCase
from contrib.performance.loadtest.population import ReportStatistics
class ReportStatisticsTests(TestCase):
"""
Tests for L{loadtest.population.ReportStatistics}.
"""
def test_countUsers(self):
... | {
"content_hash": "3f29c5110f7f84a4cb9955b623fe8aeb",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 97,
"avg_line_length": 45.352760736196316,
"alnum_prop": 0.566452485627325,
"repo_name": "trevor/calendarserver",
"id": "beae49d14954e241db3da82eed99fec6dd1ee599",
"size":... |
from __future__ import absolute_import, unicode_literals
from wagtail.wagtailcore import blocks
from wagtail.wagtailcore.fields import StreamField
class BioField(StreamField):
def __init__(self, block_types=None, **kwargs):
block_types = [
('Paragraph', blocks.RichTextBlock(icon="doc-full")),... | {
"content_hash": "de969d81f72669689e7cb54bdf55c01b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 30.307692307692307,
"alnum_prop": 0.6725888324873096,
"repo_name": "CIGIHub/greyjay",
"id": "5662758773d8e0731b26f9d0809d51e41e443293",
"size": "394"... |
"""
Configuration for sts samples.
"""
import logging
from baidubce.bce_client_configuration import BceClientConfiguration
from baidubce.auth.bce_credentials import BceCredentials
HOST = b'http://cfc.bj.baidubce.com'
AK = b'ak'
SK = b'sk'
logger = logging.getLogger('baidubce.services.cfc.client')
fh = logging.FileHa... | {
"content_hash": "08abb4797ecc745f1da175a1a14591e7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 85,
"avg_line_length": 28.09090909090909,
"alnum_prop": 0.7702265372168284,
"repo_name": "baidubce/bce-sdk-python",
"id": "31936744b0d16529f61174cee31fc0e591330bec",
"size"... |
from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoListar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoListar, self).__init__(variaveis_do_ambiente) | {
"content_hash": "de1c9b83410724fa5ea350b891209d36",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 59,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.7877358490566038,
"repo_name": "AEDA-Solutions/matweb",
"id": "b6660ec8295e89fc89fb6d03621ed343008e7632",
"size": ... |
""" Runner views
"""
from django.shortcuts import render
from haystack.views import SearchView
from runners.models import Runner
def results(request, runner_pk):
"""Home page for teams
"""
runner = Runner.objects.get(pk=runner_pk)
the_results = runner.result_set.all().order_by('-meet__date')
return render(
... | {
"content_hash": "e60e4eb818af522a8e8cd48e80f2dc27",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 63,
"avg_line_length": 23,
"alnum_prop": 0.6824196597353497,
"repo_name": "ColCarroll/bugbug",
"id": "cf3016a6614ce7e1553e2c1a2a7f836944e0c42c",
"size": "529",
"binary": ... |
from pandas import DataFrame, Series
import numpy
def avg_medal_count():
'''
Compute the average number of bronze medals earned by countries who
earned at least one gold medal.
Save this to a variable named avg_bronze_at_least_one_gold. You do not
need to call the function in your code when runni... | {
"content_hash": "42859697943a2474dab0dd2d24feef58",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 93,
"avg_line_length": 39.02,
"alnum_prop": 0.5750896975909789,
"repo_name": "coolsgupta/machine_learning_nanodegree",
"id": "1e8b293fcb8a813ae46639e7a5da50baa9050f1d",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('polls', '0052_response_comment'),
]
operations = [
migrations.CreateModel(
name='Email',
fi... | {
"content_hash": "b102ba75e8d0eaa95ebf1989388bcba8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.5850785340314136,
"repo_name": "PrefPy/opra",
"id": "9e854f5592801fb5f03585af8d9a894004f14739",
"size": "836",
... |
import mpld3
import os
import glob
import matplotlib
from . import export
from unittest import SkipTest
matplotlib.use('Agg')
TEST_PLOT_FILES = os.path.join(mpld3.BASE_PATH, 'mpld3/test_plots/*.py')
TEST_PLOT_SNAPSHOT_DIR = os.path.join(mpld3.BASE_PATH, 'mpld3/test_plots_snapshots/')
TEST_PLOT_RESULT_SNAPSHOT_DIR ... | {
"content_hash": "7a146cdef8598f3cd4b75a25f574f7f9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 104,
"avg_line_length": 38.75675675675676,
"alnum_prop": 0.699442119944212,
"repo_name": "mpld3/mpld3",
"id": "9721310843475d4b8828b9ad89ad6d0bfa44bd58",
"size": "1434",
... |
import sys
import argparse
import webbrowser
from flask import Flask, Blueprint, url_for
import tornado.ioloop
import tornado.web
import tornado.wsgi
import sockjs.tornado
blueprint = Blueprint('views', __name__)
from . import views
def static(filename):
return url_for('static', filename=filename)
def start_se... | {
"content_hash": "c49eb18f3e4a1ce4d4349660b786215a",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 89,
"avg_line_length": 28.43103448275862,
"alnum_prop": 0.6810187992722863,
"repo_name": "conda/conda-ui",
"id": "b9d4816270e6dae2c1e5e31841d4091561578caa",
"size": "1649",... |
import csv
import os
import frontmatter
CSV_DIR = './highlights/csv'
HIGHLIGHTS_DIR = './highlights'
def create_markdown_file(filename: str):
content = ''
title = ''
with open(os.path.join(CSV_DIR, filename)) as f:
filereader = csv.reader(f)
for index, row in enumerate(filereader):
... | {
"content_hash": "ecb8a7eb397b68fdfbde8392a20ce1bf",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 26.4,
"alnum_prop": 0.5357142857142857,
"repo_name": "paramsingh/paramsingh.github.io",
"id": "68e043477bf1c2bfc36383a8d0d2e39da7cd32f4",
"size": "92... |
import time
from bluetooth import *
def banner():
print "[***] Bluetooth Detector p201 [***]"
def lookup_name(device):
devList =discover_devices()
for device in devList:
name = str(lookup_name(device))
print "[+] Found Bluetooth Device "+str(name)
print "[+] MAC address: "+str(devices)
alreadyFound.append(... | {
"content_hash": "3d43386f7c6e1db46ed06a836a1a7092",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 50,
"avg_line_length": 17.1,
"alnum_prop": 0.6510721247563352,
"repo_name": "n1cfury/ViolentPython",
"id": "ef913a36f0b2b957e243dabcb602cee4a1403e98",
"size": "535",
"bin... |
import os
import shutil
import subprocess
import onnx
from onnx import numpy_helper
TOP_DIR = os.path.realpath(os.path.dirname(__file__))
DATA_DIR = os.path.join(TOP_DIR, "..", "testdata/")
def prepare_dir(path):
if os.path.exists(path):
shutil.rmtree(path)
os.makedirs(path)
def _extract_value_inf... | {
"content_hash": "dd52c2dc013bdf06eaa1cb342934bf0c",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 97,
"avg_line_length": 34.653333333333336,
"alnum_prop": 0.6344747979992305,
"repo_name": "microsoft/onnxruntime",
"id": "521938b14b65e9ee21390682649570b105917eda",
"size":... |
from flask import Flask
from flaskext.actions import Manager
from chili import app
manager = Manager(app, default_server_actions=True)
if __name__ == "__main__":
manager.run()
| {
"content_hash": "bffc235a680582f87ebbca6a15b749e8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.7158469945355191,
"repo_name": "clvrobj/chili",
"id": "ad4e0138332955610bdb58ebdf2c17b5ff1cfa01",
"size": "232",
... |
import re
from enum import Enum
from functools import wraps
from .callback import callback, MSG_RECEIVED
def msg_received(func):
@callback(MSG_RECEIVED)
@wraps(func)
def _msg_received(*args, bot, msg, **kwargs):
return func(*args, bot=bot, msg=msg, **kwargs)
return _msg_received
def command(cm... | {
"content_hash": "ff7c47461be48ae87da340b9f2738e6e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 68,
"avg_line_length": 30.705882352941178,
"alnum_prop": 0.5795019157088123,
"repo_name": "Thom7/telex",
"id": "4b59e9fbba53b85651842bcba3c8f7b76c9ef266",
"size": "1044",
... |
__author__ = 'study_sun'
from convenient import *
from url_manager import *
from downloader import *
from entity import *
| {
"content_hash": "7a0c9266881d5ff377d90cf7b21576ec",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 25,
"avg_line_length": 24.4,
"alnum_prop": 0.7377049180327869,
"repo_name": "s6530085/FundSpider",
"id": "7ab4122e196015706498dbef74a2be34fb4add7e",
"size": "146",
"binary... |
'''
This script can be run with no arguments, in which case it will produce an
APK with native libraries for all four architectures: arm, arm64, x86, and
x64. You can instead list the architectures you want as arguments to this
script. For example:
python create_apk.py arm x86
The environment variables ANDROID_... | {
"content_hash": "2418f551d3831e17b71f6c0785e806df",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 97,
"avg_line_length": 35.414529914529915,
"alnum_prop": 0.579461807650537,
"repo_name": "HalCanary/skia-hc",
"id": "27bff792fbae3183f27b6a3f95ce7646da73a97a",
"size": "84... |
import sys
if sys.version_info < (3,):
def u_encode(string):
return string.encode('utf8')
def u_decode(string):
return string.decode('utf8')
else:
def u_encode(string):
return string
def u_decode(string):
return string
| {
"content_hash": "8d2aa3e6d21dc4d0f8aa53664aafcaf7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 30,
"avg_line_length": 21,
"alnum_prop": 0.7012987012987013,
"repo_name": "lucianp/dotfiles",
"id": "50ba796317b5c41cc605136de5300f423569950f",
"size": "231",
"binary": f... |
"""
Display bitcoin prices using bitcoincharts.com.
Configuration parameters:
- cache_timeout: Should be at least 15 min according to bitcoincharts.
- color_index : Index of the market responsible for coloration,
meaning that the output is going to be green if the
pri... | {
"content_hash": "1223caa84a0c55206ca3fb28ff387b7d",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 75,
"avg_line_length": 32.5,
"alnum_prop": 0.534965034965035,
"repo_name": "sethwoodworth/py3status",
"id": "f530d2716501696746615906d55a6c0f275f3b26",
"size": "4321",
"... |
from haystack import indexes
from oscar.core.loading import get_class, get_model
# Load default strategy (without a user/request)
is_solr_supported = get_class('search.features', 'is_solr_supported')
Selector = get_class('partner.strategy', 'Selector')
strategy = Selector().strategy()
class ProductIndex(indexes.Sea... | {
"content_hash": "289b06eefa9fb2e874b7f9f9797e1867",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 35.06060606060606,
"alnum_prop": 0.6606165370210314,
"repo_name": "okfish/django-oscar",
"id": "db6bd1aa1cfd44d68e79a8520bcc54450bb178dd",
"size": "3... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
im... | {
"content_hash": "56e5538607489e71ee60dc2204dee5c7",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 118,
"avg_line_length": 26.142857142857142,
"alnum_prop": 0.7340619307832422,
"repo_name": "mbohlool/client-python",
"id": "8c6f51f7961c54cdb73b7183eba7da81a575f2bb",
"size... |
from datetime import datetime
import calendar
from direct.gui.DirectGui import DirectFrame, DirectLabel
from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil
from direct.fsm.FSM import FSM
from toontown.parties import PartyGlobals
from toontown.parties import PartyUtils
from toontown.toonbase... | {
"content_hash": "bcd8471c444fbf72bf62e9b4bc696db5",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 302,
"avg_line_length": 61.69642857142857,
"alnum_prop": 0.6166425470332851,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "a54ecfc89fe1cc06842968a4f6d4c252cb89ae... |
"""Auto-generated file, do not edit by hand. GW metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GW = PhoneMetadata(id='GW', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)),
to... | {
"content_hash": "63ac73ab803b6d77038698ec0f5cfc39",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 110,
"avg_line_length": 74,
"alnum_prop": 0.7432432432432432,
"repo_name": "daviddrysdale/python-phonenumbers",
"id": "2da4557d349dee7693eecea80e1a50d8c9c7ce11",
"size": "66... |
"""Test code for vision package"""
from __future__ import print_function
import numpy as np
import tvm
import topi
import topi.testing
def test_argsort():
dshape = (20, 100)
data = tvm.placeholder(dshape, name="data", dtype="float32")
np_data = np.random.rand(dshape[0], dshape[1]).astype(data.dtype)
np... | {
"content_hash": "cedf3da1c210328a1e27a52d2ceb37eb",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 93,
"avg_line_length": 37.03225806451613,
"alnum_prop": 0.5752032520325203,
"repo_name": "mlperf/training_results_v0.7",
"id": "c084a7c431b638ccece63b85a4b527ad3c946482",
"... |
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.iotcloud.v20210408 import models
class IotcloudClient(AbstractClient):
_apiVersion = '2021-04-08'
_endpoint = 'iotcloud.t... | {
"content_hash": "a026bb442a9eb878b669bc2106d7385d",
"timestamp": "",
"source": "github",
"line_count": 2099,
"max_line_length": 112,
"avg_line_length": 42.23296808003811,
"alnum_prop": 0.5952936929619728,
"repo_name": "tzpBingo/github-trending",
"id": "1a02f1bde334837f71fa2ac48eaf421829645d40",
"s... |
from django.core.management.base import BaseCommand, CommandError
from payments.models import Payment, ACTIVE_BACKENDS
class Command(BaseCommand):
help = "Check bitcoin payments status"
def handle(self, *args, **options):
if 'bitcoin' not in ACTIVE_BACKENDS:
raise CommandError("bitcoin b... | {
"content_hash": "3b7a3c6d1a511daf0623473d237b41ba",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 29.642857142857142,
"alnum_prop": 0.6180722891566265,
"repo_name": "CCrypto/ccvpn3",
"id": "0a0e68bd31c44f6045fb1c14fae945def7dd299d",
"size": "830",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0002_auto_20160130_1724'),
]
operations = [
migrations.AlterField(
model_name='address',
name='admin_note',
... | {
"content_hash": "6d3dec40cc7f3524660202ccff8c790d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 120,
"avg_line_length": 38.625,
"alnum_prop": 0.5992448759439051,
"repo_name": "ninapavlich/lesleyloraine",
"id": "ac971adc18bc8729805e76b0de184c807b9f0cfc",
"size": "1878"... |
from __future__ import print_function, absolute_import, division
import warnings
import numpy as np
from numpy.ma.core import nomask
import dask.array as da
from astropy import convolution
from astropy import units as u
from astropy import wcs
#from astropy import log
from astropy.io.fits import Header, HDUList, Pri... | {
"content_hash": "84cd6e354a97cdbd65fc1518e0ecdfcc",
"timestamp": "",
"source": "github",
"line_count": 1148,
"max_line_length": 121,
"avg_line_length": 36.704703832752614,
"alnum_prop": 0.5300092555236491,
"repo_name": "low-sky/spectral-cube",
"id": "fa5cee4f9d9c24540fcae698dd32470ce78a3bde",
"siz... |
import glob, os, sys
sys.path.append(os.getcwd() + '/lib/')
sys.path.append(os.getcwd() + '/cloudtracker/')
# Multiprocessing modules
import multiprocessing as mp
from multiprocessing import Pool
PROC = 16
import model_param as mc
from conversion import convert
import cloudtracker.main
# Default working directory fo... | {
"content_hash": "82c3303f22a1c5d0838e772f1708315c",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 73,
"avg_line_length": 30.401639344262296,
"alnum_prop": 0.6875168509032085,
"repo_name": "lorenghoh/ent_analysis",
"id": "ed963c181d218e01d284e796e0073b8f7932d839",
"size... |
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
from distutils import sysconfig
sysconfig.get_config_vars()["OPT"] = ''
sysconfig.get_config_vars()["CFLAGS"] = ''
setup(name="miniupnpc",
version=open('VERSION').read().strip(),
author='... | {
"content_hash": "894bfb80d660941739a4117799606ec3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 67,
"avg_line_length": 33.68421052631579,
"alnum_prop": 0.6390625,
"repo_name": "ranok/bitmonero",
"id": "aa632db8225c17204c3a31e186ef71edd5f9b761",
"size": "997",
"binar... |
"""
Implements the SimpleDB interface for MySQLdb
"""
from __future__ import generators
import MySQLdb
import MySQLdb.cursors
import _mysql_exceptions
from simpledb import SimpleDB
class SimpleMySQLdb(SimpleDB):
def __init__(self, **kwargs):
super(SimpleMySQLdb, self).__init__(**kwargs)
self.aut... | {
"content_hash": "f57b83de949bbe54d41df489663da867",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 79,
"avg_line_length": 31.446153846153845,
"alnum_prop": 0.4926614481409002,
"repo_name": "kormoc/SimpleDB",
"id": "27374fc7f40760257f0421fb9ae1e29d4f9c0856",
"size": "616... |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from xor import xorData
class CFBMode(object):
'''
This class is used to implment CFB8 mode using python cryptography. The
base encryption library function used is ECB mode... | {
"content_hash": "057ddcf394669022358320a6d6c5f8aa",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 78,
"avg_line_length": 37.707070707070706,
"alnum_prop": 0.5882668095365657,
"repo_name": "dennisme/AESBlockCiphers",
"id": "aaaccb85ec0c205b5d09abfa67188bd49cd22d28",
"siz... |
from setuptools import setup
setup(name='salearner',
version='0.1',
description='TensorFlow POC optimizing SA scoring',
url='https://github.com/Gaasmann/sa-learner',
author='Nicolas Haller',
author_email='nicolas@boiteameuh.org',
license='MIT',
classifiers=[
... | {
"content_hash": "ee7543cf5424ce787208e1d5ac995747",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 65,
"avg_line_length": 38.95238095238095,
"alnum_prop": 0.5916870415647921,
"repo_name": "Gaasmann/sa-learner",
"id": "ec33e82e78c6ecabcc697af159468ba1413ab0ee",
"size": "8... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('twitterclone', '0010_auto_20150331_1958'),
]
operations ... | {
"content_hash": "772aa995e8daa4d85191c5e6420e923b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 76,
"avg_line_length": 35.82,
"alnum_prop": 0.5343383584589615,
"repo_name": "rsubra13/dtc",
"id": "0ad24abbc91dc80255a21b1150dd7dd855ebd7b6",
"size": "1815",
"binary": f... |
from dragonfly import (Grammar, MappingRule, Choice, Text, Key, Function)
from dragonglue.command import send_command, Command
grammar = Grammar("launch")
applications = {
'sublime': 'w-s',
'pycharm': 'w-d',
'chrome': 'w-f',
'logs': 'w-j',
'SQL': 'w-k',
'IPython': 'w-l',
'shell': 'w-semicolo... | {
"content_hash": "e144c35b65b637391b85038b9bb2a17a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 114,
"avg_line_length": 22.70212765957447,
"alnum_prop": 0.6082474226804123,
"repo_name": "drocco007/vox_commands",
"id": "5e849f3b7531981288f3e3184ff9f3dda9de730a",
"size"... |
import sys
import traceback
import os
from PyQt5.QtWidgets import (QWidget, QFileDialog, QPushButton, QTextEdit,
QGridLayout, QApplication, QLabel, QComboBox,
QCheckBox, QLineEdit, QStatusBar, QMainWindow)
# files for this package
import loss_analysis
class Me... | {
"content_hash": "ecbd135e13d29778aa4c18c06912eb08",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 102,
"avg_line_length": 33.11055276381909,
"alnum_prop": 0.5718621945667021,
"repo_name": "neddles/Loss-Analysis",
"id": "df048ff33e8b90f49510dc6c06c323d3570e4f90",
"size"... |
import numpy as np
from unet3d.utils.utils import get_nibabel_data
def extract_gifti_surface_vertices(surface, index=0, geometric_type="Anatomical", **kwargs):
return extract_gifti_array(surface, index=index, geometric_type=geometric_type, **kwargs)
def extract_gifti_array(gifti_object,
... | {
"content_hash": "c9dfe975d35d77d09bc30b8a903bd0c7",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 124,
"avg_line_length": 46.31372549019608,
"alnum_prop": 0.656929156082416,
"repo_name": "ellisdg/3DUnetCNN",
"id": "08656dd973f157d05b899d1e59100a15c3546f7d",
"size": "70... |
import os
import os.path
import subprocess
import sys
import tempfile
import neovim
sys.path.append(os.path.dirname(__file__))
import resolve
@neovim.plugin
class ResolvePlugin(object):
def __init__(self, nvim):
self.nvim = nvim
def get_args(buffer):
return os.path.splitext(os.path.basename... | {
"content_hash": "1dc4cfc28ccbf6af9e40d5b21b5dbb94",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 350,
"avg_line_length": 33.53299492385787,
"alnum_prop": 0.5408719346049047,
"repo_name": "fkmclane/vim-resolve",
"id": "d0bbf6701aa8663c1e88b8f9a0058f6ef3cce22e",
"size":... |
"""
urls module includes all urls related settings. By default, import all from urls.common
"""
from common import * | {
"content_hash": "99732479f16e6139ba6bb277e23fff16",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 87,
"avg_line_length": 29,
"alnum_prop": 0.7586206896551724,
"repo_name": "teracyhq/django-tutorial",
"id": "a01948a64b0d503c9dc4feaf764eb068642808f1",
"size": "116",
"bin... |
import click
from parsec.commands.roles.create_role import cli as create_role
from parsec.commands.roles.get_roles import cli as get_roles
from parsec.commands.roles.show_role import cli as show_role
@click.group()
def cli():
pass
cli.add_command(create_role)
cli.add_command(get_roles)
cli.add_command(show_role... | {
"content_hash": "d90fdf89ce3f036e2297f9b4d2fc9959",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 64,
"avg_line_length": 23,
"alnum_prop": 0.7763975155279503,
"repo_name": "galaxy-iuc/parsec",
"id": "ea5680142a894c27e4f342b21e47b746a348d138",
"size": "322",
"binary": ... |
import simpbot
from . import conf
module = simpbot.get_module(sys=True)
loader = module.loader()
@loader('anti-clon', None)
def anticlon(irc, ev, result, target, channel, _, locale):
pass
| {
"content_hash": "07fd4a3219d13c45e91cd5458dc42d38",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 58,
"avg_line_length": 19.5,
"alnum_prop": 0.7025641025641025,
"repo_name": "IsmaelRLG/simpbot",
"id": "eae25e8cd506b41bbf6615ea644ba61a76bce19c",
"size": "288",
"binary"... |
from knack.Guest.Debian import Debian
"""
Guest Factory, creates the right guest object from
given configs.
"""
class Factory(object):
"""
create: Creates a guest object from given config
@static
@void
"""
def create(boxConfig):
if not "guest_os" in boxConfig:
raise Exception("You have to... | {
"content_hash": "a24d80cbfcf436509e5fba0628543864",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 86,
"avg_line_length": 21.375,
"alnum_prop": 0.6666666666666666,
"repo_name": "claudio-walser/knack",
"id": "25262d81615a732a688aa1befe8c89164ad8eee8",
"size": "537",
"bi... |
from __future__ import print_function
import sys
import os
def main():
if len(sys.argv) != 4:
print("Usage: gen-toolchain-links.py <versions file> <base download URL> <output directory>")
sys.exit(1)
out_dir = sys.argv[3]
if not os.path.exists(out_dir):
print("Creating directory %... | {
"content_hash": "4898044af484070abc66ccdec24dc397",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 101,
"avg_line_length": 32.27142857142857,
"alnum_prop": 0.5568835768038956,
"repo_name": "espressif/ESP8266_RTOS_SDK",
"id": "4441f8dcf9a688f878ceba64654e0ce3edf52927",
"s... |
from collections import OrderedDict, defaultdict
import sys
from pedigree import read_pedigree
DRAW_CHARACTERS = {
" ": " ",
"\\": "┐",
"/": "┘",
">": "├",
"<": "┤",
"|": "│",
"-": "─"
}
def ancestors(pedigree, id):
result = {}
depth = -1
parents = pedigree.get_parents(id)
... | {
"content_hash": "951f0220a29f3701fff39f3be048e835",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 121,
"avg_line_length": 32.2,
"alnum_prop": 0.5518245341614907,
"repo_name": "BertRaeymaekers/scrapbook",
"id": "dd5cbc67e86f751c2a71a6661e449a20c3baaff1",
"size": "5189",... |
class APIException(Exception):
"""Base class for API exceptions"""
def __init__(self, text):
"""
:param str text:
"""
self.text = text
def __str__(self):
return 'APIException(' + self.text + ')'
| {
"content_hash": "3095435ca1945552b5b85eca416ae7c1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 22.636363636363637,
"alnum_prop": 0.5060240963855421,
"repo_name": "vt-dev/sdk",
"id": "fea9d23fac13be4fd90becff722fb38bab02fade",
"size": "249",
"... |
"""
:mod:`vimeourlparser` --- Vimeo URL parser plugin
=================================================
.. note::
This module requires `lxml library <http://lxml.de/>'_
"""
from __future__ import unicode_literals
__docformat__ = "restructuredtext en"
import urllib2
import re
from lxml import etree
from lxml... | {
"content_hash": "79fc7af745a559f990a09a423a7dbd01",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 79,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.548933984073979,
"repo_name": "tetra5/gooby",
"id": "39a285c3d3e7ed6d88ba85a2a47a8595eeed701b",
"size": "3941",
... |
from urllib import parse
import functools
from aiohttp.web import HTTPForbidden
from aiohttp_session import get_session
from .handlers import login_handler, logout_handler
from .utils import APP_KEY, SESSION_KEY
def setup(app, host, version,
host_prefix='', host_scheme='https',
login_route='/log... | {
"content_hash": "3c59ec65325fe3449568c076d23f37f3",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 83,
"avg_line_length": 33.881188118811885,
"alnum_prop": 0.6285797779076563,
"repo_name": "bard-it/aiohttp_cas",
"id": "52a8b1c74beb25eb28932c36495e647aca30a7be",
"size": ... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class RetrieveFriends(Choreography):
def __init__(self, temboo_session):
"""
Create... | {
"content_hash": "6a9e4df2f853536b1eb6a73c51a747d7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 228,
"avg_line_length": 44.35526315789474,
"alnum_prop": 0.6991990507267873,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "3a548faa5db6066b8823c1ef02b3876b7341a574",
"siz... |
imagedir = parent + "/openexr-images-1.5.0/MultiResolution"
files = [ "Bonita.exr", "ColorCodedLevels.exr",
# FIXME -- we don't know how to deal with RIP-maps -- Kapaa,
"KernerEnvCube.exr", "KernerEnvLatLong.exr", "MirrorPattern.exr",
"OrientationCube.exr", "OrientationLatLong.exr",
... | {
"content_hash": "2b2ce92909ae09d393bb5ef7591a5d44",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 78,
"avg_line_length": 52.7,
"alnum_prop": 0.6603415559772297,
"repo_name": "jeremyselan/oiio",
"id": "526b27177397da9c030ab410c8f975564bf39e22",
"size": "936",
"binary":... |
from spyne.model.complex import ComplexModel
import unittest
from pprint import pprint
from spyne.application import Application
from spyne.const.xml_ns import xsd as _ns_xsd
from spyne.interface.wsdl.wsdl11 import Wsdl11
from spyne.model.complex import Array
from spyne.protocol.xml import XmlDocument
from spyne.prot... | {
"content_hash": "1f7fb947dff9b63714d5a3b4c69875d5",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 97,
"avg_line_length": 30.145833333333332,
"alnum_prop": 0.6067726330338632,
"repo_name": "deevarvar/myLab",
"id": "3d8a02e43de15d3c3a9c01d5750a25be9c08f523",
"size": "513... |
from unittest import mock
from oslo_service import loopingcall
from cinder.tests.unit import test
from cinder.volume.drivers.netapp.dataontap.utils import loopingcalls
class LoopingCallsTestCase(test.TestCase):
def setUp(self):
super(LoopingCallsTestCase, self).setUp()
self.mock_first_looping_t... | {
"content_hash": "96f11770d3e66239f494e42807ad5d03",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 74,
"avg_line_length": 33.7,
"alnum_prop": 0.6540059347181009,
"repo_name": "mahak/cinder",
"id": "213fd58a00d6e1f747199176a56eed527819de2f",
"size": "2316",
"binary": fa... |
from django.db import models
from django.contrib.auth.models import User
class Activity(models.Model):
owner = models.ForeignKey(User)
title = models.CharField(max_length=20)
description = models.CharField(max_length=140)
approx_time = models.IntegerField(null=True)
due_date = models.DateField()
... | {
"content_hash": "a4efa0a8a53b27046be59e11ee97fd02",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 50,
"avg_line_length": 29.5625,
"alnum_prop": 0.7378435517970402,
"repo_name": "Victoria-Sardelli/hackBU16",
"id": "a2e1f9f1d3136cf5f2c073573cc67a2c7b3e49a8",
"size": "473"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pingpong', '0002_auto_20150130_1509'),
]
operations = [
migrations.CreateModel(
name='Gifs',
fields=[
('id',... | {
"content_hash": "41d18d8e71e2849e9f079eb2662c7ad6",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 114,
"avg_line_length": 27.44,
"alnum_prop": 0.5306122448979592,
"repo_name": "simpleenergy/pingpong",
"id": "b9b732f3f852f25048aaf029fcaecec5d44748c3",
"size": "710",
"b... |
"""
@brief test log(time=1s)
You should indicate a time in seconds. The program ``run_unittests.py``
will sort all test files by increasing time and run them.
"""
import unittest
from pyquickhelper.pycode import ExtTestCase
from python3_module_template.subproject.myexampleb import onefunction
class TestExampl... | {
"content_hash": "b35dd5fe6a98c5207cc9c93e9613059f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 71,
"avg_line_length": 23.958333333333332,
"alnum_prop": 0.688695652173913,
"repo_name": "sdpython/python3_module_template",
"id": "3b9333e46fe51a66a9b02a8d621c990d44c50e9b",... |
from datetime import datetime
from alertaclient.utils import DateTime
class Alert:
def __init__(self, resource, event, **kwargs):
if not resource:
raise ValueError('Missing mandatory value for "resource"')
if not event:
raise ValueError('Missing mandatory value for "event... | {
"content_hash": "e5d04edc8c692daf2e5ee80f21303a66",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 127,
"avg_line_length": 46.7734375,
"alnum_prop": 0.5844329380324036,
"repo_name": "alerta/python-alerta",
"id": "5ea741ae52b5f3ecc1898f710aed2a565b83086d",
"size": "5987"... |
from __future__ import division, print_function
import paho.mqtt.client as mqtt
import base64, sys, math
from hashlib import md5
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flags, rc):
if rc != 0:
print("Connection Failed with result code... | {
"content_hash": "836f37d1e95a2d5365d575a65354c647",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 109,
"avg_line_length": 43.111111111111114,
"alnum_prop": 0.6105215281989085,
"repo_name": "euphi/homie-esp8266",
"id": "2b0f1f5b7ee16ac5abd736db4a16502b472d9226",
"size":... |
import os
from sqs import (make_SQS_connection, get_queue, queue_size, )
from cloudwatch import (make_CW_connection, update_metric, )
from threading import Timer
# Define AWS credentials
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
REGION = 'us-west-2'... | {
"content_hash": "ae9a95107d8b43329a8f07efb0e1eb29",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 76,
"avg_line_length": 31.2987012987013,
"alnum_prop": 0.6236514522821577,
"repo_name": "recombinators/autoscaling",
"id": "be4cf5a3dd8f9d79d126b7d96822ede188157470",
"size... |
'''
Problem List Actions class. Extends Actions
Created on Mar 7, 2012
@author: pbradley
@copyright PwC
@license http://www.apache.org/licenses/LICENSE-2.0
'''
import time
import TestHelper
from Actions import Actions
import logging
class PLActions (Actions):
'''
This class extends the Actions class with met... | {
"content_hash": "e4fbee5b0a42809f6055d9e55ea4d55f",
"timestamp": "",
"source": "github",
"line_count": 1281,
"max_line_length": 109,
"avg_line_length": 39.40671350507416,
"alnum_prop": 0.5709984152139461,
"repo_name": "OSEHRA/VistA",
"id": "bfdc4839f8ae569b7bc59048efef9037aecee673",
"size": "51263... |
"""Test output of various incantations of example.sh
"""
import unittest
import subprocess
from textwrap import dedent
def run(script, *args):
cmd = [script] + list(args)
if hasattr(subprocess, 'check_output'):
# python 2.7+
output = subprocess.check_output(cmd, universal_newlines=True).stri... | {
"content_hash": "1b28fc3cae2e797a95fd084ec2067f80",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 87,
"avg_line_length": 26.466666666666665,
"alnum_prop": 0.6013853904282116,
"repo_name": "nhoffman/argparse-bash",
"id": "41fc947ba405beec13b32d66f6645a93b8026053",
"size"... |
"""
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | {
"content_hash": "f28f3aae34ada6b6471a3fa2a9dd4388",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 33.013513513513516,
"alnum_prop": 0.6299631600491199,
"repo_name": "sgenoud/scikit-learn",
"id": "adfa850297d9ffca34fd76de2e29c57a7b9d5ff5",
"size": ... |
"""
This is a Python PID module heavily inspired by the Arduino PID Library
written by Brett Beauregard.
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/
"""
import time
from enum import Enum
class Direction(Enum):
direct = 1
reverse = 2
class Mode(Enum):
automatic = 1
... | {
"content_hash": "3d00593d97809abb8971593f095b7753",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 81,
"avg_line_length": 31.23076923076923,
"alnum_prop": 0.5850478122283396,
"repo_name": "johngroves/SCOUT",
"id": "7d4190de58d33245a70e0acbcbe6bef2059dac9a",
"size": "690... |
__author__ = 'nb254'
from collections import Counter
import time
import csv
import pandas as pd
import math
from datetime import date
from dateutil.relativedelta import relativedelta
import Features as features
import TagAnalysis as tga
import util
import TimeFeatures as tmpf
NUM_OF_ANS = 4
HOUR = 60 * 60
def dataCu... | {
"content_hash": "074ef11813a2c79a0981dd187959f7e0",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 105,
"avg_line_length": 37.14556962025316,
"alnum_prop": 0.6321349463281649,
"repo_name": "Nik0l/UTemPro",
"id": "99fe7886e258fc0672028129b0448dfedf3f3673",
"size": "5916"... |
from __future__ import unicode_literals
import time
import _socket, poplib, imaplib
import frappe
from frappe import _
from frappe.utils import extract_email_id, convert_utc_to_user_timezone, now, cint, cstr, strip
from frappe.utils.scheduler import log
from email_reply_parser import EmailReplyParser
from email.header ... | {
"content_hash": "bcd20dcd320e939151488b5755668557",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 98,
"avg_line_length": 28.110294117647058,
"alnum_prop": 0.687767024152062,
"repo_name": "gangadhar-kadam/helpdesk-frappe",
"id": "af8715815278ead85583e5b6caf96f37f966e7b5",... |
"""
All functions for the ascidata module
@author: Martin Kuemmel, Jonas Haase
@organization: Space Telescope - European Coordinating Facility (ST-ECF)
@license: Gnu Public Licence
@contact: mkuemmel@eso.org
@since: 2005/09/13
$LastChangedBy: jhaase $
$LastChangedDate: 2007-07-11 08:45:32Z $
$HeadURL: http://astro... | {
"content_hash": "4e41a8c7557754b908111fff28f29558",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 86,
"avg_line_length": 31.946666666666665,
"alnum_prop": 0.6940734557595993,
"repo_name": "davidharvey1986/pyRRG",
"id": "3aee5a153a86c567570263df9c835fda5931bbdc",
"size":... |
"""
Given the root node of a binary search tree (BST) and a value. You need to
find the node in the BST that the node's value equals the given value. Return
the subtree rooted with that node. If such node doesn't exist, you should return
NULL.
For example,
Given the tree:
4
/ \
2 7
/ \
... | {
"content_hash": "22460b7ae4fd7b5499a441981dd386d3",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 80,
"avg_line_length": 23.895833333333332,
"alnum_prop": 0.6224934612031386,
"repo_name": "algorhythms/LeetCode",
"id": "a99a6a63e4d5315da14d5f0616bd8e4713278e53",
"size": ... |
"""The Categorical distribution class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.f... | {
"content_hash": "d2265c029d865487ddb590b0bcdf4add",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 80,
"avg_line_length": 35.611111111111114,
"alnum_prop": 0.6470792165019934,
"repo_name": "kobejean/tensorflow",
"id": "fbbacf252100f30e9418a20343eb48e0a8583435",
"size": ... |
def factorial(n):
factorial_total = 1
while n >= 1:
factorial_total = factorial_total *n
n = n -1
return factorial_total
n = int(input("enter in a number"))
ans = factorial(n)
ans = "factorial of entered number is " + repr(ans)
print(ans)
| {
"content_hash": "3fd5fbfda0a708d1406975741d07b761",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 51,
"avg_line_length": 14.8,
"alnum_prop": 0.5641891891891891,
"repo_name": "r-martin-/Code_College",
"id": "14d6474e4e8e05cdf526dff86d5b947f8e46bc99",
"size": "296",
"bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.