text
stringlengths
4
1.02M
meta
dict
import string import random import hashlib from repoxplorer.index.commits import Commits from repoxplorer import index epoch_start = 1476633000 def create_random_str(lenght=6): value = "".join([random.choice(string.ascii_lowercase) for _ in range(lenght)]) return value def gen_emails(a...
{ "content_hash": "7b967c3bd8a0fbf6f8db193cd3ce69e4", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 68, "avg_line_length": 29.155844155844157, "alnum_prop": 0.5665924276169265, "repo_name": "morucci/repoxplorer", "id": "b6e6bb55842469b01e69e5eed5d0424dc0322269", "size": "...
import fnmatch import itertools import operator import os import threading import jsonpath_rw from oslo_config import cfg from oslo_log import log import six import yaml from ceilometer import dispatcher from ceilometer.dispatcher import gnocchi_client from ceilometer.i18n import _, _LE from ceilometer import keyston...
{ "content_hash": "77c622b447da9acdf432a0f56bd36a1e", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 79, "avg_line_length": 39.22935779816514, "alnum_prop": 0.5689117555347677, "repo_name": "mathslinux/ceilometer", "id": "8f7618ad1eca3048c954470a61bff0f1100a99fd", "size":...
import sys from HeeksCAD import HeeksCADapp
{ "content_hash": "98b7d503c74fca004c79527812fe15a1", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 32, "avg_line_length": 23, "alnum_prop": 0.8260869565217391, "repo_name": "danheeks/HeeksCAM", "id": "5246bf0aa4ae6a3cf0669bb52c2ab38c2e77ea7f", "size": "46", "binary": fa...
from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue from autobahn.wamp.types import CallOptions, RegisterOptions from autobahn.twisted.util import sleep from autobahn.twisted.wamp import ApplicationSession class Component(ApplicationSession): """ Application co...
{ "content_hash": "2a6079cc3a1a4049d510fe77f9af012b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 89, "avg_line_length": 26.785714285714285, "alnum_prop": 0.6773333333333333, "repo_name": "mcfletch/AutobahnPython", "id": "a3457c89847a904d7d0a7750a00dd47c92383304", "size...
""" Cost models that estimate the performance of programs """ import ctypes import numpy as np import tvm._ffi from tvm.runtime import Object from .. import _ffi_api @tvm._ffi.register_object("auto_scheduler.CostModel") class CostModel(Object): """The base class for cost model""" @tvm._ffi.register_object("aut...
{ "content_hash": "8513a7041b7f478305b7f6178e2bf4b2", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 98, "avg_line_length": 33.62420382165605, "alnum_prop": 0.595756772115931, "repo_name": "Laurawly/tvm-1", "id": "9ef4bcac7a99733d1d3f52e9bd8c72ac9541d5d6", "size": "6065",...
from uuid import (NAMESPACE_DNS, NAMESPACE_OID, NAMESPACE_URL, NAMESPACE_X500, RESERVED_FUTURE, RESERVED_MICROSOFT, RESERVED_NCS, RFC_4122) from libuuid._uuid import *
{ "content_hash": "d24eaef9dc25939862bbf39d5d417208", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 78, "avg_line_length": 37.6, "alnum_prop": 0.7074468085106383, "repo_name": "dln/python-libuuid", "id": "64e589e8af0a4aba91384bd4a8127949f2d6ac05", "size": "188", "binary"...
"""Start and stop the Apache HTTP server as it is used by the layout tests.""" import logging import os import socket from webkitpy.layout_tests.servers import server_base _log = logging.getLogger(__name__) class ApacheHTTP(server_base.ServerBase): def __init__(self, port_obj, output_dir, additional_dirs, nu...
{ "content_hash": "2bfbd92b1b2009fc692853535fcf6ab9", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 114, "avg_line_length": 49.51973684210526, "alnum_prop": 0.5719410123555201, "repo_name": "axinging/chromium-crosswalk", "id": "f7956e9e0e66089be69333c9fe4f8d7ece79c31c", ...
from pyfdt.pyfdt import * import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description='Device Tree Blob FUSE mount') parser.add_argument('filename', help="input dtb filename") parser.add_argument('path', help="fdt path") args = parser.parse_args() with open(args.filenam...
{ "content_hash": "ed092188693406d528ee837c4015f303", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 27.571428571428573, "alnum_prop": 0.6269430051813472, "repo_name": "jeremytrimble/pyfdt", "id": "1eeb268cef1e41517e7cbfa8d2fed03231347b2d", "size": "...
import logging import sys import rasterio import rasterio.features import shapely.affinity import shapely.geometry import shapely.ops _LOG = logging.getLogger(__name__) def valid_region(images, mask_value=None): """ Deprecated valid_region method. Used by the legacy prepare scripts. Newer ones will ...
{ "content_hash": "743a1fcc35107ecde5fa3b428a9a05ce", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 86, "avg_line_length": 25.768421052631577, "alnum_prop": 0.5984477124183006, "repo_name": "jeremyh/eo-datasets", "id": "d9c70dfb054cbb5433b126135c4103b6561b565b", "size": "...
"""Coder implementations. The actual encode/decode implementations are split off from coders to allow conditional (compiled/pure) implementations, which can be used to encode many elements with minimal overhead. This module may be optionally compiled with Cython, using the corresponding coder_impl.pxd file for type h...
{ "content_hash": "ece0e0035319a2cc56223b177199c7c8", "timestamp": "", "source": "github", "line_count": 1259, "max_line_length": 156, "avg_line_length": 35.97776012708499, "alnum_prop": 0.6838793712469092, "repo_name": "iemejia/incubator-beam", "id": "8fdc4a42e64b81c93e187fd3e6c2d8362040a2bb", "siz...
from django.contrib import admin from .models import License, Version class LicenseAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'builtin', 'url') list_filter = ('builtin',) ordering = ('builtin',) class VersionAdmin(admin.ModelAdmin): class Media: css = { 'all': ('css/...
{ "content_hash": "751697275243be78a9a5c8f3ac6df9c0", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 24.35135135135135, "alnum_prop": 0.55826859045505, "repo_name": "psiinon/addons-server", "id": "8c18684af345a68a33af9c815a427f267ea86cff", "size": "9...
import netaddr import six from tempest.api.network import base from tempest import config from tempest import test CONF = config.CONF class AllowedAddressPairTestJSON(base.BaseNetworkTest): """Tests the Neutron Allowed Address Pair API extension The following API operations are tested with this extension: ...
{ "content_hash": "90d5bd8b3ad94f53de5f60e99a5aaf89", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 77, "avg_line_length": 41.57142857142857, "alnum_prop": 0.6494845360824743, "repo_name": "sebrandon1/tempest", "id": "92dfc564442a9268d1dd23dcff29aae550306c0f", "size": "5...
from unittest import SkipTest import django import pytest from django.db import connection, migrations, models, transaction from django.db.migrations.state import ProjectState from django.test import TransactionTestCase from django.test.utils import CaptureQueriesContext from django_mysql.operations import AlterStora...
{ "content_hash": "5789b4d92f0c2b507240fb57406e1e8a", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 88, "avg_line_length": 37.46258503401361, "alnum_prop": 0.5691846740512075, "repo_name": "arnau126/django-mysql", "id": "597b1b9f84ec8e89a76fe832c50328bc35cdc257", "size":...
from nani.tests.admin import (NormalAdminTests, AdminEditTests, AdminNoFixturesTests, AdminDeleteTranslationsTests, AdminRelationTests, TranslatableInlineAdminTests) from nani.tests.basic import (OptionsTest, BasicQueryTest, CreateTest, GetTest, TranslatedTest, DeleteLanguageCodeTest, GetByLanguageTest, D...
{ "content_hash": "8a55a01737229eb92c7f569eea3438b5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 57.1, "alnum_prop": 0.8450087565674256, "repo_name": "andialbrecht/django-hvad", "id": "ecef89aacd7598dd5fcc7722c5387d8872fd6ec6", "size": "1142", ...
import os def count_lines(filename): """ returns integer of number of lines :param filename: name of file. :type filename: str :return: number of lines in the file """ if not os.path.exists(filename): raise IOError("Please make sure that " + filename + " exists. Could not be foun...
{ "content_hash": "bd2f88bcff6ba9fea8571b6cbc88084f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 100, "avg_line_length": 24.75, "alnum_prop": 0.5774410774410774, "repo_name": "frank-y-liu/gatk", "id": "94025ef1a1a9deb71999b7b4bc72524f64be0708", "size": "689", "binary...
import tempfile import os import numpy as np import ume.task def test_hstack_mat_direct_path(): X = None with tempfile.TemporaryDirectory() as temp_dirname: mat_path = os.path.join(temp_dirname, 'testcase.npz') # generate working file X_sample = np.array([[1, 2, 3], [4, 5, 6]]) ...
{ "content_hash": "2c5609defff96023fc53f2b28cb87247", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 61, "avg_line_length": 25.525, "alnum_prop": 0.5719882468168462, "repo_name": "smly/ume", "id": "fcbe2f2ec3e2ad0e9262dc927dec1f501e34e3d5", "size": "1045", "binary": fals...
import logging from flask import render_template from app import app from flask import session __author__ = 'luyangsheng' @app.route("/", methods=["GET", "POST"]) def index(): session['pid'] = 200 result = { "hello": 100 } return render_template("index.html", **result) @app.route("/log_test...
{ "content_hash": "7faf1ff87a4f70726a6dcf7d6c01d1df", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 50, "avg_line_length": 20.045454545454547, "alnum_prop": 0.6281179138321995, "repo_name": "MrYangYang/hairy-adventure", "id": "81b2b48d6795fae46d8d539745ea06f443dc11bf", "s...
from oslo_policy import policy from nova.policies import base BASE_POLICY_NAME = 'os_compute_api:os-server-diagnostics' server_diagnostics_policies = [ policy.DocumentedRuleDefault( name=BASE_POLICY_NAME, check_str=base.ADMIN, description="Show the usage data for a server", oper...
{ "content_hash": "e8e9b7c9b82e358651cd80b0cd3fc8c1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 58, "avg_line_length": 22.2, "alnum_prop": 0.5945945945945946, "repo_name": "mahak/nova", "id": "6774b7e862a57c963686c50d6c6f116b4bf77c93", "size": "1194", "binary": fals...
import logging import os import signal import sys import time from swift import gettext_ as _ from random import random, shuffle from tempfile import mkstemp from eventlet import spawn, patcher, Timeout import swift.common.db from swift.container.backend import ContainerBroker from swift.container.server import DATAD...
{ "content_hash": "464d72dbaf0d9ea7ef9781a902b2c5eb", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 79, "avg_line_length": 42.75438596491228, "alnum_prop": 0.5327862125564218, "repo_name": "lielongxingkong/windchimes", "id": "96c35a0cd6b0a2d1d783791a4ab958386f863bcb", "s...
from __future__ import absolute_import from django.contrib.auth.models import Group from django.test import TestCase from hs_core import hydroshare class TestGroupFromId(TestCase): def setUp(self): self.group, _ = Group.objects.get_or_create(name='Hydroshare Author') self.user = hydroshare.creat...
{ "content_hash": "f5b4673dac0e371985b72df466fdd79c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 105, "avg_line_length": 29.21951219512195, "alnum_prop": 0.5876460767946577, "repo_name": "FescueFungiShare/hydroshare", "id": "247a3379c2df8fbe1c4af9769709b0ce0b80cb36", "...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "6569186a33cd2733b81f31950ad12274", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 23.75, "alnum_prop": 0.7221052631578947, "repo_name": "djkonro/client-python", "id": "aa4afc0845d4ea7fb3214cdcbe30295669fc4205", "size": "967", "b...
"""Items module.""" from enum import Enum # class EquipmentSlot(Enum): # """Equipment slot enum.""" # HEAD = 0 # SHOULDERS = 1 # CHEST = 2 # WAIST = 3 # LEGS = 4 # FEET = 5 # ARMS = 6 # LEFT_HAND = 7 # RIGHT_HAND = 8 # NECK = 9 # CLOAK = 10 # FINGER_1 = 11 # F...
{ "content_hash": "7a483cda7769ad9519f2c83abf696b44", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 113, "avg_line_length": 20.528662420382165, "alnum_prop": 0.501396214706795, "repo_name": "multatronic/akurra", "id": "c98b2199bb30893bba776c0924e4b70aba387d51", "size": "...
from __future__ import print_function import os CWD = os.path.abspath(__file__) def get_mobilenet_path(): return os.path.abspath(os.path.join(CWD, os.path.pardir)) def get_root_path(): return os.path.abspath(os.path.join(get_mobilenet_path(), os.path.pardir)) def get_scripts_path(): return os.path.a...
{ "content_hash": "f2be347c27e0c824c17e2ae00782c889", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 110, "avg_line_length": 27.634920634920636, "alnum_prop": 0.6456059735784032, "repo_name": "leferrad/tensorflow-mobilenet", "id": "971c7d1774a6a8bf8f16ea35d168e07db27b09a9", ...
"""Use learned_optimization to learn policies for RL environment. This allows us to use all the gradient estimators for RL like tasks! In this setting, the unrolled computation graph consists of performing one step in the underlying environment using a policy. The meta-parameters in this case are the parameters of the...
{ "content_hash": "3d9f30e815f07d9330cb0ed0fe8fc8b7", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 78, "avg_line_length": 31.930635838150287, "alnum_prop": 0.6533309196234612, "repo_name": "google/learned_optimization", "id": "d3f0100761aa7b0c0f0e4c137fb034baaafd29ae", ...
from flask import Flask from website.app.api import api from spider.database.init_db import config_mongo from spider.util.conf import conf def create_app(): app = Flask(__name__) config_mongo(conf) app.register_blueprint(api) app.config['JSON_AS_ASCII'] = False app.config['ensure_ascii'] = False ...
{ "content_hash": "c7cf663d446556f87034963b0f077c9c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 48, "avg_line_length": 23.928571428571427, "alnum_prop": 0.7044776119402985, "repo_name": "yqh231/cloudmusic_api", "id": "24fd9bbd85cf3503360d1c0b47655b4028aff0a1", "size":...
"""Fichier contenant la fonction etat_singulier.""" from primaires.scripting.fonction import Fonction class ClasseFonction(Fonction): """Retourne l'état singulier du PNJ précisé.""" @classmethod def init_types(cls): cls.ajouter_types(cls.etat_singulier, "PNJ") @staticmethod def etat_sin...
{ "content_hash": "d76935b45f41e83b464095170bd97831", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 68, "avg_line_length": 26.653846153846153, "alnum_prop": 0.6637806637806638, "repo_name": "stormi/tsunami", "id": "ce8199d571f93bc9d2bbecc0af0c8b98020ca5f2", "size": "2269"...
from scipy import stats, linalg, integrate import numpy as np from numpy.testing import (assert_almost_equal, assert_, assert_equal, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_allclose) import pytest from pytest import raises as assert_raises def test_kde_1d(): #some basic tests compari...
{ "content_hash": "649f079ad5b12e6555e1e72dba2fa6c3", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 89, "avg_line_length": 33.20135363790186, "alnum_prop": 0.6443787585363367, "repo_name": "Stefan-Endres/scipy", "id": "b935e173f31d1699b475403322c8514d45ba9c8c", "size": "...
""" Copyright 2015 Will Boyce """ from setuptools import setup, find_packages import ec2hashcat setup( name='ec2hashcat', version=ec2hashcat.__version__, description='Password Cracking in the Cloud', long_description=file('README.rst').read(), author='Will Boyce', author_email='me@willboyce.c...
{ "content_hash": "bd57071a0616539647ba3939ea1caf56", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 34.61764705882353, "alnum_prop": 0.6304163126593033, "repo_name": "wrboyce/ec2hashcat", "id": "c4c5e3092fbaaac8fc7c51172f2c457636844b13", "size": "11...
"""OSS-Fuzz integration.""" import datetime import logging import os import re import sys import traceback import tempfile import yaml from google.cloud import ndb import pygit2 sys.path.append(os.path.dirname(os.path.realpath(__file__))) import osv OSS_FUZZ_ISSUE_URL = 'https://bugs.chromium.org/p/oss-fuzz/issues/d...
{ "content_hash": "26993866c1f7b7f2263b5f691cf2ff5c", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 80, "avg_line_length": 32.732313575525815, "alnum_prop": 0.6771423564460541, "repo_name": "google/osv.dev", "id": "9a375ed86dc83919c4ff8eb21ced83ebabb07bb2", "size": "1769...
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() history = open('HISTORY.rst').read().replace('.. :changelog:', '') setup(...
{ "content_hash": "ad97527a5c1d7d5412f528521ee806d2", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 129, "avg_line_length": 26.63157894736842, "alnum_prop": 0.5849802371541502, "repo_name": "BrianHicks/probe", "id": "bbc41df566e117f7e263f460d15d3625e5e21e29", "size": "156...
"""Tracking for bluetooth low energy devices.""" import logging import voluptuous as vol from homeassistant.helpers.event import track_point_in_utc_time from homeassistant.components.device_tracker import ( YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL, PLATFORM_SCHEMA, load_config ) ...
{ "content_hash": "6e66ceaf516da22b4d60b9203b5f8475", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 78, "avg_line_length": 35.07692307692308, "alnum_prop": 0.6023391812865497, "repo_name": "eagleamon/home-assistant", "id": "454ab127af0a6826cd749cbca81c300ba6d5f582", "siz...
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
{ "content_hash": "dcc177919b0cd1fe403cd7bdbd8f5983", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 103, "avg_line_length": 39, "alnum_prop": 0.6047008547008547, "repo_name": "hellhovnd/django", "id": "549587d5a772a1d51683211cd4e0b410c93ba0f5", "size": "5148", "binary"...
import logging _log = logging def get_log(): return _log def set_log(log): global _log _log = log
{ "content_hash": "5e6ddc95a0e1c768d4304ea44cead8a2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 17, "avg_line_length": 8.846153846153847, "alnum_prop": 0.591304347826087, "repo_name": "snower/TorMySQL", "id": "7bf432b9072f8ea438c7492bec059c33c7b7f6e1", "size": "170", ...
import pytest import datetime from zfssnap import MetadataFile, MetadataFileException class TestMetadataFile(object): @pytest.fixture def metadata(self): return MetadataFile('/tmp/test/abc_20170116T160746Z.json') @pytest.fixture def metadata_attr_tests(self, monkeypatch): metadata = M...
{ "content_hash": "2f0fcfac706102d2f3857a86841ad190", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 89, "avg_line_length": 40.08984375, "alnum_prop": 0.6011887362369678, "repo_name": "hkbakke/zfssnap", "id": "ab5667bf80d058475976e8a8c611cc32a992c2cf", "size": "10263", ...
from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): return Button(text='Hello World') TestApp().run()
{ "content_hash": "6377011cbd577c88281a9ebca088d4b3", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 41, "avg_line_length": 20, "alnum_prop": 0.7, "repo_name": "SurrealTiggi/mess", "id": "9cbb73a947aa38fac4dc69fc07de2e06d7d06f19", "size": "160", "binary": false, "copies...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("RidgeClassifier" , "FourClass_10" , "oracle")
{ "content_hash": "99630edbdd00f9569c357a9671f8227e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 35.75, "alnum_prop": 0.7832167832167832, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "0ab4bc86b9bd8269d62dd1a9819fe466bb5429cb", "size": "14...
import re def isPalindrome(file): infile = open(file, 'r') lines = infile.readlines() num_lines = int(lines[0]) total_string = ""; for line in lines[1: (num_lines+1)]: total_string += line total_string = re.sub('[^a-zA-Z0-9]', '', total_string) total_string = total_string.lower()...
{ "content_hash": "9fd88efcd9c8a1ae28a517bfd8f4d424", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 22.181818181818183, "alnum_prop": 0.5942622950819673, "repo_name": "JonShepChen/DailyProgrammerChallenges", "id": "4a9fb1755c706faf7afcf15056347172be1f...
"""A TaskRecord backend using mongodb Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of t...
{ "content_hash": "e1846b10c59154da4feb9936b2c93a15", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 100, "avg_line_length": 36.01709401709402, "alnum_prop": 0.5614617940199336, "repo_name": "sodafree/backend", "id": "72de0088fc6be0690ba25a6a9b0e2870e5cbad4b", "size": "42...
import os # try/except added for compatibility with python < 3.8 try: from unittest import mock from unittest.mock import AsyncMock # pragma: NO COVER except ImportError: # pragma: NO COVER import mock import grpc from grpc.experimental import aio import math import pytest from proto.marshal.rules.dates...
{ "content_hash": "18359b496fd5b9bd3647f70d272fdd5d", "timestamp": "", "source": "github", "line_count": 4320, "max_line_length": 131, "avg_line_length": 37.07615740740741, "alnum_prop": 0.659072604561432, "repo_name": "googleapis/python-dialogflow", "id": "0137e2a1673371dc63ea6daa727e6ce88dadf342", ...
import torch from .Module import Module class Square(Module): def updateOutput(self, input): self._backend.Square_updateOutput( self._backend.library_state, input, self.output ) return self.output def updateGradInput(self, input, gradOutput): ...
{ "content_hash": "73fa0c499a90cd839d17d7a409b6955b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 23.272727272727273, "alnum_prop": 0.578125, "repo_name": "RPGOne/Skynet", "id": "9ebaa371eda580d0571a047f7bb91732d7c8a21d", "size": "512", "binary"...
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
{ "content_hash": "ade9d8bf67e5c2e0f6cd1f8536d62fb6", "timestamp": "", "source": "github", "line_count": 438, "max_line_length": 146, "avg_line_length": 42.13470319634703, "alnum_prop": 0.6015172040097535, "repo_name": "jmgirven/warehouse", "id": "405b47a8eaf2c06d6c7e61ea1b0ebdd7512f1a91", "size": "...
import hashlib from django.core.cache import cache from django.utils import six from django.template.defaultfilters import slugify try: from django.utils.encoding import force_bytes except ImportError: force_bytes = str try: from django.contrib.auth import get_user_model except ImportError: from djan...
{ "content_hash": "d25aa387ebc8e552d8b619b1d31739fd", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 99, "avg_line_length": 31.1203007518797, "alnum_prop": 0.6392848514133849, "repo_name": "nai-central/django-avatar", "id": "e6459e500521cbfafe92efd54b77f79eedc856f9", "siz...
"""This module contains the classes that represent Telegram InlineQueryResultVideo.""" from telegram import InlineQueryResult class InlineQueryResultVideo(InlineQueryResult): """ Represents a link to a page containing an embedded video player or a video file. By default, this video file will be s...
{ "content_hash": "8a06896ff0885b1bec14b73f98f76218", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 98, "avg_line_length": 45.63529411764706, "alnum_prop": 0.5962877030162413, "repo_name": "rogerscristo/BotFWD", "id": "ae2e1b790a53feb2e3dba485e55bb795e3762194", "size": "4...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/weapon/shared_scope_weapon_lg_s02.iff" result.attribute_template_id = -1 result.stfName("craft_weapon_ingredients_n","weapon_scope_l_t2") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ##...
{ "content_hash": "86bddbd3e10639609dd45bce85af72e4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 84, "avg_line_length": 26.076923076923077, "alnum_prop": 0.7079646017699115, "repo_name": "obi-two/Rebelion", "id": "efb3159bcb95b775a8d8b5f7dfbdd988d4ef44e4", "size": "484...
from __future__ import division import numpy as np from scipy.fftpack import fft, ifft, fftfreq from scipy.interpolate import interp1d from ._warps_cy import _warp_fast from ._radon_transform import sart_projection_update from warnings import warn __all__ = ['radon', 'order_angles_golden_ratio', 'iradon', 'iradon_sar...
{ "content_hash": "6b3d39d18e5a9e6f30b7c07bd8f8fd4a", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 79, "avg_line_length": 43.00919540229885, "alnum_prop": 0.6157998824095355, "repo_name": "vighneshbirodkar/scikit-image", "id": "b73886a6db71c9779a032adbe63d682d30bd4220", ...
""" Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import os from . import Cache from . import copy_file_or_flo, get_logger, md5_for_file from shutil import rmtree from . import NotFoundError global_logger = get_lo...
{ "content_hash": "9a706da219bd78e6a6c48fb1cd8c6d2c", "timestamp": "", "source": "github", "line_count": 1021, "max_line_length": 110, "avg_line_length": 28.845249755142017, "alnum_prop": 0.5497266646293844, "repo_name": "CivicKnowledge/ckcache", "id": "a1412d16747ea485a0877e1cb6faa9d88dc3e29f", "si...
""" categories: Modules,builtins description: Second argument to next() is not implemented cause: MicroPython is optimised for code space. workaround: Instead of `val = next(it, deflt)` use:: try: val = next(it) except StopIteration: val = deflt """ print(next(iter(range(0)), 42))
{ "content_hash": "61884c9cfe2b688c4f13ce71757eb9b0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 57, "avg_line_length": 25.583333333333332, "alnum_prop": 0.6742671009771987, "repo_name": "lowRISC/micropython", "id": "cbde773f9066c8c1becada57f1fa29fbce0012dd", "size": "...
''' Support for reading ar archives (classid or GNU extended) ''' import os import time from conary.lib import util class ArchiveError(Exception): pass class ArFile(object): ''' Objects representing files in an ar archive @ivar data: file-like object supporting read() @ivar name: name (string) as st...
{ "content_hash": "217909cd9c8e0eaf7c4f2e16ce935dc8", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 79, "avg_line_length": 33.96153846153846, "alnum_prop": 0.5790864477161193, "repo_name": "fedora-conary/conary", "id": "03697ae15a3dddb444a2ada0bb260c1f5949d809", "size": "...
""" Utility routines to help in the construction of test cases. Not required for core pipeline functionality. """ import contextlib import sys @contextlib.contextmanager def nostderr(): savestderr = sys.stderr class Devnull(object): def write(self, _): pass sys.stderr = Devnull() yi...
{ "content_hash": "b2eefc322eeb86dce27ed8b4d0de4ff2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 22, "alnum_prop": 0.6846590909090909, "repo_name": "transientskp/tkp", "id": "46f7bb074da09d96884ad968aa12a07b9d7b3ec0", "size": "352", "binary": f...
import itertools import warnings import numpy from numpy.core.multiarray import normalize_axis_index from scipy import special from . import _ni_support from . import _nd_image from ._ni_docstrings import docfiller __all__ = ['spline_filter1d', 'spline_filter', 'geometric_transform', 'map_coordinates', '...
{ "content_hash": "b08fb8445b60ff008210f8763a9681c4", "timestamp": "", "source": "github", "line_count": 927, "max_line_length": 79, "avg_line_length": 36.56310679611651, "alnum_prop": 0.6055644066796483, "repo_name": "Eric89GXL/scipy", "id": "2b3ce4471df1c6f0c34ff45d3c6ab4f03f1f4d80", "size": "3533...
from fastapi import FastAPI, Path from fastapi.testclient import TestClient app = FastAPI() @app.get("/int/{param:int}") def int_convertor(param: int = Path()): return {"int": param} @app.get("/float/{param:float}") def float_convertor(param: float = Path()): return {"float": param} @app.get("/path/{para...
{ "content_hash": "72671976cd98c322297269e4255dff9c", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 91, "avg_line_length": 26.88235294117647, "alnum_prop": 0.6542669584245077, "repo_name": "tiangolo/fastapi", "id": "5a980cbf6dad7d73bd8fdcda55705d129d632b2e", "size": "1371...
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" import os import sys import warnings from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import create_tree, remove_tree from distutils.errors ...
{ "content_hash": "0b844252462ca857ab3afcec245611e6", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 91, "avg_line_length": 42.55437665782493, "alnum_prop": 0.543102910926884, "repo_name": "batermj/algorithm-challenger", "id": "b5ed6f041e19a04d69307d7ddf3ff9f7361845e1", "...
"""Very simple sample plugin""" from plugin import InvenTreePlugin class SimplePlugin(InvenTreePlugin): """A very simple plugin.""" NAME = 'SimplePlugin' SLUG = "simple"
{ "content_hash": "7b426170f603b4dd324df37b380d9e50", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 36, "avg_line_length": 18.6, "alnum_prop": 0.6881720430107527, "repo_name": "inventree/InvenTree", "id": "8130aa7eed0e6644599a631ca761cd2a5ecc05a5", "size": "186", "binar...
"""Test for dbcore's date-based queries. """ from __future__ import division, absolute_import, print_function from test import _common from test._common import unittest from datetime import datetime import time from beets.dbcore.query import _parse_periods, DateInterval, DateQuery def _date(string): return datet...
{ "content_hash": "13528caaa3d1265a35095b4143610fd9", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 77, "avg_line_length": 37.13793103448276, "alnum_prop": 0.6474001857010213, "repo_name": "mried/beets", "id": "6c9818b776ac86d12c1102b29d5e8ef06b25f3d6", "size": "4979", ...
""" Spherical Harmonic Window classes SHWindow: SHWindowCap, SHWindowMask """ from __future__ import absolute_import as _absolute_import from __future__ import division as _division from __future__ import print_function as _print_function import numpy as _np import matplotlib as _mpl import matplotlib.py...
{ "content_hash": "40e9dfd8de8d3d48439495ce4c6b6d03", "timestamp": "", "source": "github", "line_count": 1463, "max_line_length": 79, "avg_line_length": 41.17908407382092, "alnum_prop": 0.5339032284836915, "repo_name": "MMesch/SHTOOLS", "id": "852fc649070a41c13ad4d50154ae21ccb1ed3fce", "size": "6024...
from flask import Blueprint main = Blueprint('main', __name__) from . import views, errors from ..models import Permission @main.app_context_processor def inject_permissions(): return dict(Permission=Permission)
{ "content_hash": "fbfb6a482e1cc829fe9480cddfe598eb", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 21, "alnum_prop": 0.7142857142857143, "repo_name": "mainulhossain/phenoproc", "id": "e0e993af5da2bf67fa748a3c796a84b9f0084569", "size": "231", "bin...
""" All usable processes should be listed in the end for reference in the MPFile All processes should be called like this: process(xmcd_data, scanparams, process_parameters, process_number) where xmcd_data is the xmcd_data in its current state after the previous processes scanparams are the parameters for the s...
{ "content_hash": "911b79cfd8b65d8696f19ff28c2f3cf0", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 87, "avg_line_length": 32.92261904761905, "alnum_prop": 0.6208642198517447, "repo_name": "materialsproject/MPContribs", "id": "26b638b51a47a705e92a65458b973159fbf1573c", "...
from .conf import settings def load_media_defaults(): media = [] defaults = {} for key, backend in settings.PINAX_NOTIFICATIONS_BACKENDS.items(): # key is a tuple (medium_id, backend_label) media.append(key) defaults[key[0]] = backend.spam_sensitivity return media, defaults
{ "content_hash": "d84a164d24e91b33e063539d50282354", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 28.818181818181817, "alnum_prop": 0.6529968454258676, "repo_name": "pinax/pinax-notifications", "id": "032acaf09481ce8abb216480539c7b2143548d08", "si...
""" mergesort ~~~~~~~~~~~~~~ Time complexity: - Best: O(nlogn) - Average: O(nlogn) - Worst: O(nlogn) Space complexity: O(n) Stability: Yes Divide and conquer algorithm. :copyright: (c) 2017 by 0xE8551CCB. :license: MIT, see LICENSE for more details. """ from...
{ "content_hash": "c7098facdf187d033cee1dce8651e3f4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 80, "avg_line_length": 20.244444444444444, "alnum_prop": 0.5784851811196488, "repo_name": "AjithPanneerselvam/pyalgorithm", "id": "a08b5dd27bf6f59d62e02526f79e684c79709ec4", ...
''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details...
{ "content_hash": "ba56f0ba0ebe3eb759c07d71ea2bea49", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 119, "avg_line_length": 33.36893203883495, "alnum_prop": 0.5644457375618271, "repo_name": "hlzz/dotfiles", "id": "5b400b69a11e0a7888ae7dc1ee648870095a6c32", "size": "3485"...
from setuptools import setup, find_packages version = '1.0' setup( name='tn.plonestyledpage', version=version, description='', classifiers=[ "Framework :: Plone", "Programming Language :: Python", ], keywords='', author='TN Tecnologia e Negocios', author_email='ed@tecno...
{ "content_hash": "21c4b2853ce02bf1f64df4c2b250dc92", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 49, "avg_line_length": 22.725, "alnum_prop": 0.5654565456545655, "repo_name": "tecnologiaenegocios/tn.plonestyledpage", "id": "e77a8443b724ff47f4bd97306b5289bbec13e3d0", "s...
import hmac class Helper_cookie: secret = 'This is a secret' @classmethod def make_secure_val(self, val): return '%s|%s' % (val, hmac.new(self.secret, val).hexdigest()) @classmethod def check_secure_val(self, secure_val): val = secure_val.split('|')[0] if secure_val == se...
{ "content_hash": "76700769ed226eb9f2cf477d9e6f9f04", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 70, "avg_line_length": 24.533333333333335, "alnum_prop": 0.595108695652174, "repo_name": "YuhanLin1105/Multi-User-Blog", "id": "992daafe991a631d570332df4b3847105e1001e3", "...
from __future__ import unicode_literals from django.conf import settings as django_settings class _Settings(object): DEFAULTS = { 'CDN_STATIC_COMPRESSED_TYPES' : ('css', 'js'), # Lowercase 'CDN_DEFAULT_COMPRESSED_TYPES' : (), 'CDN_STATIC_FILTERS' : { ...
{ "content_hash": "13a9b92b41b8c1dfaaf1634d271be13b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 73, "avg_line_length": 30.303030303030305, "alnum_prop": 0.502, "repo_name": "lucastan/django-starter-box", "id": "2b67f462abeb00614ac9749196f25fd1c65dca63", "size": "1000"...
"""Contains the logic for `aq del dns environment`.""" from aquilon.exceptions_ import ArgumentError from aquilon.worker.broker import BrokerCommand from aquilon.aqdb.model import DnsEnvironment, Fqdn class CommandDelDnsEnvironment(BrokerCommand): required_parameters = ["dns_environment"] def render(self, ...
{ "content_hash": "8129a3deac1e8eb66e522746b731c080", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 35.724137931034484, "alnum_prop": 0.5897683397683398, "repo_name": "quattor/aquilon", "id": "0a70d1ffb2f45a0fc8a501903599c0ebcf8cebc9", "size": "1754...
""" Collects all number values from the db.serverStatus() command, other values are ignored. **Note:** this collector expects pymongo 2.4 and onward. See the pymongo changelog for more details: http://api.mongodb.org/python/current/changelog.html#changes-in-version-2-4 #### Dependencies * pymongo #### Example Conf...
{ "content_hash": "8e3998e29e0e2a67a356354b7235bda0", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 80, "avg_line_length": 41.4958217270195, "alnum_prop": 0.5040612203799423, "repo_name": "gg7/diamond", "id": "8c3126ad1dc4b15f567c21bbe6841266f8abd01f", "size": "14913", ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin class TestOnlyNew(object): config = """ tasks: test: mock: - {title: 'title 1', url: 'http://localhost/title1'} ...
{ "content_hash": "5593711605faaa81fa6ad4d3164f1d6e", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 119, "avg_line_length": 49.375, "alnum_prop": 0.6341772151898735, "repo_name": "drwyrm/Flexget", "id": "d1dbdae4a71ad828134d41c18ac87b41df9639f5", "size": "1580", "binary...
"""Authentication views""" from urllib.parse import quote import requests from django.conf import settings from django.contrib.auth import get_user_model from django.shortcuts import render from social_core.backends.email import EmailAuth from social_django.models import UserSocialAuth from social_django.utils import ...
{ "content_hash": "b137986bbaf8be9cec043ecc12ae2ad6", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 105, "avg_line_length": 32.273972602739725, "alnum_prop": 0.6939728353140917, "repo_name": "mitodl/bootcamp-ecommerce", "id": "7ad216a86580e1a31d4ca9b9e0fa0dc09534e8ff", "...
import argparse import inspect from os.path import abspath, dirname, join from robotpy_installer import sshcontroller from ..util import print_err, yesno class PyFrcUndeploy: """ Removes current robot code from a RoboRIO """ def __init__(self, parser: argparse.ArgumentParser): robot_args ...
{ "content_hash": "eb020e3f2b7547f842facb8526d888c7", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 89, "avg_line_length": 28.645569620253166, "alnum_prop": 0.5620857269111799, "repo_name": "robotpy/pyfrc", "id": "a23d10b92f038b44598b9c5856b150d6ab375a9b", "size": "2263",...
"""ungutenberg converts a Project Gutenberg etext to learnable text""" import re import sys def indexp(predicate, items): """Return the first index into items that satisfies predicate(item).""" for i, item in enumerate(items): if predicate(item): return i return -1 def main(): if...
{ "content_hash": "d3b26ded799a905d132ea2719f3e8a60", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 75, "avg_line_length": 29, "alnum_prop": 0.618921308576481, "repo_name": "pteichman/go.cobe", "id": "19268e823a0c84e692d31405ee1f6769a190f54d", "size": "1154", "binary": ...
OGONE_ERROR_MAP = { '0020001001': "Authorization failed, please retry", '0020001002': "Authorization failed, please retry", '0020001003': "Authorization failed, please retry", '0020001004': "Authorization failed, please retry", '0020001005': "Authorization failed, please retry", '0020001006': "A...
{ "content_hash": "996b373703c467995def7487e79e07c8", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 266, "avg_line_length": 61.086868686868684, "alnum_prop": 0.7081817580527813, "repo_name": "vileopratama/vitech", "id": "8b3369d9721ce703344778302d74edbcbba3b2fb", "size":...
import six from whylog.teacher.constraint_links_base import ConstraintLinksBase from whylog.teacher.user_intent import UserParserIntent, UserRuleIntent from whylog.teacher.rule_validation_problems import ( # isort:skip NoEffectParserProblem, NotSetLogTypeProblem, NotUniqueParserNameProblem, ParserCountProblem, ...
{ "content_hash": "d86e97ad1c3cd8ae6c7a2931681d1353", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 100, "avg_line_length": 38.28389830508475, "alnum_prop": 0.6406198118428335, "repo_name": "kgromadzki/whylog", "id": "1dde53b416170dbe8a098ce1b30580bf65b1c9b0", "size": "9...
from sqlalchemy import types import six from ..exceptions import ImproperlyConfigured from .scalar_coercible import ScalarCoercible class Choice(object): def __init__(self, code, value): self.code = code self.value = value def __eq__(self, other): if isinstance(other, Choice): ...
{ "content_hash": "e6a83567e2f1bc6b8f6ee794d7be8940", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 77, "avg_line_length": 25.575221238938052, "alnum_prop": 0.5605536332179931, "repo_name": "tonyseek/sqlalchemy-utils", "id": "a0852501e17b39c41680e7ec7b8291257cb26fef", "s...
"""A parser for the Music Metadata XML Format (MMD). This module contains L{MbXmlParser}, which parses the U{Music Metadata XML Format (MMD) <http://musicbrainz.org/development/mmd/>} returned by the MusicBrainz webservice. There are also DOM helper functions in this module used by the parser which probably aren't u...
{ "content_hash": "1e093fc83bb93770c0c07f00e8363406", "timestamp": "", "source": "github", "line_count": 1675, "max_line_length": 88, "avg_line_length": 28.064477611940298, "alnum_prop": 0.7034334581347855, "repo_name": "mineo/python-musicbrainz2", "id": "8b38d0c0c8a09a83017f84cd5770b5e0e2b16f33", "...
''' This file is part of ConfigShell. Copyright (c) 2011-2013 by Datera, Inc 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 appli...
{ "content_hash": "46e553311742f608f9ff03655b68bf5d", "timestamp": "", "source": "github", "line_count": 425, "max_line_length": 79, "avg_line_length": 36.88235294117647, "alnum_prop": 0.5374162679425837, "repo_name": "cvubrugier/configshell-fb", "id": "8ed6b506aea996d5d500854d8594d56a1dba7886", "si...
""" Created on 7 Jul 2021 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html document example: {"interval": 1, "units": "D"} """ import pytz from abc import abstractmethod from collections import OrderedDict from datetime impor...
{ "content_hash": "86267ae211c69cda3f6873b2e190922f", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 118, "avg_line_length": 24.14441416893733, "alnum_prop": 0.4257984426137005, "repo_name": "south-coast-science/scs_core", "id": "7b5e19838aaa0129fb28c9efbf67fab7f0de6347", ...
from . import interfaces from .response import Response from ..context import Context from ..declarations import implements from ..swagger import Location __all__ = ('WebContext',) class WebContext(Context): implements(interfaces.IWebContext) def __init__(self, op, request, params, keep_alive=None, markers=...
{ "content_hash": "73b0470f3380828ad11136eeff73ff26", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 73, "avg_line_length": 24.117021276595743, "alnum_prop": 0.5575650639611822, "repo_name": "fafhrd91/mdl", "id": "4944d8341b909c5986aece3e0900030d6de573cc", "size": "2267", ...
"""ParamSklearn can be easily extended with new classification and preprocessing methods. At import time, ParamSklearn checks the directory ``ParamSklearn/components/classification`` for classification algorithms and ``ParamSklearn/components/preprocessing`` for preprocessing algorithms. To be found, the algorithm must...
{ "content_hash": "ed7cac96afdd1b1032900686aec49531", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 155, "avg_line_length": 50.86666666666667, "alnum_prop": 0.8012232415902141, "repo_name": "automl/paramsklearn", "id": "44fd0f9e7f12ff8da71ca85c28bc5c71ce7aba00", "size": "...
import httplib import optparse import os import sys import threading import urllib import urlparse __version__ = (0, 1, 0) PASTEE_URL = "https://pastee.org" DEFAULT_LEXER = "text" DEFAULT_TTL = 30 # days class Paste: """Class representing a paste that has been submitted.""" def __init__(self, content, le...
{ "content_hash": "de8481beb9cf83a59be1bb66c3c9d7e9", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 80, "avg_line_length": 29.962365591397848, "alnum_prop": 0.5591243495424367, "repo_name": "sockeye44/instavpn", "id": "e171d06f0077d279dd2cea09e02e8f21cf5cb55e", "size": "...
""" Trains SVR model ans serializes it into a file """ from __future__ import print_function import sys import os import argparse import numpy as np from nanoalign.__version__ import __version__ import nanoalign.signal_proc as sp from nanoalign.blockade import read_mat from nanoalign.pvalues_test import pvalues_test...
{ "content_hash": "487726bd6a15bbf3230fb0e4e9e89102", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 81, "avg_line_length": 32.392857142857146, "alnum_prop": 0.6247703050349136, "repo_name": "fenderglass/Nano-Align", "id": "248e5484f900ae04fcff8ade91996a4ca1e5f388", "size"...
from __future__ import unicode_literals import pytest from voluptuous import Schema, Required import perch def test_getattr(): doc = perch.Document(x=1, y=2) assert doc.x == 1 assert doc.y == 2 def test_attributeerror(): with pytest.raises(AttributeError): perch.Document().x def test_de...
{ "content_hash": "3a473e7100e05592c554091e698d5b55", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 56, "avg_line_length": 17.5, "alnum_prop": 0.6303571428571428, "repo_name": "openpermissions/perch", "id": "05d11a7b640f22c3feb48bb85bfd0cb3ca36143e", "size": "1178", "bi...
from .response import ForwardingEmail, Image, InboundFax class Inbound(object): def __init__(self, client): self.client = client def all(self, **kwargs): """Retrieves a user's list of inbound faxes. (Sort order is always in descending ID). """ valid_keys = ['unread_...
{ "content_hash": "1c5b239842bcce995b5084e62b900e5c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 30.442622950819672, "alnum_prop": 0.5848142164781907, "repo_name": "interfax/interfax-python", "id": "80490075b1b0d3667f8ba42397e8ace9042844b8", "siz...
''' :codeauthor: :email:`Daniel Mizyrycki (mzdaniel@glidelink.net)` tests.integration.cli.grains ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test salt-ssh grains id work for localhost. (gh #16129) $ salt-ssh localhost grains.get id localhost: localhost ''' # Import Python libs from __future__ impor...
{ "content_hash": "56d94864956ad00e79387fd3d8454db3", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 91, "avg_line_length": 30.63157894736842, "alnum_prop": 0.5993127147766323, "repo_name": "stephane-martin/salt-debian-packaging", "id": "d184a76c79f3cab0510f8f9ae3d17368d988b...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('crm', '0013_auto_20180105_2159'), ] operations = [ migrations.RemoveField( model_name='invoice', ...
{ "content_hash": "6649b0a746015407415c62a0bec48537", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 128, "avg_line_length": 29.761904761904763, "alnum_prop": 0.6224, "repo_name": "scaphilo/koalixcrm", "id": "d25eaff87a371c87db98bfdc099482443d90093b", "size": "698", "bin...
from discord.ext import commands from .utils import checks import discord import inspect import datetime from collections import Counter from django.conf import settings from gaming import utils def get_current_commit(): """ Returns the current version the bot is running """ import os import subp...
{ "content_hash": "4096c46ab98033452b61701949513e20", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 144, "avg_line_length": 33.27049180327869, "alnum_prop": 0.5649174673564917, "repo_name": "bsquidwrd/Squid-Bot", "id": "6bab6f1c9de1321fec430f6d32439f3285fc255e", "size": ...
import demistomock as demisto from CommonServerPython import * import urllib2 import json import base64 import ssl import os.path import os import time import re # globals and constants IPV4_CLASS = 'minemeld.ft.local.YamlIPv4FT' IPV6_CLASS = 'minemeld.ft.local.YamlIPv6FT' URL_CLASS = 'minemeld.ft.local.YamlURLFT' DOM...
{ "content_hash": "f2e61257996bca8415dbc9f5310055df", "timestamp": "", "source": "github", "line_count": 769, "max_line_length": 128, "avg_line_length": 35.45773732119636, "alnum_prop": 0.5511057322037628, "repo_name": "VirusTotal/content", "id": "662662b7838ac21c050b9ef3aa01ee5b80aa32d0", "size": "...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VirtualVmxnet3Option(vim, *args, **kwargs): '''The VirtualVmxnet3Option data object ty...
{ "content_hash": "7fe61cb22feadc8c82bcf22906abb611", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 124, "avg_line_length": 37.74285714285714, "alnum_prop": 0.6336109008327026, "repo_name": "xuru/pyvisdk", "id": "57791011533ab23243ee65ae5c2b553b3b7fba9d", "size": "1322", ...
"""astroid manager: avoid multiple astroid build of a same module when possible by providing a class responsible to get astroid representation from various source and using a cache of built modules) """ from __future__ import print_function import imp import os import zipimport from astroid import exceptions from ast...
{ "content_hash": "34428c12b3557957bbae31623a5e7f36", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 97, "avg_line_length": 41.232, "alnum_prop": 0.5951688009313155, "repo_name": "axbaretto/beam", "id": "d08adc291b39f6a7de1f74323e5dcb84e5f86bdf", "size": "11120", "binar...
from django.conf import settings from django.contrib.auth.models import Group from django.db import models AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') SERVER_STATUS = ( (0, "Normal"), (1, "Down"), (2, "No Connect"), (3, "Error"), ) SERVICE_TYPES = ( ('moniter', "Moniter"), ('lvs', "LVS")...
{ "content_hash": "8f0fcd9577c5b3f01e2150758f4f7c72", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 113, "avg_line_length": 29.848, "alnum_prop": 0.6963280621817207, "repo_name": "alexsilva/django-xadmin", "id": "3f5cb8d5004595bbd0ffca6e55226e17dd76155c", "size": "3746",...
from test_fena.test_common import test_cmd def test_teams(): test_cmd("team add _team team_test", "team add fena.team team_test") test_cmd("team add _team team test", "team add fena.team team test") test_cmd("team empty _team", "team empty fena.team") test_cmd("team _team + @a", "team ...
{ "content_hash": "63f2e6fad1c140920c44bd5cde6e13ea", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 135, "avg_line_length": 72.95238095238095, "alnum_prop": 0.6494778067885117, "repo_name": "Aquafina-water-bottle/Command-Compiler-Unlimited", "id": "d28b1b8b155af0641a4d8511e...
"""Statistics for the assessment of DA methods. `Stats` is a data container for ([mostly] time series of) statistics. It comes with a battery of methods to compute the default statistics. `Avrgs` is a data container *for the same statistics*, but after they have been averaged in time (after the assimilation has finis...
{ "content_hash": "16bc663616c60d32aefd858091a28989", "timestamp": "", "source": "github", "line_count": 815, "max_line_length": 88, "avg_line_length": 34.38773006134969, "alnum_prop": 0.5342182259330621, "repo_name": "nansencenter/DAPPER", "id": "d59c04a4f1f8034fced9a3495eb76003999ba83e", "size": "...
"""Provides tools for reading from and writing to java properties files. """ from typing import Dict, Union, IO from jproperties import Properties import os # The default extension for property files in autopsy repo DEFAULT_PROPS_EXTENSION = 'properties-MERGED' # The default filename for property files in autopsy rep...
{ "content_hash": "08e33ff56670df9d9936c649a0106296", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 118, "avg_line_length": 32.37, "alnum_prop": 0.6731541550818659, "repo_name": "rcordovano/autopsy", "id": "833a445c096c39bd35bc7444304fb6804062a01a", "size": "3237", "bi...
""" This module provides a large set of colormaps, functions for registering new colormaps and for getting a colormap by name, and a mixin class for adding color mapping functionality. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import o...
{ "content_hash": "fa39fc5d84e557fae227202d83a4fe0d", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 78, "avg_line_length": 32.69946808510638, "alnum_prop": 0.60097600650671, "repo_name": "dimroc/tensorflow-mnist-tutorial", "id": "dbd050f9b3d6c0e9551c1abeec69393a0563559d", ...
import copy import math from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LW from cinder import utils from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_base from cinder.volu...
{ "content_hash": "bc59aceccb940b9ea5aaa4c5bb397fe8", "timestamp": "", "source": "github", "line_count": 789, "max_line_length": 79, "avg_line_length": 41.73003802281369, "alnum_prop": 0.5288382687927107, "repo_name": "dims/cinder", "id": "2b1b41d2bc926504b21efe37164d0b207f6c1de1", "size": "33670", ...
""" Utility classes for dealing with circular references. """ from __future__ import division, absolute_import from twisted.python import log, reflect from twisted.python.compat import range, _constructMethod class NotKnown: def __init__(self): self.dependants = [] self.resolved = 0 def add...
{ "content_hash": "afe864dee9834373d30e2d5ed99bccbc", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 97, "avg_line_length": 27.751633986928105, "alnum_prop": 0.5800753650494583, "repo_name": "whitehorse-io/encarnia", "id": "fd2e6b9bf4a794bbc268cfd1244f51be3d3ca96d", "size...
import logging import re MHC_1_GENE_SET = set(["A", "B", "C", "E", "F", "G", "K", "L"]) MHC_2_GENE_SET = set(["DM", "DO", "DP", "DQ", "DR"]) def seq_to_str(obj): """ Given a sequence convert it to a comma separated string. If, however, the argument is a single object, return its string representation....
{ "content_hash": "c410945ddb1b1b80e4752101a95ec3e0", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 79, "avg_line_length": 28.25, "alnum_prop": 0.5702758979698074, "repo_name": "hammerlab/immuno", "id": "ea3b231e255623669ec9ecf38c3d10e2febd3d51", "size": "4443", "binar...
import sys from PyQt4 import QtGui from mainwindow import MainWindow # main def main(): qapp = QtGui.QApplication(sys.argv) mainwindow = MainWindow() mainwindow.show() qapp.exec_() if __name__ == '__main__': main()
{ "content_hash": "0b0ae75e487adcb580d7e22553f5f317", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 39, "avg_line_length": 15, "alnum_prop": 0.6416666666666667, "repo_name": "rstebbing/powerlifting-meet-manager", "id": "f092282024d1a9a6728fa08d5b6ba1f5d630ba7f", "size": "...
import abc import contextlib import tempfile from CommonServerPython import * from dxlclient.client_config import DxlClientConfig from dxlclient.client import DxlClient from dxlclient.broker import Broker from dxltieclient import TieClient from typing import NamedTuple from dxltieclient.constants import FileReputationP...
{ "content_hash": "015d68b1fe471c1c1132f8d5d7bb3462", "timestamp": "", "source": "github", "line_count": 640, "max_line_length": 136, "avg_line_length": 44.1, "alnum_prop": 0.6074617346938775, "repo_name": "VirusTotal/content", "id": "df959e52c23b9b930219291a75ddf06a1ca6cdc7", "size": "28224", "bi...
import types from openstack_dashboard.test.integration_tests import basewebobject class BaseRegion(basewebobject.BaseWebObject): """Base class for region module * there is necessity to override some basic methods for obtaining elements as in content of regions it is required to do relative searches ...
{ "content_hash": "c2df5e9adac8696d60fe2d5ca9e2c31a", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 78, "avg_line_length": 43.36144578313253, "alnum_prop": 0.6287857738260628, "repo_name": "nvoron23/avos", "id": "0b7be6ed2303d3de9344cc47b1d3085c9cbcaf41", "size": "4171", ...
import json import datetime import logging import webapp2 from mapping import mappings PLUGIN_INFO = { "name": "Product country flag" } # cache for 2 days EXPIRATION_IN_SECONDS = 2 * 24 * 60 * 60 class GMT(datetime.tzinfo): def utcoffset(self, dt): return datetime.timedelta(hours=10) def tzn...
{ "content_hash": "aecf5407b1553f55f1edd1ab74950dc8", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 93, "avg_line_length": 28.817204301075268, "alnum_prop": 0.5962686567164179, "repo_name": "mhariri/shoppistant-countryflag-channel", "id": "dd71c9715831385a1357c825f67fad4138...
from roost import events from nose.tools import * from twisted.trial import unittest from mock import Mock from twisted.internet import task class TestEventsListeners(unittest.TestCase): def setUp(self): self.listeners = events.EventListeners() def test_add_listener(self): mock = Mock() self.listene...
{ "content_hash": "6dd3c297a836ee59c3fac6d362ee251f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 110, "avg_line_length": 31.82608695652174, "alnum_prop": 0.7062841530054644, "repo_name": "benrady/roost", "id": "0c54b2ea56b2947ca0d7a7e476375761f71d9601", "size": "733", ...