text stringlengths 4 1.02M | meta dict |
|---|---|
from decimal import Decimal
from mock import Mock, patch
from hashlib import md5
from django.db.models.loading import get_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import six
from django.core.exceptions import ImproperlyConfigured
from getpaid.backends.trans... | {
"content_hash": "7068a82ee2d49bb44c7d3d3f81652199",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 121,
"avg_line_length": 51.84108527131783,
"alnum_prop": 0.4707289719626168,
"repo_name": "kamilglod/django-getpaid",
"id": "693a25abe5549e376ed5266a6054810e666bfa60",
"si... |
"""
Copied+modified from rest_framework.versioning, which is licensed under the BSD license:
*******************************************************************************
Copyright (c) 2011-2016, Tom Christie
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are pe... | {
"content_hash": "f68308707f0a8072e8c8af19a141dbc7",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 101,
"avg_line_length": 40.645933014354064,
"alnum_prop": 0.6799293702177751,
"repo_name": "erigones/esdc-ce",
"id": "af76702c63bf9fbed5aa30b13e212714193632e9",
"size": "8... |
import sys
from oslo_config import cfg
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from designate import service
from designate import utils
from designate import version
from designate.zone_manager import service as zone_manager_service
CONF = cfg.CONF
CONF.import_opt... | {
"content_hash": "51da01250d3d5f05874106cec161b5e2",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 71,
"avg_line_length": 29.928571428571427,
"alnum_prop": 0.7303102625298329,
"repo_name": "grahamhayes/designate",
"id": "fa10073a823fe2e26e9ae156ad1d635af8ced519",
"size":... |
"""
Django settings for VetAppDjango project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
#python... | {
"content_hash": "bab1b989e3f9096de052b00d01ed26aa",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 71,
"avg_line_length": 25.46788990825688,
"alnum_prop": 0.6887608069164265,
"repo_name": "mape90/VetAppDjango",
"id": "f7ea4e04c707be73af57828dd0a19479d21852c5",
"size": "... |
"""Parsing with public available ops.
This is a wrapper of sentencepiece ops for public release.
"""
from typing import List, Tuple
import tensorflow as tf
import tensorflow_text as tf_text
import sentencepiece as sentencepiece_processor
_EOS = 1
_SOS = 4
_NUM_SHIFT_TOKENS = 103
_NEWLINE_SYMBOL = "<n>"
def _chec... | {
"content_hash": "6dff9f0c7f469f3ae189f051ed7aeed7",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 79,
"avg_line_length": 35.72222222222222,
"alnum_prop": 0.6690858821496457,
"repo_name": "google-research/pegasus",
"id": "c3f407a43a7d022af55a7e2170a5d71b8a154e68",
"size... |
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst').read()
doclink = """
Documentation
-------------
The full documentation is at ht... | {
"content_hash": "a823c70b8ee0f1519268778022074751",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 83,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.6094182825484764,
"repo_name": "zhangzhen/svtools",
"id": "d3777eb845935ea74dbc4d45ebb3eb33a6aaa3be",
"size": "146... |
from gevent import monkey
monkey.patch_all()
import os
import logging.config
import sys
from werkzeug.serving import run_simple
if __name__ == "__main__":
assert len(sys.argv) == 2, "Usage: pulsus <config_dir>"
config_dir = sys.argv[1]
# Must go 1st
logging.config.fileConfig(os.path.join(config_dir... | {
"content_hash": "00e0a314c9321254e509e647acdb085a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 25.923076923076923,
"alnum_prop": 0.6765578635014837,
"repo_name": "pennersr/pulsus",
"id": "d85909ed8dd0680ff496ae7f9d06ce182b99470c",
"size": "674"... |
"""
test_module
~~~~~~~~~~~
Tests for the :mod:`~ulid` module.
"""
import pytest
from ulid import consts
def test_min_timestamp_uses_expected_value():
"""
Assert that :func:`~ulid.consts.MIN_TIMESTAMP` uses expected byte value.
"""
value = consts.MIN_TIMESTAMP
assert value == b'\x00\... | {
"content_hash": "ba24e7abaeef34e316d5638dfff68599",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 87,
"avg_line_length": 27.017543859649123,
"alnum_prop": 0.6512987012987013,
"repo_name": "ahawker/ulid",
"id": "4b6e1bf3043cfa879011e87ed14d667a1d522023",
"size": "1540",
... |
"""Density Weighted
"""
from __future__ import division
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.cluster import KMeans
from libact.base.interfaces import QueryStrategy
from libact.utils import inherit_docstring_from, seed_random_state, zip
class DensityWeightedMeta(Quer... | {
"content_hash": "02d23aa7b41c9e838bda9862a8ebb53b",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 130,
"avg_line_length": 36.6793893129771,
"alnum_prop": 0.6499479708636836,
"repo_name": "ntucllab/libact",
"id": "b89f517b5ba7721ffecb9cf592037dff32f5843d",
"size": "4805... |
import sys
import re
import yaml
import datetime
import os.path
import exceptions
from functools import wraps
from docopt import docopt
__version__ = '0.1.0'
defaultconfigs = [ os.path.join(sys.path[0],'datasets.yml'),
'/etc/datasets.yml',
os.path.expanduser('~/.datasets.yml'),
... | {
"content_hash": "d1acd77b2ce9c5ff8a452d77494b954b",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 108,
"avg_line_length": 30.03529411764706,
"alnum_prop": 0.5709622666144405,
"repo_name": "pipitone/datasets",
"id": "71c65e45b624b528f2b15a58af89964b25c166e1",
"size": "7... |
"""
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Feb 4, 2011.
"""
from everest.querying.operators import ASCENDING
from everest.querying.operators import DESCENDING
from everest.querying.orderparser import parse_order
from everest.que... | {
"content_hash": "7483795b48508575d93230ce7e986ccb",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 40.127272727272725,
"alnum_prop": 0.7072949705482555,
"repo_name": "helixyte/everest",
"id": "7e9971363e4950048fed2656c4b80a89c0bb1787",
"size": "220... |
import zlib
from django.middleware.cache import UpdateCacheMiddleware
from django.utils.cache import patch_response_headers, get_max_age, has_vary_header
from django.core.cache import cache
import collections
class UpdateCacheMiddlewareSimpleKey(UpdateCacheMiddleware):
"""
Response-phase cache middleware that ... | {
"content_hash": "db8a3583ded97403442ab211a17f370d",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 111,
"avg_line_length": 45.660377358490564,
"alnum_prop": 0.6528925619834711,
"repo_name": "codefisher/codefisher_apps",
"id": "f7d35d9f95c295276d0fee64ff564d7c8bee3cc3",
"... |
import os
import tempfile
import time
from textwrap import dedent
from flask import Flask, request
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTarget
app = Flask(__name__)
page = dedent(
'''
<!doctype html>
<head>
<title>Upload new File</... | {
"content_hash": "324b4bdc2252249e89eb1ebdf6709f74",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 23.363636363636363,
"alnum_prop": 0.5175097276264592,
"repo_name": "siddhantgoel/streaming-form-data",
"id": "ea8832fc7514fcae63f7d2e4249d35750f4fb132"... |
from unittest import main, TestCase
from voltha.extensions.omci.omci_entities import *
from voltha.extensions.omci.database.mib_db_dict import *
from voltha.extensions.omci.database.mib_db_api import MODIFIED_KEY, CREATED_KEY,\
DEVICE_ID_KEY, MDS_KEY, LAST_SYNC_KEY
from mock.mock_adapter_agent import MockAdapterAg... | {
"content_hash": "45ffd94cbf3222bc4c8f07d83b7c42f5",
"timestamp": "",
"source": "github",
"line_count": 506,
"max_line_length": 113,
"avg_line_length": 39.13636363636363,
"alnum_prop": 0.6098065949603595,
"repo_name": "opencord/voltha",
"id": "cd5cadf77199d6ee76acac34c0819f9f8c6c5801",
"size": "204... |
import datetime
from osgeo import gdal
import numpy as np
def cells(array):
window = array[480:510, 940:970]
return window
np.set_printoptions(precision=2, linewidth=700)
path = 'C:\\Recharge_GIS\\OSG_Data\\current_use'
raster = 'aws_ras_15apr1'
aws_open = gdal.Open('{a}\\{b}.tif'.format(a=path, b=raster))
d... | {
"content_hash": "e3cec5c4885c7fea69fd490b414b03cb",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 92,
"avg_line_length": 32.88235294117647,
"alnum_prop": 0.6815742397137746,
"repo_name": "NMTHydro/Recharge",
"id": "adccae767c722c21821493bc13ac54c2e9b4baac",
"size": "167... |
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
... | {
"content_hash": "2c3cc3fdf4ee486b5ef95991252699d1",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 133,
"avg_line_length": 35.58064516129032,
"alnum_prop": 0.543064369900272,
"repo_name": "diego-d5000/MisValesMd",
"id": "9d9be48244a47127178eea2881f25dcfe401e026",
"size":... |
from stestr.tests import base
from stestr import utils
class TestUtils(base.TestCase):
def test_cleanup_test_name_defaults(self):
test_id_no_attrs = 'test.TestThing.test_thing'
test_id_with_attrs = 'test.TestThing.test_thing[attr1,attr2,att3]'
test_id_with_scenario = 'test.TestThing.test_t... | {
"content_hash": "c46562c0e8613a426702852d653bfa27",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 78,
"avg_line_length": 60.226190476190474,
"alnum_prop": 0.5742241549713382,
"repo_name": "masayukig/stestr",
"id": "88618f2553859c60236fc1d9eef5cd2c70226deb",
"size": "560... |
from collections import OrderedDict
from contextlib import contextmanager
import re
import time
from robot.errors import (BreakLoop, ContinueLoop, DataError, ExecutionFailed,
ExecutionFailures, ExecutionPassed, ExecutionStatus)
from robot.result import (For as ForResult, While as WhileResult,... | {
"content_hash": "1ec2f5720c1eb8e8341040aaf1f8acf8",
"timestamp": "",
"source": "github",
"line_count": 648,
"max_line_length": 93,
"avg_line_length": 37.09567901234568,
"alnum_prop": 0.5593643397953241,
"repo_name": "HelioGuilherme66/robotframework",
"id": "9a0d077df789a7c47ccb72486989c708d3aa3857",... |
import getopt
import os
import sys
DEFAULT_HOST = "0.0.0.0"
DEFAULT_PORT = "8080"
def usage():
print("usage: %s options" % sys.argv[0])
print()
print("OPTIONS:")
print(" -h Show this message")
print(" -H HOST Set server host (defaults to %s)" % DEFAULT_HOST)
print(" -p ... | {
"content_hash": "cbb1b1325d0d192dea753b2d4348e9be",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 30.1875,
"alnum_prop": 0.5450310559006211,
"repo_name": "reviewboard/reviewboard",
"id": "e9dec6c0f4b431737777e7624a0f0ca6863fa1e5",
"size": "1956",
... |
from .cli import main
main() | {
"content_hash": "2abe3982d3558a845ef8bfa26ca357cd",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 21,
"avg_line_length": 9.666666666666666,
"alnum_prop": 0.7241379310344828,
"repo_name": "avanov/solo",
"id": "c49f9df415fcc05442d953e006fd17c1c03432de",
"size": "29",
"bi... |
from django import forms
from backend.models import Praise
class PraiseForm(forms.ModelForm):
class Meta:
#provides an association between the model form and a model
model = Praise
exclude = ['user']
| {
"content_hash": "400e584abd9f9efb8a61ecbb426eec22",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 26,
"alnum_prop": 0.7644230769230769,
"repo_name": "SEACodeCarrots/PraiseReminder",
"id": "48b57f131e160d17d0ec5449991a7903ba9b55f9",
"size": "259",
... |
"""
A setuptools file for the pyworkout-toolkit
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pyworkout-toolkit'... | {
"content_hash": "55f93417430c1e512b60808732e6da62",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 69,
"avg_line_length": 27.098039215686274,
"alnum_prop": 0.6316931982633864,
"repo_name": "triskadecaepyon/pyworkout-toolkit",
"id": "14ae4e5cf3946b388874d7c5feef346c5948ddd7... |
class UnknownColumnNameException(Exception):
"""Exception type raised when encountering an unknown column name."""
def __init__(self, column_name):
self.column_name = column_name
def __str__(self):
return repr(self.column_name)
def SerializeProfiles(profiles):
"""Returns a serialized string for the gi... | {
"content_hash": "e4580ee1d8f74dc1300767a059e15961",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 31.324324324324323,
"alnum_prop": 0.6591889559965487,
"repo_name": "chromium/chromium",
"id": "94eeca6cb4051d9f81df14b64afcbfdde9eb8ca6",
"size": "24... |
from django.core.management.base import BaseCommand
from directory.models import Researches, ParaclinicInputGroups, ParaclinicInputField
import json
from appconf.manager import SettingManager
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('research_pk', type=int)
def... | {
"content_hash": "d1a5908d04ff2f8a5a13d3b0a7487c72",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 84,
"avg_line_length": 41.11764705882353,
"alnum_prop": 0.5231282784930854,
"repo_name": "moodpulse/l2",
"id": "15825919a3d6c517fbe54669655b43bee1c6d562",
"size": "2097",
... |
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class SingleColorTest(... | {
"content_hash": "b4f43ab084e392459bb2e0469f2b0c98",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 198,
"avg_line_length": 30.076305220883533,
"alnum_prop": 0.5908666043530512,
"repo_name": "Telestream/telestream-cloud-python-sdk",
"id": "8ca88d9bc6c36a04e0cbb047ef8c435aa... |
"""
Eric Nordstrom
Python 3.6.0
4/29/17
Removes out-of-vocabulary (OOV) words, a.k.a. "mixed words", from the provided series of
tokens. Words are deemed OOV when they are not found in either provided language dictionary.
Results are stored in .TXT file(s) specified by the user. PyDictionary option available ... | {
"content_hash": "443e1ad2e72256310ace21e4e22cabc7",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 286,
"avg_line_length": 41.066985645933016,
"alnum_prop": 0.5922171734824654,
"repo_name": "Bilingual-Annotation-Task-Force/Scripts",
"id": "0f05ac4aee78642de6dc339d6bc6572d... |
'''OpenGL extension APPLE.framebuffer_multisample
This module customises the behaviour of the
OpenGL.raw.GLES1.APPLE.framebuffer_multisample to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/APPLE/framebuffer_multisample.txt
'''
f... | {
"content_hash": "f155ec6b5702d39deed13058a172338c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 74,
"avg_line_length": 36.26086956521739,
"alnum_prop": 0.8105515587529976,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "459873a85b542cb934628a46b18b956f6579b86a",
... |
import json
import datetime
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from djangocms_text_ckeditor.models import Text
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.sites import site, AdminSite
from django.contrib.auth import get_user_model
... | {
"content_hash": "18712b0c550b9a8d7ab6e5cda793ad1f",
"timestamp": "",
"source": "github",
"line_count": 1681,
"max_line_length": 129,
"avg_line_length": 45.616894705532424,
"alnum_prop": 0.5935812837432514,
"repo_name": "vxsx/django-cms",
"id": "2112f6db0ab0814bc6770199a24a13d98b3173cd",
"size": "7... |
import socket
import struct
import sys
if len(sys.argv) != 3:
sys.exit(0)
ip = sys.argv[1]
port = int(sys.argv[2])
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "[+] Attempting connection to " + ip + ":" + sys.argv[2]
sock.connect((ip, port))
dsi_payload = "\x00\x00\x40\x00" # client quantum
dsi_pa... | {
"content_hash": "539ddffca1bd7d7bdc9dab6a06621519",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 67,
"avg_line_length": 38.733333333333334,
"alnum_prop": 0.6855995410212278,
"repo_name": "cappetta/SecDevOps-Toolkit",
"id": "1c7938b80e9c4b8704923d26b30a3cc6215f32e3",
"s... |
import time
from .public_api import PublicAPI
class PrivateAPI(PublicAPI):
def __init__(self, client_id, secret, production=True, version="v1", timeout=20):
try:
super(self.__class__, self).__init__(production, version, timeout)
except TypeError:
PublicAPI.__init__(self, pr... | {
"content_hash": "f7c7674922908d0593883b262e244904",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 107,
"avg_line_length": 36.410714285714285,
"alnum_prop": 0.5883603073401994,
"repo_name": "HoonJin/korbit-python",
"id": "50b37a7c3f864dc2f5d2ad7929b7aa0ce4d70b72",
"size... |
'''
fetch config from file/sql db
persist info to file/sql db
rotate fetching
log info, warnings, errors to file
single process
sql orm ? suitable for bulk inserts ? sqlalchemy ?
'''
# ----------------------------------------------------------------------
# load config from .ini file
from config import load_or_creat... | {
"content_hash": "0230120cb77639526066dbefde838b62",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 72,
"avg_line_length": 18.729166666666668,
"alnum_prop": 0.6040044493882091,
"repo_name": "davidbarkhuizen/yfh",
"id": "30dbd2c2d9d9e7fd57b0574ce31a2f67f296705a",
"size": "... |
import os.path
import sys
from config import UserConfig
config = UserConfig()
BASEDIR = config.BASEDIR
WHITE_SPACE = config.WHITE_SPACE
SQLALCHEMY_MIGRATE_REPO = config.SQLALCHEMY_MIGRATE_REPO
from controller_generator import generate_controller
def add_model(model_name, model_components):
# This is used to ad... | {
"content_hash": "7afc342585d1fcfe05407a0313ba86c4",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 156,
"avg_line_length": 41.52136752136752,
"alnum_prop": 0.6105393165911898,
"repo_name": "femmerling/backyard",
"id": "0194d9da1510b31add39678c85aac87dd5c434f7",
"size": ... |
from cgnaws import *
import sys
with open("/root/.aws/config") as f:
for line in f.readlines():
if line.startswith('aws_access_key_id'):
aws_access_key_id = line.split()[-1]
elif line.startswith('aws_secret_access_key'):
aws_secret_access_key = line.split()[-1]
accounts = {... | {
"content_hash": "e89d76328b0767c574c526fd8b42c491",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 124,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.6275,
"repo_name": "stealthly/minotaur",
"id": "b318369d8f5c8578560d9331e6267e84c22fecd2",
"size": "1606",
"bi... |
import datetime
import json
from typing import Dict, Optional
import arrow
import flask
import requests
import yaml
from yaml.representer import Representer
from monitoring.monitorlib import infrastructure
TIMEOUTS = (5, 25) # Timeouts of `connect` and `read` in seconds
def coerce(obj: Dict, desired_type: type):... | {
"content_hash": "20d8e7dee7b2b29ccea6e48a3b61b8ee",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 86,
"avg_line_length": 28.370588235294118,
"alnum_prop": 0.6184947128343354,
"repo_name": "interuss/dss",
"id": "740b84b6979feaba6d8387d83ab05122a77285de",
"size": "4823",... |
import pytest
from hypr import Hypr
from test_tools import cp_provider_factory
@pytest.fixture(scope='class')
def app(request):
app = Hypr(__name__)
for provider, urls in request.cls.providers.items():
if isinstance(provider, str):
provider = getattr(
request.module,
... | {
"content_hash": "dc4dee8897ce7fcc15f28a5589400697",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 60,
"avg_line_length": 22.76,
"alnum_prop": 0.5746924428822495,
"repo_name": "project-hypr/hypr",
"id": "65c471a033ce5a42c5303a3a0f6ba1c9f6b10e65",
"size": "569",
"binary... |
"""london_abbey.py"""
from lib.stage import Stage
class LondonAbbey(Stage):
"""London Abbey stage"""
def desc(self):
"""Describe action"""
action = """
After getting the second replicant. You search in Google and find that are
some people talking about a strange royal guard that arrests peo... | {
"content_hash": "db8026322d5e0f4adba62275cd9163c5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 75,
"avg_line_length": 24.96,
"alnum_prop": 0.6330128205128205,
"repo_name": "brunitto/python-runner",
"id": "16a9a7062dc500f8b2708cedd6780e830ff0cafc",
"size": "1248",
"... |
from __future__ import print_function
import os, sys
import unittest
from pathlib import Path
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import csv
from slicer.util import VTKObservationMixin
import platform
import time
from RigidAlignmentModule import RigidAlignmentModuleLog... | {
"content_hash": "d131beb680a1ece312782b6da85150fa",
"timestamp": "",
"source": "github",
"line_count": 2034,
"max_line_length": 255,
"avg_line_length": 44.441986234021634,
"alnum_prop": 0.7200951380054207,
"repo_name": "NIRALUser/SPHARM-PDM",
"id": "f7b1242ded8bb0e6747b1fa48415b74b0302423e",
"size... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'MarketPlaceSettings.twitter_maxlength'
db.alter_column('market_marketplacesettings', 'twitter_maxlength', ... | {
"content_hash": "7da66e7c43b8acb4bc461c88b535c4d2",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 181,
"avg_line_length": 74.01875,
"alnum_prop": 0.552478257198345,
"repo_name": "codepython/CollectorCity-Market-Place",
"id": "7ac549736b06cad6e1e616a616859396016891d6",
... |
import untappd
Class Venue(object):
def __init__(self, ): | {
"content_hash": "4c5abc307f8aea102dd409e36efef7f0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 23,
"avg_line_length": 10.333333333333334,
"alnum_prop": 0.6451612903225806,
"repo_name": "adamomfg/pytappd",
"id": "2aba6afd94fb80de5415c4147e5b80be7c8ca8d9",
"size": "62",... |
import json
from tempest.common.rest_client import RestClient
class HypervisorClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(HypervisorClientJSON, self).__init__(config, username,
password, auth... | {
"content_hash": "81091d18df572cdda7910c9748054629",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 39.148148148148145,
"alnum_prop": 0.6121097445600757,
"repo_name": "BeenzSyed/tempest",
"id": "c8ac9518a1d9f02bde959ddc340b11c05379a9b3",
"size": "27... |
def Enum(**enums): return type('Enum', (), enums)
class Stack(list):
# all Ostrich types; also used for state management
TYPES = Enum(NUMBER=0, STRING=1, BLOCK=2, ARRAY=3)
# extra states (used for :, etc.)
XSTATE = Enum(ASSIGN='_XASGN', EXIT='_XEXIT', CHAR='_XCHAR',
CHARBLOCK = '_XCHBK')
... | {
"content_hash": "58f3172eff395c605126064e4cb7fb0e",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 27.075949367088608,
"alnum_prop": 0.5278167367928939,
"repo_name": "KeyboardFire/ostrich-lang",
"id": "4c2af14f2414d7ee098ad590b55371954a7b6378",
"si... |
import numpy as np
import math
import argparse
import subprocess
import tempfile
from scipy.spatial.distance import *
import os
BASEDIR = os.path.dirname(os.path.abspath(__file__))
EXACTMATCH_DATASET = os.path.join(BASEDIR, 'ExactMatchChairsDataset')
RESULTDIR = os.path.join(BASEDIR,'results')
parser = argparse.Argum... | {
"content_hash": "90fe9b641efb744d86c624066aeb6dcd",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 244,
"avg_line_length": 45.04819277108434,
"alnum_prop": 0.7250601765177855,
"repo_name": "ShapeNet/JointEmbedding",
"id": "6db87f19847935354a5a49f6135911b46e547a40",
"siz... |
import cx_Freeze
import sys
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [cx_Freeze.Executable("weather.py", base=base, icon="sun.ico")]
cx_Freeze.setup(
name="Sunshine",
options={"build_exe": {"packages": ["Tkinter", "PIL"], "include_files": ["keys.py", "sun.ico", "sun.png",
... | {
"content_hash": "efa8c6858b4d1c55de974ec5e45245ca",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 109,
"avg_line_length": 32.578947368421055,
"alnum_prop": 0.4862681744749596,
"repo_name": "DevipriyaSarkar/Sunshine",
"id": "5bd13a36b075b17e1a76238e61977140ad53dde4",
"si... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "2a325634c2e649b4986b464c8b2eeb6a",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 31.91703056768559,
"alnum_prop": 0.7009166780681352,
"repo_name": "coxmediagroup/dolphin",
"id": "5726c60dccd9cc0b27a51d4adcc8c7fa7f4acc0d",
"size":... |
import unittest
from docido_sdk.toolbox.edsl import kwargsql
and_ = kwargsql.and_
or_ = kwargsql.or_
xor = kwargsql.xor
class TestKwargSQL(unittest.TestCase):
d = {
's': 's_value',
'i': 3,
'nested': {
'val': 'nested-value',
'another_key': 42,
},
'a... | {
"content_hash": "d2f801ad8195ff8acae65b5bfb6e8b02",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 78,
"avg_line_length": 36.9080459770115,
"alnum_prop": 0.5951417004048583,
"repo_name": "LilliJane/docido-python-sdk",
"id": "aa66097112aa37ec50222bfa74eca67f04251ba3",
"si... |
import pytest
import unittest
from modules.sfp_dnsgrep import sfp_dnsgrep
from sflib import SpiderFoot
@pytest.mark.usefixtures
class TestModuleDnsGrep(unittest.TestCase):
def test_opts(self):
module = sfp_dnsgrep()
self.assertEqual(len(module.opts), len(module.optdescs))
def test_setup(sel... | {
"content_hash": "fad0a5fffa61c8737cb53aa56143f3b9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 64,
"avg_line_length": 27.923076923076923,
"alnum_prop": 0.6914600550964187,
"repo_name": "smicallef/spiderfoot",
"id": "69cfefaa5e03998fe1ae61cd9c6d9ea1c19de861",
"size": ... |
from .mininode import *
from io import BytesIO
import dbm.ndbm
class BlockStore(object):
def __init__(self, datadir):
self.blockDB = dbm.ndbm.open(datadir + "/blocks", 'c')
self.currentBlock = 0
self.headers_map = dict()
def close(self):
self.blockDB.close()
... | {
"content_hash": "688e6b752c53e001ac59cbc86900dcc6",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 77,
"avg_line_length": 33.05128205128205,
"alnum_prop": 0.548099301784329,
"repo_name": "realzzt/BitCoin2013",
"id": "e76016d79b14a984b7d258389be831bebe8806d3",
"size": "5... |
from netCDF4.utils import *
from netCDF4.utils import _quantize, _StartCountStride, _out_array_shape
| {
"content_hash": "d2673836263876ec313ae2744e5d7c2b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 72,
"avg_line_length": 50.5,
"alnum_prop": 0.801980198019802,
"repo_name": "mathause/netCDF4p",
"id": "1bc94c90ff3beb858c09dba7e80af99df72c19b7",
"size": "160",
"binary": ... |
import numpy as np
from grid_world import standard_grid, negative_grid
from iterative_policy_evaluation import print_values, print_policy
SMALL_ENOUGH = 1e-3
GAMMA = 0.9
ALL_POSSIBLE_ACTIONS = ('U', 'D', 'L', 'R')
# this is deterministic
# all p(s',r|s,a) = 1 or 0
if __name__ == '__main__':
# this grid gives you a... | {
"content_hash": "a9f05cff23c655cdad562100f469c461",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 83,
"avg_line_length": 26.878048780487806,
"alnum_prop": 0.6011796733212341,
"repo_name": "balazssimon/ml-playground",
"id": "548824d5b9897eac00038376bfa98322ab7f4dd4",
"si... |
"""
USAGE:
text-search.py <string> <image>...
"""
from classifier import load_classifier
import cv2
import docopt
from features import hogdesc
import mserfeatures
import numpy as np
import ocr
from random import randint
from rectutils import find_words, next_on_same_line, on_consecutive_line, same_height
import s... | {
"content_hash": "83a7f2cdc71defd06ab45bc8947af236",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 124,
"avg_line_length": 35.777027027027025,
"alnum_prop": 0.5567516525023607,
"repo_name": "szakrewsky/text-search",
"id": "d7b96ee24d00e83adb11eed320571da0060d90bd",
"siz... |
from .link import Link
from .image import Image
class MessageContent(object):
"""MessageContent.
:param links:
:type links: list[~mailosaur.models.Link]
:param images:
:type images: list[~mailosaur.models.Image]
:param body:
:type body: str
"""
def __init__(self, data=None):
... | {
"content_hash": "bcccae32ce76917175cca00cde0c6f87",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 61,
"avg_line_length": 24.08,
"alnum_prop": 0.5764119601328903,
"repo_name": "mailosaurapp/mailosaur-python",
"id": "f51a6cf50776ec771750292aed5df406594f8069",
"size": "602... |
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
py_version = sys.version_info[:2]
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, "README.rst")).read()
README += open(os.path.join(here, "HISTORY.rst")).read()
e... | {
"content_hash": "f425b6d9428d30f74c895240dc35f6ab",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 32.44,
"alnum_prop": 0.6245376078914919,
"repo_name": "anler/Rockefeller",
"id": "0b6d14c167aa166cc0e4295baa3af909613be021",
"size": "1622",
"binar... |
import time
#import urllib2
#import requests
import subprocess
import os
import re
#import cookielib, urllib2
class MetadataError(ValueError):
pass
class MetadataRecord:
def __init__(self, ID, params):
self.ID = ID
self.lg = params[0]
self.dialect = params[1]
self.speakers = params[2]... | {
"content_hash": "dce7706df3f8263456b4aaf2eedc551e",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 143,
"avg_line_length": 35.2247191011236,
"alnum_prop": 0.6478468899521531,
"repo_name": "Glottotopia/aagd",
"id": "33d7ce4a1123e67813ffd8e6a8351ca591bf3850",
"size": "3135... |
from distutils.core import setup
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
classifiers = """
Development Status :: 1 - Beta
Intended Audience :: Developers
Operating System :: OS Independent
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Topic :: S... | {
"content_hash": "457bfcff2b5d1fc607b031e76b4534e6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 53,
"avg_line_length": 26.56756756756757,
"alnum_prop": 0.6429298067141404,
"repo_name": "gonsuke/python-luxio",
"id": "580fecb1040763e5d5e14ab459fa5b20af6739d6",
"size": "... |
import rospy
import re
import md5
from hri_msgs.srv import TextToSpeechSubsentenceDurationResponse
from hri_framework import ITextToSpeechActionServer
from nao_hri import NaoNode
import rospkg
import naoqi
class TextToSpeechCache():
def __init__(self):
self.tts_time_hashes = {}
self.file_name = No... | {
"content_hash": "180896f193c012ea222585b0bb118e4e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 138,
"avg_line_length": 36.06432748538012,
"alnum_prop": 0.6189395167828766,
"repo_name": "jdddog/nao_hri",
"id": "11117f1793f45bbf1256f16250b32bad92b62f30",
"size": "7730... |
from multiprocessing import cpu_count
from numpy import floor
# from mkl import set_num_threads # mkl is never used outside of this
def configure(
num_jobs: int = 8,
test: bool = False,
subtract: int = 1,
num_proc: int = None,
num_thread_per_proc: int = None,
) -> int:
"""
num_jobs is ... | {
"content_hash": "4fde2941919078da5a11aa4f05468465",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 85,
"avg_line_length": 23.575,
"alnum_prop": 0.616118769883351,
"repo_name": "pablocarderam/genetargeter",
"id": "b667c8a30e226c330d6c596b969cd39f71c0359a",
"size": "943",
... |
"""
byceps.blueprints.admin.page.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional
from flask import abort, g, request, url_for
from flask_babel import format_datetime, gettext
from ....services.p... | {
"content_hash": "75e246dda7369ea95bbd10bbd2f4726d",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 79,
"avg_line_length": 27.46397694524496,
"alnum_prop": 0.6508919202518363,
"repo_name": "homeworkprod/byceps",
"id": "ac56e6e472f866e22d452b68c5f50004257fbc9f",
"size": "... |
"""
Tests for Host Affinity Weigher.
"""
from unittest import mock
from manila.common import constants
from manila.db import api as db_api
from manila.scheduler.weighers import host_affinity
from manila import test
from manila.tests import db_utils
from manila.tests.scheduler import fakes
class HostAffinityWeigherT... | {
"content_hash": "2b9b8d84b96b1f3fec103fb38099e9e2",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 74,
"avg_line_length": 41.65853658536585,
"alnum_prop": 0.582552693208431,
"repo_name": "openstack/manila",
"id": "6b5d809bf2562d4fe2fec89907a8a6d05f1c9ffa",
"size": "5752... |
import os
import shutil
import unittest
import tempfile
from robofab.plistlib import readPlist
import robofab
from robofab.test.testSupport import fontInfoVersion2, expectedFontInfo1To2Conversion, expectedFontInfo2To1Conversion
from robofab.objects.objectsRF import NewFont, OpenFont
from robofab.ufoLib import UFOReader... | {
"content_hash": "368f3408eb8704af7c0b9191fd0ba0d9",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 117,
"avg_line_length": 30.35202492211838,
"alnum_prop": 0.722467412501283,
"repo_name": "adrientetar/robofab",
"id": "b948bd7fa03885d646d6364d36ae5c9cbdb9278c",
"size": "... |
import os
from collections import OrderedDict
import six
from six.moves import configparser
from conans.errors import ConanException
from conans.model.ref import ConanFileReference, check_valid_ref
from conans.util.files import load
from conans.util.templates import render_layout_file
DEFAULT_LAYOUT_FILE = "default"... | {
"content_hash": "53c60d8cff3383d7c12648850fc792d7",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 109,
"avg_line_length": 40.078947368421055,
"alnum_prop": 0.5924710002188662,
"repo_name": "conan-io/conan",
"id": "8a251bd22c8f661b413953b2a4e9aca40f7d5de4",
"size": "458... |
import os
import sys
import json
import requests
import urllib
from utils import status
from utils import task_utils
import warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning
warnings.simplefilter('ignore', InsecureRequestWarning)
# Get SSL trust setting.
verify_ssl = task_utils.get_ssl_... | {
"content_hash": "d45d7592e2c5f927f4d00940445f36dd",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 177,
"avg_line_length": 42.79770992366412,
"alnum_prop": 0.5270667974672255,
"repo_name": "voyagersearch/voyager-py",
"id": "c4670791a9ee13c134bea5d448f183c09a28555d",
"si... |
"""Setup script for JAXopt."""
import os
from setuptools import find_packages
from setuptools import setup
folder = os.path.dirname(__file__)
version_path = os.path.join(folder, "jaxopt", "version.py")
__version__ = None
with open(version_path) as f:
exec(f.read(), globals())
req_path = os.path.join(folder, "req... | {
"content_hash": "91d04f98c9c0b1ddd842d6caa8cb1eb1",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 88,
"avg_line_length": 31.78846153846154,
"alnum_prop": 0.6636418632788869,
"repo_name": "google/jaxopt",
"id": "b9f7934a9a7011632971e548ca5a2a3d04d58e09",
"size": "2229",
... |
def inject_app_defaults(application):
"""Inject an application's default settings"""
try:
__import__('%s.settings' % application)
import sys
# Import our defaults, project defaults, and project settings
_app_settings = sys.modules['%s.settings' % application]
_def_settings = sys.modules['django.conf.glo... | {
"content_hash": "672f5837d965ccde5969588b6c04434f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 63,
"avg_line_length": 33.11538461538461,
"alnum_prop": 0.6968641114982579,
"repo_name": "thsutton/django-application-settings",
"id": "b10e2fd5d64728ae7ec729e9e5591adf31e7e9... |
import sys
from ldif import LDIFParser, LDIFWriter, LDIFRecordList
class LDIFVerifier():
"""
Check that two LDIF files contain equivalent LDAP information. If they
don't, emit a summary of the differences
"""
def __init__( self, file1, file2):
"""
Parameters:
file1
... | {
"content_hash": "1e601ceafc90b579c2c87316f1aafe1d",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 116,
"avg_line_length": 32.41284403669725,
"alnum_prop": 0.5544862722898387,
"repo_name": "paulmillar/Xylophone",
"id": "ff21c68f2e51945ea6b7ba9e68e63c9bda213c6d",
"size":... |
import conf
import g
import hashlib
import os
import psycopg2
import time
import urllib
import uuid
from grax.user import User
from gwis.query_base import Query_Base
from gwis.exception.gwis_error import GWIS_Error
from gwis.exception.gwis_warning import GWIS_Warning
from util_ import db_glue
from util_ import misc
... | {
"content_hash": "d3a1ba4bd9fab6341c0d86d9f66db2a4",
"timestamp": "",
"source": "github",
"line_count": 838,
"max_line_length": 79,
"avg_line_length": 41.45107398568019,
"alnum_prop": 0.5589877936434823,
"repo_name": "lbouma/Cyclopath",
"id": "d37d67ec60187b8e2e50541398eaa8c7597e434c",
"size": "348... |
import sys
import itk
import vtk
if len(sys.argv) < 2:
print("Usage: " + sys.argv[0] + " <InputFileName>")
sys.exit(1)
imageFileName = sys.argv[1]
Dimension = 2
PixelType = itk.UC
ImageType = itk.Image[PixelType, Dimension]
reader = vtk.vtkPNGReader()
reader.SetFileName(imageFileName)
reader.SetDataScalarTyp... | {
"content_hash": "bd5af0af713d769f3fcd1834e6b7d431",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 59,
"avg_line_length": 23.62962962962963,
"alnum_prop": 0.7758620689655172,
"repo_name": "InsightSoftwareConsortium/ITKExamples",
"id": "dfce35f310387dcd04818146c2c45ff2968bf... |
"""Classes and functions for testing the behavior of TMTapes."""
import unittest
from automata.tm.tape import TMTape
class TestTMTape(unittest.TestCase):
"""A test class for testing all Turing machines."""
def test_tape_copy(self):
"""Should copy TMTape."""
tape = TMTape('0011', blank_symbo... | {
"content_hash": "001bd5ab290181348c32db1e344377ec",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 27.933333333333334,
"alnum_prop": 0.6634844868735084,
"repo_name": "caleb531/automata",
"id": "7d1ed82a8477dc6c4e09cdf8c2204621d2c223f5",
"size": "44... |
"""End-to-end test for Bigquery tornadoes example."""
from __future__ import absolute_import
import logging
import time
import unittest
from builtins import round
from hamcrest.core.core.allof import all_of
from nose.plugins.attrib import attr
from apache_beam.examples.cookbook import bigquery_tornadoes
from apache... | {
"content_hash": "261000063486479f3b7db59464326a18",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 35.26229508196721,
"alnum_prop": 0.703393770339377,
"repo_name": "markflyhigh/incubator-beam",
"id": "f7eb93ba609bbf5591b39e69a6b0522cfb94bc01",
"siz... |
from typing import List
from etk.extractor import Extractor, InputType
from etk.extraction import Extraction
from bs4 import BeautifulSoup
from bs4.element import Comment
import re
import copy
import pandas as pd
from zipfile import ZipFile
from requests import get
class Toolkit:
@staticmethod
def create_tabl... | {
"content_hash": "24721fa90d70fd09e5cac327a5872f4d",
"timestamp": "",
"source": "github",
"line_count": 624,
"max_line_length": 116,
"avg_line_length": 41.306089743589745,
"alnum_prop": 0.4663045586808923,
"repo_name": "usc-isi-i2/etk",
"id": "49db728651e1677148881c1145fd6863aaddbd8e",
"size": "257... |
from __future__ import annotations
import json
import os
from unittest.mock import Mock, patch
import pytest
from pytest import param
from airflow.models import Connection
from airflow.providers.jdbc.hooks.jdbc import JdbcHook
from airflow.utils import db
jdbc_conn_mock = Mock(name="jdbc_conn")
class TestJdbcHook... | {
"content_hash": "470e991ea335277f0c8e17fa9d647635",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 110,
"avg_line_length": 34.26373626373626,
"alnum_prop": 0.5599743425272611,
"repo_name": "apache/airflow",
"id": "50913b023769bd4c3bc68aac437d49d81d246ecb",
"size": "3905"... |
from django.db import models
from django.utils.translation import ugettext, ugettext_lazy as _
from django.forms import widgets
from django.core.mail import send_mail
from django.conf import settings
from form_designer import app_settings
import re
from form_designer.pickled_object_field import PickledObjectField
from ... | {
"content_hash": "2651da72192f69733de6c788a468f8f4",
"timestamp": "",
"source": "github",
"line_count": 458,
"max_line_length": 377,
"avg_line_length": 44.52838427947598,
"alnum_prop": 0.5389330195155437,
"repo_name": "praekelt/django-form-designer",
"id": "862d6d7bdc9c8fa87bbc2aa14ed43c58c0ee731a",
... |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sitecheck', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ApiClientState',
fields=[
('id', models.AutoField(verbose_name='ID', seri... | {
"content_hash": "074b597bc9d1808f502c874f12e69084",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 140,
"avg_line_length": 39.26829268292683,
"alnum_prop": 0.5347826086956522,
"repo_name": "tykling/tlsscout",
"id": "a1cc9947dad048239c7d846e50b93b810d030594",
"size": "163... |
import logging
from doodle.config import CONFIG
from doodle.core.property import IntegerProperty, StringProperty
from doodle.core.redis_client import redis_cache_client
from .base_model import JSONModel
class KeywordArticle(JSONModel):
keywords = StringProperty()
article_id = IntegerProperty()
def _get... | {
"content_hash": "960481cde0ac790163379f274e539c26",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 115,
"avg_line_length": 37.53061224489796,
"alnum_prop": 0.6302338227297444,
"repo_name": "keakon/Doodle",
"id": "1c3e4b60b760a917f64869badc26e0447f7b250e",
"size": "1864",... |
from django.apps import AppConfig
class SocialAppConfig(AppConfig):
name = "social"
def ready(self):
import social.signals | {
"content_hash": "fe661f5042bacdeafc23ce233c6d426b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 33,
"avg_line_length": 17.625,
"alnum_prop": 0.7021276595744681,
"repo_name": "eyohansa/temu",
"id": "beb6626b0cdbf805c46fe92591f10934bca81f0a",
"size": "141",
"binary": f... |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
RegistrationProviderFactory,
AuthUserFactory
)
from django.contrib.auth.models import Group
from osf.models import RegistrationSchema
from waffle.models import Flag
from osf.migrations import update_provider_auth... | {
"content_hash": "411a910766815ccc62d4203749aa454e",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 104,
"avg_line_length": 30.763975155279503,
"alnum_prop": 0.6208358570563295,
"repo_name": "baylee-d/osf.io",
"id": "434a240c7ec195152df440ff299caa0889475477",
"size": "49... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name = 'stager',
version = '0.0.1',
description = 'the perfect Gentoo installer',
url = 'https://github.com/gentoo/stager',
author = 'Matthew Marchese',
author_email = 'maffblaster@gentoo.org',... | {
"content_hash": "65d8d7818457727a6c2864884b8bdd9c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 49,
"avg_line_length": 27.22222222222222,
"alnum_prop": 0.6408163265306123,
"repo_name": "DigitalSurvival/kaudit",
"id": "411515e3be33e20565e888b8a6a8bf386c863116",
"size":... |
from __future__ import division
from direct.showbase.ShowBase import ShowBase
from direct.showbase.DirectObject import DirectObject
from panda3d.core import Point3, NodePath, LineSegs
from panda3d.core import OrthographicLens
from positions import Positions
from panda3d.core import WindowProperties
from positions impor... | {
"content_hash": "d1b8e35f4c8d7c05e41fae2315fc4fbb",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 93,
"avg_line_length": 35.86976744186047,
"alnum_prop": 0.5560165975103735,
"repo_name": "codedragon/calibrate",
"id": "1b17c7bf3a0acfef293bed2bce8e29f374ba8ee2",
"size": ... |
import pika
import smtplib
def email(FROM,TO,message,gmail_user,gmail_pwd):
server = smtplib.SMTP("74.125.22.108", 587)
server.ehlo()
server.starttls()
server.login(gmail_user, gmail_pwd)
server.sendmail(FROM, TO, message)
server.close()
connection = pika.BlockingConnection(pika.ConnectionPar... | {
"content_hash": "adace9545134501bf10d126f6d027d05",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 87,
"avg_line_length": 27.20689655172414,
"alnum_prop": 0.6628643852978454,
"repo_name": "deathping1994/sendmail-api",
"id": "2ada6877ffcebe7e8b2b04cbae555cfbea34abe9",
"si... |
import json
import os
import logging
import argparse
from copy import deepcopy
from random import randint
default_path = "data/settings.json"
class Settings:
def __init__(self, path=default_path):
self.path = path
self.default_settings = {
"TOKEN": None,
"EMAIL": None,
... | {
"content_hash": "9413ed569723937e253044827510eb59",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 87,
"avg_line_length": 31.984,
"alnum_prop": 0.5377688844422212,
"repo_name": "LogicaExMachina/FoxDedsBot",
"id": "ba68b060fbe07fa376d88c9fcc430bcfd18e1f9e",
"size": "3998... |
import sys
from voluptuous.error import LiteralInvalid, TypeInvalid, Invalid
from voluptuous.schema_builder import Schema, default_factory, raises
from voluptuous import validators
__author__ = 'tusharmakkar08'
def Lower(v):
"""Transform a string to lower case.
>>> s = Schema(Lower)
>>> s('HI')
'hi... | {
"content_hash": "e5305f82575f9680ba8f4fd3c4724644",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 72,
"avg_line_length": 19.415584415584416,
"alnum_prop": 0.5163879598662208,
"repo_name": "tuukkamustonen/voluptuous",
"id": "434c360c7e95a90076782850cc917179762ecf83",
"s... |
import socket
import struct
header_struct = struct.Struct('!I') # message upto 2 ^ 32 -1 in length
def recvall(sock, length):
blocks = []
while length:
block = sock.recv(length)
if not block:
raise EOFError('Socket closed with {} bytes left'.format(length))
length -= len(... | {
"content_hash": "748b9d9f1b4239d03b0159368f118b36",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 77,
"avg_line_length": 31.507042253521128,
"alnum_prop": 0.6414841305319624,
"repo_name": "gauravssnl/python3-network-programming",
"id": "e21ef19b90b94b632873d20f015157dad3e... |
"""UPC module.
:Provided barcodes: UPC-A
"""
from functools import reduce
from .base import Barcode
from .charsets import upc as _upc
from .errors import IllegalCharacterError
from .helpers import sum_chars
class UPCA(Barcode):
"""Class for UPC-A bar codes.
Args:
code (str): UPC-A bar code.
... | {
"content_hash": "fd6bc6d9c1b0b4a377874b06a3ebdac8",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 97,
"avg_line_length": 25.414414414414413,
"alnum_prop": 0.5597305919886565,
"repo_name": "steenzout/python-barcode",
"id": "291d51681aed73df3759ffe2087a04aa70541139",
"si... |
import pytest
import warnings
import offlinetb
def test_capture_warnings(recwarn):
warnings.simplefilter('always')
try:
f()
except CustomException:
tb = offlinetb.distill(var_depth=4)
[v] = [v for v in tb['traceback'][-1]['vars'] if v['name'] == 's']
assert v['vars'][0]['value'] ... | {
"content_hash": "a2e00cbf2d8c5ccd09bdb97cf7af6185",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 19.542857142857144,
"alnum_prop": 0.5877192982456141,
"repo_name": "vmalloc/offlinetb",
"id": "833cea6c8f196852284de6dc389d774266d2333e",
"size": "68... |
import pytest
import moldesign as mdt
from moldesign import units as u
from .molecule_fixtures import *
from . import helpers
def test_forcefield_atom_term_access(protein_default_amber_forcefield):
mol = protein_default_amber_forcefield
for atom in mol.atoms:
assert atom.ff.ljepsilon.dimensionality ... | {
"content_hash": "b8cdc58213ecd455d7c7e31da21d31e0",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 96,
"avg_line_length": 32.605633802816904,
"alnum_prop": 0.6997840172786177,
"repo_name": "Autodesk/molecular-design-toolkit",
"id": "d261cdb21c50a3ceaf2bb1c4d1b31173cc7d98e9... |
from datetime import datetime, timedelta
from pymongo import MongoClient, ReturnDocument
from pymongo.database import Database
from pymongo.errors import PyMongoError
from model.event import Event
from persist.eventencoder import EventEncoder
class MongoWrapper:
def __init__(self, debug=False):
self.deb... | {
"content_hash": "43bfd6b186a81187b1bc9ce8ee1cf19a",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 179,
"avg_line_length": 39.524193548387096,
"alnum_prop": 0.4986737400530504,
"repo_name": "lpbm/tlcal",
"id": "c78761d8d8ebeeaeec36d7ec14a1bd59d6d86109",
"size": "4901",
... |
from itertools import chain
import xadmin
from django import forms
from django.db.models import ManyToManyField
from django.forms.utils import flatatt
from django.template import loader
from django.utils.encoding import force_unicode
from django.utils.html import escape, conditional_escape
from django.utils.s... | {
"content_hash": "7309adac60ba7cfb2786ad11c7ec3107",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 122,
"avg_line_length": 40.10377358490566,
"alnum_prop": 0.5951540813926135,
"repo_name": "LennonChin/Django-Practices",
"id": "eabb2cc229396b360d6b43d0bd5970e021104c21",
... |
import psycopg2
import sys
import os
# define queries
QUERIES = {}
# delete not land surface data
QUERIES['delete_not_land_surface_data'] = ("""
DELETE FROM tambora_temperature_monthly WHERE event_id in (SELECT event_id FROM tambora_temperature_monthly AS AA
LEFT JOIN world_coastline_50m_poly as BB
ON... | {
"content_hash": "c1a412f25e0a99682cddbb6daa43930d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 124,
"avg_line_length": 28.453125,
"alnum_prop": 0.6447007138934652,
"repo_name": "ElenorFrisbee/MSC",
"id": "f9f9e71c0227903d505a7487c616f08ba9f85a82",
"size": "1859",
"... |
"""Foundational utilities common to many sql modules.
"""
from .. import util, exc
import itertools
from .visitors import ClauseVisitor
import re
import collections
PARSE_AUTOCOMMIT = util.symbol('PARSE_AUTOCOMMIT')
NO_ARG = util.symbol('NO_ARG')
class Immutable(object):
"""mark a ClauseElement as 'immutable' ... | {
"content_hash": "1ea93316f47e28a0db33d126092d0f28",
"timestamp": "",
"source": "github",
"line_count": 620,
"max_line_length": 90,
"avg_line_length": 34.08387096774194,
"alnum_prop": 0.5924664016657203,
"repo_name": "michaelBenin/sqlalchemy",
"id": "28f324ad9d53568d5cc484a36c64d27a9e48a5d1",
"size... |
"""
From sourceforge pycrypto project:
http://sourceforge.net/projects/pycrypto/
Code for running GnuPG from Python and dealing with the results.
===================================================================
Distribute and use freely; there are no restrictions on further
dissemination and usage except those imp... | {
"content_hash": "7e82ff79176bbbee70c0f0eae27ca893",
"timestamp": "",
"source": "github",
"line_count": 818,
"max_line_length": 103,
"avg_line_length": 29.586797066014668,
"alnum_prop": 0.54640112387406,
"repo_name": "metalink-dev/pymetalink",
"id": "1623d1003b090bf095345d20f6d9ea5fbc6d424c",
"size... |
import mock
from cloudferry.lib.os.compute import instances
from tests import test
class LiveMigrationTestCase(test.TestCase):
def test_raises_error_for_unknown_migration_tool(self):
nova_client = mock.Mock()
config = mock.Mock()
config.migrate.incloud_live_migration = "not-existing-migra... | {
"content_hash": "e88d4a0eeabb9677038cfc30c259f9b2",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 33.5,
"alnum_prop": 0.6268656716417911,
"repo_name": "SVilgelm/CloudFerry",
"id": "1038a57ed4ff786b84f2ade16af7487540f127f8",
"size": "1916",
"bina... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, ... | {
"content_hash": "0a3c3a03b6f762f2de619aefbb008a7a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 101,
"avg_line_length": 39.175438596491226,
"alnum_prop": 0.6480071652485445,
"repo_name": "iri6e4ka/test-project",
"id": "139615fa7e5222848067590d01bf3f51609974fd",
"size"... |
import os
from setuptools import find_packages
from setuptools import setup
HERE = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(HERE, 'README.rst')).read()
CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read()
REQUIRES = ('cryptacular',
'docutils',
'dogpile.cache... | {
"content_hash": "22c05ceb530c986756b861ca89030eda",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 63,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.5763066202090592,
"repo_name": "dbaty/Yait",
"id": "e45e56e4bef5238dc71c504c0b4131d9383eb921",
"size": "1435",
... |
import pytest
import unittest
from modules.sfp_focsec import sfp_focsec
from sflib import SpiderFoot
from spiderfoot import SpiderFootEvent, SpiderFootTarget
@pytest.mark.usefixtures
class TestModuleIntegrationFocsec(unittest.TestCase):
@unittest.skip("todo")
def test_handleEvent(self):
sf = SpiderF... | {
"content_hash": "2fdcf038359feb97dbcbb91d4ae49457",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 26.9375,
"alnum_prop": 0.6716937354988399,
"repo_name": "smicallef/spiderfoot",
"id": "9b88950a510ce6610d59bead2df952eeae0f843b",
"size": "862",
"b... |
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s: %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',)
logger = logging.getLogger('scanner')
| {
"content_hash": "9f215884c383d59a7aa070f3b19e060e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 20.181818181818183,
"alnum_prop": 0.5495495495495496,
"repo_name": "gogobirds/Pencil",
"id": "873b2582a50200eab45e61a86b9a0887cf2ff2b4",
"size": "305... |
import json
from flask import Blueprint, request, flash, abort, make_response
from flask import render_template, redirect, url_for
from flask_login import current_user, login_required
from werkzeug.datastructures import MultiDict
from portality import dao
import portality.models as models
from portality import consta... | {
"content_hash": "11d87b09a351429e2c016ce620008c82",
"timestamp": "",
"source": "github",
"line_count": 760,
"max_line_length": 278,
"avg_line_length": 35.71578947368421,
"alnum_prop": 0.6473253757736517,
"repo_name": "DOAJ/doaj",
"id": "5e02c11ccd8f6e16513387b91e180c80e19cc515",
"size": "27144",
... |
import os.path
from neutron_lib.api import attributes
from neutron_lib import context
from neutron_lib import fixture
from neutron.api import extensions
from neutron import policy
from neutron.tests import base
TEST_PATH = os.path.dirname(os.path.abspath(__file__))
class APIPolicyTestCase(base.BaseTestCase):
"... | {
"content_hash": "e0154389717597531b26247f8d28fff5",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 40.373333333333335,
"alnum_prop": 0.6459709379128138,
"repo_name": "huntxu/neutron",
"id": "6b8b2d58e31ef1b83043ab7ad630dc7813ba02b9",
"size": "3661"... |
import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._zsrc import ZsrcValidator
from ._zmin import ZminValidator
from ._zmid import ZmidValidator
from ._zmax import ZmaxValidator
from ._zauto import ZautoValidator
from ._z import ZValidator
from .... | {
"content_hash": "ad4985dbe2b0fa85e0cfd324f5e5053a",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 60,
"avg_line_length": 42.35514018691589,
"alnum_prop": 0.6734333627537511,
"repo_name": "plotly/plotly.py",
"id": "6bf73df4f7e3e402a95193794e554f7abe6116e3",
"size": "453... |
from pyqtgraph.Qt import QtCore
import pyqtgraph as pg
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import sys
import serial
pg.setConfigOptions(antialias=True)
class SerialPort:
""" Serial Port Widget """
def __init__(self,layout):
if not isinstanc... | {
"content_hash": "79ef23a61e44b1f7566e30831dd45251",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 59,
"avg_line_length": 21.76271186440678,
"alnum_prop": 0.5630841121495327,
"repo_name": "MCasari-PMEL/EDD-ICMGUI",
"id": "8cff230e6776ebf6129cc948a120f0605801821f",
"size"... |
import os
import shutil
import tempfile
import uuid
from pathlib import Path
from typing import Text, Optional, Union, List, Callable, Set, Iterable
YAML_FILE_EXTENSIONS = [".yml", ".yaml"]
JSON_FILE_EXTENSIONS = [".json"]
TRAINING_DATA_EXTENSIONS = set(JSON_FILE_EXTENSIONS + YAML_FILE_EXTENSIONS)
def yaml_file_exte... | {
"content_hash": "56e082ee79929999d2857f2cb2082bb6",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 87,
"avg_line_length": 28.942528735632184,
"alnum_prop": 0.6503177124702144,
"repo_name": "RasaHQ/rasa_nlu",
"id": "ffabb6923725d28ad8ee22e06bfb24258fb68338",
"size": "503... |
"""Example of a Vizier Client, which can be run on multiple machines.
For distributed cases, this is meant to be used after the Vizier Server (see
run_vizier_server.py`) has been launched and provided an address to connect to.
Example of a launch command:
```
python run_vizier_client.py --address="localhost:[PORT]"
`... | {
"content_hash": "bd28e8ee14ff6ccc7f6f89709d8ceadc",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 261,
"avg_line_length": 34.63559322033898,
"alnum_prop": 0.7112796672375826,
"repo_name": "google/vizier",
"id": "747bfe3c819e4c0205adbabaf6e7ba59eb31efac",
"size": "4663"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.