text
stringlengths
4
1.02M
meta
dict
import logging import ftplib import os import re from flexget import plugin from flexget.event import event from flexget.entry import Entry from flexget.config_schema import one_or_more log = logging.getLogger('ftp_list') class InputFtpList(object): """ Generate entries from a ftp listing Configuration...
{ "content_hash": "c7f7a6f27d8fe356b61fde856f6d4448", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 117, "avg_line_length": 36.58536585365854, "alnum_prop": 0.49746666666666667, "repo_name": "patsissons/Flexget", "id": "57e5f8d8160b6c591da0ae630d7dfe86afb72667", "size": ...
import settings class Mysql: def __init__(self,host,port): self.host=host self.port=port print('connecting..') @classmethod def from_conf(cls): return cls(settings.HOST,settings.PORT) def select(self): print(self) print('select function') conn=Mysql('192.1...
{ "content_hash": "8d15e7a47688ae125ea76c93d103d8a5", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 47, "avg_line_length": 25.5, "alnum_prop": 0.6162464985994398, "repo_name": "5StevenWu/Coursepy", "id": "dd29841c35cd533932f6fb193ad8dcead2827c19", "size": "399", "binary...
import sys sys.path.append('hooks')
{ "content_hash": "17c0f1988adc16023b74ac61e8729656", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 24, "avg_line_length": 18, "alnum_prop": 0.75, "repo_name": "CanonicalBootStack/charm-hacluster", "id": "b7fe4e1b7df4100835744a17913e88b273f9fcc2", "size": "611", "binary"...
"""empty message Revision ID: 0026 add expires, send_starts_at Revises: 0025 add email and email types Create Date: 2019-07-16 00:30:24.998868 """ # revision identifiers, used by Alembic. revision = '0026 add expires, send_starts_at' down_revision = '0025 add email and email types' from alembic import op import sql...
{ "content_hash": "8ae608b3a9a4f226d77bc1cd9cf22b32", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 86, "avg_line_length": 29.5, "alnum_prop": 0.6803874092009685, "repo_name": "NewAcropolis/api", "id": "86f00d0c5d615ddadc59edd3964fa6afd056d21a", "size": "826", "binary":...
from __future__ import print_function, division from sympy.concrete.expr_with_limits import AddWithLimits from sympy.core.add import Add from sympy.core.basic import Basic, C from sympy.core.compatibility import is_sequence, xrange from sympy.core.containers import Tuple from sympy.core.expr import Expr from sympy.cor...
{ "content_hash": "f074b43420b79718eb6aa7f8ba5cd8a8", "timestamp": "", "source": "github", "line_count": 1341, "max_line_length": 95, "avg_line_length": 37.882923191648025, "alnum_prop": 0.5517214228066377, "repo_name": "ojengwa/sympy", "id": "951e1b16129e58899b3348235d053889b30bf7ae", "size": "5080...
from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group, User def add_moderator_group(apps, schema_editor): g = Group.objects.create(name="moderators") g.save() for user in User.objects.all(): # add any existing admin users # t...
{ "content_hash": "359f0a72f90d610fcd34dfd9a9bdbebf", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 28.428571428571427, "alnum_prop": 0.6917922948073701, "repo_name": "DemocracyClub/EveryElection", "id": "a96c4562d6a092303b8c5bed8ca5b6e46d686109", "...
r''' Full setup, used to distribute the debugger backend to PyPi. Note that this is mostly so that users can do: pip install pydevd in a machine for doing remote-debugging, as a local installation with the IDE should have everything already distributed. Reference on wheels: https://hynek.me/articles/sharing-your-la...
{ "content_hash": "7adc36e8aa5b3a6c716233c3647aab74", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 160, "avg_line_length": 29.125, "alnum_prop": 0.6685524775653531, "repo_name": "ThiagoGarciaAlves/intellij-community", "id": "e779033a7d89184b6d60dfb4c7392e23dcd62b5f", "s...
import logging l = logging.getLogger("claripy.frontends.light_frontend") from ..frontend import Frontend class LightFrontend(Frontend): def __init__(self, solver_backend): Frontend.__init__(self, solver_backend) self.constraints = [ ] self.variables = set() self._finalized = False # # Storable support # ...
{ "content_hash": "071e75b7ae51e1e764044f0409e98aee", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 83, "avg_line_length": 26.58125, "alnum_prop": 0.700446743475194, "repo_name": "avain/claripy", "id": "40d39c28b1cabff4f4f97c652f9d40cd6dbcbb52", "size": "4276", "binary...
import inspect import functools from itertools import izip from rc.redis_clients import RedisClient from rc.redis_cluster import RedisCluster from rc.serializer import JSONSerializer from rc.utils import generate_key_for_cached_func from rc.promise import Promise #: Running mode for cache NORMAL_MODE = 0 BATCH_MODE ...
{ "content_hash": "9a11a33d74376916930f9c4e972461a9", "timestamp": "", "source": "github", "line_count": 456, "max_line_length": 79, "avg_line_length": 38.675438596491226, "alnum_prop": 0.5804604218643683, "repo_name": "fengsp/rc", "id": "f95715ca2208485ae08e116f5b8de875eccd0e5f", "size": "17660", ...
from __future__ import absolute_import, division, unicode_literals, print_function """ This file contains utilities to generate test repositories. """ import datetime import io import os import threading import time import six import tempfile import textwrap import sys import shutil import subprocess from os.path im...
{ "content_hash": "1ed3b2d94e845a37c2766b9e95f2c336", "timestamp": "", "source": "github", "line_count": 739, "max_line_length": 96, "avg_line_length": 30.039242219215154, "alnum_prop": 0.5778638677417902, "repo_name": "qwhelan/asv", "id": "d52c099ba0dd62b4411cd839b31b68650e998f3a", "size": "22288",...
import reportengine import sys from django.core.management.base import BaseCommand, CommandError from optparse import make_option from reportengine.outputformats import CSVOutputFormat, XMLOutputFormat from urlparse import parse_qsl ## ASSUMPTIONS: We're running this from the command line, so we can ignore ## - AdminO...
{ "content_hash": "64c5cc5a00eda2c5bb33c2395541d50f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 100, "avg_line_length": 33.66101694915254, "alnum_prop": 0.5453172205438066, "repo_name": "jrutila/django-reportengine", "id": "beba979d471e6721b9a4351efe58f1406fa7c48c", ...
from pwn import * context(arch='amd64', os='linux', terminal=['tmux', 'neww']) env = {} if args['GDB']: io = gdb.debug( './HeapsOfPrint-amd64-2.23-0ubuntu9', env=env, gdbscript='''\ b *0x5555555548a8 ignore 1 10 b *0x555555554984 ignore 2 10 c ''...
{ "content_hash": "8927f7c1300957889737829f346f70b7", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 133, "avg_line_length": 40.33136094674556, "alnum_prop": 0.6467136150234741, "repo_name": "integeruser/on-pwning", "id": "53784e96244dd780edd9931564812e8d9949b68c", "size"...
""" Question: Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0]. Note: You must do this in-place...
{ "content_hash": "3fa87657d823a1addc1a220981d30967", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 137, "avg_line_length": 31.76, "alnum_prop": 0.5831234256926953, "repo_name": "mvj3/leetcode", "id": "072ffab7952ab060435d2351802fd88b1342db66", "size": "1588", "binary":...
import sys import tensorflow as tf from model import ModelW2T from tfx.bricks import embedding, dense_to_one_hot, linear, conv2d, dropout, reduce_max, batch_norm_lin, conv2d_bn, \ pow_1, max_pool class Model(ModelW2T): def __init__(self, data, FLAGS): super(Model, self).__init__(data, FLAGS) ...
{ "content_hash": "546e1700a28a4b8586b83a013acb52d8", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 126, "avg_line_length": 45.14598540145985, "alnum_prop": 0.5154405820533549, "repo_name": "jurcicek/ndm", "id": "5be6691f4ed4115dc34b5c04f7ba434a40f5491b", "size": "6208",...
""" mailthon.response ~~~~~~~~~~~~~~~~~ Response objects encapsulate responses returned by SMTP servers. :copyright: (c) 2015 by Eeo Jun :license: MIT, see LICENSE for details. """ from collections import namedtuple _ResponseBase = namedtuple('Response', ['status_code', 'reason']) class R...
{ "content_hash": "94cb522044fa61b5816c4ca309c6c91f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 65, "avg_line_length": 24.70967741935484, "alnum_prop": 0.6207571801566579, "repo_name": "eugene-eeo/mailthon", "id": "d1b57035f366346abe36787625af83584aa496b6", "size": "1...
"""Command for creating target instances.""" from googlecloudsdk.api_lib.compute import base_classes from googlecloudsdk.calliope import exceptions as calliope_exceptions from googlecloudsdk.command_lib.compute import flags as compute_flags from googlecloudsdk.command_lib.compute.instances import (flags as ...
{ "content_hash": "7827d5302613fbdd1b541e76cd8a41ac", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 86, "avg_line_length": 35.075, "alnum_prop": 0.688168210976479, "repo_name": "Sorsly/subtle", "id": "8260fa336d41219c832956ac3a74624e9d0baae8", "size": "3401", "binary": ...
import os.path __all__ = [ "BUILD_SCRIPT_IMPL_PATH", "BUILD_SCRIPT_PATH", "BUILD_SWIFT_PATH", "MODULE_PATH", "MULTIROOT_DATA_FILE_PATH", "PROJECT_PATH", "RESOURCES_PATH", "SWIFT_BUILD_ROOT", "SWIFT_REPO_NAME", "SWIFT_SOURCE_ROOT", "UTILS_PATH", ] # -----------------------...
{ "content_hash": "5b161f4e40d908521b51af0d9480d97c", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 88, "avg_line_length": 28.380208333333332, "alnum_prop": 0.6314920168838319, "repo_name": "atrick/swift", "id": "9de8475b262ffa6f84d47f32cc7a257641c88ce9", "size": "5794",...
"""Test sensor of AccuWeather integration.""" from datetime import timedelta import json from homeassistant.components.accuweather.const import ( ATTRIBUTION, CONCENTRATION_PARTS_PER_CUBIC_METER, DOMAIN, LENGTH_MILIMETERS, ) from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homea...
{ "content_hash": "1f9f04c99065054fdc4bd7788a5283be", "timestamp": "", "source": "github", "line_count": 598, "max_line_length": 89, "avg_line_length": 36.32943143812709, "alnum_prop": 0.6876409666283084, "repo_name": "tchellomello/home-assistant", "id": "b94d17066c8d776b15c55fea649a0a0bd16aea4f", "...
import argparse as _argparse import base64 as _base64 import binascii as _binascii import code as _code import codecs as _codecs import collections as _collections import fnmatch as _fnmatch import getpass as _getpass import inspect as _inspect import json as _json import os as _os import pprint as _pprint import pkgut...
{ "content_hash": "01da64500ad8556ee9813daf635785dc", "timestamp": "", "source": "github", "line_count": 2102, "max_line_length": 134, "avg_line_length": 27.842055185537582, "alnum_prop": 0.5872462579454583, "repo_name": "ssorj/quiver", "id": "b72327bf0421fdc9d42b61876431b5590f816889", "size": "5931...
import unittest import threading import gc import IECore import Gaffer import GafferTest import GafferScene import GafferSceneTest class GroupTest( GafferSceneTest.SceneTestCase ) : def testTwoLevels( self ) : sphere = IECore.SpherePrimitive() input = GafferSceneTest.CompoundObjectSource() input["in"].setVa...
{ "content_hash": "20d9d972912b10ad912148a119159b5d", "timestamp": "", "source": "github", "line_count": 734, "max_line_length": 147, "avg_line_length": 33.31880108991825, "alnum_prop": 0.6338321884200196, "repo_name": "goddardl/gaffer", "id": "014604dbf4ae5c83682e62d8a5c5f605bfa5eae9", "size": "263...
"""Test share/rpcauth/rpcauth.py """ import base64 import configparser import hmac import importlib import os import sys import unittest class TestRPCAuth(unittest.TestCase): def setUp(self): config = configparser.ConfigParser() config_path = os.path.abspath( os.path.join(os.sep, os.pat...
{ "content_hash": "1a890ee37dc672c631a6a6e2ecbb2140", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 34.86363636363637, "alnum_prop": 0.6564537157757496, "repo_name": "machinecoin-project/machinecoin", "id": "78f258532f2e8a32dc60efff0c8d01530c3caf3e", ...
""" Publish all Bokeh release notes on to a single page. This directive collect all the release notes files in the ``docs/releases`` subdirectory, and includes them in *reverse version order*. Typical usage: .. code-block:: rest :tocdepth: 1 .. toctree:: .. bokeh-releases:: To avoid warnings about orp...
{ "content_hash": "f0695bebc83a63e3d10c4e68123b60d3", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 92, "avg_line_length": 29.15929203539823, "alnum_prop": 0.404855842185129, "repo_name": "ericmjl/bokeh", "id": "8094e7e6a38871e674648c8ff47a524e48d9e7cc", "size": "3628", ...
from flask import g, jsonify from flask_httpauth import HTTPBasicAuth from ..models import User, AnonymousUser from . import api from .errors import unauthorized, forbidden auth = HTTPBasicAuth() @auth.verify_password def verify_password(email, password): if email == '': g.current_user = AnonymousUser() ...
{ "content_hash": "4e47cfc856841223f092af367305cd63", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 64, "avg_line_length": 29.24074074074074, "alnum_prop": 0.6649778340721976, "repo_name": "Tuklab/tuklab101", "id": "11071f3736deee12b9b30359bc74873c6de7a6ee", "size": "1579...
""" Update WebFaction DNS entry Uses the WebFaction DNS API http://docs.webfaction.com/xmlrpc-api/apiref.html#dns """ import getopt import sys import os import subprocess import traceback import logging import logging.handlers import ConfigParser import xmlrpclib import urllib2 import re __app__ = os.path.basename(...
{ "content_hash": "da326d77ae5c695b1f2b80252cb4aaf5", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 93, "avg_line_length": 31.58102766798419, "alnum_prop": 0.5812265331664581, "repo_name": "gesquive/webfaction-ddns", "id": "a555c1752d193c6bee812a2c425947b73fbbe060", "siz...
import logging import os from cliff import command as cmd from fuelclient import objects from octane import magic_consts from octane.util import env as env_util from octane.util import ssh LOG = logging.getLogger(__name__) def cleanup_environment(env_id): env = objects.Environment(env_id) controller = env...
{ "content_hash": "f15b591d189b506c9a0d73394c2362d0", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 76, "avg_line_length": 31.849056603773583, "alnum_prop": 0.620260663507109, "repo_name": "Mirantis/octane", "id": "f8bd2d11bbbf6c24d1d68a0737df3cc7f504b204", "size": "2234"...
""" Implementacion of Upward and Downward pass. With combinatorics cache used. """ from numpy import * from pyFMM.Kernels.translations import * from pyFMM.DataStructure.quadtree import * import time def upwardStep1(quadtree, p, k): ''' Upward pass Step 1: Generation of the multipole expansion coefficient...
{ "content_hash": "13c8bad333ae998127438676f31de5d8", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 88, "avg_line_length": 37.270440251572325, "alnum_prop": 0.5749240634492069, "repo_name": "barbagroup/pyfmm", "id": "15734b26fe6592141862d44e1364536fa6631f88", "size": "11...
import logging import sys import os from os.path import join as joinpath from . import globals class Logger(): def __init__(self, job=False): self._log = logging.getLogger('fbstats') if job: logfh = logging.FileHandler(joinpath(globals.data_dir, globals.log_filename)) logfh.setFormatter(logging.Formatte...
{ "content_hash": "adf5f6a9c5bce36799eabd13f451d4af", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 19.6046511627907, "alnum_prop": 0.6915776986951364, "repo_name": "amol9/fbstats", "id": "a83d7520a2acd2d33f4ee881b88ccaaf743482e7", "size": "843", ...
import pymysql as sql import pandas as pd import datetime from bokeh.embed import components from bokeh.models import ColumnDataSource from bokeh.models.formatters import DatetimeTickFormatter from bokeh.plotting import figure from flask import current_app from app import db # setting date format to be used on the x a...
{ "content_hash": "f2e41a27d814a41dcef5419ae7bea460", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 173, "avg_line_length": 42.397260273972606, "alnum_prop": 0.6792676359719978, "repo_name": "saltastro/salt-data-quality-site", "id": "36510289482513037066be3438d5e53fc0d4ff8...
class ServiceNotFoundException(Exception): pass class ServiceManagerInitializedException(Exception): pass
{ "content_hash": "f1455de3a8d61bd5b638b4bf988be196", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 52, "avg_line_length": 22.8, "alnum_prop": 0.8245614035087719, "repo_name": "drousis/pywebdata", "id": "08aa9c81a0f82726fd48b03527dc773c7123dc2a", "size": "114", "binary":...
import math class Solution: def bulbSwitch(self, n: int) -> int: return int(math.sqrt(n))
{ "content_hash": "df2517866f7b361c9b7df52e019c2ab0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 40, "avg_line_length": 25.25, "alnum_prop": 0.6435643564356436, "repo_name": "jiadaizhao/LeetCode", "id": "2ef6f7b07eb64cc6d5cff2088c0d51dc0a5f9752", "size": "101", "binar...
"""Commands for feedback thread and message operations.""" __author__ = 'Koji Ashida' from core.domain import feedback_jobs_continuous from core.domain import subscription_services from core.domain import user_services from core.platform import models (feedback_models,) = models.Registry.import_models([models.NAMES.f...
{ "content_hash": "9d7685c74a1dd5fa2f3e7d9605bbefa5", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 85, "avg_line_length": 36.392405063291136, "alnum_prop": 0.683304347826087, "repo_name": "won0089/oppia", "id": "e5394fc3815bce7d897b1bd526b2cd23699ed867", "size": "6373",...
from unittest import mock from neutron_lib import context as ctx from neutron_lib import rpc as n_rpc from oslo_config import cfg from oslo_serialization import jsonutils import six import unittest2 from gbpservice.nfp.lib import transport """ Common class used to create configuration mapping """ class Map(dict): ...
{ "content_hash": "95aa48537d67307c8cb91c12c8294f50", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 79, "avg_line_length": 29.896551724137932, "alnum_prop": 0.5497885428681276, "repo_name": "noironetworks/group-based-policy", "id": "e69df6b8d1be01b1a927d0a5d41b6bbffa3c03be...
import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.decomposition import NMF, non_negative_factorization from sklearn.decomposition import _nmf as nmf # For testing internals from scipy.sparse import csc_matrix import pytest from sklearn.utils._testing import assert_raise_message from...
{ "content_hash": "5576bd4710596de859258b1251aee62c", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 79, "avg_line_length": 38.78921568627451, "alnum_prop": 0.6166645604279877, "repo_name": "ndingwall/scikit-learn", "id": "ff6b4ed8b4245fcd7ff5ab2aa73893ac708a4510", "size"...
from pylearn2.models.mlp import MLP class Autoencoder(MLP): """ An MLP whose output domain is the same as its input domain. """ def get_target_source(self): return 'features'
{ "content_hash": "70c88d6c37f247c25cb1aa511ae9e9de", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 20.2, "alnum_prop": 0.6534653465346535, "repo_name": "xinmei9322/theano_exercises", "id": "f0be958d77c0f5f89557471c84e7514c47d336b7", "size": "202", ...
import smtpd import asyncore import os import email def parsemail(mail, savename): prefix = savename mails = [] names = [] def parsesingle(mail): if mail.is_multipart(): for m in mail.get_payload(): parsesingle(m) return name = mail.get_param("name...
{ "content_hash": "e7df0d09dbf8848eb534922f82ea8315", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 82, "avg_line_length": 30.961038961038962, "alnum_prop": 0.5239093959731543, "repo_name": "sintrb/SinMail", "id": "61db05d58f6ceef96bad6959cd3f14f8650f6482", "size": "2384"...
import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx...
{ "content_hash": "73e6582268f79492a99d8c0e3a8b7ef3", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 31.081967213114755, "alnum_prop": 0.6735232067510548, "repo_name": "sc68cal/neutron-classifier", "id": "ab238962a3309c111762f03bb8525364a4a0f866", "s...
"""Gradients for operators defined in math_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.client import pywrap_tf_session as c_api from tensorflow.python.eager import context from tensorflow.python.frame...
{ "content_hash": "efdd32e86529aee76b2009cd213deb88", "timestamp": "", "source": "github", "line_count": 2028, "max_line_length": 112, "avg_line_length": 34.69378698224852, "alnum_prop": 0.6611520914168763, "repo_name": "annarev/tensorflow", "id": "c5821ce8fcb052a46f58c93e07a7fdf3766ff214", "size": ...
from sahara.api import acl from sahara.service.api.v2 import cluster_templates as api from sahara.service import validation as v from sahara.service.validations import cluster_template_schema as ct_schema from sahara.service.validations import cluster_templates as v_ct import sahara.utils.api as u rest = u.RestV2('cl...
{ "content_hash": "f2e34a801b6951291751e18a3ecfd307", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 40.88135593220339, "alnum_prop": 0.7487562189054726, "repo_name": "shakamunyi/sahara", "id": "3db2b7e3de7f0659f0a2faa4d8114373f83d0fbb", "size": "299...
import math import re import requests try: import ephem except ImportError as ie: raise Exception(f'Cannot import module: {ie}') from datetime import datetime from functools import lru_cache from requests.exceptions import HTTPError from supybot import callbacks, ircutils import supybot.log as log from supyb...
{ "content_hash": "0a26f6bf3b536dd39fb5e491f66483e7", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 128, "avg_line_length": 30.376847290640395, "alnum_prop": 0.5339333495499878, "repo_name": "Alcheri/Plugins", "id": "8677f52a8297c6edf20f2291543cbad42a9bb933", "size": "14...
from functools import partial MINVERSION = '1.54.0' def exists(env): # we suppose the tool is always available return True def BjamSupported(context): text = 'Checking for ${BJAM_BIN} ...' instruction = '${BJAM_BIN} -v' context.Message(context.env.subst(text)) ret = context.TryAction(instruc...
{ "content_hash": "05a8b6cdab59c710b7432ff2582cb676", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 73, "avg_line_length": 25.923076923076923, "alnum_prop": 0.6019499788045782, "repo_name": "manuelnaranjo/scons-boost-config", "id": "a53bbc00d9466280f141556b4e520e941b6f6fad"...
from __future__ import absolute_import from google.cloud.language_v1 import LanguageServiceClient from google.cloud.language_v1 import enums from google.cloud.language_v1 import types __all__ = ("enums", "types", "LanguageServiceClient")
{ "content_hash": "71869f53138b6500b6499bf1c1d494f1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 34.285714285714285, "alnum_prop": 0.7833333333333333, "repo_name": "tswast/google-cloud-python", "id": "624bd11943917416fa514a75df951b2349004c19", "si...
from asposebarcode import Settings from com.aspose.barcode import BarCodeBuilder from com.aspose.barcode import Symbology class Creating2DBarcode: def __init__(self): dataDir = Settings.dataDir + 'WorkingWith2DBarcodes/Basic2DBarcodeFeatures/Creating2DBarcode' # Instantiate barco...
{ "content_hash": "91844ea6f1e20c89115d6f47696e0c5e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 101, "avg_line_length": 30.193548387096776, "alnum_prop": 0.6655982905982906, "repo_name": "aspose-barcode/Aspose.BarCode-for-Java", "id": "3bced2eb37762f353a3716521306f0c0b8...
import os import pandas as pd import numpy as np import xlrd import xlwt import matplotlib.pyplot as plt from pandas.tools.plotting import scatter_matrix ########################################################################## ## Module Constants ####################################################################...
{ "content_hash": "09f2f4e1cee4939d9a38ee7be695afc1", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 86, "avg_line_length": 28.93877551020408, "alnum_prop": 0.5853314527503526, "repo_name": "georgetown-analytics/bike-psychics", "id": "990ca06763c6e45cde4a68b97e26bf14a2b7417a...
from extreme_deconvolution import extreme_deconvolution
{ "content_hash": "897f6bfcb40d345c98e61f18bd59db7c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 55, "avg_line_length": 55, "alnum_prop": 0.9090909090909091, "repo_name": "gaow/extreme-deconvolution", "id": "c168249dac2bfe1f169d1dd8b91bf61b2923441b", "size": "55", "bi...
import markupsafe from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from django.db import models from framework.auth import Auth from framework.exceptions import HTTPError from osf.models.external import ExternalProvider from osf.models.files...
{ "content_hash": "e9560f0376405ec04e3d8170724a84ea", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 306, "avg_line_length": 37.92913385826772, "alnum_prop": 0.623417064563006, "repo_name": "chrisseto/osf.io", "id": "63797abe77ebb85c7652cd2d441c9acd3ab7a7ed", "size": "965...
""" ================================================================================ Modifications: Run just agent_100k Save reward / step Run for 500 Epoch Save file result file directly to ================================================================================ """ import os import sys from time import sleep...
{ "content_hash": "6d9f86e479beb540344b9adcd9935a24", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 80, "avg_line_length": 32.11594202898551, "alnum_prop": 0.5453519855595668, "repo_name": "village-people/flying-pig", "id": "39ba2075cdcf5afca989cc8a0260b57bd6b8704f", "si...
class Solution: # @param root, a tree node # @return a boolean def isValidBST(self, root): self.prev = None return self.is_valid_bst_aux(root) def is_valid_bst_aux(self, root): if root is None: return True else: if not self.is_valid_bst_aux(root.l...
{ "content_hash": "6070a7bfd0038a4057a9a4c95ee28f6c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 53, "avg_line_length": 30.4, "alnum_prop": 0.5098684210526315, "repo_name": "JiaminXuan/leetcode-python", "id": "795a90f9abed626d2eb5001d217af76b19740b9a", "size": "771", ...
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
{ "content_hash": "e174964cc832e3994831075fa18854c6", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 91, "avg_line_length": 26.096, "alnum_prop": 0.6882280809319435, "repo_name": "janusnic/dj-21v", "id": "79a345301fcd01d4f8c8e9e060adb91bc867e75e", "size": "3262", "binar...
from django.apps import AppConfig class PollConfig(AppConfig): name = 'polls'
{ "content_hash": "6f2c6f8e473f4827a58be6bdb18ec5ef", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 16.8, "alnum_prop": 0.7380952380952381, "repo_name": "achntrl/referendum", "id": "23320d00c8d32a52c8142287656bb4a6fe49133b", "size": "84", "binary":...
""" This is the main loop of the system. Will check for a change of ip address every 30 seconds and update if it has changed. """ from time import sleep from config import * from datetime import datetime from log import Log import sys, os if __name__ == '__main__': # Initialize log log = Log() log.write...
{ "content_hash": "6a1a07a950ff3f81a6b448f1a876d5b8", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 76, "avg_line_length": 26.205479452054796, "alnum_prop": 0.4986931521170936, "repo_name": "devalfrz/simple-dyndns", "id": "89e0bcbd8db21f5847cbc11c1cf13d7259400bf1", "size"...
"""Tests for stream module.""" from __future__ import absolute_import import unittest import set_sys_path # Update sys.path to locate mod_pywebsocket module. from mod_pywebsocket import common from mod_pywebsocket import stream class StreamTest(unittest.TestCase): """A unittest for stream module.""" def t...
{ "content_hash": "9c71ff68f7e9916ce1415608dfd4ada9", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 32.575, "alnum_prop": 0.5909439754412893, "repo_name": "GoogleChromeLabs/pywebsocket3", "id": "153899d20533eb4cf0a9816c8b3b2bc8c50548bf", "size": "28...
from oslo_log import log as logging from heat.common.i18n import _LE LOG = logging.getLogger(__name__) from zaqarclient.queues.v1 import client as zaqarclient from zaqarclient.transport import errors as zaqar_errors from heat.engine.clients import client_plugin CLIENT_NAME = 'zaqar' class ZaqarClientPlugin(clien...
{ "content_hash": "8bd5b18b0b1a289d16ed09d1a01ee555", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 27.5, "alnum_prop": 0.6325757575757576, "repo_name": "gonzolino/heat", "id": "2b5d99f1ee841d3fad56fc27ff15da0de365bfeb", "size": "1895", "binary": ...
import datetime import operator import typing from typing import Dict, Iterable, FrozenSet, Optional, Set, Tuple, Iterator from .definition import Definition from .entity import Entity, EntityData, EntitySet from .logic import SubpropertiesIterator, SuperpropertiesIterator from .logic.lineage import SubpropertiesHandl...
{ "content_hash": "ec1f4227e84218413983ae8b107ce9a9", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 106, "avg_line_length": 36.257884972170686, "alnum_prop": 0.6103975848129766, "repo_name": "althonos/pronto", "id": "1c9e3e84d1c9775c6943d383c498d793e54c50c3", "size": "19...
from lib.Request import Request from lib.Response import Response import json class RequestValidator(Request): """ This class will manage all the operation of a validation this is responsible for getting the response and sendting it for validation This will coordinate between request and response ...
{ "content_hash": "37906cf1c58e86a8e702058e9df30976", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 29.15, "alnum_prop": 0.5757575757575758, "repo_name": "ratanphayade/APIValidator", "id": "b9eb8f6339d2b3ec343070e1046da3e4aa59fc33", "size": "1749", ...
import collections import json def format_exception(e): """ Parameters ---------- e : exceptions.Exception Returns ------- str """ data = collections.OrderedDict() data['exception_type'] = type(e).__module__ + '.' + e.__class__.__name__ data['exception_message'] = e.mess...
{ "content_hash": "4c5d935ea2f0b7ef99fb037b84077d9c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 16.80952380952381, "alnum_prop": 0.5580736543909348, "repo_name": "dnguyen0304/clare", "id": "4b13bdf61ca4ef399b930e97ab20aefe0418485c", "size": "378...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/furniture/shared_furniture_toolchest_large.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "d5922582284df51dfb828ba29ca0ccd5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 90, "avg_line_length": 24.53846153846154, "alnum_prop": 0.7053291536050157, "repo_name": "anhstudios/swganh", "id": "5fe43f3e0c47160346935e7b8ba2772adf4108ef", "size": "464...
default_app_config = "fluentcms_suit.apps.DefaultConfig"
{ "content_hash": "dfa604f44f71305ceec0b1089e3fc066", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 56, "avg_line_length": 57, "alnum_prop": 0.8070175438596491, "repo_name": "bashu/fluentcms-suit", "id": "5a21e4c681bc74a2ff0dcab179e70f14baaaedb7", "size": "57", "binary":...
from __future__ import absolute_import from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from sentry.models import Rule from sentry.web.frontend.base import ProjectView class ProjectRuleRemoveView(ProjectView): required_scope...
{ "content_hash": "a58582cf02f88f2f235ad36dcc2e8c9b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 86, "avg_line_length": 29.703703703703702, "alnum_prop": 0.6970074812967582, "repo_name": "nicholasserra/sentry", "id": "a01d84ad6e783c3a54d554d96edc38d03343b75c", "size": ...
import json import re class IdleVideo(object): def __init__(self, title, episode, description, videoId, date, duration, timecodes): self.title = title self.episode = episode self.description = description self.videoId = videoId self.date = date self.duration = duration self.timecodes = t...
{ "content_hash": "eadde47eacab4dd31e014e398558aacc", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 138, "avg_line_length": 27.36231884057971, "alnum_prop": 0.6173199152542372, "repo_name": "karthikb351/thumbsdb", "id": "c5dfc41158cfaf45e3526d2219a4dbf188da86b9", "size":...
'''Hello to you! Illustrates format with {} in print. ''' person = input('Enter your name: ') greeting = 'Hello, {}!'.format(person) print(greeting)
{ "content_hash": "aeef001305dc1b943e8aa6ed865a74c0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 54, "avg_line_length": 25.166666666666668, "alnum_prop": 0.6622516556291391, "repo_name": "hwheeler01/comp150", "id": "eb6c309983884d0173c77bacaf286641ec100ce2", "size": "15...
from bottle import route, run, request, response, static_file import barrister # Our implementation of the 'Calculator' interface in the IDL class Calculator(object): # Parameters match the params in the functions in the IDL def add(self, a, b): return a+b def subtract(self, a, b): return...
{ "content_hash": "3ea6642d186d5729da040342b0b2fe56", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 61, "avg_line_length": 28.178571428571427, "alnum_prop": 0.7046894803548795, "repo_name": "coopernurse/barrister-js", "id": "87ae2af7b81317c56567cfe502973e7cc5f23d9f", "siz...
from amara.xpath import datatypes from amara.xslt.numbers import formatter ASCII_DIGITS = '0123456789' ASCII_LOWER = 'abcdefghijklmnopqrstuvwxyz' ASCII_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' class english_formatter(formatter): language = 'en' _roman_digits = _roman_upper, _roman_lower = [], [] for multipl...
{ "content_hash": "8781835296b86da7029cd044c3b50fe3", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 72, "avg_line_length": 39.2, "alnum_prop": 0.4905247813411079, "repo_name": "zepheira/amara", "id": "aceb8328ed63c098bca96679567a0daca33bb9f1", "size": "2845", "binary": ...
from quantum.openstack.common import uuidutils from quantum.plugins.nec.common import ofc_client from quantum.plugins.nec import ofc_driver_base class TremaDriverBase(ofc_driver_base.OFCDriverBase): """Common class for Trema (Sliceable Switch) Drivers""" networks_path = "/networks" network_path = "/networ...
{ "content_hash": "6907b2e1ab4aa50b05b0afd11917e7e2", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 79, "avg_line_length": 37.030434782608694, "alnum_prop": 0.58635669836797, "repo_name": "rossella/neutron", "id": "38c7e395008993ccb4bb458a9322235a18306773", "size": "9215...
import os from twitter.common.contextutil import temporary_file from pex.testing import run_simple_pex_test def test_pex_execute(): body = "print('Hello')" _, rc = run_simple_pex_test(body, coverage=True) assert rc == 0 def test_pex_raise(): body = "raise Exception('This will improve coverage.')" run_si...
{ "content_hash": "86c45f86ce68fbdb21582dad532159d8", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 22.862068965517242, "alnum_prop": 0.6576168929110106, "repo_name": "jamesbroadhead/pex", "id": "4ec03abf3228a1963723099d49ee147570cb3676", "size": "7...
from __future__ import print_function import logging import shutil from unittest import TestCase import keras.backend as K from bigdl.dllib.nncontext import * from bigdl.dllib.feature.image import ImageSet np.random.seed(1337) # for reproducibility class ZooTestCase(TestCase): logging.basicConfig(level=loggi...
{ "content_hash": "cf445a8a5638fe0e49e17e31d2828b75", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 100, "avg_line_length": 41.71980676328502, "alnum_prop": 0.6008568781843446, "repo_name": "yangw1234/BigDL", "id": "8a33f0bf44cb2353660383b6dea678885a9b308d", "size": "922...
import tensorflow as tf import numpy as np from functools import reduce from PIL import Image ## ----------- ----------- ----------- ----------- ----------- ----------- VGG19_LAYERS = ( 'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2', 'conv3_1', ...
{ "content_hash": "c5f70d3fe28e6561cb8965c79f61431b", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 110, "avg_line_length": 38.68787878787879, "alnum_prop": 0.5514999608365316, "repo_name": "thisray/MS_Course", "id": "46007720ae96ac36577d6eca61d4ed67bb887ade", "size": "1...
from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ('contentcuration', '0058_auto_20170223_1636'), ] operations = [ migrations.CreateModel( name='ChannelResourceSize', ...
{ "content_hash": "0dc7a1201aa7cc73c3bd860971dfc335", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 336, "avg_line_length": 46.96875, "alnum_prop": 0.5914836992681304, "repo_name": "DXCanas/content-curation", "id": "1a1e4d6ce7f638b137db55677f5a9fe05a73c469", "size": "1576...
import os.path import re import subprocess import sys from in_file import InFile import in_generator import license HEADER_TEMPLATE = """ %(license)s #ifndef %(class_name)s_h #define %(class_name)s_h #include "core/css/CSSParserMode.h" #include <string.h> namespace WebCore { enum CSSValueID { %(value_keyword_enu...
{ "content_hash": "0154241c4be0156a8324cc7789d46ddd", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 152, "avg_line_length": 34.01840490797546, "alnum_prop": 0.6414788097385031, "repo_name": "windyuuy/opera", "id": "a51823c216367504627529b83d30dd9b3376b0de", "size": "5568...
from django.shortcuts import render # Create your views here. class AuditavelViewMixin(object,): def form_valid(self, form, ): if not form.instance.criado_por: form.instance.criado_por = self.request.user form.instance.modificado_por = self.request.user return super(AuditavelVie...
{ "content_hash": "c24ebe3ecc19f7f6738fa0b996f4790c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 63, "avg_line_length": 39, "alnum_prop": 0.7037037037037037, "repo_name": "luzfcb/versionamento_testes", "id": "aafc1f02edfd570d733f3f18b3213baff900c75d", "size": "351", "...
"""Prioritize structural variants based on biological information. Provides high level summaries of structural variants in regions of interest, as defined by the input configuration. Tries to narrow structural variant calls based on potential biological targets. """ import os import pandas as pd import toolz as tz fr...
{ "content_hash": "0995aa94dfe160f1cef61b84332f3f31", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 117, "avg_line_length": 50.714285714285715, "alnum_prop": 0.5606542480690595, "repo_name": "lbeltrame/bcbio-nextgen", "id": "48343fec8eccce33cf37f321416a0886121b56e4", "si...
''' Camshift tracker ================ This is a demo that shows mean-shift based tracking You select a color objects such as your face and it tracks it. This reads from video camera (0 by default, or the camera number the user enters) http://www.robinhewitt.com/research/track/camshift.html Usage: ------ camshift...
{ "content_hash": "7e7de9bb0c48f03b6e75b2fe2a01442d", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 112, "avg_line_length": 31.42063492063492, "alnum_prop": 0.5352361707501895, "repo_name": "makelove/OpenCV-Python-Tutorial", "id": "d55c1ac76c647b95ccea2a0f1ca817dc32e72246"...
from sanity import settings from sanity.initializer import BaseInitializer from sanity.settings import module_path class Initializer(BaseInitializer): @property def requirements(self): return [ "awesome", "flameshot", "peek", "redshift", "rof...
{ "content_hash": "aadc48a33149c0685b7841f352f22793", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 87, "avg_line_length": 31.24561403508772, "alnum_prop": 0.5334081976417743, "repo_name": "gregflynn/dotsanity", "id": "d341f75dca31667f9ac6e3e2c24a9f75acabb8d5", "size": "1...
from mpi4py import MPI import argparse import numpy as NP from astropy.io import fits from astropy.io import ascii from astropy.coordinates import Galactic, FK5 from astropy import units import scipy.constants as FCNST from scipy import interpolate import matplotlib.pyplot as PLT import matplotlib.colors as PLTC impo...
{ "content_hash": "99af563373fad07557725c85dd107a68", "timestamp": "", "source": "github", "line_count": 1580, "max_line_length": 611, "avg_line_length": 55.22594936708861, "alnum_prop": 0.6399257366171195, "repo_name": "dannyjacobs/PRISim", "id": "e6098b94d9a1755184db48b91b01351f7b66164b", "size": ...
import vcr import unittest from pokemontcgsdk import Subtype class TestSubtype(unittest.TestCase): def test_all_returns_subtypes(self): with vcr.use_cassette('fixtures/subtypes.yaml'): subtypes = Subtype.all() self.assertTrue(len(subtypes) > 15) self.assertT...
{ "content_hash": "8c90a2d46ea3d5c7e6ece9764f7f557a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 31.181818181818183, "alnum_prop": 0.6559766763848397, "repo_name": "PokemonTCG/pokemon-tcg-sdk-python", "id": "11d57409b1a9354fe614c466ce3459289711dc92...
from django.conf import settings from django.conf.urls import patterns, include, url urlpatterns = patterns("", url(r'^campeonato/agregar$','campeonatos.views.agregar', name='agregar_torneo'), url(r'^campeonato/editar/$','campeonatos.views.editar', name='editar_torneo'), url(r'^campeonato/editar/(?P<id>\d+...
{ "content_hash": "056b701ebfc66a797d5df6ad50d918de", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 97, "avg_line_length": 58.81818181818182, "alnum_prop": 0.7063369397217929, "repo_name": "diegonalvarez/tournament-stats", "id": "47859fca27ce68fd7d810e67a99f4ad8e2357d10", ...
import os import sys import time import base64 import difflib import unittest import warnings from cStringIO import StringIO import email from email.charset import Charset from email.header import Header, decode_header, make_header from email.parser import Parser, HeaderParser from email.generator imp...
{ "content_hash": "0e3de72ba64443643603f762de49cb1a", "timestamp": "", "source": "github", "line_count": 3321, "max_line_length": 460, "avg_line_length": 37.429990966576334, "alnum_prop": 0.5912071115401633, "repo_name": "wangyou/XX-Net", "id": "f28b7a4c9bde148089adca0dd14098fec62b9286", "size": "12...
''' Provides several CacheStore backends for Cheetah's caching framework. The methods provided by these classes have the same semantics as those in the python-memcached API, except for their return values: set(key, val, time=0) set the value unconditionally add(key, val, time=0) set only if the server doesn't alr...
{ "content_hash": "d59738179ca7ffae4d71834be6af3c3f", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 74, "avg_line_length": 28.556603773584907, "alnum_prop": 0.59200528576148, "repo_name": "nzavagli/UnrealPy", "id": "8017018768155db4be714fc5055607ec02929626", "size": "302...
from __future__ import absolute_import import sys import idiotest.suite as suite BOLD = 1 FG_RED = 31 FG_GREEN = 32 FG_YELLOW = 33 FG_BLUE = 34 FG_MAGENTA = 35 FG_CYAN = 36 FG_WHITE = 37 def hilite(string, *attr): """Add attributes to a string unless stdout is not a tty.""" if not sys.stdout.isatty(): ...
{ "content_hash": "b98671aa78d866a0812f52ec1443ba97", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 70, "avg_line_length": 26.78523489932886, "alnum_prop": 0.5427211225256828, "repo_name": "depp/idiotest", "id": "9daff69e995187170e6e0c4702dcc45ae2244177", "size": "4075",...
from unittest.mock import patch from unittest.mock import call from unittest.mock import MagicMock from mt_vagrant import step from mt_vagrant import settings @patch('mt_vagrant.step.commands') def test_mac_install(mock_commands): step.mac_install() mock_commands.run.assert_called_with([ 'brew cask...
{ "content_hash": "b2a54501da3980b27877309e6a94b718", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 59, "avg_line_length": 21.741935483870968, "alnum_prop": 0.6899109792284867, "repo_name": "pdiazv/minty", "id": "f1f11032e6671122bee745cf37d01bba5c77e393", "size": "674", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from configurable import Configurable #*************************************************************** class BaseCell(Configurable): """""" #====================================...
{ "content_hash": "5c8bd27f9e948466ef4886af9754d6b8", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 108, "avg_line_length": 34.035714285714285, "alnum_prop": 0.5204616998950682, "repo_name": "strubell/Parser", "id": "6c551d06404d25bdc76253aaff1aa95e57ee2cfc", "size": "253...
""" Allow to trace called methods and package """ import frida import re syms = [] def on_message(message, data): global syms global index, filename if message['type'] == 'send': if "SYM" in message["payload"]: c = message["payload"].split(":")[1] print c syms.a...
{ "content_hash": "3677c07f3ac7255e6afa09ac9459b996", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 96, "avg_line_length": 24.495412844036696, "alnum_prop": 0.5445692883895131, "repo_name": "mseclab/AHE17", "id": "56a285cca1123e47d25db2a8ef855ea9df69a272", "size": "2670"...
''' Created on Dec 9, 2013 @author: Chris ''' import wx from gooey.gui.lang import i18n from gooey.gui.option_reader import OptionReader class BasicConfigPanel(wx.Panel, OptionReader): def __init__(self, parent, **kwargs): wx.Panel.__init__(self, parent, **kwargs) self.header_msg = None ...
{ "content_hash": "cb4c4b1ea77e0e1b562b8ab467bcd1a2", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 93, "avg_line_length": 27.615384615384617, "alnum_prop": 0.6525069637883009, "repo_name": "jonathanlurie/Tubular", "id": "488afd2837e0703bb4913a73e0bc69704fc3f092", "size":...
from ..legend import Legend def size_bins_legend(title=None, description=None, footer=None, prop='size', variable=None, dynamic=True, ascending=False, format=None): """Helper function for quickly creating a size bins legend. Args: title (str, optional): Title of legen...
{ "content_hash": "828a71d467ada391e68665a52ffbb909", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 102, "avg_line_length": 40.57142857142857, "alnum_prop": 0.6044600938967136, "repo_name": "CartoDB/cartoframes", "id": "68cee0b7e4a4d2b564832112edf67defc22d0bb6", "size": "...
import os import unittest from azure.common import AzureHttpError from azure.storage.blob import ( Blob, PageBlobService, SequenceNumberAction, PageRange, ) from tests.testcase import ( StorageTestCase, TestMode, record, ) #------------------------------------------------------------------...
{ "content_hash": "95d1ffa2b9f3ab4e4783853b3d9812bc", "timestamp": "", "source": "github", "line_count": 631, "max_line_length": 111, "avg_line_length": 34.210776545166404, "alnum_prop": 0.5968870153333025, "repo_name": "emgerner-msft/azure-storage-python", "id": "bb74f63c26daaa6b863637473d9f8bba8dc87...
# /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the ...
{ "content_hash": "9d16cbf9bf24196291fa829d6f2866bb", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 123, "avg_line_length": 44.63636363636363, "alnum_prop": 0.5264457199284083, "repo_name": "Chiru/NVE_Simulation", "id": "e0772db2b658750f8cb744ee08c1bb2130300ad3", "size":...
"""greenlet-local objects """ from weakref import WeakKeyDictionary from copy import copy from .lock import RLock from greenlet import getcurrent __all__ = ["local"] class _localbase: __slots__ = '_local__args', '_local__lock', '_local__dicts' def __new__(cls, *args, **kw): self = object.__new__(cls...
{ "content_hash": "1b025684dbb85cec716b51faf6505cd1", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 95, "avg_line_length": 34.81651376146789, "alnum_prop": 0.5238471673254282, "repo_name": "veegee/guv", "id": "1112b0dd08349cfeab40b6e5f37c579f1db5991d", "size": "3795", ...
"""Models for the general application.""" from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.contrib.postgres.search import SearchVectorField from django.contrib.postgres.indexes import GinIndex from search.utils import get_template_text c...
{ "content_hash": "fe2453fec49bdb9488e0afccff6b5fc4", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 74, "avg_line_length": 28.403508771929825, "alnum_prop": 0.6324891908585547, "repo_name": "uccser/cs-unplugged", "id": "9462440705f35516e4d7ea38cbd817848c28c1bf", "size": "...
import factory from .models import Application, Authentication, User class ApplicationFactory(factory.DjangoModelFactory): FACTORY_FOR = Application name = 'test' client_id = '2134' client_secret = 'safsdfdsf' callback_url = 'http://testserver' class AuthenticationFactory(factory.DjangoModelFa...
{ "content_hash": "c044f1a879eb12b12683cce6a18103ee", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 56, "avg_line_length": 24.032258064516128, "alnum_prop": 0.7046979865771812, "repo_name": "kitsunde/django-octocat", "id": "4690cecf548afd35940e1805fc4ca20335702b3d", "size...
from distutils.core import setup setup( name='hk_data_sources', version='0.0.1', packages=['hk_data_sources'], url='', license='MIT', author='christlc', author_email='chris.tlchoy@gmail.com', description='' )
{ "content_hash": "0052451a204e22f7a84df27caff0fa40", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 42, "avg_line_length": 20.166666666666668, "alnum_prop": 0.6157024793388429, "repo_name": "christlc/hongkong_data_sources", "id": "1ba2572d745b462ab2b1824d841c03fc65c8df21", ...
""" shellstreaming.istream.stdin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :synopsis: Infinite input stream from stdin """ from relshell.record import Record from relshell.recorddef import RecordDef from shellstreaming.istream.base import Base class Stdin(Base): """Infinite input stream from stdin""" def ...
{ "content_hash": "722058a75b13f203e0e71ff28a748ec5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 26.533333333333335, "alnum_prop": 0.5251256281407035, "repo_name": "laysakura/shellstreaming", "id": "723543f61ca4e95e23677c6672769ac49118b0ec", "siz...
"""Parametric image model that uses mini resnet.""" from typing import Any, Sequence, Tuple, Mapping import gin import haiku as hk import jax import jax.numpy as jnp from learned_optimization.tasks import base from learned_optimization.tasks import resnet from learned_optimization.tasks.datasets import base as datase...
{ "content_hash": "242d111a91baad1f94eb0ce4c430bfa2", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 80, "avg_line_length": 36.939597315436245, "alnum_prop": 0.6571584302325582, "repo_name": "google/learned_optimization", "id": "334677f5b5221be5100f990cec05e1bde4d7d0ee", ...
import numpy as np import cvxpy.interface as intf import cvxpy.settings as s from cvxpy.reductions.solution import Solution, failure_solution from cvxpy.reductions.solvers import utilities from cvxpy.reductions.solvers.qp_solvers.qp_solver import QpSolver def constrain_gurobi_infty(v) -> None: ''' Limit valu...
{ "content_hash": "829cc7343aceeba48cad68fbc81de2ea", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 100, "avg_line_length": 36.83150183150183, "alnum_prop": 0.5255096966683243, "repo_name": "merraksh/cvxpy", "id": "47a4251a3b12e03b91cc26999310b08710962cd1", "size": "1005...
from __future__ import absolute_import, division, print_function import salty import unittest class data_manipulation_tests(unittest.TestCase): data = ['cpt'] data2 = ['cpt', 'density', 'viscosity'] data_ranges = [[200, 1000], [900, 1300], [0, 2]] T = [298.1, 298.16] P = [101, 102] devmodel1 =...
{ "content_hash": "f8e9d67c37de8fbe49aeb606619879c7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 35.30232558139535, "alnum_prop": 0.6054018445322793, "repo_name": "wesleybeckner/salty", "id": "c371e663b93173b670e6ba122d7fd836a0d879ed", "size": "1...
""" Tests for Trial's interaction with the Python warning system. """ import sys, warnings from StringIO import StringIO from twisted.python.filepath import FilePath from twisted.trial.unittest import TestCase, _collectWarnings from twisted.trial.reporter import TestResult class Mask(object): """ Hide a L{Te...
{ "content_hash": "09e25086098e0cccd010f5f552c4638d", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 80, "avg_line_length": 33.57446808510638, "alnum_prop": 0.6181083650190115, "repo_name": "hortonworks/hortonworks-sandbox", "id": "2a85103373ad9fbf7becbd752458aea7480c7588",...
from panda3d.core import * import sys,os loadPrcFileData("", "prefer-parasite-buffer #f") import direct.directbase.DirectStart from direct.interval.IntervalGlobal import * from direct.gui.DirectGui import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.actor import Actor from random impo...
{ "content_hash": "3e45619f6038e8142c2c23e167f6e21d", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 117, "avg_line_length": 39.98275862068966, "alnum_prop": 0.6110392410521777, "repo_name": "toontownfunserver/Panda3D-1.9.0", "id": "9d7e6d56d9ca1d611f8569605b91f6cfaf7d5531"...
import logging import os log = logging.getLogger('no_subprocess_init') def handle_event(event): log.info('%s %d %s' % (__file__, os.getpid(), event)) def __sgevents_init__(dispatcher): dispatcher.register_callback(callback=handle_event, callback_in_subprocess=False)
{ "content_hash": "bf4e87b021d6408221a7c08b5e573ee6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 21.615384615384617, "alnum_prop": 0.701067615658363, "repo_name": "westernx/sgevents", "id": "e30447ef6e1ea2e5329f040526d62f2640fb2b12", "size": "281...
import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class ExpandDimsOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAsExpandDimsOptions(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = ExpandDimsOptions(...
{ "content_hash": "22ee35764d78c81e71c8e72627d0598e", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 114, "avg_line_length": 29.14814814814815, "alnum_prop": 0.6899618805590851, "repo_name": "google-research/falken", "id": "f9fec78d950a19d252a5b53c9d51f2397265f1a9", "size"...
from . import HermesTestCase from .. import models class CategoryTestCase(HermesTestCase): def test_is_root(self): """A Category should know if it is the root category""" expected = True self.assertEqual(expected, self.root_category.is_root) expected = False self.assertEqu...
{ "content_hash": "a648acbe08bd7027ec4a1f9d16d73a04", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 93, "avg_line_length": 39.85436893203884, "alnum_prop": 0.6728380024360536, "repo_name": "emilian/django-hermes", "id": "9a83fc4240058f510cdb890c2f13d965a86c3a9b", "size":...
import os import io import unittest import json from . import operationdefinition from .fhirdate import FHIRDate class OperationDefinitionTests(unittest.TestCase): def instantiate_from(self, filename): datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or '' with io.open(os.path.join(datadir, filen...
{ "content_hash": "413e22cc81f8f3a2df8262d968e697a7", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 187, "avg_line_length": 59.822784810126585, "alnum_prop": 0.7010156580617859, "repo_name": "all-of-us/raw-data-repository", "id": "9d4fac102ca0c61d4f15334207372cdb1fe8c9ef", ...
from __future__ import unicode_literals from django_extensions.management.commands.print_settings import Command def test_without_args(capsys): print_settings = Command() print_settings.run_from_argv(['manage.py', 'print_settings']) out, err = capsys.readouterr() assert 'DEBUG' in out assert 'IN...
{ "content_hash": "f652d1c6d17f61a6d8f99d5b5a253254", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 74, "avg_line_length": 23.925373134328357, "alnum_prop": 0.6150966936993137, "repo_name": "linuxmaniac/django-extensions", "id": "1cb491a1558f9b232b2237a6e9ddf5e0ef39e79f", ...