text stringlengths 4 1.02M | meta dict |
|---|---|
from .cloud_tts import (
AudioConfig,
AudioEncoding,
CustomVoiceParams,
ListVoicesRequest,
ListVoicesResponse,
SsmlVoiceGender,
SynthesisInput,
SynthesizeSpeechRequest,
SynthesizeSpeechResponse,
Timepoint,
Voice,
VoiceSelectionParams,
)
__all__ = (
"AudioConfig",
... | {
"content_hash": "dbdb23ffab64f0b58d0973cf02ee35df",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 31,
"avg_line_length": 20.06896551724138,
"alnum_prop": 0.6752577319587629,
"repo_name": "googleapis/python-texttospeech",
"id": "2a34ccab0090fbcd18a4fda4b8321c43b5f5f997",
... |
"""this module contains utilities for rebuilding a _ast tree in
order to get a single Astroid representation
"""
import sys
import _ast
import astroid
from astroid import astpeephole
from astroid import nodes
_BIN_OP_CLASSES = {_ast.Add: '+',
_ast.BitAnd: '&',
_ast.BitOr: '|',... | {
"content_hash": "6a2c17286a6ba0afcfb7080c7d7967eb",
"timestamp": "",
"source": "github",
"line_count": 906,
"max_line_length": 92,
"avg_line_length": 43.13245033112583,
"alnum_prop": 0.5558882235528942,
"repo_name": "ClovisIRex/Snake-django",
"id": "60a1ad777d74eac972d8c5480a9210b9449ca934",
"size... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Prefere... | {
"content_hash": "a1b5707e483811ae7033dff5105a23f4",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 119,
"avg_line_length": 29.51304347826087,
"alnum_prop": 0.5332940483205657,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "5be0777c6c0e8879b061c4aaa546788... |
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the... | {
"content_hash": "0d113e4d44b4d635f164282bfc18bbf9",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 182,
"avg_line_length": 34.44604316546763,
"alnum_prop": 0.5167084377610693,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "be6e2c096f958d2f3ea6dbb888151cf6f1f9df0f",
... |
import functools
from django import http
from django.core.exceptions import PermissionDenied
from django.shortcuts import redirect
from olympia import amo
from olympia.access import acl
from olympia.addons.decorators import addon_view_factory
from olympia.addons.models import Addon
from olympia.amo.decorators import ... | {
"content_hash": "3283334f8ee0e82af357ca6ac1a6d594",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 78,
"avg_line_length": 39.2463768115942,
"alnum_prop": 0.5912112259970458,
"repo_name": "eviljeff/olympia",
"id": "d3f714ef978a50412f0f6c6daf2cf30ad5ef7574",
"size": "2708"... |
from django.conf.urls import url
from .views import TestView
urlpatterns = [
url(r'^test/$', TestView.as_view())
]
| {
"content_hash": "9f02a689a0c2e38c0af36471fbdcc7e4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 39,
"avg_line_length": 15.25,
"alnum_prop": 0.680327868852459,
"repo_name": "tarkatronic/django-excel-response",
"id": "170cecbdd55bff1146f82543912c80819c604ef9",
"size": "1... |
import os
import urllib
import djangoappengine.main.main
from google.appengine.ext import blobstore
from google.appengine.ext import webapp
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
class MainHa... | {
"content_hash": "33452492945e982892d9bc0e8722a310",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 110,
"avg_line_length": 38.4,
"alnum_prop": 0.6731770833333334,
"repo_name": "GoSteven/Diary",
"id": "b33b09bdea011f0561bbcc84a99b9076602134c7",
"size": "1561",
"binary":... |
from flask import Flask, render_template, url_for
import json
import os.path
import locale
app = Flask(__name__)
supported_languages = set(['pt', 'en', 'de'])
page_file = 'pages/%(lang)s/%(page)s.html'
@app.route('/')
@app.route('/<language>/')
def route_home(language = 'en'):
is_valid_language = lang... | {
"content_hash": "8748d7a6df4c27b80ecbd92831e85cba",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 85,
"avg_line_length": 29.357142857142858,
"alnum_prop": 0.6027980535279805,
"repo_name": "rhpaiva/rhpaiva.com",
"id": "d6f0b6f95b6c4105c352fe2d4d7bc4fa920f7b3d",
"size": ... |
import smtplib
from django.http.response import HttpResponseRedirect
from django.shortcuts import render
from django import forms
class ContactForm(forms.Form):
name = forms.CharField(label='Name *', max_length=50)
email = forms.EmailField(label='Email *', max_length=50)
message = forms.CharField(label='M... | {
"content_hash": "13a2a6a2819d838b47fb736f8a6d76cd",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 125,
"avg_line_length": 40.96470588235294,
"alnum_prop": 0.5792647903503734,
"repo_name": "Codeepy/Share.it",
"id": "28f85a19b1e09a9938b4e639c1a9692ae47bb10c",
"size": "348... |
import git
import click
import json
import os
import shutil
import sys
import datetime
import time
REPOS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".repos"))
class RepoSettingsRepository(object):
@classmethod
def from_dict(cls, data):
return cls(**data)
def __init__(self, na... | {
"content_hash": "1b904741848ab74371cc315b8a213234",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 84,
"avg_line_length": 24.640287769784173,
"alnum_prop": 0.5997080291970803,
"repo_name": "posborne/git-repohistory",
"id": "15c1dd2d77051f012840576efdb46f4a2e57e5e8",
"si... |
import pika
import time
def callback(ch, method, properties, body):
print 'received:%s' %(body, )
time.sleep(5)
print 'done'
ch.basic_ack(delivery_tag = method.delivery_tag)
conn = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = conn.channel()
channel.queue_declare(queue = ... | {
"content_hash": "2a48826f922624d147ac60009b47b201",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 70,
"avg_line_length": 19.47826086956522,
"alnum_prop": 0.7053571428571429,
"repo_name": "IvanJobs/play",
"id": "ad87d7c1a3265072a0a8d9f02ff1ed92951814a4",
"size": "471",
... |
from django.shortcuts import render, redirect
from django.contrib.auth.models import User as User_model
from django.contrib.auth import login
from django.http import HttpResponse
#from django.template import Context
from maps import settings
from maps import forms
def getUserIdFromUserName(userName):
user = User... | {
"content_hash": "8d28dce6a0705e6b21360d214ebe291d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 158,
"avg_line_length": 32.85245901639344,
"alnum_prop": 0.6516966067864272,
"repo_name": "agilman/django-maps",
"id": "0714b8e6713ea9b21ac003727997c5383276c325",
"size": "... |
from find_faces.server import serve
serve() | {
"content_hash": "0b501cabf8922865595ae045798823f8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.7954545454545454,
"repo_name": "Dixneuf19/fuzzy-octo-disco",
"id": "8cf83642af744d0decf6ee99749b16569bd28a44",
"si... |
"""
Scheduler Service
"""
from oslo.config import cfg
from oslo import messaging
from cinder import context
from cinder import db
from cinder import exception
from cinder import flow_utils
from cinder import manager
from cinder.openstack.common import excutils
from cinder.openstack.common import importutils
from cind... | {
"content_hash": "bbc9a73176810532e11f338dc18e6f01",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 78,
"avg_line_length": 45.34070796460177,
"alnum_prop": 0.5251293061383819,
"repo_name": "theanalyst/cinder",
"id": "663ef89777329ab6b49005aae3f97f039c860ecb",
"size": "11... |
from statsmodels.compat.python import iterkeys, itervalues, zip, range
from statsmodels.stats.correlation_tools import cov_nearest
import numpy as np
import pandas as pd
from scipy import linalg as spl
from collections import defaultdict
from statsmodels.tools.sm_exceptions import (ConvergenceWarning, OutputWarning,
... | {
"content_hash": "dfccb2da7f84ece85cf2b72774b99fc3",
"timestamp": "",
"source": "github",
"line_count": 1413,
"max_line_length": 79,
"avg_line_length": 33.552016985138,
"alnum_prop": 0.5624670421228037,
"repo_name": "bert9bert/statsmodels",
"id": "2416c38526e44049aee09e7decd3e67f7095242d",
"size": ... |
import sys
import os
import signal
def write_stdout(s):
sys.stdout.write(s)
sys.stdout.flush()
def write_stderr(s):
sys.stderr.write(s)
sys.stderr.flush()
def main():
while 1:
write_stdout('READY\n')
line = sys.stdin.readline()
write_stdout('This line kills supervisor: ' + line);
... | {
"content_hash": "7a51b06c0b3edfdf13ee325002d6acb5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 27.08,
"alnum_prop": 0.5731166912850812,
"repo_name": "kristophjunge/docker-mediawiki",
"id": "99f9a43ddf37e8f23966cc23f03b9282a5eab61e",
"size": "69... |
import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")
import argparse
import commands
import cv2
import fnmatch
import json
import math
import numpy as np
import os.path
from progress.bar import Bar
import scipy.spatial
sys.path.append('../lib')
import Matcher
import Pose
import Proje... | {
"content_hash": "5402036e7c20df3df2d05cb23f295926",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 24.885714285714286,
"alnum_prop": 0.7761194029850746,
"repo_name": "UASLab/ImageAnalysis",
"id": "0e5732d905c5a9923aeca870992a36c957f42c1e",
"size": ... |
"""Unit tests for the bytes and bytearray types.
XXX This is a mess. Common tests should be moved to buffer_tests.py,
which itself ought to be unified with string_tests.py (and the latter
should be modernized).
"""
import os
import re
import sys
import copy
import functools
import pickle
import tempfile
import unitt... | {
"content_hash": "9cc15c5aded894a169185a9e96c3d9d0",
"timestamp": "",
"source": "github",
"line_count": 1145,
"max_line_length": 96,
"avg_line_length": 38.61659388646288,
"alnum_prop": 0.5703365297629818,
"repo_name": "p4datasystems/CarnotKE",
"id": "0668d868900b0df18e3c0573046d0527ad6b0a5e",
"size... |
"""A simple, hierarchical distributed counter."""
import threading
import time
from typing import Dict, Mapping, Optional, Union
from acme import core
Number = Union[int, float]
class Counter(core.Saveable):
"""A simple counter object that can periodically sync with a parent."""
def __init__(self,
... | {
"content_hash": "acbd0790c0bb03f28adf06010749c57c",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 80,
"avg_line_length": 33.728,
"alnum_prop": 0.6416034155597723,
"repo_name": "deepmind/acme",
"id": "8492b3d45688ecfcadcd2a4c974da67e499dcee1",
"size": "4832",
"binary"... |
"""
tests.components.sensor.command_sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests command sensor.
"""
import unittest
import homeassistant.core as ha
from homeassistant.components.sensor import command_sensor
class TestCommandSensorSensor(unittest.TestCase):
""" Test the Template sensor. """
def setUp(se... | {
"content_hash": "94aa94202a5d0332f1ae27395374d8d1",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 73,
"avg_line_length": 27.16,
"alnum_prop": 0.5689739813451153,
"repo_name": "Theb-1/home-assistant",
"id": "ae6c9452d3f9067963dbf5c10656ea13acd840d7",
"size": "2037",
"b... |
import unittest
from pythonbacktest.indicatorcalculator import IndicatorsCalculatorPerfMonitor
class IndicatorsCalculatorPerfMonitorTests(unittest.TestCase):
sample_indicator_name_1 = "indicator_1"
sample_indicator_name_2 = "indicator_2"
def test_no_data(self):
perf_monitor = IndicatorsCalculato... | {
"content_hash": "ca4a885713aa2bb4cdda981edd86e600",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 116,
"avg_line_length": 38.02325581395349,
"alnum_prop": 0.6764525993883792,
"repo_name": "quantwizard-com/pythonbacktest",
"id": "77a7f085418151a0b89da9c908778859b774b9e3",
... |
import unittest
from streamlink.plugins.metube import MeTube
class TestPluginMeTube(unittest.TestCase):
def test_can_handle_url(self):
should_match = [
'https://www.metube.id/live/METROTV',
'https://www.metube.id/live/GTV',
'https://www.metube.id/videos/16881738/yudi_2... | {
"content_hash": "af4d30e72ab45e72d4030c63ddcce5d4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 99,
"avg_line_length": 35.791666666666664,
"alnum_prop": 0.610011641443539,
"repo_name": "beardypig/streamlink",
"id": "0848dac8fde35e25e23a96afe2aaebf0fd9e424e",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BlogPost',
fields=[
('id', models.AutoField(auto_cr... | {
"content_hash": "66ccaf875ddddfcefd45ca5701e641b8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 114,
"avg_line_length": 25.304347826086957,
"alnum_prop": 0.5532646048109966,
"repo_name": "mude918/aws_site01",
"id": "09d99000077e7f9f1441e76723623e51f284b845",
"size": "... |
import psycopg2
import sys
def time_it(fn):
def wrapped(*args):
import time
start = time.time()
fn(*args)
used = time.time() - start
print "%s used %s" % (str(fn), used)
return wrapped
@time_it
def matrix_vector_multiply(conn, m1, m2, result):
cur = conn.cursor()
cur.execute("delete from %s" % result)
... | {
"content_hash": "c2306f39c8511b5a295e08d86c74be51",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 138,
"avg_line_length": 27.933701657458563,
"alnum_prop": 0.6481408227848101,
"repo_name": "spininertia/graph-mining-rdbms",
"id": "8c0560b905a9ddbb091e1cc588661175318e74c0"... |
""" Core functions of the updater. """
import os
import re
import zipfile
import psutil
import sys
from . import helpers
# Authorship information.
__author__ = "Sébastien Mathieu"
__version__ = "1.0.0"
def create_archive(path, output_path=None, ignore_list=None, package_name=None, to_remove=None,
... | {
"content_hash": "2d119caa1a407391f9c92b453b925d1e",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 105,
"avg_line_length": 32.72549019607843,
"alnum_prop": 0.6351108448172559,
"repo_name": "sebMathieu/crude-user-updater",
"id": "36506787ca5631e9f57ca0a0f92caf98b67d7451",
... |
"""
This module defines the atom types that are available for representing
molecular functional groups and substructure patterns. Each available atom type
is defined as an instance of the :class:`AtomType` class. The atom types
themselves are available in the ``atomTypes`` module-level variable, or as
the return value... | {
"content_hash": "05bd6b6573ed11a219bf00922f6b9dea",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 261,
"avg_line_length": 73.83727034120734,
"alnum_prop": 0.5713422437082326,
"repo_name": "pierrelb/RMG-Py",
"id": "8a215e15bcfe8403dd32a2d088c6e4b8ec670e30",
"size": "295... |
import Queue
import sqlite3
import threading
class Db(object):
def __init__(self, db, injector):
self.db = db
self.injector = injector
self.tasks = Queue.Queue()
self.position = None
self.pending_events = []
self.running = True
self.thread = threading.Thread(... | {
"content_hash": "0ad1c5fb91885715ad27ee62d73d68dd",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 101,
"avg_line_length": 31.819148936170212,
"alnum_prop": 0.5392845202273487,
"repo_name": "jeckersb/Proton",
"id": "85f8191ee7e1c6524669f19058355e3acf2c0b89",
"size": "380... |
from utils.munin.base import MuninGraph
class NBMuninGraph(MuninGraph):
@property
def graph_config(self):
graph = {
'graph_category' : 'NewsBlur',
'graph_title' : 'NewsBlur Task Server Times',
'graph_vlabel' : 'Feed fetch time / server',
'graph_args' : '... | {
"content_hash": "e67ca752cbf5e285f4c3012bf7c7c6a0",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 83,
"avg_line_length": 28.354166666666668,
"alnum_prop": 0.4739162380602498,
"repo_name": "bruceyou/NewsBlur",
"id": "fed10164b37c0320a7220746a05645da01dde8a6",
"size": "13... |
import multiprocessing
from time import time, sleep
import numpy as np
from rtgraph.core.constants import Constants
from rtgraph.common.logger import Logger as Log
TAG = "Simulator"
class SimulatorProcess(multiprocessing.Process):
"""
Simulates signals and converts them as raw data to feed the processes.
... | {
"content_hash": "aec6fa2b54a1f772bf01477f014f8cab",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 106,
"avg_line_length": 29.142857142857142,
"alnum_prop": 0.5612745098039216,
"repo_name": "ssepulveda/RTGraph",
"id": "4e1abdbf54dc4e0ceb93bbb6fbe5d355a2e78f9e",
"size": "... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
from pants.util.memo import memoized, memoized_property, per_instance, testable_memoized_property
class MemoizeTest(unittest.TestCase):
def test_f... | {
"content_hash": "619c4b395e90eafa57bf28b1d7ae395a",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 97,
"avg_line_length": 26.322033898305083,
"alnum_prop": 0.6309079201545396,
"repo_name": "ity/pants",
"id": "855b94ad846f0dfb155940a55f9a883ec0f0a01e",
"size": "7912",
... |
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
from pyasn1_modules import pem
from pyasn1_modules import rfc5280
from pyasn1_modules import rfc6010
class UnconstrainedCCCExtensionTestCase(unittest.TestCase):
uncons... | {
"content_hash": "47cfad74b21e64b2eed6ad3ac269e319",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 77,
"avg_line_length": 34.638297872340424,
"alnum_prop": 0.6937960687960688,
"repo_name": "etingof/pyasn1-modules",
"id": "1726a8d880a3cbf4527456bd8ea6704df98fcd5a",
"size"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from src.fourier_series.fourier_series import GeneralizedFourierSeries
from src.fourier_series.legendre.polynomials import legendre_polyval
from src.f... | {
"content_hash": "47beee2d543e19b836e49c3fb8a5dadf",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 70,
"avg_line_length": 34.15068493150685,
"alnum_prop": 0.5302847974328119,
"repo_name": "jaantollander/Fourier-Legendre",
"id": "9e8960e081acd1c152a9f2417557e6fb47d507cb",
... |
import requests
from diaryapi import Diary_API
from authloader import load_user, load_app_info
username, password = load_user()
appkey, key = load_app_info()
with requests.Session() as sess:
d_api = Diary_API(sess, appkey=appkey,
key=key)
if not d_api.sid and not d_api.auth(use... | {
"content_hash": "760e109bdc3300113e0f3ee8d7900cb2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 100,
"avg_line_length": 31.708333333333332,
"alnum_prop": 0.5795006570302234,
"repo_name": "yastrov/py-diary-api",
"id": "8062c434047a47f37f0e9efeae2612de6a7877e5",
"size":... |
from .linear_model import yule_walker
from statsmodels import PytestTester
test = PytestTester()
| {
"content_hash": "98386318e95fa11a8bb530f2f1384ed0",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 37,
"avg_line_length": 24.5,
"alnum_prop": 0.8163265306122449,
"repo_name": "ChadFulton/statsmodels",
"id": "55dc22530f382a25a806f60d60df1af6e64506ae",
"size": "98",
"bina... |
'''
© 2012-2013 eBay Software Foundation
Authored by: Tim Keefer
Licensed under CDDL 1.0
'''
import os
import sys
from optparse import OptionParser
try:
input = raw_input
except NameError:
pass
sys.path.insert(0, '%s/../' % os.path.dirname(__file__))
from common import dump
import ebaysdk
from ebaysdk.exce... | {
"content_hash": "9457b073566a3a95d9e8fab88de1e530",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 95,
"avg_line_length": 25.431137724550897,
"alnum_prop": 0.5589828113962797,
"repo_name": "shashwatsehgal/ToLop",
"id": "703409bfc113cdc7490f596d5d6534b1ec0567bb",
"size":... |
"""
Tests for L{twisted.trial.util}
"""
from __future__ import division, absolute_import
import os, sys
from zope.interface import implementer
from twisted.python.compat import _PY3, NativeStringIO
from twisted.python import filepath
from twisted.internet.interfaces import IProcessTransport
from twis... | {
"content_hash": "485ce6bee0c17bbf9539cb3db774e533",
"timestamp": "",
"source": "github",
"line_count": 777,
"max_line_length": 80,
"avg_line_length": 34.15958815958816,
"alnum_prop": 0.5901966694295833,
"repo_name": "timkrentz/SunTracker",
"id": "29497e5c87381218ca6c2ce019a8e100677d6f1c",
"size": ... |
"""
Presence analyzer unit tests.
"""
import os.path
import json
import datetime
import unittest
from presence_analyzer import main, utils
TEST_DATA_CSV = os.path.join(
os.path.dirname(__file__), '..', '..', 'runtime', 'data', 'test_data.csv'
)
TEST_USERS_XML = os.path.join(
os.path.dirname(__file__), '..',... | {
"content_hash": "a567cce03cac8ce0508d04e62f0cb026",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 78,
"avg_line_length": 29.483568075117372,
"alnum_prop": 0.5472929936305733,
"repo_name": "stxnext-kindergarten/presence-analyzer-apardon",
"id": "c2826777cf7991d701281404cb... |
import os
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.scrollview import ScrollView
from kivy.uix.treeview import Tree... | {
"content_hash": "4b7c1922fa979587cdbf11baf93f7461",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 84,
"avg_line_length": 46.843971631205676,
"alnum_prop": 0.5417108251324754,
"repo_name": "noooway/exj",
"id": "bf7cc369dc93736404fbc8f0d804a5d733fe42c0",
"size": "6605",
... |
"""
Copyright 2010 Daniel Graziotin <daniel.graziotin@acm.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... | {
"content_hash": "9b604231c7fa04f904849c64b4912ffd",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 118,
"avg_line_length": 38.25,
"alnum_prop": 0.6887254901960784,
"repo_name": "dgraziotin/dycapo",
"id": "89b478576f2261f45b895c1266329805c0425331",
"size": "2448",
"bina... |
import Cookie
import os
from django.conf import settings
from common.tests import ViewTestCase
from common import api
from common import clean
from common import util
class JoinTest(ViewTestCase):
def setUp(self):
super(JoinTest, self).setUp()
self.form_data = {'nick': 'johndoe',
'fi... | {
"content_hash": "56e9176efef6fba16ea3863f83edfc05",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 75,
"avg_line_length": 34.13768115942029,
"alnum_prop": 0.616005094459775,
"repo_name": "tallstreet/jaikuenginepatch",
"id": "0f72835234b34c50f3b424045ee474117f7627e9",
"s... |
# -*- coding: utf-8 -*-
import argparse
import json
import logging
import os
import signal
import socket
import sys
import threading
import time
import urllib2
import uuid
from collections import defaultdict
from multiprocessing import Process, Event
repo_root = os.path.abspath(os.path.split(__file__)[0])
sys.path.i... | {
"content_hash": "9ad8a683865015da948f94cdd5336e0c",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 143,
"avg_line_length": 30.78635014836795,
"alnum_prop": 0.5702168674698795,
"repo_name": "smilusingjavascript/blink",
"id": "35a7c7262d5d25511fba6976fedbe8c7a2cfd7b2",
"s... |
import putio
import os.path
from putiox import PutioEx
from file import FileEx
from subtitles import SubtitleEx
from sqlite import SQLiteEx
import logging
from utils import mkdir_p
logger = logging.getLogger(__name__)
class Orchestra(object):
def __init__(self, apiToken, moviesDir, seriesDir):
handle = putio.Clie... | {
"content_hash": "5e1dc2d175f6eef94854ab71949e62a6",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 130,
"avg_line_length": 35.566265060240966,
"alnum_prop": 0.7388211382113821,
"repo_name": "Alkpone/Orchestra",
"id": "e4e5bcb3dc427f7bff62465a5fddbccc67559942",
"size": "2... |
import numpy
import numpy as np
from . import _ni_support
from . import _ni_label
from . import _nd_image
from . import _morphology
__all__ = ['label', 'find_objects', 'labeled_comprehension', 'sum', 'mean',
'variance', 'standard_deviation', 'minimum', 'maximum', 'median',
'minimum_position', 'ma... | {
"content_hash": "fe48a6b35404d85d2b5d1ede2bfe1d3a",
"timestamp": "",
"source": "github",
"line_count": 1517,
"max_line_length": 124,
"avg_line_length": 33.076466710613055,
"alnum_prop": 0.5772166530482093,
"repo_name": "matthew-brett/scipy",
"id": "091e446bd8f9257206f68b13fe871d76f7299564",
"size"... |
import requests
from . import TransportationImageProvider
from ...utils.shapely_utils import boundary_to_polygon, raw_boundary_to_polygon
from ...services.aus_map import AUS_NW, AUS_SE
from ...utils.header import render_header_to
PATH = 'ferry_paths.json'
BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlanne... | {
"content_hash": "6201d383ae423d267bcff520e2acc398",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 79,
"avg_line_length": 27.125,
"alnum_prop": 0.5495391705069125,
"repo_name": "Mause/statistical_atlas_of_au",
"id": "b0f45da8d552812bcbec7864b695006c588f06af",
"size": "26... |
from boto.swf.exceptions import SWFResponseError, SWFTypeAlreadyExistsError
from swf import exceptions
from swf.constants import REGISTERED
from swf.exceptions import AlreadyExistsError, DoesNotExistError, ResponseError, raises
from swf.models import BaseModel
from swf.models.base import ModelDiff
from swf.utils impor... | {
"content_hash": "cddae068758cf8b96a17748d06bd8401",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 87,
"avg_line_length": 32.495114006514655,
"alnum_prop": 0.5743785084202085,
"repo_name": "botify-labs/simpleflow",
"id": "3998a6f3e76a2611df7e706db35d82abc980ddae",
"size... |
from scrapy.item import Item, Field
class Ingredient(Item):
name = Field()
quantity = Field()
class Recipe(Item):
id = Field()
name = Field()
author = Field()
description = Field()
ingredients = Field()
instructions = Field()
published_date = Field()
updated_date = Field()
c... | {
"content_hash": "64117327d48353c60940b49d76b2dbf9",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 83,
"avg_line_length": 22.88888888888889,
"alnum_prop": 0.6347087378640777,
"repo_name": "mrorii/cookbot",
"id": "70be1d7ad266e958fc90534ebdd0de46ca353145",
"size": "941",
... |
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_horizon.dashboards.admin.volumes.volume_types.qos_specs \
import views
urlpatterns = patterns(
'',
url(r'^(?P<qos_spec_id>[^/]+)/create/$',
views.CreateKeyValuePairView.as_view(), name='create'),
url(r'^(?P<q... | {
"content_hash": "ee6518283a8954c9352b15dd0445eb81",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 36.214285714285715,
"alnum_prop": 0.631163708086785,
"repo_name": "mrunge/openstack_horizon",
"id": "15a35e3e928f819d784d79a209639de956ba62c8",
"size... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_ins... | {
"content_hash": "f740ca4fe0649c553d770e75c7d327d2",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 339,
"avg_line_length": 35.05714285714286,
"alnum_prop": 0.7449062754686226,
"repo_name": "googleapis/api-client-staging",
"id": "6d662feecdca9c7b64bb4dc07e307c1ae510ff9b",
... |
__author__ = 'had'
# The MIT License (MIT)
# Copyright (c) [2015] [Houtmann Hadrien]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the Aidez-moi), to deal
# in the Software without restriction, including without limitation the righ... | {
"content_hash": "ba7c04f82792809ad189415f95d84a13",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 93,
"avg_line_length": 33.88732394366197,
"alnum_prop": 0.5451648656137434,
"repo_name": "hadmagic/Aidez-moi",
"id": "e7f22904ed89b0b39a890cbf1ebab8ab8c21fe50",
"size": "7... |
from __future__ import unicode_literals
from jinja2 import contextfilter
from pprint import pformat
from cgi import escape as html_escape
def html_format(variable):
data = pformat(variable, indent=4)
data = html_escape(data)
data = data.replace(' ', ' ')
data = data.replace(... | {
"content_hash": "f8c32e62e0e9a68df4c5a704534feb16",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 59,
"avg_line_length": 18.73469387755102,
"alnum_prop": 0.6339869281045751,
"repo_name": "Saevon/saevon.github.io",
"id": "4f5aece68e043336bab58c2bbbc28f5592ea87f0",
"size"... |
import os
import os.path
import glob
pyfiles = glob.glob('*.py')
# Get file sizes and modification dates
name_sz_date = [(name, os.path.getsize(name), os.path.getmtime(name))
for name in pyfiles]
for r in name_sz_date:
print(r)
# Get file metadata
file_metadata = [(name, os.stat(name)) for name ... | {
"content_hash": "c18aea0d109afcd471ed678f1548397a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 69,
"avg_line_length": 24.11764705882353,
"alnum_prop": 0.6780487804878049,
"repo_name": "huawei-cloud/compass-adapters",
"id": "6f25844a522eb6e489198daa9daeb18240de0c41",
... |
"""Axonius Integration for Cortex XSOAR - Unit Tests file."""
from TestData.Raw_data import USERS_SQS, DUMMY_TAGS, DUMMY_DEVICES_IDS, DUMMY_USER_IDS, DUMMY_DEVICES
from TestData.Expected_data import EXPECTED_USERS_SQS, EXPECTED_DEVICE_TAGS, EXPECTED_DEVICE
from Axonius import run_command
class DummyDevices:
def ... | {
"content_hash": "e9a296ab9f8481991b9d3489ee2d932a",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 101,
"avg_line_length": 26.354545454545455,
"alnum_prop": 0.6585029320455329,
"repo_name": "VirusTotal/content",
"id": "ddeab790716b74b594e5c489d09d522995847d7a",
"size": ... |
import re
import urllib2
import socket
import HTMLParser
import logging
from datetime import datetime
URL_REGEX = re.compile(r"(?:^|\s)((?:https?://)?(?:[a-z0-9.\-]+[.][a-z]{2,4}/?)(?:[^\s()<>]*|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'\".,<>?]))", flags=re.I... | {
"content_hash": "b2a24fd89e08c11f089e52b01006f1a5",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 236,
"avg_line_length": 34.44642857142857,
"alnum_prop": 0.5393986521513737,
"repo_name": "BiohZn/Cardinal",
"id": "8f7355cbcba8521f4b396f6133563d16f82d93b6",
"size": "388... |
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __fu... | {
"content_hash": "7ae05cd56f87948e7117feba76abf66e",
"timestamp": "",
"source": "github",
"line_count": 477,
"max_line_length": 140,
"avg_line_length": 44.926624737945495,
"alnum_prop": 0.567942137190854,
"repo_name": "docusign/docusign-python-client",
"id": "b7b3e375cb8c8c61989f12b3c42ef98fe21ed920"... |
import imath
import IECore
class V3fVectorCreator( IECore.Op ) :
def __init__( self ) :
IECore.Op.__init__( self,
"Op that generates a V3fVectorData object.",
IECore.ObjectParameter(
name = "result",
description = "A V3fVectorData object.",
defaultValue = IECore.V3fVectorData(),
type = IECor... | {
"content_hash": "ffc00710b5bc22d2218ba1aee8f0896f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 24.263157894736842,
"alnum_prop": 0.6648590021691974,
"repo_name": "appleseedhq/cortex",
"id": "bb7a6a6e14282dcbf8288f3ab0f55d834641fba1",
"size": "9... |
from __future__ import absolute_import, division, print_function
import sys
import platform
import os
import _pytest._code
from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN
import pytest
_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "")
def runpdb_and_get_report(testdir, source):
p = t... | {
"content_hash": "2618e5c05bd4b61fda09ff55541637d4",
"timestamp": "",
"source": "github",
"line_count": 756,
"max_line_length": 94,
"avg_line_length": 30.21031746031746,
"alnum_prop": 0.5210823591225535,
"repo_name": "davidszotten/pytest",
"id": "4739f0e2dca4cae723c08bccd945cdea79b8b6c6",
"size": "... |
import tensorflow as tf
from tensorforce import util
from tensorforce.core.explorations import Exploration
class EpsilonAnneal(Exploration):
"""
Annealing epsilon parameter based on ratio of current timestep to total timesteps.
"""
def __init__(
self,
initial_epsilon=1.0,
fin... | {
"content_hash": "7e40e5fcc03316df8683ce3e60558489",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 120,
"avg_line_length": 35.53488372093023,
"alnum_prop": 0.6295811518324608,
"repo_name": "lefnire/tensorforce",
"id": "9975c8f30bb9e78fb8d12717ce250b3c510791b8",
"size": "... |
import json
import uuid
from openstackclient.tests.functional.network.v2 import common
class TestMeterRule(common.NetworkTests):
"""Functional tests for meter rule"""
METER_ID = None
METER_RULE_ID = None
@classmethod
def setUpClass(cls):
common.NetworkTests.setUpClass()
if cls.h... | {
"content_hash": "9f815c9043fccfd64c96b0f4706efc39",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 79,
"avg_line_length": 30.174242424242426,
"alnum_prop": 0.5247301029374843,
"repo_name": "openstack/python-openstackclient",
"id": "31bc08453b3c3813968b1b88ee1559e85669ad12... |
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages # noqa
setup(
name='pecan-wtforms',
version='0.1.0',
description="""
""",
long_description=None,
classifiers=[
... | {
"content_hash": "4122b17026f2c4775f832d63e0b07323",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 55,
"avg_line_length": 29.342105263157894,
"alnum_prop": 0.6134529147982063,
"repo_name": "ryanpetrello/pecan-wtforms",
"id": "330d3e340546d1292dae0823c6e3f20c366c506a",
"s... |
TDA_LOOKUP_COLUMN = {}
import re, sys, configparser
import os
from os import listdir
from os.path import isfile, join
import glob
import argparse
import shutil
from pynwn.file.twoda import TwoDA
MDL_NAME_REGEX = re.compile(r'p(\D\D)(\d+_head)(\d+).mdl', flags=re.IGNORECASE)
PLT_NAME_REGEX = re.compile(r'(.+)_head(\d... | {
"content_hash": "a6a470ccb86a0ee55a5e9cfc455e31f2",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 115,
"avg_line_length": 36.9375,
"alnum_prop": 0.5947546531302876,
"repo_name": "jd28/pynwn-tools",
"id": "7cd81bf297ca3b49fb4e02d76ebee423505e70ae",
"size": "3569",
"bin... |
import asyncio
import hashlib
import os
from .connection import ObfuscatedConnection
from .tcpabridged import AbridgedPacketCodec
from .tcpintermediate import (
IntermediatePacketCodec,
RandomizedIntermediatePacketCodec
)
from ...crypto import AESModeCTR
class MTProxyIO:
"""
It's very similar to tcp... | {
"content_hash": "28b21a86edb8ffd7be657bfc46d00d4d",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 81,
"avg_line_length": 34.73026315789474,
"alnum_prop": 0.6395150596703921,
"repo_name": "LonamiWebs/Telethon",
"id": "69a43bce9916d17a931fed41a16c6792e979090a",
"size": "... |
from setuptools import setup, find_packages
DESCRIPTION = "FFXIV Lodestone Scraper"
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
VERSION = '0.1.18'
CLASSIFIERS = [
'Intended Audience :: Developers',
'License :: OSI App... | {
"content_hash": "0de58114d206b3698cd74334cba6c33f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 67,
"avg_line_length": 29.542857142857144,
"alnum_prop": 0.6673114119922631,
"repo_name": "scragg0x/FFXIV-Scraper",
"id": "2cfe1b9a8b06f3820d02ba9d786194b3b7dcd4f3",
"size"... |
import warnings
from collections import defaultdict
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
print("Failed to import ElementT... | {
"content_hash": "7dc212d4aeba4bd966fd8e53c576bc44",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 117,
"avg_line_length": 39.17115689381934,
"alnum_prop": 0.5082331998219849,
"repo_name": "kislayabhi/pgmpy",
"id": "ca26cf9e0599f40f32016378e858582798f5c904",
"size": "24... |
"""Django's command-line utility for administrative tasks."""
import os
def main():
print("SECRET_KEY: {0}".format(os.getenv('SECRET_KEY')))
if __name__ == '__main__':
main()
| {
"content_hash": "baa42f963cbacd71b1a8af1792a914a8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 61,
"avg_line_length": 18.7,
"alnum_prop": 0.6096256684491979,
"repo_name": "dokku/dokku",
"id": "0c5ebba3b0fb30cbf18d530d08f089c388c46817",
"size": "209",
"binary": fals... |
import png
r = png.Reader('GroupsAndLabels.png')
data = r.read()
width = data[0]
height = data[1]
pixels = list(data[2])
newPixels = list()
for row in pixels:
newRow = list()
for col in xrange(width):
alpha = row[4 * col]
newRow.append(255)
newRow.append(255)
newRow.append(255)
... | {
"content_hash": "327fc9823d710cd3b66558615c277e6b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 47,
"avg_line_length": 22.695652173913043,
"alnum_prop": 0.6360153256704981,
"repo_name": "getdunne/SARAH",
"id": "b2d10bcc438ab6cdefad28816f35fad7f772d7a1",
"size": "522",... |
import sys
import time
import argparse
import ConfigParser
from vnc_api.vnc_api import *
from cfgm_common.exceptions import *
class ConfigNodeProvisioner(object):
def __init__(self, args_str=None):
self._args = None
if not args_str:
args_str = ' '.join(sys.argv[1:])
self._par... | {
"content_hash": "210877d5919ab611dba897f3fa3f7b38",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 89,
"avg_line_length": 34.6258064516129,
"alnum_prop": 0.543692938326812,
"repo_name": "hthompson6/contrail-controller",
"id": "5c2c4539acb7321bf4c5a2f51da5c013b7ded59d",
... |
import numpy as np
from nose.tools import eq_
from fancyimpute.knn import KNN
from low_rank_data import XY, XY_incomplete, missing_mask
def test_knn():
# get a baseline error from just zero-filling the missing entries
sad_zero_fill = np.sum(np.abs(XY[missing_mask]))
mad_zero_fill = sad_zero_fill / missi... | {
"content_hash": "74aec7e3650736b62cf9b8997489260e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 86,
"avg_line_length": 36.964285714285715,
"alnum_prop": 0.6019323671497585,
"repo_name": "iskandr/fancyimpute",
"id": "b5f564f1b2e928d319a1bfe3aed5a17c2d3608b3",
"size": "... |
import new, sys
import galaxy.util
import parameters
from parameters import basic
from parameters import grouping
from elementtree.ElementTree import XML
class ToolTestBuilder( object ):
"""
Encapsulates information about a tool test, and allows creation of a
dynamic TestCase class (the unittest framework... | {
"content_hash": "0e83f9b06b947ca9f9ffa7c81efb3ffe",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 159,
"avg_line_length": 58,
"alnum_prop": 0.6241379310344828,
"repo_name": "volpino/Yeps-EURAC",
"id": "52e142bd301f6f3c16fe89d9d7d4971cdff73a86",
"size": "3190",
"binary... |
import lxml.etree
import lxml.html
from ._patterns import FORWARD_LINE, FORWARD_STYLES, MULTIPLE_WHITESPACE_RE
INLINE_TAGS = [
"a",
"b",
"em",
"i",
"strong",
"span",
"font",
"q",
"object",
"bdo",
"sub",
"sup",
"center",
"td",
"th",
]
BEGIN = "begin"
END = "... | {
"content_hash": "ecf6a6238ca220b8bf78b67d93692558",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 88,
"avg_line_length": 31.439140811455847,
"alnum_prop": 0.601609352463372,
"repo_name": "closeio/quotequail",
"id": "1bc19d73271fb5454017624f9fd54435b01a340e",
"size": "1... |
"""Common utility functions."""
import base64
import collections
import datetime
import hashlib
import imghdr
import json
import os
import random
import re
import string
import time
import unicodedata
import urllib
import urlparse
from constants import constants # pylint: disable=relative-import
import feconf # pyl... | {
"content_hash": "4304a8048ec754c383dcd5c4cc6b5cd9",
"timestamp": "",
"source": "github",
"line_count": 644,
"max_line_length": 80,
"avg_line_length": 31.091614906832298,
"alnum_prop": 0.6328222544074315,
"repo_name": "souravbadami/oppia",
"id": "ec3872ed0b5b964aa1233aeaf9a67302a4c1da59",
"size": "... |
import sys
import time
import uuid
from database import DataBase
from datetime import datetime
from twitter import Twitter
from config import Config
class WeiboMessage(object):
def __init__(self,site,moduleId,moduleName,moduleImageList):
self.message_id = str(uuid.uuid1())
self.message_comment = mo... | {
"content_hash": "7773b712bbdca036603152634bc65e92",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 194,
"avg_line_length": 36.299065420560744,
"alnum_prop": 0.5671987641606591,
"repo_name": "XJouYi/TwitterRobot",
"id": "f3493d710f661d24ba24ec67c83c5221d46b9e1c",
"size":... |
from django.contrib.sites.managers import CurrentSiteManager
## legacy...
class TempJobsManager(CurrentSiteManager):
def get_query_set(self):
return super(TempJobsManager, self).get_query_set() \
.filter(status=self.model.TEMPORARY)
class ActiveJobsManager(CurrentSiteManager):
... | {
"content_hash": "d02ca60343b7d486e87fc378504d9a5e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 63,
"avg_line_length": 33.5,
"alnum_prop": 0.6716417910447762,
"repo_name": "wtrevino/django-listings",
"id": "ac7409a486fe02e662e55ec82e07301688219818",
"size": "493",
"... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "b4a9b950c3cb7e667ca187567b3438e9",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 123,
"avg_line_length": 28.685314685314687,
"alnum_prop": 0.71160409556314,
"repo_name": "mahabs/nitro",
"id": "336a235afe6197028c57336a934a56200fb7a56d",
"size": "4716",
... |
u"""
.. module:: models
"""
import logging
import os
# pylint: disable=unused-import
import uuid
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models import F
from django.utils import timezone
logger = logging.getLogger('volontulo.models')
... | {
"content_hash": "7df80001e798a975d3559b542218f07d",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 78,
"avg_line_length": 30.77683615819209,
"alnum_prop": 0.6166131252868288,
"repo_name": "stxnext-csr/volontulo",
"id": "4a29300c17703f763f97371cc70edffc1dd4d39b",
"size":... |
import hashlib
import io
import random
from shutil import rmtree
from tempfile import mkdtemp
from unittest import skipIf
import attr
from itemadapter import ItemAdapter
from twisted.trial import unittest
from scrapy.http import Request, Response
from scrapy.item import Field, Item
from scrapy.pipelines.images import... | {
"content_hash": "133aa0b111d321e04f8c0d58e01493fb",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 110,
"avg_line_length": 41.791866028708135,
"alnum_prop": 0.6405060392695632,
"repo_name": "dangra/scrapy",
"id": "ad138a2dc5588cbb956c7e4c373ed7cecc2ca1b2",
"size": "1746... |
import StringIO
import csv
import logging
import os
import requests
import sys
from base64 import b64decode
def create_config_files(directory):
"""
Initialize directory ready for vpn walker
:param directory: the path where you want this to happen
:return:
"""
# Some constant strings
vpn_ga... | {
"content_hash": "e98ad55b20f9d728cd571c7a59505976",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 75,
"avg_line_length": 28.56756756756757,
"alnum_prop": 0.5581835383159887,
"repo_name": "rpanah/centinel",
"id": "2f76d2525510577b54d773d74c668eaafce7b1ee",
"size": "2114"... |
""" command line utility for working with FragmentCatalogs (CASE-type analysis)
**Usage**
BuildFragmentCatalog [optional args] <filename>
filename, the name of a delimited text file containing InData, is required
for some modes of operation (see below)
**Command Line Arguments**
- -n *maxNumMols*: specify t... | {
"content_hash": "3eed547cf9ea4e04c78a753c39e22dcc",
"timestamp": "",
"source": "github",
"line_count": 653,
"max_line_length": 105,
"avg_line_length": 31.67228177641654,
"alnum_prop": 0.5625181317087322,
"repo_name": "ptosco/rdkit",
"id": "b1925d93279ad103319169cb82870986d88a43c9",
"size": "20973"... |
from django.contrib.gis import admin
from .models import CollectionResource
admin.site.unregister(CollectionResource)
| {
"content_hash": "c56e930f6d160dd37603bf9e63f405a3",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 41,
"avg_line_length": 29.75,
"alnum_prop": 0.8571428571428571,
"repo_name": "hydroshare/hydroshare",
"id": "7e0c1edb870f00215b4ac45200732cc262bf3260",
"size": "119",
"bin... |
"""
RoleGroup module
"""
from ovs.dal.dataobject import DataObject
from ovs.dal.structures import Relation
from ovs.dal.hybrids.role import Role
from ovs.dal.hybrids.group import Group
class RoleGroup(DataObject):
"""
The RoleGroup class represents the junction table between Role and Group.
"""
__prop... | {
"content_hash": "91157f336dac4ca519f46ce4c2b121e1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 77,
"avg_line_length": 27,
"alnum_prop": 0.6688453159041394,
"repo_name": "mflu/openvstorage_centos",
"id": "be0266cb52e7bd9a64aeab93bb82ad72d6853e1b",
"size": "1040",
"b... |
"""
The ``wind_farm`` module contains the class WindFarm that implements
a wind farm in the windpowerlib and functions needed for the modelling of a
wind farm.
SPDX-FileCopyrightText: 2019 oemof developer group <contact@oemof.org>
SPDX-License-Identifier: MIT
"""
from windpowerlib import tools, power_curves, WindTurbi... | {
"content_hash": "a7501c1a1113653d94a504b22dc1dd35",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 120,
"avg_line_length": 42.418219461697724,
"alnum_prop": 0.5343615775087857,
"repo_name": "wind-python/windpowerlib",
"id": "aa806aa19ea829f7d9faa9debbfb72e2190caa69",
"s... |
from __future__ import unicode_literals
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = "Full Stack Web Application Framework in Python"
app_icon = "octicon octicon-circuit-board"
app_version = "5.0.34"
app_color = "orange"
app_email = "support@frapp... | {
"content_hash": "c6dbaab2eeb1194090f8df77eee759f9",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 86,
"avg_line_length": 29.77037037037037,
"alnum_prop": 0.7210748942523015,
"repo_name": "mbauskar/Das_frappe",
"id": "a3a207f39e94cc7402a96af98d7b4b2726e32e8d",
"size": "... |
import json
from django.conf import settings
from raven.processors import Processor
class JSONProcessor(Processor):
"""
This is a sentry wrapper to process the JSON and remove anything from it
that could be considered as leaking sensitive data. Sentry has some
processor for doing this, but they don't... | {
"content_hash": "8e9e6a7a6a465f02839ca70664fd6b5e",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 27.348837209302324,
"alnum_prop": 0.6011904761904762,
"repo_name": "muffinresearch/solitude",
"id": "311174ebb360981220c4763b2094589ce7621aeb",
"size... |
'''
Supported functions/arguments/defaults:
'''
connect_kwargs = {
'device': 'localhost', # ip or hostname of TRex
'trex_rpc_port': None, # TRex extention: RPC port of TRex server (for several TRexes under same OS)
'trex_pub_port': None, # TRex extention: ... | {
"content_hash": "548b112b35275ac8d18881a1c19b310d",
"timestamp": "",
"source": "github",
"line_count": 1613,
"max_line_length": 225,
"avg_line_length": 52.32734035957843,
"alnum_prop": 0.49880337424766596,
"repo_name": "dimagol/trex-core",
"id": "964dd617d74c7541b50eee221c9156f50410c299",
"size": ... |
"""Resolve JSON for OpenAIRE grants."""
from __future__ import absolute_import, print_function
import jsonresolver
from invenio_pidstore.resolver import Resolver
from invenio_records.api import Record
from werkzeug.routing import Rule
def resolve_grant_endpoint(doi_grant_code):
"""Resolve the OpenAIRE grant."""... | {
"content_hash": "e8e6df37998ab58705fb24516af8f7d0",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 33.90909090909091,
"alnum_prop": 0.6791778373547811,
"repo_name": "inveniosoftware/invenio-openaire",
"id": "33b8a9429aa88e6ec10b7e642ecbb23e474984a2",... |
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^login/?$', login, dict(template_name='login.html'), name='login'),
url(r'^logout/$', logout, {'next_page': '/'}, name='lo... | {
"content_hash": "a72c5ee98a9fad96bcc9a5c086ff3534",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 28.692307692307693,
"alnum_prop": 0.6568364611260054,
"repo_name": "seccom-ufsc/hertz",
"id": "0b2130d855472dead01c65cbd6cadd1e4a21e1a1",
"size": "37... |
from __future__ import unicode_literals
from django.db import router
class Operation(object):
"""
Base class for migration operations.
It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it agains... | {
"content_hash": "ea72eb4f318f37cccf3f30efa3ceed97",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 103,
"avg_line_length": 37.085470085470085,
"alnum_prop": 0.6388568794653146,
"repo_name": "memtoko/django",
"id": "557c956732fd9e70382ec6782508ee3688496ba0",
"size": "433... |
import numpy
from copy import deepcopy
visitedStates = []
nodeNumber = 0
class State():
"""Lol"""
def __init__(self, floor, genM, chM):
self.floor = floor
self.genM = genM
self.chM = chM
self.pairVector = numpy.sum(numpy.logical_and(genM, chM), 1)
self.singleChipVector... | {
"content_hash": "71c8a82983bf83298f698879c60af26e",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 44.27272727272727,
"alnum_prop": 0.499729817356533,
"repo_name": "znuxor/aoc2016",
"id": "07a6d3b4540db7c8c813dc8c69660b4a517d8d73",
"size": "9276",... |
from __future__ import print_function
import re
import kconfiglib
# Indentation to be used in the generated file
INDENT = ' '
# Characters used when underlining section heading
HEADING_SYMBOLS = '#*=-^"+'
# Keep the heading level in sync with api-reference/kconfig.rst
INITIAL_HEADING_LEVEL = 3
MAX_HEADING_LEVEL =... | {
"content_hash": "f0aa9ee057719c71e10e98593e8145f3",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 107,
"avg_line_length": 30.79245283018868,
"alnum_prop": 0.5892565359477124,
"repo_name": "espressif/ESP8266_RTOS_SDK",
"id": "6d6d7b1fafe81ab62a6e26a00a0c1975432da1f3",
"... |
from os import sys
try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip install scikit-build')
sys.exit(1)
setup(
name='{{ cookiecu... | {
"content_hash": "9b26065e55025163152ed3cdb3edfb71",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 76,
"avg_line_length": 35.638297872340424,
"alnum_prop": 0.6143283582089553,
"repo_name": "thewtex/ITKModuleTemplate",
"id": "cb05a9689e0800b74ba2392a13f35f816360f04a",
"si... |
"""Basic arithmetic operators.
See the @{$python/math_ops} guide.
@@add
@@subtract
@@multiply
@@scalar_mul
@@div
@@divide
@@truediv
@@floordiv
@@realdiv
@@truncatediv
@@floor_div
@@truncatemod
@@floormod
@@mod
@@cross
@@add_n
@@abs
@@negative
@@sign
@@reciprocal
@@square
@@round
@@sqrt
@@rsqrt
@@pow
@@exp
@@expm1
@@l... | {
"content_hash": "d90bdd61b1bb24978bb5ce19d6d22c62",
"timestamp": "",
"source": "github",
"line_count": 2289,
"max_line_length": 80,
"avg_line_length": 32.79641764962866,
"alnum_prop": 0.6382757656085573,
"repo_name": "yaroslavvb/tensorflow",
"id": "e1b52a4086dabfba81547a76bc0c9cdfea1dfffd",
"size"... |
"""Helper functions for stoichiometric consistency checks."""
import logging
from collections import defaultdict
import cobra
import numpy as np
import sympy
from numpy.linalg import svd
from optlang.symbolics import add
from pylru import lrudecorator
from six import iteritems, itervalues
from memote.support.helper... | {
"content_hash": "276194c6f1a07c92ff3301031c245327",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 88,
"avg_line_length": 32.43553008595988,
"alnum_prop": 0.6487632508833923,
"repo_name": "opencobra/memote",
"id": "c8f29da44867f237ca77ebb474c45281b7388a4f",
"size": "119... |
from collections import namedtuple
from ortools.constraint_solver import pywrapcp
VEHICLE_COUNT = 30
VEHICLE_CAPACITY = 200
Customer = namedtuple("Customer", ['index', 'demand', 'x', 'y'])
print('Init')
customers = list()
customers.append(Customer(0, 0, 0, 0))
customers.append(Customer(1, 1, 1.0, 1.0))
customers.app... | {
"content_hash": "2ddc64ad7ba008d711e0ed9be42a0753",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 75,
"avg_line_length": 26.59375,
"alnum_prop": 0.7050528789659224,
"repo_name": "google/or-tools",
"id": "68ec9d59a486c96628bcc253b5554ec6453bf61b",
"size": "1725",
"bina... |
import boto.sqs
import boto.sqs.queue
import argparse
from boto.sqs.message import Message
from boto.sqs.connection import SQSConnection
from boto.exception import SQSError
import sys
sys.path.append('/data')
from keys import access_key_id, secret_access_key
parser = argparse.ArgumentParser()
parser.add_argument("qna... | {
"content_hash": "538a5fb3f223123bdcfb5e9671d96565",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 120,
"avg_line_length": 29.043478260869566,
"alnum_prop": 0.7784431137724551,
"repo_name": "kjw0106/aws",
"id": "d0d1fc1839576248987216f3db21249551f9b113",
"size": "735",
... |
""" Defines the scraped items dictionary model of items = {}. """
# -*- coding: utf-8 -*-
import scrapy
class CraigslistRental(scrapy.Item):
# Dictionary keys created for scraping in craigslist.py
cl_id = scrapy.Field()
price = scrapy.Field()
attributes = scrapy.Field()
housing = scrapy.Field()... | {
"content_hash": "0f5788a62142b71d90e0b18d39203029",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 26.52,
"alnum_prop": 0.6621417797888386,
"repo_name": "jttyeung/investable",
"id": "23a1fe873ce069b7dbcfacfbe1a03de9884bd901",
"size": "663",
"bina... |
from flask_restful import Resource, reqparse, fields, marshal_with
from dateutil import parser
from flask_jwt_extended import jwt_required
from .revisions import revision_fields
from ... import db
futuremark3dmark06result_fields = {
'id': fields.Integer,
'result_date': fields.DateTime(dt_format='iso8601'),
... | {
"content_hash": "70452858eeb55db9851093cb0c6b0f39",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 79,
"avg_line_length": 43.86619718309859,
"alnum_prop": 0.6442446620645368,
"repo_name": "rivalrockets/rivalrockets-api",
"id": "2ac5f9e6276acd482b05bf9629d570969616cc69",
... |
import json
import click
from tabulate import tabulate
@click.command('alerts', short_help='List environments, services, groups and tags')
@click.option('--environments', '-E', is_flag=True, help='List alert environments.')
@click.option('--services', '-S', is_flag=True, help='List alert services.')
@click.option('-... | {
"content_hash": "bab6d875479d6d76ce6f0ec9b58a7bdd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 162,
"avg_line_length": 54.02127659574468,
"alnum_prop": 0.6266246553761323,
"repo_name": "alerta/python-alerta-client",
"id": "7041b2b1186cd40cba9e4e628698371e8c4e8754",
"... |
"""PPP module answering questions about integer sequences."""
from ppp_libmodule import HttpRequestHandler
from .requesthandler import RequestHandler
def app(environ, start_response):
"""Function called by the WSGI server."""
return HttpRequestHandler(environ, start_response, RequestHandler) \
.di... | {
"content_hash": "9fe2147b955b1e82fb113344a36ca6c1",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 36.55555555555556,
"alnum_prop": 0.7507598784194529,
"repo_name": "ProjetPP/PPP-OEIS",
"id": "5f718f330a3fa57374d57a577f4a5d1e05c50b34",
"size": "329"... |
from __future__ import print_function
from bcc import BPF
import argparse
from time import strftime
import ctypes as ct
# symbols
kallsyms = "/proc/kallsyms"
# arguments
examples = """examples:
./ext4slower # trace operations slower than 10 ms (default)
./ext4slower 1 # trace operations ... | {
"content_hash": "7ff105a1d505fb15a505055e178b2cfe",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 79,
"avg_line_length": 26.63606557377049,
"alnum_prop": 0.6106597735105859,
"repo_name": "zaafar/bcc",
"id": "b0b72a544129e7a12625c59136e47ee1b0a8e34d",
"size": "9062",
... |
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, ... | {
"content_hash": "be1c50060bdec6d012296ef6bc7fe938",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 118,
"avg_line_length": 31.013651877133107,
"alnum_prop": 0.600583250797843,
"repo_name": "gnmiller/craig-bot",
"id": "fd9402095c044727b4fd7b717bb4a1ab45502c95",
"size": "... |
from datetime import datetime
import pytz
import apache_beam as beam
from apache_beam.transforms import window
from log_elements import LogElements
p = beam.Pipeline()
(p | beam.Create([
window.TimestampedValue("event", datetime(2020, 3, 1, 0, 0, 0, 0, tzinfo=pytz.UTC).timestamp()),
window.Timestam... | {
"content_hash": "59f7837509a82a68dadeba43216fa8a3",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 105,
"avg_line_length": 49.535714285714285,
"alnum_prop": 0.6604181687094448,
"repo_name": "iemejia/incubator-beam",
"id": "0444becb41fe8756af09a6861a0691be6ad33fb8",
"size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.