text
stringlengths
4
1.02M
meta
dict
"""Configuration handling.""" # Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev> # SPDX-License-Identifier: BSD-3-Clause import os from collections import UserDict from functools import cached_property from pathlib import Path from typing import cast, Any, Dict, Iterable, Literal, Optional import to...
{ "content_hash": "474de49c2ff0581273d371c4c5451674", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 82, "avg_line_length": 31.166134185303516, "alnum_prop": 0.6126089185033317, "repo_name": "bow/volt", "id": "d334df6fd55ab8083435fe030ba35a01b66f6b5e", "size": "9755", "...
from google.appengine.tools import os_compat # pylint: disable-msg=W0611 import cStringIO from testlib import mox import os import time import unittest import zipfile from google.appengine.api import apiproxy_stub_map from google.appengine.api import datastore from google.appengine.api import datastore_file_stub fro...
{ "content_hash": "2c02d31e88aaae6f25d9ddbd12af8c79", "timestamp": "", "source": "github", "line_count": 1296, "max_line_length": 80, "avg_line_length": 37.182870370370374, "alnum_prop": 0.6121521509058084, "repo_name": "akbertram/appengine-mapreduce", "id": "7fa7420ba015d91c4aac8f9b95b5a21ec15a067b",...
import os from unipath import FSPath as Path import djcelery from django.core.urlresolvers import reverse PROJECT_DIR = Path(__file__).absolute().ancestor(3) DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = () MANAGERS = ADMINS INTERNAL_IPS = ('127.0.0.1',) # TODO: test if the next line is good for us # SESSION_ENGINE...
{ "content_hash": "1fbd816ef38310b616e7fa0a0582b0b6", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 100, "avg_line_length": 29.677551020408163, "alnum_prop": 0.670196671709531, "repo_name": "hasadna/open-shot", "id": "6353d4bcf829e91b85134e2dd8a4e940ecc442c6", "size": "7...
from a10sdk.common.A10BaseClass import A10BaseClass class Udp(A10BaseClass): """Class Description:: Set UDP STUN timeout. Class udp supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param port_start: {"description": "Port...
{ "content_hash": "cc64ca6b785b6eda54e60aca9339de3d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 168, "avg_line_length": 39.142857142857146, "alnum_prop": 0.6192214111922141, "repo_name": "a10networks/a10sdk-python", "id": "83dcb3ade086dfe06cd58bb5f81257a298409263", "s...
import sys import os import shlex # themes/plugins import sphinx_rtd_theme from recommonmark.parser import CommonMarkParser # 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.ab...
{ "content_hash": "053ada6a05bd4a62a8b8e310ab77a95e", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 211, "avg_line_length": 34.049180327868854, "alnum_prop": 0.7115230300112342, "repo_name": "jrs53/geomesa", "id": "79ea0f879e13ce6fa7f1c6f84bfb7c0be58cda1b", "size": "1288...
import copy import logging from a10_neutron_lbaas.acos import openstack_mappings from a10_neutron_lbaas.v2 import handler_base_v2 from a10_neutron_lbaas.v2 import handler_persist from a10_neutron_lbaas.v2 import v2_context as a10 import acos_client.errors as acos_errors LOG = logging.getLogger(__name__) class PoolH...
{ "content_hash": "a97b5523ed3bac41e8ba3ce290df9bee", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 91, "avg_line_length": 39.9140625, "alnum_prop": 0.5944411822274418, "repo_name": "hthompson6/a10-neutron-lbaas", "id": "823a1c0061f074dbdcbb1bfba5455da2c0675f29", "size":...
from info import __doc__ from kdtree import * from ckdtree import * from qhull import * __all__ = filter(lambda s:not s.startswith('_'),dir()) __all__ += ['distance'] import distance from numpy.testing import Tester test = Tester().test
{ "content_hash": "03e14dd26a1da84362b41373df24f624", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 21.727272727272727, "alnum_prop": 0.6903765690376569, "repo_name": "scipy/scipy-svn", "id": "a9b15fa976afde58f9bb7dfcb619aaf86e7eb9c6", "size": "266"...
from rdflib import Literal from classes import ldp from namespaces import dcterms, iana, ore, rdf # alias the RDFlib Namespace ns = ore class Proxy(ldp.Resource): def __init__(self, position, proxy_for, proxy_in): super(Proxy, self).__init__() self.title = 'Proxy for {0} in {1}'.format(position, ...
{ "content_hash": "f7ca362176c074fd1293a2b69f68b574", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 86, "avg_line_length": 37.333333333333336, "alnum_prop": 0.6209415584415584, "repo_name": "peichman-umd/newspaper-batchload", "id": "2bf671cc606c8791f84e061a47c1f58e903491b1"...
import json import sys from setuptools import setup try: from jupyterpip import cmdclass except: import pip import importlib pip.main(["install", "jupyter-pip"]) cmdclass = importlib.import_module("jupyterpip").cmdclass with open("setup.json") as f: setup_data = json.load(f) if sys.versio...
{ "content_hash": "7612d1e4d48832e6a31f6acecfe6e7ac", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 62, "avg_line_length": 20, "alnum_prop": 0.5974358974358974, "repo_name": "bollwyvl/nb-mermaid", "id": "11cfe1801e65bf82e92d52771a9fdeb59cadd3af", "size": "826", "binary"...
from measurements import webrtc from telemetry import test class WebRTC(test.Test): """Obtains WebRTC metrics for local video playback.""" test = webrtc.WebRTC page_set = 'page_sets/webrtc_cases.json'
{ "content_hash": "465703b2b6b6230a17350d35ed91925b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 26.125, "alnum_prop": 0.7511961722488039, "repo_name": "anirudhSK/chromium", "id": "2f1522ea96dadcafe6b877260f8bad51fc510c76", "size": "371", "binar...
"""The preprocess mediator.""" from plaso.containers import warnings class PreprocessMediator(object): """Preprocess mediator.""" def __init__(self, storage_writer, knowledge_base): """Initializes a preprocess mediator. Args: storage_writer (StorageWriter): storage writer, to store preprocessing ...
{ "content_hash": "1f4eb7aaf33fb8fa3782a2b20f7576f3", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 28.76, "alnum_prop": 0.6731571627260083, "repo_name": "kiddinn/plaso", "id": "19c983f050d8dbd875bc9f068e661a62d3ffbe14", "size": "1462", "binary": ...
""" Utility methods """ import os import sys from os.path import isfile, join from optparse import OptionParser class EC2Type: def __init__(self, arch, ephemeral=1, has_nvme=False): self.arch = arch self.ephemeral = ephemeral self.has_nvme = has_nvme AMI_HELP_MSG = """PLEASE NOTE - If y...
{ "content_hash": "c42af1ddf30624948ebbdd5e9b8584da", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 108, "avg_line_length": 33.039800995024876, "alnum_prop": 0.5741605179942779, "repo_name": "fluo-io/fluo-deploy", "id": "158ea920892e840c940569ff51820bacd3c4899a", "size":...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HUnitConnectCAE_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HUnitConnectCAE_ConnectedLHS """ # Flag this instance as compiled now self.is_compiled...
{ "content_hash": "8b7bc97e4358fe711ba6f72c0c57ec64", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 112, "avg_line_length": 27.104166666666668, "alnum_prop": 0.6825518831667948, "repo_name": "levilucio/SyVOLT", "id": "17c2123dac1c6271a2d0947bc806c9030444d407", "size": "13...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import json import logging import os import re from collections import deque from functools import wraps from flask import Flask, request, jsonify, make_response from flas...
{ "content_hash": "507b75ec0a85653664f3bf1d2ae8bb77", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 120, "avg_line_length": 33.96733668341709, "alnum_prop": 0.6225312523115615, "repo_name": "OmgOhnoes/Flexget", "id": "320db5b12b04ec8ddd6b676f2109514da9bdced0", "size": "1...
from __future__ import unicode_literals from django.http.cookie import parse_cookie from channels.test import ChannelTestCase, HttpClient class HttpClientTests(ChannelTestCase): def test_cookies(self): client = HttpClient() client.set_cookie('foo', 'not-bar') client.set_cookie('foo', 'ba...
{ "content_hash": "068e7adca132dace10e7385d3f9b2829", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 76, "avg_line_length": 32.666666666666664, "alnum_prop": 0.5803571428571429, "repo_name": "Coread/channels", "id": "0ec9089dd9af306ca8789ad30f5c5e7f2702ab5b", "size": "784"...
import os from setuptools import setup, find_packages def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) with open(filepath) as f: f.read() setup( name="RapidSMS", version=__import__('rapi...
{ "content_hash": "c61343ad2acb35595e491848b5cdc38e", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 64, "avg_line_length": 28.796296296296298, "alnum_prop": 0.6051446945337621, "repo_name": "catalpainternational/rapidsms", "id": "0f6a0355645b5edcfe7df272c17a51fcb64113e5", ...
"""Utility functions, node construction macros, etc.""" # Author: Collin Winter # Local imports from .pgen2 import token from .pytree import Leaf, Node from .pygram import python_symbols as syms from . import patcomp try: unicode except NameError: unicode = str ############################################...
{ "content_hash": "3f310ddf39bce1ccb457b4359d333ef5", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 88, "avg_line_length": 33.45080091533181, "alnum_prop": 0.5580106717745246, "repo_name": "liamcurry/py3kwarn", "id": "e16cdb668913661a7dba9c203844fd11ea6f8c4c", "size": "1...
import os import unittest from transformers import BigBirdTokenizer, BigBirdTokenizerFast from transformers.file_utils import cached_property from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow from .test_tokenization_common import TokenizerTesterMixin SPIECE_UNDERL...
{ "content_hash": "b53715f4dc6d5ab67df81579cbd15014", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 358, "avg_line_length": 36.116402116402114, "alnum_prop": 0.5736888368004688, "repo_name": "huggingface/pytorch-transformers", "id": "c4d700cad6bd68fe64f83ff0c70e433c1cd406a...
from django.conf import settings
{ "content_hash": "e060bb020a0b0d1fc2fbe39995eb6505", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 32, "avg_line_length": 33, "alnum_prop": 0.8484848484848485, "repo_name": "yunojuno/django-sample-app", "id": "7ad28dc4f2f6e42e6bab867dea1075c17ec83dfa", "size": "75", "bi...
import os import tempfile import unittest import tests from deployd.common.types import DeployStatus, BuildInfo, DeployStage, AgentStatus from deployd.common.env_status import EnvStatus from deployd.types.ping_report import PingReport class TestStatusFunction(tests.TestCase): def test_load_dump_file(self): ...
{ "content_hash": "ad03001a78eb476eaa4e569345f7d71c", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 99, "avg_line_length": 37.25, "alnum_prop": 0.5913104909925821, "repo_name": "pinterest/teletraan", "id": "11ee677eea114a4731aae5845c8a9ae44191c3ca", "size": "3417", "bin...
"""Top-level presubmit script for services/viz.""" USE_PYTHON3 = True def CheckChangeOnUpload(input_api, output_api): import sys original_sys_path = sys.path sys.path = sys.path + [input_api.os_path.join( input_api.change.RepositoryRoot(), 'components', 'viz')] import presubmit_checks as ps al...
{ "content_hash": "7e70a9de688364e14322e0f495ff839a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 58, "avg_line_length": 28.466666666666665, "alnum_prop": 0.6768149882903981, "repo_name": "chromium/chromium", "id": "299e3aaad4ad1b224db47ffe14301dfc1176bd59", "size": "56...
"""Momentum for TensorFlow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.keras.optimizer_v2 import optimizer_v2 from tensorflow.python.ops import math_ops from tensorflow.python.ops imp...
{ "content_hash": "7fc30f2da8ab379b89e39b0b09be93ff", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 78, "avg_line_length": 34.87012987012987, "alnum_prop": 0.6919925512104284, "repo_name": "alshedivat/tensorflow", "id": "e26c82279f580f9f544b5f475ff3a945c73e35bd", "size": ...
baggage_key = 'crossdock-baggage-key'
{ "content_hash": "fab64840c0a9d9bea51fbc5d1b20f3dd", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 37, "avg_line_length": 38, "alnum_prop": 0.7631578947368421, "repo_name": "guillermo-sentinella/jaeger-client-python", "id": "d6da9ff0a40bef847766ffa6c6d5c38c24d5144a", "siz...
""" ========================================= Nested versus non-nested cross-validation ========================================= This example compares non-nested and nested cross-validation strategies on a classifier of the iris data set. Nested cross-validation (CV) is often used to train a model in which hyperparam...
{ "content_hash": "3321336fd4a7066e05620544fef76b27", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 79, "avg_line_length": 37.73504273504273, "alnum_prop": 0.716647791619479, "repo_name": "vortex-ape/scikit-learn", "id": "b40dc91fc4d8f645560e83ad0293a8f9106e0bff", "size"...
import ga, Matrix, Ann, copy, random ## initialise the GA oga = ga.ga() oga.seedGA(5, 20, 5, 4) for p in oga.getPopulation(): print(p["second_thresholds"]) print(p["second_thresholds"].renderT()) pop = oga.getPopulation() newPop = [] for n in range(5): newPop.append(copy.deepcopy(pop[0])) currVal = newPop[n]["...
{ "content_hash": "3b16ac8f28edd287a024cba80be7d5a6", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 55, "avg_line_length": 22.40909090909091, "alnum_prop": 0.6906693711967545, "repo_name": "bluemini/agenetic", "id": "14b70d4b7305d1499daa04196269cdc5ceb477e6", "size": "255...
from geopy.point import Point from geopy.location import Location from geopy import geocoders VERSION = (0, 95, 1) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:]: version = '%s.%s' % (version, VERSION[...
{ "content_hash": "1a1ffc7e1b9ba49aa63d0846a5288d20", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 49, "avg_line_length": 26.384615384615383, "alnum_prop": 0.6122448979591837, "repo_name": "AdaptiveApplications/carnegie", "id": "dc4b80aaf978e9d58d33ca32f39a073afa788f90", ...
from __future__ import absolute_import, division, print_function # Implements the blaze.eval function from .air import prepare, interps from .. import array #------------------------------------------------------------------------ # Eval #------------------------------------------------------------------------ def ...
{ "content_hash": "2f3dace5ade5aa11e6fca578191e5de7", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 73, "avg_line_length": 31.416666666666668, "alnum_prop": 0.5695339143615006, "repo_name": "zeeshanali/blaze", "id": "a5b57f2818b12f41286a7e324e1fb82613f3b216", "size": "263...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0087_auto_20220810_1647'), ] operations = [ migrations.AddField( model_name='tieredbenefit', name='display_label', field=models.CharField(bla...
{ "content_hash": "4dacf8d98a712e3d7de05ee20bff843d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 155, "avg_line_length": 35.142857142857146, "alnum_prop": 0.6260162601626016, "repo_name": "python/pythondotorg", "id": "f0203331baa6d5733fdbc9755e8681432d2d32b0", "size": ...
from multi import MultiRecipientElement
{ "content_hash": "aa72ad627e5dd7b9e669814b81221290", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 39, "avg_line_length": 40, "alnum_prop": 0.9, "repo_name": "schristakidis/p2ner", "id": "da1bc73a435e31dd05f004c78351aefb58bb8c78", "size": "683", "binary": false, "copi...
"""A class for manipulating time series based on measurements at unevenly-spaced times, see: http://en.wikipedia.org/wiki/Unevenly_spaced_time_series """ import csv import datetime import itertools import pprint from queue import PriorityQueue import sortedcontainers from dateutil.parser import parse as date_parse f...
{ "content_hash": "991bfb0702ea9ea207cfcd26c62b124d", "timestamp": "", "source": "github", "line_count": 1120, "max_line_length": 79, "avg_line_length": 32.159821428571426, "alnum_prop": 0.5597323634748327, "repo_name": "datascopeanalytics/traces", "id": "356b8d2e7c901fc900ecbc40bc61b6de128ea528", "...
import os DIRNAME = os.path.dirname(__file__) DJANGO_PROJECT = 'test_app' DJANGO_SETTINGS_MODULE = 'test_app.settings' ADMINS = ( ('', ''), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'ado_mssql'. 'N...
{ "content_hash": "8119b192a257f75b618cd0e666edd6b0", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 119, "avg_line_length": 30.303030303030305, "alnum_prop": 0.7196666666666667, "repo_name": "pombredanne/django-livesettings", "id": "32db4fb39098c2d3cb8b6eb72c80b0b7084d0e65"...
import jwt import json import urllib2 from functools import wraps from flask import request from app.handler.dbHelper import DBHelper from app.config import DOP_API_RPT from app.handler.error_handler import CustomError, PermissionDenied, NotAuthorized __author__ = 'Xiaoxiao.Xiong' def validate_token(auth): """...
{ "content_hash": "4c7d4239ed0fc142c1ce637b82b2f4fd", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 94, "avg_line_length": 25.580357142857142, "alnum_prop": 0.6160558464223386, "repo_name": "dhrproject/mydatasource", "id": "045f3abebfffc276bfa94b15972a48de0a475c1f", "siz...
""" Calculate correlations and covariance """ import pandas as pd import numpy as np import xgboost as xgb import operator from sklearn import preprocessing from sklearn.cross_validation import train_test_split import matplotlib matplotlib.use("Agg") # Needed to save figures import matplotlib.pyplot as plt # --- Im...
{ "content_hash": "9944bafbf0b215ac6ea5b4493d0ee7a8", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 63, "avg_line_length": 25.125, "alnum_prop": 0.7307213930348259, "repo_name": "HighEnergyDataScientests/bnpcompetition", "id": "7d807eb6bfa27cf6f4b879af82c123b95a537a23", "...
from __future__ import absolute_import from django.contrib import admin from easy_maps.admin import AddressAdmin from easy_maps.models import Address admin.site.register(Address, AddressAdmin)
{ "content_hash": "cd71b41d62fe17511f9911b80d3111bc", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 32.333333333333336, "alnum_prop": 0.8247422680412371, "repo_name": "hfeeki/django-easy-maps", "id": "0c1d0ffe0c9d0a223552ab2e9029ad562c2687c1", "size"...
"""The SleuthKit (TSK) volume system.""" from dfvfs.lib import definitions from dfvfs.lib import tsk_partition from dfvfs.volume import factory from dfvfs.volume import volume_system class TSKVolume(volume_system.Volume): """Volume that uses pytsk3.""" def __init__(self, file_entry, bytes_per_sector): """In...
{ "content_hash": "cfe0f4e54720ee4a1df5e7079029c467", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 80, "avg_line_length": 33.2967032967033, "alnum_prop": 0.6914191419141914, "repo_name": "joachimmetz/dfvfs", "id": "9d49d07b1340ba443c3b5b6996444c7e846d59b3", "size": "3054...
import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_AUTH_TOKEN'] client = Client(account_sid, auth_token) # Get an object fr...
{ "content_hash": "0a6ccec585e1c1a0730211c1724450dd", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 68, "avg_line_length": 37.1875, "alnum_prop": 0.7579831932773109, "repo_name": "TwilioDevEd/api-snippets", "id": "7342e37c786e78011d58c3281f14a078e9b268f1", "size": "668", ...
""" Plotting functions for easily and quickily visualizing synthesized AIA results """ import os import numpy as np import h5py import matplotlib.pyplot as plt import matplotlib.colors import matplotlib.animation import astropy.units as u from astropy.coordinates import SkyCoord from sunpy.map import Map __all__ = ['...
{ "content_hash": "604240ec2382d5d7acf92ab461a9ed2f", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 99, "avg_line_length": 40.8041237113402, "alnum_prop": 0.596766043456291, "repo_name": "wtbarnes/synthesizAR", "id": "d7f14cfe91ff0126b28035953ebc1aed164b50fa", "size": "39...
not_found = {"message":"404 Not found"}
{ "content_hash": "5f557e014e61b1e1873bbb8ca8609b50", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 39, "avg_line_length": 39, "alnum_prop": 0.6666666666666666, "repo_name": "Itxaka/pyapi-gitlab", "id": "b132e40e3784e29f405990a074051c11471fd3c5", "size": "39", "binary": ...
""" Spectral analysis. """ import numpy as np def transform(ts, xs): """ Calculate the discrete Fourier transform of a signal. Parameters: ts: Times. xs: Signal values. Returns: The transformed frequencies and amplitudes. Note: The times must be equally spaced. """ ...
{ "content_hash": "36467d57c8ebc5717098405e5ad1ce00", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 130, "avg_line_length": 33.02970297029703, "alnum_prop": 0.6522781774580336, "repo_name": "0/realtimepork", "id": "f7fe06df02766f5fa1ee4d27eb4b38d6febce50e", "size": "3336...
import random from hashlib import md5 TRACE_SOL = 'tests/play.sol' TEST_SEED = 1337 NUM_TESTS = 1000 def hash(val): return int(md5(str(val).encode()).hexdigest(), base=16) & 0xffffffff def make_random_strat(): """Makes a random pure strategy.""" seed = random.randrange(0, 2 ** 31) def random_strat(...
{ "content_hash": "0c7d01aba7756f60222300a66b5f106d", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 97, "avg_line_length": 36.28044280442804, "alnum_prop": 0.5814686737184703, "repo_name": "alienbrittani/cs61a", "id": "a980d3df1b5ffec10aa26546a6d1ea0979120e57", "size": "...
from copy import deepcopy from werkzeug.datastructures import ImmutableMultiDict class ArticleMetadataFactory(object): def __init__(self, article_source): self.article = article_source def update_article_no_change_to_url_and_doi(self): form = deepcopy(ARTICLE_METADATA_VALID_FORM) for...
{ "content_hash": "1b24e14405e9bbe83ab9f715e1347c88", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 134, "avg_line_length": 43.921875, "alnum_prop": 0.607612949128424, "repo_name": "DOAJ/doaj", "id": "ade28efc837323b0c65e1a24fdf113a53ece9cd1", "size": "2811", "binary": ...
"""Integration tests configuration file.""" import os from mine.tests.conftest import ( # pylint: disable=unused-import pytest_configure, pytest_runtest_setup, ) ROOT = os.path.dirname(__file__) FILES = os.path.join(ROOT, "files")
{ "content_hash": "19604c6e6505730ea1091d68c3fe1922", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 66, "avg_line_length": 20.333333333333332, "alnum_prop": 0.7008196721311475, "repo_name": "jacebrowning/mine", "id": "102ee236c3e2283c2fb27731bdac3a26f9ff1a50", "size": "24...
""" An example to show sending and receiving events behind a proxy. """ import os from azure.eventhub import EventData, EventHubConsumerClient, EventHubProducerClient CONNECTION_STR = os.environ["EVENT_HUB_CONN_STR"] EVENTHUB_NAME = os.environ['EVENT_HUB_NAME'] HTTP_PROXY = { 'proxy_hostname': '127.0.0.1', # pro...
{ "content_hash": "e8031b88849b1bbfe66e4009eb245e52", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 107, "avg_line_length": 36.15909090909091, "alnum_prop": 0.7146448774355751, "repo_name": "Azure/azure-sdk-for-python", "id": "f2f1eecc35825f0b3eebbb080219f913e1e267af", "s...
from __future__ import unicode_literals import json from django.db import models, migrations def show_facility_code_field(apps, schema_editor): """Create a facility code Field for each active org.""" Org = apps.get_model('orgs', 'Org') DataField = apps.get_model('contacts', 'DataField') for org in ...
{ "content_hash": "f42effe51170732c363c712f39db0c07", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 75, "avg_line_length": 28.952380952380953, "alnum_prop": 0.6101973684210527, "repo_name": "xkmato/tracpro", "id": "b8b7af4644737badc1235e9fc3dc412893fd54a7", "size": "1240"...
import logging import shutil import threading import os import xml.etree.ElementTree as etree from datetime import datetime import requests import vlc from dateutil import parser from dateutil.tz import tzutc from i3pystatus import IntervalModule from i3pystatus.core.desktop import DesktopNotification from i3pystatus....
{ "content_hash": "9735854389705d773dad3db3e968c064", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 127, "avg_line_length": 34.92642140468227, "alnum_prop": 0.5746433017332184, "repo_name": "m45t3r/i3pystatus", "id": "8ee558965198f749a6eafd1e21a8dc0145cf0058", "size": "1...
from datetime import datetime from pony.orm.core import PrimaryKey, Required, Optional, Set, Discriminator, sql_debug from grepopla.model.database import db from grepopla.settings import PRODUCTION class GameObject(db.Entity): _table_ = "game_object" game_object_type = Discriminator(str) id = PrimaryKey...
{ "content_hash": "088a848f74d8814b51385a609e20f174", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 87, "avg_line_length": 23.372881355932204, "alnum_prop": 0.6845540246555475, "repo_name": "spseol/grepopla-server", "id": "a2334ffa0277c5efac0bf026b123912e31d6651f", "size"...
""" This module provides utility classes for io operations. """ import codecs import errno import os import re import tempfile from monty.io import zopen __author__ = "Shyue Ping Ong, Rickard Armiento, Anubhav Jain, G Matteo, Ioannis Petousis" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "1...
{ "content_hash": "0e7ffdb1107864b422fc8bef6a63e127", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 99, "avg_line_length": 29.526315789473685, "alnum_prop": 0.5935828877005348, "repo_name": "fraricci/pymatgen", "id": "681a90de149016a256442d9b0a02c2ae81a2b827", "size": "6...
from fields.jsonf import JSONField, JSONCharField
{ "content_hash": "d0f304bfe5721e4b7d178320edcd4012", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 49, "avg_line_length": 50, "alnum_prop": 0.86, "repo_name": "williamroot/opps", "id": "75747f61b28644c62d460c08c58f7aac57658658", "size": "96", "binary": false, "copies"...
import os from cpp_namespace_environment import CppNamespaceEnvironment from model import Model, UnixName from schema_loader import SchemaLoader def _GenerateFilenames(full_namespace): # Try to find the file defining the namespace. Eg. for # nameSpace.sub_name_space.Type' the following heuristics looks for: # ...
{ "content_hash": "da866b6e80a1bb39639adc5d793f5500", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 37.04054054054054, "alnum_prop": 0.6833272528274352, "repo_name": "endlessm/chromium-browser", "id": "6387c807a0506877d4713238654561e63fa07a0c", "siz...
from __future__ import with_statement import sys import paramiko from fudge import Fake, patch_object, with_fakes from fabric.context_managers import settings, hide, show from fabric.network import (HostConnectionCache, join_host_strings, normalize, denormalize) import fabric.network # So I can call patch_object...
{ "content_hash": "fcb1528974448c5345873b75fc054536", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 90, "avg_line_length": 35.79838709677419, "alnum_prop": 0.5878200795975069, "repo_name": "rsteckroth/TavFabric", "id": "38addcea3ba17715944e383ecc1f3324fdc62c72", "size": ...
from great_expectations.expectations.registry import get_renderer_impl from great_expectations.render import ( LegacyDescriptiveRendererType, RenderedTableContent, ) from great_expectations.render.renderer.content_block.content_block import ( ContentBlockRenderer, ) class ProfilingColumnPropertiesTableCon...
{ "content_hash": "03f5774bf6b4e0fdbccda19879ab8e97", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 88, "avg_line_length": 39.45454545454545, "alnum_prop": 0.5817972350230415, "repo_name": "great-expectations/great_expectations", "id": "590b4f9f0c735a71483fb3bc8deb7d8269a1f...
from networkx.linalg.attrmatrix import * import networkx.linalg.attrmatrix from networkx.linalg.spectrum import * import networkx.linalg.spectrum from networkx.linalg.graphmatrix import * import networkx.linalg.graphmatrix from networkx.linalg.laplacianmatrix import * import networkx.linalg.laplacianmatrix from network...
{ "content_hash": "f1a08dfe09839f90ca3f6113bddc9301", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 51, "avg_line_length": 41.38461538461539, "alnum_prop": 0.8643122676579925, "repo_name": "sserrot/champion_relationships", "id": "f09b4023b75ad0d60264270438ee61daf4054a37", ...
import sys, os import subprocess as sub import multiprocessing import time import datetime import logging from optparse import OptionParser, OptionGroup import pos_common import pos_wrappers class generic_workflow(object): """ A generic command-line workflow class. Workflow should be understood as a con...
{ "content_hash": "9beebc2de36ceadf4aa434d831382a3c", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 164, "avg_line_length": 43.1426116838488, "alnum_prop": 0.6473376080289935, "repo_name": "chrisfilo/poSSum", "id": "af6eb386a825b147f642e4b784243a0b8639b9ed", "size": "251...
import os import os.path import string paRootDirectory = '../../' paHtmlDocDirectory = os.path.join( paRootDirectory, "doc", "html" ) ## Script to check documentation status ## this script assumes that html doxygen documentation has been generated ## ## it then walks the entire portaudio source tree and check that ##...
{ "content_hash": "51c9d110918424aa7ff521e5f0b9f5af", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 129, "avg_line_length": 32.05747126436781, "alnum_prop": 0.627465041233417, "repo_name": "powerboat9/USTL", "id": "5d6b58518f7c97eed0e37c9a08fbcf14b3377f89", "size": "2789"...
from django.shortcuts import render # ========================================================================= # Renders about.html page # ========================================================================= def about(request): return render(request, "about.html", {})
{ "content_hash": "a76c484318ddb6febffb281a2e9b3c9f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 35.125, "alnum_prop": 0.33451957295373663, "repo_name": "brittdawn/django-webstore", "id": "9121cb38e4c27122f7ded99e36f440a432d76f3f", "size": "281", ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ldpoznan.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "8a0b619e5962336bb91962a26140f44d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 72, "avg_line_length": 25.444444444444443, "alnum_prop": 0.7117903930131004, "repo_name": "esenti/ld-poznan", "id": "e58587cb4c68216f5d1ed7f7988cc9f14e751983", "size": "251"...
from __future__ import unicode_literals from indico.core.db import db from indico.core.db.sqlalchemy import PyIntEnum from indico.modules.events.editing.models.editable import EditableType from indico.util.string import format_repr, return_ascii class EditingReviewCondition(db.Model): __tablename__ = 'review_con...
{ "content_hash": "ab0c2f12e188a2bdfc63b280a81438e1", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 70, "avg_line_length": 24.373333333333335, "alnum_prop": 0.5924507658643327, "repo_name": "mic4ael/indico", "id": "8201095087f50a37b0def3198e1c4348cd0199ca", "size": "2042"...
"""threaded module.""" # Standard Library import typing # Local Implementation from ._asynciotask import AsyncIOTask from ._asynciotask import asynciotask from ._threaded import Threaded from ._threaded import threaded from ._threadpooled import ThreadPooled from ._threadpooled import threadpooled try: # Local I...
{ "content_hash": "60b06172bdca33819b0c82f9819b7279", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 80, "avg_line_length": 26.263157894736842, "alnum_prop": 0.7004008016032064, "repo_name": "penguinolog/threaded", "id": "eac6f39a0fabc07463ab0dcd8f70d41207a71cfd", "size": ...
""" test_comments.py """ import datetime from unittest import TestCase from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from mockito import mock, when from marimo_co...
{ "content_hash": "0dfdb58014708dc048c14efa76073b24", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 120, "avg_line_length": 43.578125, "alnum_prop": 0.6629616349946217, "repo_name": "brandonivey/marimo-comments", "id": "7f1caffb51cf8afcfa608e4e39a67675eabd3dc5", "size": "...
"""myapp.py Usage: (window1)$ python myapp.py -l info (window2)$ python >>> from myapp import add >>> add.delay(16, 16).get() 32 You can also specify the app to use with celeryd:: $ celeryd -l info --app=myapp.celery """ from celery import Celery celery = Celery("myapp") celery.conf.update(B...
{ "content_hash": "7b0d916df37d1b060481afe31e2cce35", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 50, "avg_line_length": 14.8, "alnum_prop": 0.6216216216216216, "repo_name": "frac/celery", "id": "40ca6b5e8e72baf09b6e05328641c72301621c2e", "size": "444", "binary": fals...
"""Support for Nest sensors that dispatches between API versions.""" from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAssistantType from .const import DATA_SDM from .sensor_legacy import async_setup_legacy_entry from .sensor_sdm import async_setup_sdm_entry async def...
{ "content_hash": "66113faf40cd4893f252299bcf91e691", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 33.526315789473685, "alnum_prop": 0.750392464678179, "repo_name": "soldag/home-assistant", "id": "6245c5d83d02f5323fc8039fe8efd6b4ae764d61", "size": ...
"""Integration to UniFi Network and its various features.""" from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from .const import ( ATTR_MA...
{ "content_hash": "aed13d9aa0189bdb3e918019d1323b82", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 91, "avg_line_length": 31.496062992125985, "alnum_prop": 0.68275, "repo_name": "jawilson/home-assistant", "id": "180f1d6752f871055f535b6eccf4b6338c144942", "size": "4000",...
import os import glob import click from .settings import LOCAL_CONFIG, load_config from .git import BranchGetter from .utils import taskstatus def get_issue(lancet, issue_id=None): with taskstatus("Looking up issue on the issue tracker") as ts: project_id = lancet.config.get("tracker", "project_id") ...
{ "content_hash": "9cbf40cda7b7f2e405667f175b4ea36a", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 81, "avg_line_length": 34.458015267175576, "alnum_prop": 0.5930438635356668, "repo_name": "GaretJax/lancet", "id": "cf2848f4968694048877c7105be020da0e58357f", "size": "451...
import sys import os import time from selenium.common.exceptions import NoAlertPresentException import framework class Exploit (framework.Exploit): attributes = {'Name' : "CUTEFLOW_0022", 'Description' : "CuteFlow v2.11.2 cross site scripting attack.", 'References' : ...
{ "content_hash": "cf4a3028ffb3ea009b36fc0241108f79", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 134, "avg_line_length": 29.717391304347824, "alnum_prop": 0.5581565471836137, "repo_name": "UMD-SEAM/bugbox", "id": "8489fa66c932313146c7adc8f5ee345fe8a4db3e", "size": "153...
import os import re import asyncio import logging import traceback from enum import Enum from .constructs import Serializable from .exceptions import ExtractionError from .utils import get_header, md5sum LOG = logging.getLogger(__name__) class EntryTypes(Enum): """ TODO """ URL = 1 STEAM = 2 FILE = ...
{ "content_hash": "e1e3ac8dfe466cc77465799bc146191d", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 99, "avg_line_length": 36.3014705882353, "alnum_prop": 0.5075957058942677, "repo_name": "DiscordMusicBot/MusicBot", "id": "6a35dac2fddfeb1753cf8a48edcdc521e895b952", "size...
import frappe from frappe.test_runner import make_test_records from frappe.tests.utils import FrappeTestCase from frappe.utils import random_string class TestAutoAssign(FrappeTestCase): @classmethod def setUpClass(cls): super().setUpClass() frappe.db.delete("Assignment Rule") @classmethod def tearDownClass(c...
{ "content_hash": "5ae47d73a692fefe675587260413bd30", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 98, "avg_line_length": 27.592814371257486, "alnum_prop": 0.6766493055555556, "repo_name": "StrellaGroup/frappe", "id": "8f1773608f9333144fa6759b6e2a19bd24d43be6", "size": ...
""" PotentialIterator finds if it is possible to use an iterator. """ from pythran.analyses.aliases import Aliases from pythran.analyses.argument_read_once import ArgumentReadOnce from pythran.passmanager import NodeAnalysis import gast as ast class PotentialIterator(NodeAnalysis): """Find whether an expression...
{ "content_hash": "2618999c605dfdaedf83d1efe158b7c0", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 32.17142857142857, "alnum_prop": 0.6412078152753108, "repo_name": "serge-sans-paille/pythran", "id": "23c6b3ad30f8fc78ba01c118ecccd9bb4007911a", "siz...
import uuid from heat.common import exception from heat.common import template_format from heat.engine import parser from heat.engine.resources import subnet as sn from heat.engine import scheduler from heat.engine import template from heat.tests.common import HeatTestCase from heat.tests import utils try: from n...
{ "content_hash": "7da5abbaeee577083a8e0638b140ad5e", "timestamp": "", "source": "github", "line_count": 836, "max_line_length": 79, "avg_line_length": 34.188995215311, "alnum_prop": 0.5567140158141488, "repo_name": "redhat-openstack/heat", "id": "a65c292179dfca1a9972a2d3d14f854370a8d6cb", "size": "...
"""Tests for tensorflow.ops.gradients.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import warnings import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.pyth...
{ "content_hash": "fe344b78a5bf7dc2b06731f0bf692565", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 84, "avg_line_length": 37.995098039215684, "alnum_prop": 0.6391003311400679, "repo_name": "ibmsoe/tensorflow", "id": "cd4c37d7e03a50d240d64690fa78a4f607d0f5ee", "size": "2...
import re import unittest from django.template import Template, Context, add_to_builtins from django.utils.html import escape add_to_builtins('django.contrib.markup.templatetags.markup') class Templates(unittest.TestCase): def test_textile(self): try: import textile exce...
{ "content_hash": "b91904d2617abee629f2beccfa43fde3", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 99, "avg_line_length": 31.285714285714285, "alnum_prop": 0.5674553756745537, "repo_name": "greggian/TapdIn", "id": "8bc17005f5d751555d0efc97505fab4b8dadf5e7", "size": "2476...
from django.db import models class Blueprint(models.Model): name = models.CharField(max_length=30) class MineBlueprint(models.Model): name = models.CharField(max_length=30, unique=True) max_output_rate = models.FloatField() output = models.IntegerField() max_capacity = models.FloatField() def...
{ "content_hash": "2c4c046f44efe4a390bfb3b0f228da3d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 72, "avg_line_length": 28.88, "alnum_prop": 0.6952908587257618, "repo_name": "Fakor/congov", "id": "c3172e99d994bc9a1f5a3627f498d712147cad3b", "size": "1444", "binary": f...
import imp import os plugin_folder = os.path.join(os.path.dirname(os.path.abspath(__file__))) main_module = '__init__' def get_plugins(): plugins = [] possible_plugins = os.listdir(plugin_folder) for i in possible_plugins: location = os.path.join(plugin_folder, i) if not os.path.isdir(loc...
{ "content_hash": "555cf2f3264ed4da9b8cfb513af0b980", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 90, "avg_line_length": 29.142857142857142, "alnum_prop": 0.6388888888888888, "repo_name": "z/xonotic-map-manager", "id": "59bb4102f31e97c76e45981691404fa9022901be", "size":...
from story.models import Story def test_story_creation(data_dict): story = Story.objects.create(**data_dict) assert str(story) == data_dict['name']
{ "content_hash": "243ab51fa8036b06e29aa94cb009f970", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 45, "avg_line_length": 22.714285714285715, "alnum_prop": 0.6981132075471698, "repo_name": "DjangoGirls/djangogirls", "id": "f0e1a985153acf8cf3c4187123acad338fb7344a", "size"...
from time import sleep from treehopper.api import * from treehopper.libraries.sensors.optical import Tsl2591 board = find_boards()[0] board.connect() sensor = Tsl2591(board.i2c) while board.connected: print(sensor.lux) sleep(0.1)
{ "content_hash": "beacf6fb6c2fef6211fb0fa244ec401e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 21.818181818181817, "alnum_prop": 0.7541666666666667, "repo_name": "treehopper-electronics/treehopper-sdk", "id": "110ab53e495913c88d78cab6d7239e47f29f...
from foreman import define_rule COUNT = 0 if COUNT > 0: raise AssertionError('load more than once') COUNT += 1 # This creates a circular dependency! define_rule('rule_y').depend('//pkg1/pkg2:rule_x')
{ "content_hash": "c635f140d2c127161dcaea7ee61fc773", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 18.90909090909091, "alnum_prop": 0.7019230769230769, "repo_name": "clchiou/garage", "id": "fa9b44abb86e8d6a82948e8477c7144c6a527f9e", "size": "208", ...
from swiftclient.client import ClientException import tempfile from troveclient.compat import exceptions from trove.common import cfg from trove.guestagent.common import operating_system from trove.guestagent import guest_log from trove.tests.config import CONFIG from trove.tests.scenario.helpers.test_helper import D...
{ "content_hash": "b8e0f2e10251fa267ea5540b823e4308", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 79, "avg_line_length": 44.82738095238095, "alnum_prop": 0.5731642544150843, "repo_name": "Tesora-Release/tesora-trove", "id": "cdd8c6e5fb5903b0fd05151f5d0f6fd6f45f59e0", "...
""" .. module: security_monkey.tests.watchers.vpc.test_networkacl :platform: Unix .. version:: $$VERSION$$ .. moduleauthor:: Bridgewater OSS <opensource@bwater.com> """ from security_monkey.tests.watchers import SecurityMonkeyWatcherTestCase from security_monkey.watchers.vpc.networkacl import NetworkACL import ...
{ "content_hash": "ba9820658143c9a4721735cf28550b5a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 72, "avg_line_length": 28.870967741935484, "alnum_prop": 0.7050279329608938, "repo_name": "Netflix/security_monkey", "id": "8b13a3c5873b0048c702d0c93f9e15b8ca9ce131", "size...
"""Add Issues Revision ID: 19471f93d42 Revises: 56bda17c92ee Create Date: 2015-03-27 16:46:53.627287 """ # revision identifiers, used by Alembic. revision = '19471f93d42' down_revision = '56bda17c92ee' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( 'issues', sa.Column...
{ "content_hash": "046df8ae3b109d5ce04d072b65ccba16", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 37.625, "alnum_prop": 0.6528239202657807, "repo_name": "vladan-m/ggrc-core", "id": "70d5eea25dd57afaf3df62ab78ca33abdb311d7e", "size": "1807", "bin...
"""Launch script for running a full probabilistic iterative solver baseline.""" from absl import app from absl import flags import tensorflow as tf import tensorflow_datasets as tfds from metapose import data_utils from metapose import inference_time_optimization as inf_opt _INPUT_PATH = flags.DEFINE_string( 'in...
{ "content_hash": "d4a4f9e843fbdfaeb276ebd52a1d6d71", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 37.03174603174603, "alnum_prop": 0.6328761251607372, "repo_name": "google-research/google-research", "id": "5cb5891ba04d0b3c481ca3b5fc5261fc95bd5a1e",...
"""Allows using emdp as a gym environment.""" import numpy as np import gym from gym import spaces import emdp.utils as utils def gymify(mdp, **kwargs): return GymToMDP(mdp, **kwargs) class GymToMDP(gym.Env): def __init__(self, mdp, observation_one_hot=True): """ :param mdp: The emdp.MDP obj...
{ "content_hash": "3f6e58017a11e39c6192771a38ee2797", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 26.826923076923077, "alnum_prop": 0.6, "repo_name": "zafarali/emdp", "id": "15b0ae9bd8ca0da84d79cdc194a66ff1203252f3", "size": "1395", "binary": fa...
from __future__ import absolute_import, division, print_function import stripe TEST_RESOURCE_ID = "ich_123" class TestCardholder(object): def test_is_creatable(self, request_mock): resource = stripe.issuing.Cardholder.create( billing={ "address": { "city"...
{ "content_hash": "e3a28e33db9f1e270d14d30b366be15a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 72, "avg_line_length": 36.69642857142857, "alnum_prop": 0.6072992700729927, "repo_name": "stripe/stripe-python", "id": "81c789f12e3be6b35057d21bf335e3680c078ffa", "size": "...
from bisect import bisect_right from itertools import chain, count from typing import Generator, List, Sequence, Tuple from ..sqrt import fast_fsqrt as fsqrt def is_prime(n: int, sieve: List[int]=None) -> bool: if n <= 1: return False if sieve is None: for factor in range(2, fsqrt(n) + 1): ...
{ "content_hash": "0abd205a454cc6d6aad26c222c105586", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 78, "avg_line_length": 23.84426229508197, "alnum_prop": 0.5139223100721898, "repo_name": "cryvate/project-euler", "id": "2bebc5998efe6dc5c1447264fed2d18705706a38", "size":...
import json import os import sys from collections import namedtuple from datetime import datetime from config_util import parse_args, parse_contexts, generate_file_path from train import do_training import mxnet as mx from stt_io_iter import STTIter from label_util import LabelUtil from log_util import LogUtil import n...
{ "content_hash": "60f91a953c398af6341a7a38639ad523", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 121, "avg_line_length": 47.80397727272727, "alnum_prop": 0.5751470850418969, "repo_name": "lxn2/mxnet", "id": "a425e0a8ab409bd9a17537f5e083a5fbe883a0c9", "size": "16827", ...
from __future__ import absolute_import import pytest from collections import defaultdict from odin.exceptions import ValidationError from odinweb import decorators from odinweb.constants import * from odinweb.data_structures import NoPath, Param, HttpResponse from odinweb.exceptions import HttpError from odinweb.tes...
{ "content_hash": "4de96fff00c46e73ddaad10c87632e51", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 121, "avg_line_length": 32.76704545454545, "alnum_prop": 0.5515866134905497, "repo_name": "python-odin/odinweb", "id": "0805657ffaf3c7b8721ae020d27ef4a706e15a56", "size": ...
"""Cursor classes """ import weakref import re from . import errors RE_SQL_COMMENT = re.compile("\/\*.*\*\/") RE_SQL_INSERT_VALUES = re.compile( r'VALUES\s*(\(\s*(?:%(?:\(.*\)|)s\s*(?:,|)\s*)+\))', re.I | re.M) RE_SQL_INSERT_STMT = re.compile(r'INSERT\s+INTO', re.I) RE_PY_PARAM = re.compile(b'(%s)') RE_SQL_S...
{ "content_hash": "e6e6998a431f75c0bbd6bad73a3bf1d6", "timestamp": "", "source": "github", "line_count": 800, "max_line_length": 78, "avg_line_length": 31.995, "alnum_prop": 0.5406704172526957, "repo_name": "rcosnita/fantastico", "id": "213b98451a44873051c5ec8719f4f669249aa691", "size": "26726", "...
from flask import Blueprint, render_template, g from sqlakeyset import get_page # type: ignore from sqlakeyset.results import s as sqlakeysetserial # type: ignore from sqlalchemy import desc, asc, or_ from bouncer.constants import READ # type: ignore from app.auth.acls import requires from app.vulnerability.views.v...
{ "content_hash": "afc670959a5247b48937f8bccc4e19af", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 86, "avg_line_length": 38.69444444444444, "alnum_prop": 0.7458722182340273, "repo_name": "google/vulncode-db", "id": "fa8cde4ae55c63158c8c31d5259c2bc65e281898", "size": "33...
from telebot import TeleBot, types class TululBot(TeleBot): def __init__(self, token): super(TululBot, self).__init__(token) self._user = None @property def user(self): if self._user is not None: return self._user self._user = self.get_me() return sel...
{ "content_hash": "b5be7a3eeceb7750c19db60737fb0166", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 73, "avg_line_length": 29.837209302325583, "alnum_prop": 0.5752143413873734, "repo_name": "tulul/tululbot", "id": "2b1bee728056ef01d96cda8e68c6c41913c38808", "size": "1283"...
""" Policy based configuration of libvirt objects This module provides helper APIs for populating the config.py classes based on common operational needs / policies """ import six from nova.pci import utils as pci_utils def set_vif_guest_frontend_config(conf, mac, model, driver, queues=None): """Populate a Lib...
{ "content_hash": "02010746a43efc5eafe290d1102a25df", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 78, "avg_line_length": 31.34355828220859, "alnum_prop": 0.6572714816989627, "repo_name": "cernops/nova", "id": "2522efee43287289bb6dadf86f1c48390363ebd1", "size": "5719", ...
from reobject.query.parser import Q from reobject.query.queryset import EmptyQuerySet from reobject.query.queryset import QuerySet
{ "content_hash": "62ba050d3bb6e7ce37348dccf76940bb", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 43.666666666666664, "alnum_prop": 0.8625954198473282, "repo_name": "onyb/reobject", "id": "fd8670cbf936d2e0ee6ca654f42c74a27ea85b6c", "size": "131", ...
import math def distance(dorf1, dorf2): """ Erwartet als Parameter zwei Dörfer und gibt ihre Distanz zurück. """ distance = math.sqrt((dorf1.x-dorf2.x)**2 + (dorf1.y-dorf2.y)**2) return distance def colorprint(string, color='blue'): """ Prettifies output. Makes debugging fun again. ...
{ "content_hash": "60921fa775cdd84020a861a9ec20ce4d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 103, "avg_line_length": 25.170731707317074, "alnum_prop": 0.6395348837209303, "repo_name": "erstis-go-botting/TouchOfBob", "id": "86ee3f50a142c8b80e0509fdec43170ebde5d117", ...
from monosat import * #Create two Boolean variables: a = Var() b = Var() # c is true if a is true or b is false, and false otherwise c = Or(a, Not(b)) #Add a unit clause to the solver, asserting that variable c must be true Assert(c) #Solve the instance in MonoSAT, returning either True if the instance is SAT, and...
{ "content_hash": "33a86f922248d24b647f65abae4952cf", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 151, "avg_line_length": 29.762237762237763, "alnum_prop": 0.6846804511278195, "repo_name": "sambayless/monosat", "id": "c769530fd1a86fe897b6f06cf5dd359b0786b5d9", "size": ...
""" Singleton implementation. Usage: class A(singleton.Singleton): pass Please NOTE: id(A.Instance()), id(A)) """ __copyright__ = '2013, Room 77, Inc.' __author__ = 'Pramod Gupta' import threading # with_metaclass method from Six compatibility library. # https://github.com/benjaminp/six/blob/1.11.0/six.py#L819 def...
{ "content_hash": "5120e6440a3df02d7557dd49da461d14", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 98, "avg_line_length": 29.875, "alnum_prop": 0.6485355648535565, "repo_name": "room77/py77", "id": "4a36a5b6a19e534e69b5d8f4a1d69e23adfd1153", "size": "2390", "binary": f...
from nucleator.cli.command import Command from nucleator.cli import utils from nucleator.cli import ansible from nucleator.cli import properties from distutils.version import StrictVersion import os, subprocess class Init(Command): name = "init" def parser_init(self, subparsers): """ ...
{ "content_hash": "5f7f29cf34dec41e564fbfc9a0236285", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 175, "avg_line_length": 37.74074074074074, "alnum_prop": 0.5806813402495443, "repo_name": "47lining/nucleator-core", "id": "698fb730c725bf20ea1c8bb261d23fc7a279cda8", "siz...
""" WSGI config for newdjangosite project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICAT...
{ "content_hash": "501845d1daccebdbc8c21e8e77967098", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 45, "alnum_prop": 0.7958333333333333, "repo_name": "kbarnes3/BaseDjangoSite", "id": "e02d1ac5dcf9ed7878ebb9fbdfb2a50c8164de95", "size": "1440", "bi...
from django.conf import settings class EventType: """ Helper class to define types of events. See .model.Event.type. """ def __init__(self, db_value, human_readable_value, human_readable_value_plural=None, css_class_name_suffix='primary'): self.db_value = db_v...
{ "content_hash": "88a5567f4fb0e94421d0d34146c6fbf2", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 76, "avg_line_length": 33.91836734693877, "alnum_prop": 0.6089049338146811, "repo_name": "normanjaeckel/DreifaltigkeitHomepage", "id": "8ff03cbc58a0277a7fcaf19aaa24807ddbca34...
from __future__ import unicode_literals from collections import defaultdict from datetime import datetime, date from django.db import transaction from django.shortcuts import get_object_or_404 from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_framework.fields impo...
{ "content_hash": "dba5710a8e0a653784a7aae861e7cbfc", "timestamp": "", "source": "github", "line_count": 1469, "max_line_length": 120, "avg_line_length": 37.09938733832539, "alnum_prop": 0.6303968880162939, "repo_name": "unicef/un-partner-portal", "id": "7d4745a95846323772c86a0230b04427f770c7a4", "s...
import numpy import pytest from spacy.tokens import Doc from spacy.attrs import ORTH, SHAPE, POS, DEP, MORPH @pytest.mark.issue(2203) def test_issue2203(en_vocab): """Test that lemmas are set correctly in doc.from_array.""" words = ["I", "'ll", "survive"] tags = ["PRP", "MD", "VB"] lemmas = ["-PRON-"...
{ "content_hash": "cfbe52f8bdec037047f88f9b7815b43a", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 81, "avg_line_length": 36.1764705882353, "alnum_prop": 0.6184959349593496, "repo_name": "explosion/spaCy", "id": "c334cc6ebc41999735550b7250b1399f80407295", "size": "4920"...
"""Implements `echo hi` shell code interpolation.""" import os import platform from subprocess import Popen, PIPE import stat import tempfile from UltiSnips.compatibility import as_unicode from UltiSnips.text_objects._base import NoneditableTextObject def _chomp(string): """Rather than rstrip(), remove only the ...
{ "content_hash": "7b1a5f72d3523a14cffc478aa8a23a79", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 32.720588235294116, "alnum_prop": 0.6202247191011236, "repo_name": "marshnmedia/dotfiles", "id": "3e9099a6fb7c980581dc6fbbcfae875c148a0ef9", "size": ...
from django.db import models from django.template.defaultfilters import truncatechars from django.utils import timezone from sked.models import Event, Session from twit.threads import SendTweetThread class TweetTooLongError(Exception): def __init__(self, msg=None): self.msg = msg if not self.msg: ...
{ "content_hash": "cd3df1f2f48b6890e15789b8753ab649", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 96, "avg_line_length": 30.84659090909091, "alnum_prop": 0.5479830539694235, "repo_name": "sunlightlabs/tcamp", "id": "a371326020796149585a967836fda99a61f30ba8", "size": "5...
""" Django settings for campaignserver project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...
{ "content_hash": "42154eb4dbf891ebebaf42a74f35de2b", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 74, "avg_line_length": 26.010309278350515, "alnum_prop": 0.7225525168450257, "repo_name": "follownjmoney/campaign-server", "id": "3be0863eff355be0aff2320b7a43eb0609c75255", ...