text
stringlengths
4
1.02M
meta
dict
""" Author: Andres Andreu < andres at neurofuzzsecurity dot com > Company: neuroFuzz, LLC Date: 12/31/2015 Last Modified: 06/17/2016 functions to facilitate TCP port scanning via raw sockets BSD 3-Clause License Copyright (c) 2015-2016, Andres Andreu, neuroFuzz LLC All rights ...
{ "content_hash": "ac8feec09d7d0df0b40b4168ccf5f5d9", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 93, "avg_line_length": 36.238461538461536, "alnum_prop": 0.6412651241774571, "repo_name": "dre/neurofuzz_toolkit", "id": "3b4f3d70aed759422a065510fe6b23c0e6fd6a27", "size"...
import math import numpy as np import datetime as dt def truncateStrikes(optionStrikes, stockPrice): strikesToInt = list(map(float, optionStrikes)) osList = np.asarray(strikesToInt) idx = np.argmin(np.abs(osList - stockPrice)) leftBound = osList[idx] - (osList[idx] * .05) rightBound = leftBound + (osList[idx] *...
{ "content_hash": "e494dfc2f44820089514795c9e34c6cb", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 99, "avg_line_length": 28.818181818181817, "alnum_prop": 0.7318611987381703, "repo_name": "themichaelusa/bestcondor", "id": "61d8f35165bd084bc35262193300e60a073d9c44", "siz...
class GronthoPipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "c59bdb00503513eb6ed326770cc667f6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 31, "alnum_prop": 0.6881720430107527, "repo_name": "prantu/grontho_scraper", "id": "f4a8c2b3aa234afae533652647f3731e68c31b30", "size": "252", "binar...
__author__ = 'fahadadeel' import jpype import os.path from WorkingWithSlidesInPresentation import CreatingSvg asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath jpype.startJVM(jpype.getDefaultJVMPath(), "-...
{ "content_hash": "45c90b00f882699b8d95b0437f712dbe", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 95, "avg_line_length": 31.46153846153846, "alnum_prop": 0.7506112469437652, "repo_name": "asposeslides/Aspose_Slides_Java", "id": "e0919d68b0d10138e8bc07c15c6166591d913332", ...
""" A fake (in-memory) hypervisor+api. Allows nova testing w/o a hypervisor. This module also documents the semantics of real hypervisor connections. """ import collections import contextlib import time import uuid import fixtures import os_resource_classes as orc from oslo_log import log as logging from oslo_seri...
{ "content_hash": "c8ce694075f72b6d7617f1894cdb6ea7", "timestamp": "", "source": "github", "line_count": 1036, "max_line_length": 79, "avg_line_length": 37.47490347490348, "alnum_prop": 0.5712703482382032, "repo_name": "klmitch/nova", "id": "0c2476cbfb1d158c0bb23dc4fe85327e90b2ffdb", "size": "39598"...
import sys from pyasn1.type import univ, tag from pyasn1 import error __all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61String', 'VideotexString', 'IA5String', 'GraphicString', 'VisibleString', 'ISO646String', 'GeneralString', 'UniversalString', 'BMPString', 'UTF8String'] NoVa...
{ "content_hash": "8a0452668b53fdd8a5864236e412b4d7", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 99, "avg_line_length": 35.54111405835544, "alnum_prop": 0.6215389208149862, "repo_name": "Samuel789/MediPi", "id": "b95e9a79f47edec20b08d46fb6b8359f03c5acde", "size": "135...
from __future__ import print_function import sys import time import glob import os from jekyllclient import utils from jekyllclient.post import Post from jekyllclient.config import CONF @utils.arg('--disable-comments', dest='comments', action='store_false', help='the layout of the new blog', ...
{ "content_hash": "589d5150a9e225d4b7da4ec3570073fd", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 101, "avg_line_length": 33.424418604651166, "alnum_prop": 0.5571403722386502, "repo_name": "krystism/jekyllclient", "id": "59d5c7f27436b66754a2327879a03aba2b77cda8", "size...
import sys import re import getopt import json from amazon.api import AmazonAPI # Globals _DEBUG = False DefaultInputFilename = 'input.txt' DefaultOutputFilename = 'output.txt' DefaultConfigFilename = 'config.json' # Main function # Inputs # argv - Variable list of arguments def main(argv): # Configuration dat...
{ "content_hash": "ea7799f7c9035f8bc47b223bc58e522c", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 149, "avg_line_length": 25.51624548736462, "alnum_prop": 0.6393604980192417, "repo_name": "AJ-N/title_gore", "id": "a74e4d241d34010a71c5f660ef170fb4e81a6544", "size": "712...
""" Mirrors the contents of an IMAP4 mailbox into a local maildir or mbox. Intended for keeping a local backup of a remote IMAP4 mailbox to protect against loss. Very handy for backing up "[Gmail]/All Mail" from your Gmail account, to snag all your archived mail. Re-running it on a regular basis will update only the ...
{ "content_hash": "34d5424871c8983fc5bb69a6d1fe4032", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 142, "avg_line_length": 37.28595041322314, "alnum_prop": 0.5865768241865413, "repo_name": "rtucker/imap2maildir", "id": "13465ab8e89454f17e895a4818f4cf35e73f368e", "size":...
"""Convert notebook to the v1 format.""" #----------------------------------------------------------------------------- # Copyright (C) 2008-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 this software. #-----...
{ "content_hash": "a27d96475e74d7bd397c93d30c6c0c85", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 41.125, "alnum_prop": 0.3799392097264438, "repo_name": "wusung/ipython-notebook-tabs", "id": "303b604901a613f1ee92ae5a4a6e2357c688a97e", "size": "658...
import tornado.options from nsq import Reader, run from nsq import Writer, Error import functools import logging from host_pool import HostPool class NSQProxy: def __init__(self, topic, nsqds): self.topic = topic self.writer_pool = HostPool([Writer([nsqd]) for nsqd in nsqds]) def relay(self, n...
{ "content_hash": "13199b7d8e4eedce7ee7e03a82848ca5", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 109, "avg_line_length": 40.05357142857143, "alnum_prop": 0.6963887650468124, "repo_name": "pombredanne/pynsq", "id": "75b2710d624767988893774886e11ddbd26d43a3", "size": "24...
""" Application description """ import sys import os import logging import omodeler METADATA_URL = "https://graph.microsoft.com/v1.0/$metadata" INPUT_LOCATION = "./input/" TEMP_LOCATION = "./tmp/" OUTPUT_LOCATION = "./output/" LOG_FILENAME = "app.log" CLASS_PREFIX = "Graph" CONSOLE_LOG_LEVEL = logging.DEBUG def main...
{ "content_hash": "09414226b98a93ac4ef89a491453435e", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 98, "avg_line_length": 24, "alnum_prop": 0.6833333333333333, "repo_name": "elexpander/odataPyModel", "id": "79c769431c0bdf24272d212536edba9dc1f4249f", "size": "1080", "bi...
import urllib2 import json import argparse import sys import csv reload(sys) sys.setdefaultencoding('UTF8') parser = argparse.ArgumentParser(description='Lists all folders and folder permissions for groups in a DB or DE team.') parser.add_argument('-g', '--group', dest='groups', action='append', help='Target group na...
{ "content_hash": "7fbdbbff2ffe78fc1792dc01f07bb7f7", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 119, "avg_line_length": 44.35, "alnum_prop": 0.6272078166102969, "repo_name": "dropbox/DropboxBusinessScripts", "id": "138db8631c2a7ed2934f75642f82ece870c42b65", "size": "...
"""Models for scaffolding.""" import json from pathlib import Path import attr from .const import COMPONENT_DIR, TESTS_DIR @attr.s class Info: """Info about new integration.""" domain: str = attr.ib() name: str = attr.ib() codeowner: str = attr.ib(default=None) requirement: str = attr.ib(defaul...
{ "content_hash": "a85db77283775d99c62a89128f679e08", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 88, "avg_line_length": 30.065573770491802, "alnum_prop": 0.6134133042529989, "repo_name": "Cinntax/home-assistant", "id": "68ab771122e0ab0479f274191c7ebf6b445eb197", "size"...
import sys import warnings from collections import OrderedDict # import cv2 warnings.warn("deprecated\nnew:NaiveBayes", DeprecationWarning) class Classifier(object): """ note:implemets Classifier#match non implemets features detector """ def __init__(self): self.bf = cv2.BFMatch...
{ "content_hash": "866cb7c38401a32b73318f551c9c57c5", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 96, "avg_line_length": 34.339622641509436, "alnum_prop": 0.5010989010989011, "repo_name": "umyuu/FEZUnofficialRankingBot", "id": "a4f196b71b8a03cf8c5ce74069c999fdf8b85349", ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_firewall_ssh_setting except ImportError:...
{ "content_hash": "eec6c494cab6fbb34855b07c240c4dd9", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 133, "avg_line_length": 38.472361809045225, "alnum_prop": 0.6338819226750261, "repo_name": "thaim/ansible", "id": "e4b55f1c527a07252291df6f6faaa1bd4e881c02", "size": "8352...
"""Tests for experiment_utils.py.""" from common import experiment_utils def test_get_dispatcher_instance_name(): """Tests that get_dispatcher_instance_name returns the expected result.""" assert experiment_utils.get_dispatcher_instance_name( 'experiment-a') == 'd-experiment-a' def test_get_trial_i...
{ "content_hash": "90c12f3c76a8a9dcffc382f75a48ef5e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 78, "avg_line_length": 36.57142857142857, "alnum_prop": 0.6575520833333334, "repo_name": "google/fuzzbench", "id": "7f72081013d2147aa9df010ab9ed5d00725716b6", "size": "1343...
import numpy import scipy from . import pyamgcl_ext from scipy.sparse.linalg import LinearOperator class solver(pyamgcl_ext.solver): """ Iterative solver with preconditioning """ def __init__(self, P, prm={}): self.P = P pyamgcl_ext.solver.__init__(self, self.P, prm) def __repr__(s...
{ "content_hash": "d22a72e4aea66c5694257689efc799b4", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 99, "avg_line_length": 35.016129032258064, "alnum_prop": 0.6153846153846154, "repo_name": "ddemidov/amgcl", "id": "732cd2194fa0ba7dc0b485c323580ccac1c42b2a", "size": "2171"...
""" gdcdatamodel.test.test_update_case_cache ---------------------------------- Test functionality to update stale case caches """ import pytest from gdcdatamodel import models as md from migrations import update_case_cache @pytest.fixture def case_tree(g): """Create tree to test cache cache on""" case =...
{ "content_hash": "86a9b62b62330b615b73f031fa457058", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 75, "avg_line_length": 26.4375, "alnum_prop": 0.6170212765957447, "repo_name": "NCI-GDC/gdcdatamodel", "id": "0c681e3017bf946ad3d83fc6b0fef53f0639e0e5", "size": "1692", "...
import datetime from django.db import models from django.utils import timezone class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def was_published_recently(self): now = timezone.now() return now - datetime.tim...
{ "content_hash": "4ae60b3bcd0673fbda40ebc007f0ca2d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 71, "avg_line_length": 30.88888888888889, "alnum_prop": 0.7026378896882494, "repo_name": "chonpz28/django-tutorial", "id": "e255587c550a8530ee32a39b0410a406358a6292", "size...
__author__ = 'Joe Linn' from . import action from .action import abstractdocument from .response import * from .responseset import * import pylastica.exception.bulk class Bulk(object): DELIMITER = "\n" UDP_DEFAULT_HOST = 'localhost' UDP_DEFAULT_PORT = 9700 def __init__(self, client): ...
{ "content_hash": "52a3eb926c57d00964bb3242fecf3ee1", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 162, "avg_line_length": 31.447852760736197, "alnum_prop": 0.528969957081545, "repo_name": "jlinn/pylastica", "id": "a6ec8b9113e02abf9faee8f5bc1360c2d8b52c0a", "size": "102...
"""Platform for light integration.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAssistantType from .const import DOMAIN from .devolo_multi_level_switch im...
{ "content_hash": "6381cfcfb14c6dbd65e6f8e2c0b2e86a", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 110, "avg_line_length": 36.095238095238095, "alnum_prop": 0.6104881266490765, "repo_name": "turbokongen/home-assistant", "id": "2a9be33223fdbf201c906a4b378112ecf3745416", "...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^regular_view_function/(?P<number>\d{1,5})/$', views.regular_view_function, name='regular_view_function'), url(r'^view_class/(?P<number>\d{1,5})/$', views.ViewClass.as_view(), name='view_class'), url(r'^view_subclass/(?P<number>\d{...
{ "content_hash": "92b29526b5edef6a7f47143a082ec48d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 116, "avg_line_length": 49, "alnum_prop": 0.6571428571428571, "repo_name": "pasztorpisti/django-universal-view-decorator", "id": "ecad3dbb972b44ec3759b190d1267ac76762a90a", ...
from bs4 import BeautifulSoup from urllib.request import urlopen import re import pdb import time import json import datetime import random def try_request(url): num_attempts = 5 for i in range(num_attempts): try: html = urlopen(url) except: time.sleep(5) return ht...
{ "content_hash": "634da24549481b4b9f547659054d4dc7", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 29.054794520547944, "alnum_prop": 0.5502121640735502, "repo_name": "redshiftzero/guantanamo", "id": "906dc7ec1fc43beda52ab6834eeca2dddf3322cb", "size...
import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API pytan_loc = "~/gh/pytan" pytan_static_path = os.path.join(os.path.expanduser(pytan_loc)...
{ "content_hash": "f711633ff8b6a5f8021228422591f795", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 90, "avg_line_length": 33.2, "alnum_prop": 0.7202141900937081, "repo_name": "tanium/pytan", "id": "0e4b09f8982ff7cdafbf478588498fc41ebb4863", "size": "3031", "binary": fa...
""" Quality trimming for paired end reads: 1) remove read segment quality control indicator 2) discard reads with "N" % python quality-trim-se.py phred <input_fastq_file> basename phred is either 33 or 64 Output files are basename.1 and basename.2 """ import sys import os import screed #python quality-...
{ "content_hash": "4fde19d870af7a68fffaaad54e7033f2", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 109, "avg_line_length": 27.263157894736842, "alnum_prop": 0.5556628056628057, "repo_name": "jiarong/SSUsearch", "id": "802c27478d9b09429eaf2051147e71ed04eaa520", "size": "...
brown_cluster_dict_filename = "brown-cluster.model"
{ "content_hash": "8f0d106b6b7e7ded14793b782087f468", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 51, "avg_line_length": 51, "alnum_prop": 0.803921568627451, "repo_name": "iamhuy/rumour-veracity-verification", "id": "9fad04df94106e6abe96237b2028141203643337", "size": "51...
from rest_framework import serializers from builds.models import Build, Version from projects.models import Project class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = ( 'id', 'name', 'slug', 'description', 'language', 'r...
{ "content_hash": "0d5eee3423d49bf837ce7ded5a2ac4d1", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 77, "avg_line_length": 24.305555555555557, "alnum_prop": 0.6068571428571429, "repo_name": "sils1297/readthedocs.org", "id": "a590f70d9bca364663b577cc1f2fb13d70ab8b8c", "siz...
import numpy as np class PDControllerExplicitMultiDof(object): def __init__(self, pb): self._pb = pb def computePD(self, bodyUniqueId, jointIndices, desiredPositions, desiredVelocities, kps, kds, maxForces, timeStep): numJoints = len(jointIndices) #self._pb.getNumJoints(bodyUniqueId) ...
{ "content_hash": "766e637446e794ca4b31be4896fea887", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 99, "avg_line_length": 31.755102040816325, "alnum_prop": 0.6169665809768637, "repo_name": "MTASZTAKI/ApertusVR", "id": "20cd0a65e2f0489b487b45fae4fe16bcf6cabf9b", "size": "...
revision = '291f6bc486eb' down_revision = '71efde332866' branch_labels = None depends_on = None import alembic import sqlalchemy def upgrade(): external_channel = alembic.op.create_table("external_channel", sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True, autoincrement=True), sqlalchemy.Column("chan...
{ "content_hash": "2d5a5536877101c80c7c545a6d6e568d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 98, "avg_line_length": 38.53846153846154, "alnum_prop": 0.7544910179640718, "repo_name": "mrphlip/lrrbot", "id": "6be0db6ddd5bd4f25486fa609ad3e747a6881c0d", "size": "1002",...
""" WSGI config for kakeibo project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
{ "content_hash": "acdfc3f2aa194bbf5e1c9914cfd7211a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.5, "alnum_prop": 0.7704081632653061, "repo_name": "m16Takahiro/kakeibo", "id": "0e79404c2d45ac4af51434d63044a4f750847c17", "size": "392", "binar...
import dataportal # Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveSh...
{ "content_hash": "59c22bfa11a5014cae523480a0a627c9", "timestamp": "", "source": "github", "line_count": 537, "max_line_length": 417, "avg_line_length": 37.02420856610801, "alnum_prop": 0.6789558394527714, "repo_name": "NSLS-II-CSX/ipython_ophyd", "id": "e4b5f91c7122a2ed8ce241216d719a35fc56cb5e", "s...
import re import os import sys from django.conf import settings from django.core.management.base import BaseCommand, CommandError from fsm.fsmspec import deploy, deploy_all class Command(BaseCommand): """Command for convenient way to deploy FSM. Whenever an FSM specification changes (e.g. adding a new FSM ...
{ "content_hash": "2e4f838f49c7ce60c82c2ecdd93ace63", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 95, "avg_line_length": 37.86363636363637, "alnum_prop": 0.5882352941176471, "repo_name": "raccoongang/socraticqs2", "id": "e8e398c907acd3a1354610a9f68c1d2ba86bfb7e", "size"...
""" Infinite file-based caching. Caches forever when passed timeout of 0. """ import sys import django from django.core.cache.backends import filebased # NOTE: We aren't using smart_str here, because the underlying library will # perform a call to md5 that chokes on that type of input; we'll just not # fret the en...
{ "content_hash": "cf60b8e564c371030ad1914bf2e77639", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 75, "avg_line_length": 29.37142857142857, "alnum_prop": 0.6517509727626459, "repo_name": "DjangoAdminHackers/johnny-cache", "id": "4277ab5f32d0ff13f3bac93c384d490431913c5d", ...
import logging # Third-party from astropy.logger import StreamHandler __all__ = ['logger'] class JokerHandler(StreamHandler): def emit(self, record): record.origin = 'thejoker' super().emit(record) class JokerLogger(logging.getLoggerClass()): def _set_defaults(self): """Reset logger...
{ "content_hash": "df46083e3660675ace254e6d04f14dca", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 47, "avg_line_length": 22.625, "alnum_prop": 0.6546961325966851, "repo_name": "adrn/thejoker", "id": "c8a2bbad019ecaf1bc0dabb4cb23f7d46bcf3b44", "size": "743", "binary": ...
from msrest.serialization import Model class Application(Model): """Contains information about an application in a Batch account. :param id: A string that uniquely identifies the application within the account. :type id: str :param display_name: The display name for the application. :type di...
{ "content_hash": "23293738aa3e62565135e003212d9f70", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 108, "avg_line_length": 41.05555555555556, "alnum_prop": 0.6630581867388363, "repo_name": "rjschwei/azure-sdk-for-python", "id": "5d0e5f4a1d4a3f13c4ca34e305cf308a480c6a9e", ...
"""Automatic injection of bibliography entries for nipy module """ from ..entries import Doi # If defined, would determine from which to which version of the corresponding # module to care about min_version = None max_version = None def inject(injector): injector.add('nipy', None, Doi('10.1016/S1053-8119(09)722...
{ "content_hash": "56965d0445d49564a78ac3f0a213a083", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 99, "avg_line_length": 38.55, "alnum_prop": 0.6731517509727627, "repo_name": "mvdoc/duecredit", "id": "7bf6bb42a2d082f8c00dff3f6aaa209f8283210b", "size": "1162", "binary"...
from stockzie.strategy.BaseStrategy import BaseStrategy from stockzie.strategy.Ma520Strategy import Ma520Strategy
{ "content_hash": "8e2b44b81625c49059bb3944ad989535", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 57, "avg_line_length": 56.5, "alnum_prop": 0.9026548672566371, "repo_name": "amozie/amozie", "id": "8102d916c7417017126a5788f222b57c087c9f8d", "size": "113", "binary": fal...
from django.core.urlresolvers import reverse from django import http from horizon.workflows import views from mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks import tests from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizo...
{ "content_hash": "90d86200741dc730535dd5a59b2d8bb4", "timestamp": "", "source": "github", "line_count": 1437, "max_line_length": 79, "avg_line_length": 45.17327766179541, "alnum_prop": 0.5320423945527929, "repo_name": "flochaz/horizon", "id": "b7f5c930bc5eed9c1ed3bee71b43b89b44913ffa", "size": "655...
from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descript...
{ "content_hash": "bffe2574d78d340c6db3b2b5aca68901", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 871, "avg_line_length": 39.025735294117645, "alnum_prop": 0.7270843146490815, "repo_name": "google/resultstoreui", "id": "fee26eb97d1cd24ab324d9f8265eb5ed1b30f384", "size"...
import sys from common import * from ll import * from pracmln import logic class MCMCSampler(object): def __init__(self, mrf, mcsatParams, discardDuplicateWorlds = False, keepTopWorldCounts = False, computeHessian = False): self.mrf = mrf self.N = len(self.mrf.mln.formulas) self.wtsLast ...
{ "content_hash": "93075914c17cc2528ebbf7c2573eb3e6", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 152, "avg_line_length": 43.57478005865103, "alnum_prop": 0.5734571640083451, "repo_name": "danielnyga/pracmln", "id": "69c0dbe34bc881c2fb0a4a008cfc2c9d88dd66a3", "size": "...
inches_str = input('Enter rain fall = ') area_str = input('Enter area covered in acre = ') inches_float = float(inches_str) area_float = float(area_str) acre = 43560.0 cubit_f = 7.48051945 volume = (inches_float/12) * acre * area_float gallons = volume * cubit_f print('gallons = ', gallons)
{ "content_hash": "8491d69335039bdf08d180b8a4069cb0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 49, "avg_line_length": 22.692307692307693, "alnum_prop": 0.6847457627118644, "repo_name": "lliverjose/py_tpocu", "id": "eaa83cf62105075ad34ab043cebcdb087058cc0a", "size": "...
import importlib import data_pipeline.db.factory as db_factory def build(dbtype_name, argv, logger): db = db_factory.build(dbtype_name) module_name = "data_pipeline.initsync.{type}db".format(type=dbtype_name) module = importlib.import_module(module_name) class_name = "{upper}{rest}Db".format(upper=d...
{ "content_hash": "c87edab5f501a4c98e91826e2d1529e1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 33, "alnum_prop": 0.6545454545454545, "repo_name": "iagcl/data_pipeline", "id": "8e70dbc70b4e3002f0d42ceff2acab9f4890e7cc", "size": "1553", "binary...
"""tmuxp lives at <https://github.com/tmux-python/tmuxp>.""" import sys from setuptools import setup about = {} with open("tmuxp/__about__.py") as fp: exec(fp.read(), about) with open('requirements/base.txt') as f: install_reqs = [line for line in f.read().split('\n') if line] with open('requirements/test.t...
{ "content_hash": "724b57d9da15d024126ba0e3ea180369", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 67, "avg_line_length": 32.01587301587302, "alnum_prop": 0.5929598413485374, "repo_name": "tony/tmuxp", "id": "419f20e70646d2e1e1c4b01bc2776ea61fc7c560", "size": "2017", "...
from hypothesis.utils.conventions import not_set def accept(f): def test_can_derive_other_vars_from_one_calculated(self, T=not_set, R=not_set): return f(self=self, T=T, R=R) return test_can_derive_other_vars_from_one_calculated
{ "content_hash": "4d2df73ef6d9cf5bee72575901af2936", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 83, "avg_line_length": 40.833333333333336, "alnum_prop": 0.7183673469387755, "repo_name": "ryanvarley/ExoData", "id": "baee7e98af0932ce0dc02dcf8ee596a33b32d8f9", "size": "24...
from JumpScale import j from fabric.api import * import JumpScale.baselib.remote.cuisine import JumpScale.lib.docker import JumpScale.baselib.redis # codedirFromHost="" #to not map the code dir codedirFromHost="# /opt/code:/opt/code" redis=j.clients.redis.getRedisClient("localhost",9999) secret=redis.get("ms1:secr...
{ "content_hash": "1006852cf70746c389538f97cfee134c", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 135, "avg_line_length": 26.48989898989899, "alnum_prop": 0.6850333651096282, "repo_name": "Jumpscale/play", "id": "77680a6734d241431959babe451c0916f721e10f", "size": "5246...
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() exif_stats = Table('exif_stats', pre_meta, Column('id', INTEGER, primary_key=True, nullable=False), Column('post_id', INTEGER), ) exifstats = Table('exifstats', post_meta, Colu...
{ "content_hash": "db13b4924aa75d504c2c26c34212b71e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 28.575757575757574, "alnum_prop": 0.6956521739130435, "repo_name": "calcutec/flask-burtonblog", "id": "c3332c213ea4954b3388df63cae0ddf5efc2a320", "si...
"""The backups V3 API.""" from oslo_log import log as logging from webob import exc from cinder.api.contrib import backups as backups_v2 from cinder.api import microversions as mv from cinder.api.openstack import wsgi from cinder.backup import api as backup_api from cinder import exception from cinder.i18n import _ ...
{ "content_hash": "8fe9ab89e27834af7e1017b4295fb05e", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 78, "avg_line_length": 36.92391304347826, "alnum_prop": 0.6296732410950839, "repo_name": "eharney/cinder", "id": "a98a8a2e9450e668ee869408dee93155128085b1", "size": "4028",...
""" anydo.error """ class AnyDoAPIError(Exception): """An AnyDoAPI error occured.""" def __init__(self, code, msg): super(AnyDoAPIError, self).__init__(code, msg) self.code = code self.msg = msg def __str__(self): return "(%s): %s" % (self.code, self.msg)
{ "content_hash": "cec92367369d98e000b7d7e6a7595adc", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 27.454545454545453, "alnum_prop": 0.5463576158940397, "repo_name": "gvkalra/python-anydo", "id": "d5cac3c8c19ab136bf824795b15b3a9a655b715b", "size": ...
import os from setuptools import setup, find_packages VERSION = '0.1' if __name__ == '__main__': setup( name = 'django-moneta', version = VERSION, description = "Django app for Moneta eTerminal API.", long_description = open(os.path.join(os.path.dirname(__file__), 'README.md')).re...
{ "content_hash": "687ccb79b3b884de0f089e10c6b1be34", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 93, "avg_line_length": 32.513513513513516, "alnum_prop": 0.5286783042394015, "repo_name": "visionect/django-moneta", "id": "da3f9b8882e04e6610d940dc41975b4f9486218a", "size...
from django.conf.urls import patterns, include, url from django.contrib.auth.models import User, Group from rest_framework import viewsets, routers # from resume.views import hello # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() # We should create our API now ...
{ "content_hash": "ddafc5a3dd58b983369e25110f053a70", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 82, "avg_line_length": 36.285714285714285, "alnum_prop": 0.7034120734908137, "repo_name": "tzuhsienli/resume-site", "id": "9a2326ce96be8a5a83b78033ffc73dd79143b047", "size"...
from __future__ import absolute_import import re import logging from functools import partial from typing import Any, Callable, Text, Dict, Optional from django.http import HttpRequest, HttpResponse from zerver.lib.actions import check_send_message from zerver.lib.response import json_success from zerver.lib.request im...
{ "content_hash": "575573c4b73db4b6e8eb59d8dfb79bfb", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 101, "avg_line_length": 33.01590909090909, "alnum_prop": 0.6023955393405384, "repo_name": "vaidap/zulip", "id": "a8bbf6e79eea75e6619df0dea2a6c99a6d70d829", "size": "14527"...
from .tracks import TrackDensityMap
{ "content_hash": "2d86ee58046f4e751f9c2cbd33c3a84c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8611111111111112, "repo_name": "christianbrodbeck/nipype", "id": "911ccc2a436676c5c5186046edec78aef627928c", "size": "36", "bina...
from datetime import datetime import os import argparse # argument parser library from prettytable import PrettyTable from prettytable import ALL import pwd from shutil import copyfile import getpass Dir = os.path.dirname(os.path.realpath(__file__)) def exitLoop(ncycle): limit = 6 retu...
{ "content_hash": "fa0401e4bd2ee0e068f5b4d2bb59a4cb", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 200, "avg_line_length": 38.0989010989011, "alnum_prop": 0.591866166714739, "repo_name": "tuos/dasMonitorAOD2015", "id": "860aac5d695505f9dd02b5f37ff558460e9d0cd9", "size":...
from distutils.core import setup import clusterlib NAME = 'clusterlib' VERSION = clusterlib.__version__ AUTHOR = "Arnaud Joly" AUTHOR_EMAIL = "arnaud.v.joly@gmail.com" URL = 'http://clusterlib.github.io/clusterlib/' DESCRIPTION = 'Tools to manage jobs on cluster' with open('README.rst') as f: LONG_DESCRIPTION = f...
{ "content_hash": "b27425588ece18731fae3619f8ddd0d6", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 54, "avg_line_length": 32.292682926829265, "alnum_prop": 0.6306646525679759, "repo_name": "arjoly/clusterlib", "id": "1ac576ddfdbabb5c9ed1568e3ac6b0cdb9004429", "size": "13...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Poll' db.create_table('polls_poll', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=Tr...
{ "content_hash": "cc6735f4ae7cf7340a65cd723e22c8a5", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 99, "avg_line_length": 35.875, "alnum_prop": 0.5598141695702671, "repo_name": "byteweaver/django-polls", "id": "ef2824f8b0ada4671e46d840d9d3993e64a0ee3b", "size": "1746", ...
"""Cancel a dedicated host.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers @click.command() @click.argument('identifier') @environment.pa...
{ "content_hash": "5e9981208fd5ccc6e28818829a6769b9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 92, "avg_line_length": 27.41860465116279, "alnum_prop": 0.6564885496183206, "repo_name": "kyubifire/softlayer-python", "id": "537828de15e702dffc47fc161b9d630fa8b23bc6", "si...
from time import time from sys import exc_info from traceback import format_exception from asyncore import socket_map from asyncore import loop from pysnmp.carrier.base import AbstractTransportDispatcher from pysnmp.error import PySnmpError class AsyncoreDispatcher(AbstractTransportDispatcher): def __init__(self):...
{ "content_hash": "b318a79d3e0b264f4754369c212aae8c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 93, "avg_line_length": 35.70454545454545, "alnum_prop": 0.6594525779758116, "repo_name": "ww9rivers/pysnmp", "id": "ae6025499b0e5101c4a36c4166a794fe4800b701", "size": "1718...
""" settings.py Configuration for Flask app Important: Place your secret keys and other private settings in the private_settings.py module, which should be kept out of version control. """ from application import private_settings class Config(object): """Base class for a configuration object.""" GOOGLE_CLOUD_P...
{ "content_hash": "98c49422e10ea6edf3060adac5b58e43", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 79, "avg_line_length": 26, "alnum_prop": 0.7487179487179487, "repo_name": "orionmelt/snoopsnoo", "id": "dad4fddc0eab3094f1416b6d89b1ddb1486223b0", "size": "780", "binary"...
from __future__ import unicode_literals import copy from django import forms from django.conf import settings from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.http import HttpRequest from django.test import TestCase fro...
{ "content_hash": "daf599f58dbb16870729690a03db5501", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 87, "avg_line_length": 43.827510917030565, "alnum_prop": 0.6310964977830917, "repo_name": "thedrow/django-guardian", "id": "775421b8fdb0bbdf912f87fc1992bbd70c1a0307", "siz...
import sqlalchemy.types import uuid class UUID(sqlalchemy.types.TypeDecorator): impl = sqlalchemy.types.BINARY(16) python_type = uuid.UUID def load_dialect_impl(self, dialect): return dialect.type_descriptor(self.impl) def process_bind_param(self, value, dialect): if value is None: ...
{ "content_hash": "739d2190c002210d02d05d52b39f4279", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 58, "avg_line_length": 25.848484848484848, "alnum_prop": 0.6002344665885111, "repo_name": "imagi-ng/metadata-database", "id": "69a8fcd1cf52e610503c1e0449d1463f14680aa8", "s...
""" pygments.styles.borland ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the Borland IDEs. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Commen...
{ "content_hash": "2299d8daba40e07b39f7fda1a83e9ff0", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 30.76, "alnum_prop": 0.49934980494148246, "repo_name": "fortes/mashpress", "id": "4d1e14f4fc34af96bf5356384d8bb10c13483d5e", "size": "1562", "binar...
import unittest from frostbite_rcon_utils.encoder import encode_packet from frostbite_rcon_utils.decoder import decode_int32 from frostbite_rcon_utils.helpers import create_packet class TestEncoder(unittest.TestCase): def setUp(self): self.packet = create_packet(1, False, False, ['hej']) self.enco...
{ "content_hash": "e82e8edfdc891ff076a26c1875f40657", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 112, "avg_line_length": 50.28947368421053, "alnum_prop": 0.6624803767660911, "repo_name": "edvinerikson/frostbite-rcon-utils-python", "id": "f909a1a8cfdccb800edbcdd2b41ad0dd4...
from google.cloud import aiplatform_v1beta1 def sample_get_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1beta1.JobServiceClient() # Initialize request argument(s) request = aiplatform_v1beta1.GetModelDeploymentMonitoringJobRequest( name="name_value", ) # ...
{ "content_hash": "41489d05836edbc32c65de690c78524a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 95, "avg_line_length": 29.263157894736842, "alnum_prop": 0.7517985611510791, "repo_name": "googleapis/python-aiplatform", "id": "8e7f5451b6a150a28d5274c4fd2e640e806306fb", ...
import argparse import requests import json import os import sys def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( '--server', help="Discovery server address in the form IP:Port", default = '127.0.0.1:5998') parser.add_argument( '--load-balance', help="Load ...
{ "content_hash": "57cca95390a7ebcf8f5209443e04208e", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 91, "avg_line_length": 34.37837837837838, "alnum_prop": 0.6348270440251572, "repo_name": "numansiddique/contrail-controller", "id": "6db73f652f85cee116bf15a70f53a93997e86d27"...
from openstack.tests.unit import base from openstack.identity.v3 import role_domain_user_assignment IDENTIFIER = 'IDENTIFIER' EXAMPLE = { 'id': IDENTIFIER, 'links': {'self': 'http://example.com/user1'}, 'name': '2', 'domain_id': '3', 'user_id': '4' } class TestRoleDomainUserAssignment(base.TestC...
{ "content_hash": "81e7f7055f0e04043aed20bf507f7a32", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 33.625, "alnum_prop": 0.6394052044609665, "repo_name": "stackforge/python-openstacksdk", "id": "185c89ce8fcee4a65d4d2b79fd8955b3187eda07", "size": "1...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
{ "content_hash": "5c4636391fc294162a22b98f352a270d", "timestamp": "", "source": "github", "line_count": 960, "max_line_length": 79, "avg_line_length": 35.62291666666667, "alnum_prop": 0.5599742675010234, "repo_name": "vulcansteel/autorest", "id": "7506669d25f1beabc27468d689ddca90e7e3022b", "size": ...
"""Dune HD implementation of the media player.""" from __future__ import annotations from typing import Any, Final from pdunehd import DuneHDPlayer import voluptuous as vol from homeassistant.components.media_player import ( PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA, MediaPlayerEntity, ) from homeassistant.c...
{ "content_hash": "4bd18abbc3f9f1fdbdcee4c9ee988c85", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 87, "avg_line_length": 30.46153846153846, "alnum_prop": 0.6193181818181818, "repo_name": "home-assistant/home-assistant", "id": "437b5b66a991023297ab5d41a45cd93bfe24439f", ...
__author__ = 'nathan' from base import BaseSerializer class XMLSerializer(BaseSerializer): def serialize(self, model): pass
{ "content_hash": "f44b6b01502d2267bd45406d0a168ea6", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 36, "avg_line_length": 15.555555555555555, "alnum_prop": 0.6928571428571428, "repo_name": "zhoubangtao/dbsync", "id": "373cb58ff255a60b261b1820157ac8ba17d5d834", "size": "16...
"""Base for terminal user interfaces.""" # # (C) Pywikibot team, 2003-2015 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id$' import getpass import logging import math import re import sys from . import transliteration import pywikibot from pywikibot im...
{ "content_hash": "da050cb48f97d13d296a11e45bce538c", "timestamp": "", "source": "github", "line_count": 521, "max_line_length": 95, "avg_line_length": 36.69865642994242, "alnum_prop": 0.5809623430962343, "repo_name": "emijrp/pywikibot-core", "id": "17bdd4616927c288e3d484d2239de7b828d67fbb", "size":...
"""Replay Buffer (solution).""" import random from collections import namedtuple Experience = namedtuple("Experience", field_names=["state", "action", "reward", "next_state", "done"]) class ReplayBuffer: """Fixed-size circular buffer to store experience tuples.""" def __init__(self, size=1000): ...
{ "content_hash": "c5696428327b4d93c125cea7856a4f39", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 75, "avg_line_length": 33.982142857142854, "alnum_prop": 0.6053599579611141, "repo_name": "hetaodie/hetaodie.github.io", "id": "85f3572c45dbafea0be825e9ee2947ed94481f76", "...
"""Code to model the eccentric Kozai mechanism. Numerically integrate only the octupole term of the equations of motion of a hierarchical triple. This procedure averages over not only the individual orbits, but also the individual KL cycles as well. """ import json import time from math import acos, cos, pi, sin, s...
{ "content_hash": "0b0270b48c5ae44f473354516a8eb285", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 79, "avg_line_length": 28.463414634146343, "alnum_prop": 0.5166238217652099, "repo_name": "joe-antognini/kozai", "id": "1afe7d2719878b911a0d5b05acb73bbf487d0113", "size": ...
import numpy as np import cv2 def rotate(img): angle=90 center=(img.shape[0]/2,img.shape[1]/2) map_matr=np.empty((2,3),dtype=float) rm=cv2.getRotationMatrix2D(center=center,angle=angle,scale=1) dst = cv2.warpAffine(img,rm,(img.shape[0],img.shape[1])) return dst
{ "content_hash": "eb293f5dc7f71a318055ed7038e036ce", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 65, "avg_line_length": 26.181818181818183, "alnum_prop": 0.6770833333333334, "repo_name": "MoZZez/neurohack", "id": "fea12abafb26c3f152f92c4e3b65aadfb4bb0c4b", "size": "288...
""" Task where both the input and output sequence are plain text. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import tensorflow as tf from seq2seq.tasks.inference_task import InferenceTask...
{ "content_hash": "7a806906350343748d88ddcaee751913", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 77, "avg_line_length": 31.01492537313433, "alnum_prop": 0.6616939364773821, "repo_name": "kontact-chan/seq2seq", "id": "88e26a8f59d7c08addc52a183afdee727c2897c7", "size": "...
from django import forms from django.conf import settings from django.utils.timezone import now from django.utils.translation import ugettext as _ from daiquiri.core.utils import get_detail_fields from .models import Participant, Contribution class ParticipantForm(forms.ModelForm): class Meta: model = ...
{ "content_hash": "a9e820b101b361f6fe71c38b91c655dc", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 115, "avg_line_length": 37.11578947368421, "alnum_prop": 0.6318774815655134, "repo_name": "aipescience/django-daiquiri", "id": "86bea4e8a94fb18db05397b57ca877f0e57c2c22", "...
import subprocess import sys import os import shutil from camio_deps import * from camio_prepare_repo_deps import * ############################################################################################################################ #Use apt tools to manage packages def check_dpkg(): cmd = "dpkg --versio...
{ "content_hash": "6aa88fd80e6af589e310a80963c9fcec", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 128, "avg_line_length": 37.696969696969695, "alnum_prop": 0.5461644464859899, "repo_name": "mgrosvenor/camio2", "id": "91170ae58e09a8c4f73bf4f24254769571afa54e", "size": "...
"""DeDeDe configs.""" from __future__ import print_function BUILD_WORKON_PACKAGES = ( 'chromeos-ec', 'coreboot', 'depthcharge', 'libpayload', 'vboot_reference', ) BUILD_PACKAGES = BUILD_WORKON_PACKAGES + ( 'chromeos-bootimage', 'coreboot-private-files', 'intel-jslfsp', ) def get_com...
{ "content_hash": "f06f65d2933fa17f578a5d2db0096ed3", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 32.127272727272725, "alnum_prop": 0.6479909451046972, "repo_name": "endlessm/chromium-browser", "id": "abf5ca18d0cfe617731507bbbc211d9bc6a6275a", "si...
import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, Resourc...
{ "content_hash": "2c500839dfec23406c3864388357fa79", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 146, "avg_line_length": 43.45864661654135, "alnum_prop": 0.6330449826989619, "repo_name": "Azure/azure-sdk-for-python", "id": "7fc9848a31ef874cf03e9c10bfb65f106d0b97bd", "...
@given(u'I have a General Ledger File') def step_impl(context): assert False @then(u'the label \'Account:\' will be in the first row and the first column') def step_impl(context): assert False @then(u'the Account Title will be in the first row and second column of the ledger') def step_impl(context): as...
{ "content_hash": "221402829f3f245a80377d45ee64101e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 86, "avg_line_length": 23.666666666666668, "alnum_prop": 0.7144686299615877, "repo_name": "glenjarvis/Lemonade", "id": "35815d87009fa0657cfe847ffa6d9774bd7c0505", "size": "...
"""Gradients for operators defined in array_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings from tensorflow.python import pywrap_tensorflow from tensorflow.python.eager import context from tensorflow.python.framework import const...
{ "content_hash": "17aeae9cc402968423bffa5cb25ecb54", "timestamp": "", "source": "github", "line_count": 1141, "max_line_length": 113, "avg_line_length": 36.67134092900964, "alnum_prop": 0.666579035418957, "repo_name": "ppwwyyxx/tensorflow", "id": "048080230aaff4e3310883627ebbf8d28a6c8a34", "size": ...
from .. import Provider as ISBNProvider class Provider(ISBNProvider): pass
{ "content_hash": "b6d871e68a045042fae7c5a1f1eaf6a2", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 16.2, "alnum_prop": 0.7530864197530864, "repo_name": "deanishe/alfred-fakeum", "id": "3df1adc4a0a43075468f8e9e19fdaf6d8def37c1", "size": "81", "bina...
import unittest def my_test_suite(): test_loader = unittest.TestLoader() test_suite = test_loader.discover('.', pattern='*_test.py') return test_suite
{ "content_hash": "695445d4a8ce714918257bd167897842", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 63, "avg_line_length": 28, "alnum_prop": 0.6607142857142857, "repo_name": "cogu/autosar", "id": "e62a7f5cfc1d33cdab0d0bd0e3a0e7d62889536e", "size": "168", "binary": false,...
from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSlot as Slot from .lastfsn_ui import Ui_Frame from ....core2.instrument.instrument import Instrument from ...utils.window import WindowRequiresDevices class LastFSNIndicator(QtWidgets.QFrame, WindowRequiresDevices, Ui_Frame): def __init__(self, **kwargs): ...
{ "content_hash": "f8938495c0cb992d23ad30b6408e78e9", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 110, "avg_line_length": 43.29032258064516, "alnum_prop": 0.713859910581222, "repo_name": "awacha/cct", "id": "4b15df4a4870f28badfd4666714a42d5bf265874", "size": "2684", "...
import pytest from context import unit as un from context import units as uns from context import template as t from context import exceptions as e from context import set as s from context import factories as f # Fixtures, factories, and test data class FactoryTestType(un.CompoundUnit): options_defaults = uns...
{ "content_hash": "019226d61ce411200bc3514250b69297", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 76, "avg_line_length": 36.369791666666664, "alnum_prop": 0.663182013461263, "repo_name": "jthomale/pycallnumber", "id": "ae404416a4332a5bbda7d4d2c25a824c04c26598", "size":...
import math import re from pyfr.backends.base.kernels import ComputeMetaKernel from pyfr.solvers.base import BaseElements class BaseAdvectionElements(BaseElements): @property def _scratch_bufs(self): if 'flux' in self.antialias: return {'scal_fpts', 'scal_qpts', 'vect_qpts'} elif ...
{ "content_hash": "71a94d4f189ed423448911ae320eb911", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 78, "avg_line_length": 35.86153846153846, "alnum_prop": 0.5377520377520377, "repo_name": "tjcorona/PyFR", "id": "15b771f5c12547e5cd218b1a0c6faf26c4276c1a", "size": "4687",...
''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class HotelGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.check_audit = None self.hid = None self.need_room_type = None def getapiname(self): ...
{ "content_hash": "10516e1f74f22a7804358364cc61327c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 26.76923076923077, "alnum_prop": 0.6724137931034483, "repo_name": "CooperLuan/devops.notes", "id": "3ef7bbf5322605b8491ac928eaad9636b7f276e9", "size"...
"""Tests for number options.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import pytest from confpy.options import numopt def test_integer_coerce(): """Test if text values are converted to integer.""" ...
{ "content_hash": "e1de1c60b490ab1095652b7079196fa2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 68, "avg_line_length": 23.54, "alnum_prop": 0.62107051826678, "repo_name": "kevinconway/confpy", "id": "3e9cbc6f115fb06b31168dd54397b5e8c77c0446", "size": "1177", "binary...
"""Models for manifest validator.""" import importlib import json import pathlib from typing import Any, Dict, List import attr @attr.s class Error: """Error validating an integration.""" plugin = attr.ib(type=str) error = attr.ib(type=str) fixable = attr.ib(type=bool, default=False) def __str_...
{ "content_hash": "fd60139e34f7cb2c1d79d61b8aa87568", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 79, "avg_line_length": 28.306122448979593, "alnum_prop": 0.5724585436193222, "repo_name": "Teagan42/home-assistant", "id": "37d705c29cadc5cf5cf472e0d286acd6602444a4", "size...
""" WSGI config for code_for_good project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
{ "content_hash": "35645320dd48f6bacad0c1b741504335", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.1875, "alnum_prop": 0.7667493796526055, "repo_name": "Spferical/cure-alzheimers-fund-tracker", "id": "b2430555ee7a7ecd45613600362f290fdee38436", "...
""" Sample application that demonstrates how to use the App Engine Memcache API. For more information, see README.md. """ # [START all] import cgi import cStringIO import logging import urllib from google.appengine.api import memcache from google.appengine.api import users from google.appengine.ext import ndb impo...
{ "content_hash": "1d079b1e44d12d080d9f2515f7525d67", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 34.605839416058394, "alnum_prop": 0.5916473317865429, "repo_name": "JavaRabbit/CS496_capstone", "id": "ad087b2ac725dde7e05b4383b514d1bef0fac0f0", "s...
import os from setuptools import setup, find_packages def files(package, paths): skip = len(package)+1 for path in paths: for dirpath, dirnames, filenames in os.walk(os.path.join(package, path)): for filename in filenames: yield os.path.join(dirpath, filename)[skip:] setup...
{ "content_hash": "ef80839388af39b59423df6d329d5f66", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 84, "avg_line_length": 39.03125, "alnum_prop": 0.6020816653322658, "repo_name": "misli/fedora-software", "id": "c6684d4fd32e2c9b6e8f99d7424ff368d27b0734", "size": "1294", ...
"""Tests for generate_listeners.""" import os import generate_listeners if __name__ == "__main__": srcdir = os.path.join(os.getenv("TEST_SRCDIR"), 'envoy_api_canonical') generate_listeners.GenerateListeners( os.path.join(srcdir, "examples/service_envoy/listeners.pb"), "/dev/stdout", "/dev/stdout", it...
{ "content_hash": "3836bdb84c04f773b4192def7ba5066c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 96, "avg_line_length": 36.45454545454545, "alnum_prop": 0.6957605985037406, "repo_name": "eklitzke/envoy", "id": "f98fc438eab0f68592fe5c91fc547fc31bf28f07", "size": "401", ...
from distutils2.core import setup setup(name='MonthDelta', version='1.0b1', description='date computations with months', long_description=open('README.rst').read(), author='Jess Austin', author_email='jess.austin@gmail.com', url='http://pypi.python.org/pypi/MonthDelta', licens...
{ "content_hash": "3cae9311110791e9b6848562225ca48f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 65, "avg_line_length": 40.833333333333336, "alnum_prop": 0.5904761904761905, "repo_name": "jessaustin/monthdelta", "id": "7186be7a397afa186793d4b57820da8258c31f00", "size":...
from ExtraModules import EasyCRNMaker as maker def execute(input1,input2): crn = maker() slowest = 1 slower = 2 slow = 3 medium = 4 fast = 5 faster = 6 fastest = 7 crn.addReaction('c + 2y -> c + y',fast) crn.addReaction('c -> ',medium) crn.addReaction('p -> a',slowest) crn.addReaction('a + x -> b + a + x...
{ "content_hash": "e04f41e3792d3d5c92c89786503c71d3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 61, "avg_line_length": 24.944444444444443, "alnum_prop": 0.6525612472160356, "repo_name": "aayushkapadia/chemical_reaction_simulator", "id": "cab4fad34fbcfcbcdb551ecebdc83edc...
from pysqes.task import SQSTask from tests.stubs import SQSConnStub conn = SQSConnStub() task = SQSTask(conn) @task.task def add(a, b): return a + b
{ "content_hash": "7d094ce5e82ffd9d8888d4ff95185f1b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 35, "avg_line_length": 13.166666666666666, "alnum_prop": 0.7088607594936709, "repo_name": "sauramirez/pysqes", "id": "3b833d56d4cffe9cd1387d27214c6dd736997a2c", "size": "15...
import factory import random from factory import django, fuzzy from django.contrib.gis.geos import fromstr, Point, MultiPoint, GeometryCollection from rynda.message.models import Category class FuzzyPoint(fuzzy.BaseFuzzyAttribute): """ Generate fuzzy geojango point """ def point_gen(self): lat = ran...
{ "content_hash": "195c07de9a51fddc56da2bb92a201217", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 82, "avg_line_length": 26.45, "alnum_prop": 0.6739130434782609, "repo_name": "sarutobi/flowofkindness", "id": "685df749396b6ede4c2fc1398ac320640885201e", "size": "1075", ...
import asyncio import logging import uvloop from aiofcm import FCM, Message def setup_logger(log_level): log_level = getattr(logging, log_level) logging.basicConfig( format='[%(asctime)s] %(levelname)8s %(module)6s:%(lineno)03d %(message)s', level=log_level ) if __name__ == '__main__':...
{ "content_hash": "fde0e02af10dc0191ec66e4b93a610eb", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 83, "avg_line_length": 23.942307692307693, "alnum_prop": 0.5831325301204819, "repo_name": "Fatal1ty/aiofcm", "id": "2649d4c3a6472b30d1cb804d517b8d2f7de578e6", "size": "1245...
""" Name: 'Sunflow Exporter 1.4.18 (.sc)...' Blender: 2.45 Group: 'Export' Tip: 'Export to a Sunflow Scene File' Version : 1.4.18 (January 2008) Author : R Lindsay (hayfever) / Christopher Kulla / MADCello / olivS / Eugene Reilly / Heavily Tessellated / Humfred Description ...
{ "content_hash": "8307757775e655c6c0c42c782d7600f8", "timestamp": "", "source": "github", "line_count": 2416, "max_line_length": 467, "avg_line_length": 47.53973509933775, "alnum_prop": 0.5141655638364561, "repo_name": "k-matsuzaki/sunflow", "id": "18d957a19fc584baaf08f67f9294c8b7923f2d1c", "size":...
if __name__ == "__main__": import logSetup import logging logSetup.initLogging() # logSetup.initLogging(logging.WARNING) # Shut up fucking annoying psycopg2 vomit every exec. import warnings from sqlalchemy import exc as sa_exc warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2') warning...
{ "content_hash": "a7ddac3cc3fc8f2d88dee00dcd785249", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 85, "avg_line_length": 24.03723404255319, "alnum_prop": 0.6988271741535738, "repo_name": "fake-name/ReadableWebProxy", "id": "1c7be9626a75a5ce2a34df52a968fe03a9e0d479", "s...
import base64 from django.contrib.auth import authenticate from .utils import Choices class SessionAuthenticator(object): @classmethod def authenticate(cls, request): user = request.user return user class HTTPBasicAuthenticator(object): @classmethod def authenticate(cls, request): ...
{ "content_hash": "22220635490175b9b1e0acc10fbd8caf", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 30.492537313432837, "alnum_prop": 0.6397454723445913, "repo_name": "pavlov99/jsonapi", "id": "394a44659a2653cd7c71d4d824d58e427d5d5b92", "size": "204...