text
stringlengths
4
1.02M
meta
dict
import sys import re import os import csv import numpy as np from operator import itemgetter from time import time from extract_toc import parseargs from predict_using_toc_mapper import Mapper, get_topic, read_model_file from find_topics import toc_entries, get_summary_map, read_topics import dateparser import check_3...
{ "content_hash": "caef39546a20910b6e832b313fde502c", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 169, "avg_line_length": 31.97190082644628, "alnum_prop": 0.6089024453290596, "repo_name": "rupendrab/py_unstr_parse", "id": "2beceb42e5cec9a0cbdc33d7b81f11bb40ea35df", "si...
"""Tokenization classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import re import unicodedata import six import tensorflow as tf def validate_case_matches_checkpoint(do_lower_case, init_checkpoint): """Checks whether the ...
{ "content_hash": "85816234e5a09c02ec1d415a330e6f44", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 84, "avg_line_length": 33.304582210242586, "alnum_prop": 0.5734865652314665, "repo_name": "kubeflow/kfserving-lts", "id": "e5f17ec2035c323d48388a973d19a44b1530ef29", "size...
from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('catalog.views', url(r'(?P<item_slug>.+)$', 'view_item'), url(r'$', 'index'), )
{ "content_hash": "bcb4a20c6ff311df0a91b8cbd2868de4", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 60, "avg_line_length": 27.666666666666668, "alnum_prop": 0.6686746987951807, "repo_name": "wd5/jangr", "id": "1de936ee0488da9204c8a3be83f2e2875fb45309", "size": "190", "bi...
__all__ = ["interact"] import jnupy import sys def input(prompt=None): if prompt is not None: print(prompt, end="") result = jnupy.input() if result is None: raise EOFError return result def mp_repl_continue_with_input(line): # check for blank input if not line: ...
{ "content_hash": "51e26f0449ea30e2a8518f14d8884bbc", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 152, "avg_line_length": 29.78301886792453, "alnum_prop": 0.5388026607538803, "repo_name": "EcmaXp/micropython", "id": "ed2b256e68325e22f43151fb1b63fcf6569b110d", "size": "...
import functools import re import string import typing as t if t.TYPE_CHECKING: import typing_extensions as te class HasHTML(te.Protocol): def __html__(self) -> str: pass __version__ = "2.1.2.dev0" _strip_comments_re = re.compile(r"<!--.*?-->", re.DOTALL) _strip_tags_re = re.compile(r"<...
{ "content_hash": "8910359d03910ba5f411af39834040d0", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 88, "avg_line_length": 31.55593220338983, "alnum_prop": 0.5657965409818455, "repo_name": "pallets/markupsafe", "id": "1f9d8cdbacc608f364b9caa956fbf7b0e7272e57", "size": "9...
import re from oslo_log import log from arsenal.director import openstack_scout LOG = log.getLogger(__name__) def get_pyrax_token(**kwargs): # NOTE(ClifHouck) support Rackspace-specific auth for OnMetal. # I'm refusing to put pyrax into requirements for Arsenal, because Arsenal # should not be Rackspa...
{ "content_hash": "c868540a6b58d03df03f9d3aad4ba01b", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 78, "avg_line_length": 31.440677966101696, "alnum_prop": 0.6520215633423181, "repo_name": "rackerlabs/arsenal", "id": "102187e5c5d25db4dffe32a8b667706f1d735912", "size": "...
from __future__ import division from common import recover_xor_key, score_text from itertools import cycle, izip, islice, tee # Taken from https://docs.python.org/2/library/itertools.html#recipes def _pairwise(iterable): """s -> (s0,s1), (s1,s2), (s2, s3), ...""" a, b = tee(iterable) next(b, None) retu...
{ "content_hash": "286e41ce3516b1a684a29113f1594a46", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 76, "avg_line_length": 31.645569620253166, "alnum_prop": 0.6328, "repo_name": "ericnorris/cryptopals-solutions", "id": "10c0fd63026f76dc727f4c69dc4b69f901615547", "size": "...
from sippy.SipConf import SipConf try: from urllib import quote, unquote except ImportError: from urllib.parse import quote, unquote RFC3261_USER_UNRESERVED = '&=+$,;?/#' # Quote from RFC-3261: # Several rules are incorporated from RFC 2396 [5] but are updated to # make them compliant with RFC 2234 RFC3261_MAR...
{ "content_hash": "5641ca1af7805dc4d1825358d546ad8e", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 114, "avg_line_length": 36.04362416107382, "alnum_prop": 0.4854296620426404, "repo_name": "sippy/b2bua", "id": "1708de01344601b660135dccd0207ea60981d920", "size": "12172",...
"""Validate manifests.""" import argparse from pathlib import Path import subprocess import sys from . import gather_info, generate, error, docs from .const import COMPONENT_DIR TEMPLATES = [ p.name for p in (Path(__file__).parent / "templates").glob("*") if p.is_dir() ] def valid_integration(integration): ...
{ "content_hash": "c79064a83749a6a530fa39bb209e00f3", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 81, "avg_line_length": 25.12087912087912, "alnum_prop": 0.6325459317585301, "repo_name": "Cinntax/home-assistant", "id": "2258840f430d927f537c974eb9c161f456bf5c3c", "size":...
HIPCHAT_ADDON_KEY = 'io.close.hipchat-addon' HIPCHAT_ADDON_NAME = 'Close.io' HIPCHAT_ADDON_DESCRIPTION = 'A HipChat add-on to give details about a Close.io lead when its URL is mentioned in HipChat' HIPCHAT_ADDON_VENDOR_URL = 'http://close.io' HIPCHAT_ADDON_VENDOR_NAME = 'Close.io' #HIPCHAT_ADDON_BASE_URL = 'https://cl...
{ "content_hash": "5c4310321b284924053d09417c091c28", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 121, "avg_line_length": 40.5, "alnum_prop": 0.7506172839506173, "repo_name": "elasticsales/closeio-hipchat-addon", "id": "2a337f862043fe2410f416be1b6aacd333808485", "size":...
""" This is the example demonstrates how to use Kernel Tuner to insert tunable parameters into template arguments """ import json import numpy from kernel_tuner import tune_kernel def tune(): kernel_string = """ template<typename T, int blockSize> __global__ void vector_add(T *c, T *a, T *b, int n) { aut...
{ "content_hash": "d101ece3fd29dabce90b78578ac1f03f", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 104, "avg_line_length": 22.88095238095238, "alnum_prop": 0.6118626430801248, "repo_name": "benvanwerkhoven/kernel_tuner", "id": "5d2d42c540021be2de825bcddc8ca945d057617a", ...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v12.errors", marshal="google.ads.googleads.v12", manifest={"CustomerClientLinkErrorEnum",}, ) class CustomerClientLinkErrorEnum(proto.Message): r"""Container for enum describing possible CustomeClientLink err...
{ "content_hash": "7d9b33cf7254a1ec9c2626842e8ab5af", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 29.35483870967742, "alnum_prop": 0.6703296703296703, "repo_name": "googleads/google-ads-python", "id": "9432211967f9df06a41e8091c09c7d8140431c3f", "s...
from setuptools import setup, find_packages setup( name="PyEXR", version="0.3.10", description="One line EXR manipulation library", author="Thijs Vogels", author_email="t.vogels@me.com", url="https://github.com/tvogels/pyexr", install_requires=["OpenEXR", "numpy", "future"], dependency_...
{ "content_hash": "ec199c383fe2cf00dc1363e278f090ef", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 87, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6659340659340659, "repo_name": "tvogels/pyexr", "id": "86e1b9489646e8fd4e5435c7240d4e118328c28b", "size": "455", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'PageWidget.width' db.delete_column(u'director_pagewidget', 'width') # Adding field 'PageWidget.theme' ...
{ "content_hash": "473c09c0cd7bc6da0596b311cfa3105e", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 228, "avg_line_length": 66.04411764705883, "alnum_prop": 0.5649075929637052, "repo_name": "ngageoint/geoevents", "id": "f00490e7e456024338a0e5bc6cfa19a3a5784fda", "size": ...
from System.Diagnostics import * from System.IO import * import System from System import TimeSpan, DateTime from Deadline.Events import * from Deadline.Scripting import * from Deadline.Slaves import * import sys import os import textwrap def GetDeadlineEventListener(): return SlaveMonitor() def CleanupDeadli...
{ "content_hash": "8823f05872c1bfc5df6a40bc586aad3e", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 31.339130434782607, "alnum_prop": 0.6351276359600444, "repo_name": "danbradham/slavemonitor", "id": "11f023040cbf8f459f7dbafdfdc9a8e37d75d4c4", "siz...
from lino_xl.lib.contacts.management.commands.garble_persons import *
{ "content_hash": "ab40e4b37c16c56baa602bb3b5fe0fae", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 69, "avg_line_length": 35.5, "alnum_prop": 0.8169014084507042, "repo_name": "lsaffre/lino-faggio", "id": "2bed9dbd3ceecf6002e567624ebb55502bc717a5", "size": "71", "binary"...
"""Internal-only module with immutable data structures. Please, do not use it outside of Luigi codebase itself. """ from collections import OrderedDict, Mapping import operator import functools class FrozenOrderedDict(Mapping): """ It is an immutable wrapper around ordered dictionaries that implements the ...
{ "content_hash": "05e77cfb2041f35a851997fec4dd0781", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 121, "avg_line_length": 29.796296296296298, "alnum_prop": 0.6476072094468615, "repo_name": "adaitche/luigi", "id": "a40c3d03803db088bb3bf6cb3fddf69278524064", "size": "1609...
from ginga import toolkit tkname = toolkit.get_family() if tkname == 'qt': from ginga.qtw.Viewers import * elif tkname == 'gtk': from ginga.gtkw.Viewers import * elif tkname == 'gtk3': from ginga.gtk3w.Viewers import * elif tkname == 'pg': from ginga.web.pgw.Viewers import * from ginga.table.TableV...
{ "content_hash": "80c12142121daa94a339b1d996235dad", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 45, "avg_line_length": 21.4375, "alnum_prop": 0.6967930029154519, "repo_name": "stscieisenhamer/ginga", "id": "349620514307be6d520ee4fd4182c09768e3243a", "size": "343", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms_lab_publications', '0004_auto_20150624_1236'), ] operations = [ migrations.AlterField( model_name='publicationset', name...
{ "content_hash": "95b77ca71cdf9801bb598650032db753", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 92, "avg_line_length": 25.36842105263158, "alnum_prop": 0.6265560165975104, "repo_name": "mfcovington/djangocms-lab-publications", "id": "18d141ef2fd083e7387c537afea89d753caa...
import time import json from . import QueueStatReporter from ..stratum_server import StratumClient # Parameters: {"current block"'s key name, # current timestamp, # new key name for "current block" (something like unproc_block_{block_hash}} solve_rotate_multichain = """ -- Get all the keys ...
{ "content_hash": "335893770785c0c53c8cdea0d3a5e589", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 100, "avg_line_length": 44.84615384615385, "alnum_prop": 0.521726700971984, "repo_name": "sigwo/powerpool", "id": "c413fd9bdc12ea574763b03dcd6ae1288e4e704f", "size": "6996...
from oslo_utils import uuidutils from nova import context from nova import exception from nova.objects import cell_mapping from nova import test from nova.tests import fixtures SAMPLE_MAPPING = {'uuid': '', 'name': 'fake-cell', 'transport_url': 'rabbit:///', 'dat...
{ "content_hash": "6fce0c4ce52ff2d23db6a935c4f04161", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 76, "avg_line_length": 36.9, "alnum_prop": 0.6214995483288166, "repo_name": "rajalokan/nova", "id": "ccb4928db42a965df9cf7cb4a927c5f0f55e0e7b", "size": "3894", "binary": ...
import inspect import random import time from math import sqrt def monte_carlo_average(function, lowerLimit, upperLimit, acceptableError,\ maximumIterations=100000): """ title:: monte_carlo_average description:: This method will perform an integration using the Mon...
{ "content_hash": "b1037768c21f038f4cb3f41a4fa84c7c", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 79, "avg_line_length": 38.49425287356322, "alnum_prop": 0.5764407285756943, "repo_name": "aap5869/RIT", "id": "39c3e32ebcb6a7ab65f918a04046f0aa079e4225", "size": "6698", ...
import os from frb.cfx import CFX from frb.utils import find_file from frb.raw_data import M5, dspec_cat from frb.search_candidates import Searcher from frb.dedispersion import de_disperse_cumsum from frb.search import search_candidates, create_ellipses from frb.queries import query_frb, connect_to_db # Setup exp_cod...
{ "content_hash": "4308dadd50428f3f9d4ab78787f61d24", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 86, "avg_line_length": 39.726190476190474, "alnum_prop": 0.5783637998201978, "repo_name": "ipashchenko/frb", "id": "9df40e57e0774fefd4377f5d03aad395a958fdd7", "size": "3337...
""" Tests For ZoneManager """ import datetime import mox import novaclient from nova import context from nova import db from nova import flags from nova import service from nova import test from nova import rpc from nova import utils from nova.auth import manager as auth_manager from nova.scheduler import zone_manage...
{ "content_hash": "29e473c80d3032c9e7fcd9a0d863b9f5", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 78, "avg_line_length": 34.95161290322581, "alnum_prop": 0.5936009844639286, "repo_name": "termie/nova-migration-demo", "id": "e132809dc30e5294d8a9a812a6ce1f6ba2f28407", "s...
"""Pull a sandwich run's output directory's metrics from traces into a CSV. python pull_sandwich_metrics.py -h """ import collections import logging import os import shutil import sys import tempfile _SRC_DIR = os.path.abspath(os.path.join( os.path.dirname(__file__), '..', '..', '..')) sys.path.append(os.path.j...
{ "content_hash": "57af849e59f99c656ca757a995cc064d", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 80, "avg_line_length": 32.09448818897638, "alnum_prop": 0.6935721295387635, "repo_name": "junhuac/MQUIC", "id": "e30232c05ab95282c62bb4fd2950de8696e8900d", "size": "8315",...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('teams', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('nucleus', '0001_in...
{ "content_hash": "709780274731eb08d0c244eb7e8a0b46", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 128, "avg_line_length": 34.095238095238095, "alnum_prop": 0.6068435754189944, "repo_name": "prattl/wepickheroes", "id": "76b88e7b318dd113b6789a32fa32a333046d02ff", "size": ...
""" Pretty printers for sparse matrix classes """ from .util import stripType, templateParams, strToBool class CompressedMatrixPrinter: """Print blaze::StaticMatrix""" def __init__(self, val): """Extract all the necessary information""" self.type = stripType(val.type) template_params = templateParams(self....
{ "content_hash": "19c8fa8064ea9119cdfd829c05cdb9f8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 83, "avg_line_length": 25.632653061224488, "alnum_prop": 0.6687898089171974, "repo_name": "camillescott/boink", "id": "10f3c4dd1553f27502371a5a667e6cd55b0c2c9d", "size": "1...
from datadog.api.base import ActionAPIResource class User(ActionAPIResource): """ A wrapper around User HTTP API. """ @classmethod def invite(cls, emails): """ Send an invite to join datadog to each of the email addresses in the *emails* list. If *emails* is a string, it wi...
{ "content_hash": "068fa276daf737836213d16e2b18b8c8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 29.59259259259259, "alnum_prop": 0.6070087609511889, "repo_name": "rogst/datadogpy", "id": "d22f2d52a223ab2bef9c07aa4a8313ffecf45fbf", "size": "799",...
from django.db import models from django.utils.translation import ugettext as _ from modelcluster.fields import ParentalKey from wagtail.core.models import Page, Orderable from wagtail.core.fields import RichTextField from wagtail.images.models import Image from wagtail.admin.edit_handlers import FieldPanel, MultiFie...
{ "content_hash": "bda71b978ba66bc16e9bf5c0d4f45cbf", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 80, "avg_line_length": 31.58, "alnum_prop": 0.6700443318556049, "repo_name": "evonove/evonove.it", "id": "dd52b4f24b1007ef40656357f4f928c2c278f198", "size": "1579", "bina...
""" Created on Feb 20, 2014 @author: Aaron Ponti """ from ch.systemsx.cisd.openbis.dss.etl.dto.api import SimpleImageContainerDataConfig class MicroscopyCompositeDatasetConfig(SimpleImageContainerDataConfig): """Image data configuration class for composite image files.""" def createChannel(self, channelCod...
{ "content_hash": "4691ce324bcaa0a46bc0a83fea27194d", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 87, "avg_line_length": 30.930555555555557, "alnum_prop": 0.6731028289178267, "repo_name": "aarpon/obit_microscopy_core_technology", "id": "8d0b5802c6bb4a286a03672fa49ec47a9ca...
from __future__ import print_function import unittest from mock import patch from six import StringIO from biggraphite.cli import bgutil from tests import test_utils as bg_test_utils class TestBgutil(bg_test_utils.TestCaseWithFakeAccessor): metrics = ["metric1", "metric2"] @patch("sys.stdout", new_callab...
{ "content_hash": "ccc7d53333489987eff90a5ad4ded193", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 88, "avg_line_length": 27.607142857142858, "alnum_prop": 0.6714100905562742, "repo_name": "criteo/biggraphite", "id": "239d538d93fb3555708add32fbabe947ebdcc8e7", "size": "1...
from discord.ext import commands from discord.ext.commands import Cog import re def setup(bot): bot.add_cog(SwitchSerialNumberCheck(bot)) class SwitchSerialNumberCheck(Cog): def __init__(self, bot): self.bot = bot @commands.command(aliases=["ssnc"]) async def check_nx_serial(self, ctx, seri...
{ "content_hash": "e61cc753e7dc258e638611f650201fe6", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 184, "avg_line_length": 39.43478260869565, "alnum_prop": 0.5045203969128996, "repo_name": "thedax/Kurisu", "id": "3b17bfc0bfd1004753f1522ed4fc5e9ceed8ac1a", "size": "5319"...
import logging import numpy import theano from theano import tensor from blocks.roles import VariableRole, add_role from blocks.bricks import ( Initializable, Linear, Sequence, Tanh) from blocks.bricks.base import lazy, application from blocks.bricks.parallel import Fork from blocks.bricks.recurrent import Bidirec...
{ "content_hash": "65fe4c287af6ddcea47cb361e057c8bc", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 92, "avg_line_length": 37.381188118811885, "alnum_prop": 0.6050854191497815, "repo_name": "rizar/attention-lvcsr", "id": "5a595e89d967ed45def8f96b86eb469a5cf0fb5f", "size"...
from controller import controller def main(): controller.run() if __name__=='__main__': main()
{ "content_hash": "376e2e1be3c98d61ec48419f00275d6d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 33, "avg_line_length": 15, "alnum_prop": 0.6095238095238096, "repo_name": "ohbarye/gracenote-api-sample", "id": "69cc7f5cec412f21d4054a3b8b850a6eefb3781e", "size": "105", ...
""" Parser module specific to BCL::Contact predictions """ __author__ = "Felix Simkovic" __date__ = "12 Dec 2016" __version__ = "0.1" import re from conkit.io._parser import ContactFileParser from conkit.core.contact import Contact from conkit.core.contactmap import ContactMap from conkit.core.contactfile import Con...
{ "content_hash": "e786c71a5c90f01cb211f25260829d02", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 106, "avg_line_length": 27.405405405405407, "alnum_prop": 0.5833333333333334, "repo_name": "fsimkovic/conkit", "id": "142387bb06d8cbe8b09a92f14d2b97d742b84431", "size": "36...
"""Tests for tensorflow.ops.data_flow_ops.FIFOQueue.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import random import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.core.protobuf import con...
{ "content_hash": "8bc49745d215abf93c0f8f18b10fe521", "timestamp": "", "source": "github", "line_count": 1663, "max_line_length": 80, "avg_line_length": 36.37101623571858, "alnum_prop": 0.6112755228569067, "repo_name": "seanli9jan/tensorflow", "id": "8961c4b13c25269671fdc16fc425516d01970892", "size"...
import numpy import apogee.tools.read as apread _DATA= apread.rcsample() #such that we can re-use it in different tests def test_int64(): #Test that there aren't 64-bit integers for key in _DATA.dtype.names: assert not numpy.issubdtype(_DATA[key].dtype,numpy.int64), "Tag '%s' in the RC catalog is a 64-...
{ "content_hash": "0cdbf75151dfdec6f3c8a7b55eafe593", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 170, "avg_line_length": 44.888888888888886, "alnum_prop": 0.7227722772277227, "repo_name": "jobovy/apogee", "id": "5f89bce942ba461880c013e7d41e568b328e5d5c", "size": "404", ...
from ropper import RopperService # not all options need to be given options = {'color' : False, # if gadgets are printed, use colored output: default: False 'badbytes': '00', # bad bytes which should not be in addresses or ropchains; default: '' 'all' : False, # Show all gadgets, thi...
{ "content_hash": "21985462a374882b6cddf932d5d0067c", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 107, "avg_line_length": 32.48275862068966, "alnum_prop": 0.6817409766454352, "repo_name": "sashs/Ropper", "id": "ca723a2a353bd649970c4d33eb0cbddfead2f98c", "size": "4732",...
from collections import OrderedDict from fnmatch import fnmatch from glob import glob from tabulate import tabulate import os.path as osp, itertools,numpy as np from control4.algs.alg_params import str2numlist from control4.bench.diagnostic_common import disp_dict_as_2d_array,disp_dict_as_3d_array,compute_mean_std_acro...
{ "content_hash": "13c4c9673aaa3d2a20a6b2ff7351905c", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 161, "avg_line_length": 48.21084337349398, "alnum_prop": 0.5786580032487817, "repo_name": "SFPD/rlreloaded", "id": "022f8a5b74f3328ae5eee343eb285d7a51dd48a0", "size": "810...
from pygeocoder import Geocoder import us, csv, json WRITE = 'wb' READ = 'rb' #corpus = json.load(open('bieber-raw-test.json',READ)) corpus = json.load(open('#birthday-birthday-20140626-082517.json',READ)) #corpus = json.load(open('sxsw-SXSW-#SXSW-#sxsw-20140308-001535.json',READ)) def get_location(tweet): if tweet[...
{ "content_hash": "95d565b8b71d8a7c2ece51f2e3473d0b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 102, "avg_line_length": 34.96774193548387, "alnum_prop": 0.7149446494464945, "repo_name": "mac389/Maui", "id": "059764502eb02a5c3edb8adbbbdc70ed21f28c05", "size": "1084", ...
""" A Python class implementing KBHIT, the standard keyboard-interrupt poller. Works transparently on Windows and Posix (Linux, Mac OS X). Doesn't work with IDLE. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free S...
{ "content_hash": "894c47132a412282da4363fc33a79681", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 76, "avg_line_length": 21.8, "alnum_prop": 0.6667889908256881, "repo_name": "kevinkahn/softconsole", "id": "4df204e677f9ed09efcea6c4f88634861c947c6f", "size": "2747", "b...
import __main__ import argparse import code import os import sys def add_config_parameter(parser): parser.add_argument( '-c', '--config', dest='config_file', action='store', type=str, help='custom config file', default=None ) def load_run_parsers(subparsers): run_parser = subparsers.add_...
{ "content_hash": "123df350d4fc9be433b69a9904e31508", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 76, "avg_line_length": 27.54736842105263, "alnum_prop": 0.6428480448350529, "repo_name": "zhaochao/fuel-web", "id": "fb78d89a485fb14ecf177e1a51b584b25d30ae53", "size": "85...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0024_channel_modified'), ] operations = [ migrations.AlterField( model_name='channel', name='modified', ...
{ "content_hash": "3f80fbca16a81cc9747542e7df759c2e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 54, "avg_line_length": 21.11111111111111, "alnum_prop": 0.5947368421052631, "repo_name": "mozilla/airmozilla", "id": "7d2e5f66e8c69fc5397ee94a0c911dcb61464979", "size": "40...
import argparse import base64 import os import random import struct import sys def main(): parser = argparse.ArgumentParser(description='Generate random test cases for the base64 unit test.') parser.add_argument('--count', default=1000, type=int, help='Number of test cases to generate') parser.add_argument...
{ "content_hash": "dc067a4c5ce90557fffeff6c9cb70e00", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 108, "avg_line_length": 42.42857142857143, "alnum_prop": 0.6487093153759821, "repo_name": "dbitbox/mcu", "id": "825773ebce8562c16409cb2ece94e1ea2bcdf300", "size": "1805", ...
import os import pickle import numpy as np import matplotlib.pyplot as pylab import operator from multiprocessing import Pool, Manager import glob from collections import Counter,defaultdict from scipy.stats import norm import logging def bayes_selection_constnat_optimization(self): removal_ratio=0.9 ...
{ "content_hash": "065de51da21e286088339a9fe0803e70", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 201, "avg_line_length": 51.275862068965516, "alnum_prop": 0.6792199058507061, "repo_name": "knightjdr/screenhits", "id": "34865291a6702bca118be0a426d040d08e69f96a", "size"...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource ...
{ "content_hash": "3199b354be6e919665d56a61383b6550", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 116, "avg_line_length": 32.24742268041237, "alnum_prop": 0.6304347826086957, "repo_name": "twilio/twilio-python", "id": "222959bcfa75340cb672479f3ee9bd4e82dcb293", "size":...
""" **Name** pyzombied — Start pyzombie server. **Synopsis** ``pyzombied.py [options]`` **Description** The ``pyzombied.py`` command shall start the *pyzombie* HTTP RESTful server. **Options** ``--home`` Home directory to override $PYZOMBIEHOME. ``--config`` Configuration...
{ "content_hash": "79a0a212b849efd84407d794171ada03", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 124, "avg_line_length": 29.296875, "alnum_prop": 0.6583111111111111, "repo_name": "lanhel/pyzombie", "id": "39e2ba68a1fb393aa182bcb3714984a1a540bc38", "size": "5754", "b...
import json import datetime import six import dateutil.parser class JSONWithDatetimeEncoder(json.JSONEncoder): """Create JSON string as json.JSONEncoder, convert datetime.datetime objects to ISO format string.""" def default(self, o): o = o.isoformat() if isinstance(o, datetime.datetime) else json.JS...
{ "content_hash": "8d02867addc6475e1b2281ffa92e4dab", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 105, "avg_line_length": 30.05263157894737, "alnum_prop": 0.5840630472854641, "repo_name": "postmen/postmen-sdk-python", "id": "4310a6a30c6c37ad49811c857f026998be153318", "s...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "delphi.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "ed810af8bc0f99209e580ac5efbb143a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 70, "avg_line_length": 25.22222222222222, "alnum_prop": 0.7092511013215859, "repo_name": "VulcanoAhab/delphi", "id": "204aafe8fab9182bd79f967ba5df8e946e322525", "size": "249...
import os import warnings from dataset.persistence.database import Database from dataset.persistence.table import Table from dataset.persistence.util import row_type from dataset.freeze.app import freeze # shut up useless SA warning: warnings.filterwarnings( 'ignore', 'Unicode type received non-unicode bind param ...
{ "content_hash": "01eeb26a25de5e529896731139d750f6", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 110, "avg_line_length": 46.80952380952381, "alnum_prop": 0.7131230925737538, "repo_name": "twds/dataset", "id": "0a1556c18271d16e716fac4298ca32d2d5527b45", "size": "1966", ...
"""A server wrapper around dealer operations.""" from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler import logging from .bank import Bank QUERIES = { "is_done": (lambda bank: bank.is_done(), True), "get_output_path": (lambda bank: bank.output_path, None), "get_header": (lambda b...
{ "content_hash": "99cd210d2377950215bf2b00d06c2ea1", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 95, "avg_line_length": 33.80530973451327, "alnum_prop": 0.581413612565445, "repo_name": "nivbend/bdd_bot", "id": "f1a262faee176e0c5fe7b5823a1d90715f0c96bc", "size": "3820"...
import sys import time import serial import serial.tools.list_ports from SerialCrypt import Devices # variables SERIAL_BD = 9600 SERIAL_PORT = None SERIAL_TIMEOUT = 5 # verify the arduino is connected for port in serial.tools.list_ports.comports(): if port[2][:len(Devices.DEVICE_DEBUG_ID)] == Devices.DEVICE_DEBUG_I...
{ "content_hash": "6bea62f07a63c697a06b0bd377744ac6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 73, "avg_line_length": 20.083333333333332, "alnum_prop": 0.7413554633471646, "repo_name": "sch3m4/SerialCrypt", "id": "36463794fbfb863fa367987e62a8795771aa5e0e", "size": "8...
import warnings from pandas import DateOffset, DatetimeIndex, Series, Timestamp from pandas.compat import add_metaclass from datetime import datetime, timedelta from dateutil.relativedelta import MO, TU, WE, TH, FR, SA, SU # noqa from pandas.tseries.offsets import Easter, Day import numpy as np def next_monday(dt):...
{ "content_hash": "6a2df3f87a0ea97d9e49cce6b64ccada", "timestamp": "", "source": "github", "line_count": 509, "max_line_length": 79, "avg_line_length": 31.781925343811395, "alnum_prop": 0.5806391790814118, "repo_name": "louisLouL/pair_trading", "id": "9acb52ebe0e9f25f0eaefbb3524240ef02170b43", "size...
from socket import timeout as socket_timeout # noqa from django.core.urlresolvers import reverse # noqa from django import http from mox import IgnoreArg # noqa from mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.test import helpers as test USERS_INDEX_URL = reverse('horizon...
{ "content_hash": "10410528774711f82e30bcfc99cd3837", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 79, "avg_line_length": 40.5316742081448, "alnum_prop": 0.537259279933017, "repo_name": "deepakselvaraj/federated-horizon", "id": "97a6cf3ddf740cd409094ca050a2fe5879c537f1", ...
import pygame from pygame.locals import * class Viewport(pygame.sprite.Sprite): def __init__(self, parent, viewport_rect, canvas_w, canvas_h): super(Viewport, self).__init__() self.parent = parent self.resize(viewport_rect) self.canvas = pygame.Surface((canvas_w, canvas_h)).conve...
{ "content_hash": "77b99e872c866d5e849f8b077a5a8c55", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 81, "avg_line_length": 32.285714285714285, "alnum_prop": 0.5811209439528023, "repo_name": "flexo/evolutron", "id": "2a7167027501673e8436b9c058cc271bb24d37e3", "size": "1356...
import sys, time, mysql.connector, geopy.point, geopy.distance, json from geopy.point import Point class SettingDB: def __init__(self, uname, pw, table_name="setting", db_name="doublefault"): self.table_name = table_name self.db_name = db_name self.db_user = uname self.db_pw = pw...
{ "content_hash": "8f7a5b10e4ed898f658be10866cd7964", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 192, "avg_line_length": 32.44604316546763, "alnum_prop": 0.5674057649667406, "repo_name": "AimForTheAce/BostonMysticsBot", "id": "929c9b4992d896878de3a55348b66150bef4d162", ...
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
{ "content_hash": "63bfa929645d97ab8ccef3ae627f9a1a", "timestamp": "", "source": "github", "line_count": 1109, "max_line_length": 119, "avg_line_length": 44.12714156898107, "alnum_prop": 0.5743711302286614, "repo_name": "twz915/django", "id": "a878a79acde1179e03f0ca8a46118d546dbd9448", "size": "4893...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Movie', fields=[ (...
{ "content_hash": "1abc4cd557fc873d3310c4f028cd874a", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 512, "avg_line_length": 49.22222222222222, "alnum_prop": 0.5471783295711061, "repo_name": "pyprism/Hiren-Movie", "id": "a0cf8082889e6ce8522544ea40e62aeed39cccad", "size": "...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals from collections import namedtuple import json import os import random from string import ascii_lett...
{ "content_hash": "91d8bcad9821bd977a2d15abb7273811", "timestamp": "", "source": "github", "line_count": 678, "max_line_length": 84, "avg_line_length": 34.46755162241888, "alnum_prop": 0.548675595874877, "repo_name": "jpopelka/atomic-reactor", "id": "4d8989e8dc0b706e4d9dcb4e8572eab6351355ee", "size"...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('promoted', '0011_create_switch_for_subscription'), ] operations = [ migrations.RenameField( model_name='promotedsubscription', old_name='paid_at', new_name='paym...
{ "content_hash": "2f8b333c7893defb4b9aae58d079dd48", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 60, "avg_line_length": 22.25, "alnum_prop": 0.5898876404494382, "repo_name": "mozilla/olympia", "id": "b959c801442bfc6fe23c1400f984ae42c9d09b54", "size": "406", "binary":...
from oslo_config import cfg from oslo_log import versionutils _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN', 'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO', 'oslo.messaging=INFO', 'oslo_messaging=INFO', ...
{ "content_hash": "0a69fa9f3eeb775e7804cf2deeafad5c", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 79, "avg_line_length": 47.465753424657535, "alnum_prop": 0.539009139009139, "repo_name": "openstack/oslo.log", "id": "b1917fb8ae0fd3994baaa1c4a49662e1852ee652", "size": "1...
"""For accessing cihai as a package.""" import os import sys def run(): base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, base) from .process import Packager p = Packager.from_cli(sys.argv[1:]) p.download() p.export() if __name__ == '__main__': sys.e...
{ "content_hash": "c93a073068de1773e773e8a9b2becc22", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 70, "avg_line_length": 18.38888888888889, "alnum_prop": 0.6042296072507553, "repo_name": "cihai/cihaidata-unihan", "id": "688cb941a3dbfc3540ff20f5e6b30d767acd3525", "size":...
import fractions, time, unittest from bibliopixel.control import midi from argparse import Namespace from test.bibliopixel import patch C3 = Namespace(type='note_on', note=32, channel=1, velocity=96) C3_ZERO = Namespace(type='note_on', note=32, channel=1, velocity=0) C3_OFF = Namespace(type='note_off', note=32, channe...
{ "content_hash": "649197605246512ecac83b1f6be4c8f9", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 73, "avg_line_length": 32.71764705882353, "alnum_prop": 0.565623876303488, "repo_name": "rec/BiblioPixel", "id": "d21e4c8840b33ba644c16a82e72f4dbecc58be0f", "size": "2781",...
import time import logging from ..exceptions import ( ProtocolError, ConnectTimeoutError, ReadTimeoutError, MaxRetryError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Ret...
{ "content_hash": "a259c0c550ea38926bcd075f0e11f139", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 104, "avg_line_length": 35.22222222222222, "alnum_prop": 0.6005902106441436, "repo_name": "ThinkboxSoftware/Deadline", "id": "130217bfdb357839411ca548038691ef2a86f1f4", "s...
from __future__ import unicode_literals class Chat(object): def __init__(self, app, id, name, adapter, private=False): self.app = app self.id = id self.name = name self.private = private self.adapter = adapter self.storage = app.get_storage('communication:{}:chats:...
{ "content_hash": "5f18c6fd29d87d026c828a31b25746c4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 28.65, "alnum_prop": 0.5759162303664922, "repo_name": "KiraLT/KiraBot", "id": "9e7beae7f4cfbf36c8a62e73d3a336bec77f3803", "size": "573", "binary": ...
""" Extending on demo-03, implements an event callback we can use to process the incoming data. """ import sys import time from ant.core import driver from ant.core import node from ant.core import event from ant.core import message from ant.core.constants import * from config import * NETKEY = '\xB9\xA5\x21\xFB\x...
{ "content_hash": "8c44605a087f11b23106b862e8c2c174", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 24.345454545454544, "alnum_prop": 0.7520537714712472, "repo_name": "tomwardill/python-ant", "id": "815dd7bbaa65cc8fcc517cae722b912b4be107aa", "size":...
"""Gaussian processes regression.""" # Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Modified by: Pete Green <p.l.green@liverpool.ac.uk> # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve_triangular import scip...
{ "content_hash": "a937bf4684f0dea74cb51b10f1bbed64", "timestamp": "", "source": "github", "line_count": 521, "max_line_length": 79, "avg_line_length": 43.232245681381954, "alnum_prop": 0.5831113478955781, "repo_name": "ogrisel/scikit-learn", "id": "b4ab0441efc7135a598d5f720d0162d3f8997a76", "size":...
import unittest from conans.test.tools import TestClient from conans.test.utils.cpp_test_files import cpp_hello_conan_files from conans.paths import CONANFILE import textwrap class InfoTest(unittest.TestCase): def _create(self, number, version, deps=None, deps_dev=None, export=True): files = cpp_hello_co...
{ "content_hash": "7f1667f69aa6feddd0dba5aee723ae47", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 98, "avg_line_length": 45.95882352941177, "alnum_prop": 0.5297580954818891, "repo_name": "dragly/conan", "id": "ec3152645815c07caeec1aa9b2fb2cdc12219d4c", "size": "7813", ...
import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.devsettings' if __name__ == '__main__': """ Test Django App in travis.ci """ import django from django.core.management import execute_from_command_line execute_from_command_line([sys.argv[0], "makemigrations", "category", ]) ...
{ "content_hash": "7c1a96efe2b6b7b9205c18a700c4e825", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 29.75, "alnum_prop": 0.6588235294117647, "repo_name": "aneumeier/category", "id": "5f92bfabc1f3b2432e2422bfba90ddf465cca10a", "size": "619", "binar...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import director from cocos.actions import * from cocos.layer import * import pyglet class BackgroundLayer( cocos.layer.Layer ): def __init__(self): super( BackgroundLayer, self ).__in...
{ "content_hash": "d27bbc3a001bf118e2b6a6ec136051b5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 24.06896551724138, "alnum_prop": 0.6504297994269341, "repo_name": "adamwiggins/cocos2d", "id": "3434d639f0bde6b8dc56d14d31fe17a4bb5232ef", "size": "7...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import os import unittest from caffe2.proto import caffe2_pb2 from caffe2.python import core, test_util, workspace, model_helper, brew import caffe2....
{ "content_hash": "3971ae954d9d7fa495e1b4c6091c67c8", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 79, "avg_line_length": 40.76937984496124, "alnum_prop": 0.6216190521462186, "repo_name": "bwasti/caffe2", "id": "e9b8a10a7f9d4c9de09cc6248d633fe8581b446e", "size": "21037"...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: avi_controllerproperties author: Gaurav Rastogi (@grastogi23) <grastogi@avinetworks.com> short_description: Module for setup of ControllerPropertie...
{ "content_hash": "4fe192c7c9eaae69a273541d1dc8360d", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 134, "avg_line_length": 46.137529137529135, "alnum_prop": 0.6325973829131512, "repo_name": "thaim/ansible", "id": "f88787ed24dc67d31fb1a1ef2a5843aa9b1a67c4", "size": "2013...
from scrapy.contrib.spiders.init import InitSpider from scrapy.http import Request from scrapy.selector import Selector from decouple import config import re import json import requests from urlparse import urljoin from scrapy.utils.project import get_project_settings as Settings STGS = Settings() CITY_FROM = 'REC' ...
{ "content_hash": "e7d44dc595caa673e1fcaf05e60f2feb", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 100, "avg_line_length": 27.842105263157894, "alnum_prop": 0.5945179584120983, "repo_name": "arthuralvim/palestra_pug_scrapy", "id": "63c84c6a2624870565e307ba5d1bc256e9407969"...
from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import TestCase, Client, override_settings from mock import patch from buildservice.models import Build, Repository from buildservice.utils.testing import create_user_token @override_settings(BUILDSERVICE_API...
{ "content_hash": "8a7798a319af3506902205142bdf616a", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 83, "avg_line_length": 38.177083333333336, "alnum_prop": 0.606275579809004, "repo_name": "m-vdb/github-buildservice-boilerplate", "id": "2c15f5ef70e7cf4d9931b834e45d8ddc6a06f...
""" Recurrent Conditional GAN in keras. It only contains the base class and subclass needs to create their own architecture """ from abc import abstractmethod import tensorflow as tf class RCGAN(object): def __init__(self, input_dim, window_length, num_classes, code_size=64, learning_date=1e-4, batch_size=32, ...
{ "content_hash": "2811e13ac6429fdfbe04496dd0e3eb6b", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 110, "avg_line_length": 36.833333333333336, "alnum_prop": 0.6681749622926093, "repo_name": "vermouth1992/tf-playground", "id": "6b850e469af100678a08d64f36af98b4b68cb196", "...
import pytest import platform import functools from azure.core.exceptions import HttpResponseError, ClientAuthenticationError from azure.core.credentials import AzureKeyCredential from testcase import TextAnalyticsTest, TextAnalyticsPreparer from testcase import TextAnalyticsClientPreparer as _TextAnalyticsClientPrepa...
{ "content_hash": "1fa8f8fc4a5425d8abb70bb2048e7166", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 147, "avg_line_length": 41.117559523809526, "alnum_prop": 0.620896818790489, "repo_name": "Azure/azure-sdk-for-python", "id": "aa1013abb7a12d7f4282c8cc6cc6167ce150d9f4", "...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import sys import pip from .. import click, sync from ..exceptions import PipToolsError from ..logging import log from ..utils import assert_compatible_pip_version, flat_map # Make sure we're using...
{ "content_hash": "558a48987c2f67b72edd055cf1f98cc3", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 148, "avg_line_length": 42.84931506849315, "alnum_prop": 0.6547314578005116, "repo_name": "nateprewitt/pipenv", "id": "e1d7f5e534d0948427d599f92440394e5bdd268a", "size": "3...
import datetime import dateutil.relativedelta from django.utils import timezone import mock from nose.tools import * # flake8: noqa import pytest from urlparse import urlparse from api.base.settings.defaults import API_BASE from api_tests.nodes.views.test_node_draft_registration_list import DraftRegistrationTestCase ...
{ "content_hash": "8f54613c6f5194b1e3b7634a2b29f70a", "timestamp": "", "source": "github", "line_count": 1058, "max_line_length": 200, "avg_line_length": 44.71266540642722, "alnum_prop": 0.6057159768316915, "repo_name": "TomBaxter/osf.io", "id": "c37e838d4925fd1f642ccb5c5d1faea74dcf9b13", "size": "4...
''' This contains functions to run the Trend Filtering Algorithm (TFA) in a parallelized manner on large collections of light curves. ''' ############# ## LOGGING ## ############# import logging from astrobase import log_sub, log_fmt, log_date_fmt DEBUG = False if DEBUG: level = logging.DEBUG else: level = ...
{ "content_hash": "eef1f139615b1c007ea3527f6ea61e6d", "timestamp": "", "source": "github", "line_count": 1530, "max_line_length": 80, "avg_line_length": 35.020261437908495, "alnum_prop": 0.562568821037308, "repo_name": "lgbouma/astrobase", "id": "3ab5410b8bc5034e3887b7ac25fb4e6663229382", "size": "5...
'''Test case for configuration reader ''' import unittest from lighty.signals import SignalDispatcher class SignalsTestCase(unittest.TestCase): '''Test case for signals implementation ''' def setUp(self): self.dispatcher = SignalDispatcher() self.objects = None self.filtered = No...
{ "content_hash": "0dc660603a91fdc5f7b96c53ac008290", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 34.98571428571429, "alnum_prop": 0.5933033891384238, "repo_name": "GrAndSE/lighty", "id": "bdceb771bf842e609111c34b531ff18757b415d1", "size": "2449",...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline is_dangerous = True ...
{ "content_hash": "70e65c5cc98a11c17bad9b67bf33f487", "timestamp": "", "source": "github", "line_count": 1095, "max_line_length": 233, "avg_line_length": 91.90593607305937, "alnum_prop": 0.5796476445045063, "repo_name": "mvaled/sentry", "id": "38e056c8e6116e5a17d31e80750e660d009f4cb4", "size": "1006...
import pytest from pygelf import GelfTcpHandler, GelfUdpHandler, GelfHttpHandler, GelfTlsHandler, GelfHttpsHandler, GelfTlsHandler from tests.helper import logger, get_unique_message, log_warning STATIC_FIELDS = { '_ozzy': 'diary of a madman', '_van_halen': 1984, '_id': 42 } @pytest.fixture(params=[ ...
{ "content_hash": "d2cfda699ebbfecd45b3b0bb87a5efb9", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 148, "avg_line_length": 53.390243902439025, "alnum_prop": 0.706258565555048, "repo_name": "keeprocking/pygelf", "id": "fb4eb08001ee27cbf88663721120e7bb17a4ba7f", "size": "2...
import os import sys import fnmatch import codecs if len(sys.argv) < 3: print os.path.basename(__file__), 'target_path', 'framework_names...' sys.exit(1) FRAMEWORK_PATH = os.path.join(os.path.dirname(__file__), 'Frameworks') target_path = sys.argv[1] print 'Patching #import in *.h/*.m from', target_path heade...
{ "content_hash": "8c54d5dbc06609151533a0d6a57f1bcd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 109, "avg_line_length": 36.74285714285714, "alnum_prop": 0.6430793157076206, "repo_name": "cubie-api/cubie-sdk-ios", "id": "a72e595aff5556276fb1e63db03d2a4dedade0b3", "size...
import os import sys import tornado.auth import tornado.escape import tornado.ioloop #import tornado.options import tornado.web import tornado.httpserver import tornado.httputil #import tornado.gen import dill as pickle import fnmatch import importlib.util import tarfile import subprocess import logging from tornado.op...
{ "content_hash": "34bb393c99c7d012f261aec54b844ad1", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 151, "avg_line_length": 49.044444444444444, "alnum_prop": 0.6315133665609425, "repo_name": "shareactorIO/pipeline", "id": "1cb90addc647efa972ffc6a4812f0fd311d4d199", "size...
""" A connection to a hypervisor through libvirt. Supports KVM, LXC, QEMU, UML, and XEN. **Related Flags** :driver_type: Libvirt domain type. Can be kvm, qemu, uml, xen (default: kvm). :connection_uri: Override for the default libvirt URI (depends on driver_type). :disk_prefix: Override the def...
{ "content_hash": "8314b21a05f05160578692483f2b6eec", "timestamp": "", "source": "github", "line_count": 5250, "max_line_length": 79, "avg_line_length": 42.82495238095238, "alnum_prop": 0.5392050028688214, "repo_name": "shhui/nova", "id": "bf771be4a261878110f359064d76898564940dab", "size": "225758",...
""" Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.25 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubernete...
{ "content_hash": "0875820e1e49f4bd5ebc51674fdfdc78", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 124, "avg_line_length": 30.141666666666666, "alnum_prop": 0.5792092894664086, "repo_name": "kubernetes-client/python", "id": "b700176cdcf8432abf18d2bcf357324641a7e2c2", "s...
from __future__ import print_function from string import Template # run.py by default will delete cloudformation templates and buckets created by this script and create everything from scratch. # other parameters (yet to be defined) will roll out a smaller change import boto3 import botocore import os import argparse...
{ "content_hash": "564c59da492948c6f69c4a16616d07e3", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 189, "avg_line_length": 36.17622950819672, "alnum_prop": 0.6730486008836525, "repo_name": "powellquiring/bigimage", "id": "c004333794df6f410417558b3dc0607903dd5a8a", "size...
from flask.globals import _app_ctx_stack, _request_ctx_stack from werkzeug.urls import url_parse def route_from(url, method = None): appctx = _app_ctx_stack.top reqctx = _request_ctx_stack.top if appctx is None: raise RuntimeError('Attempted to match a URL without the ' 'application context bei...
{ "content_hash": "190ce620af4aa7ddd352135f627b5f02", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 82, "avg_line_length": 40.833333333333336, "alnum_prop": 0.6744897959183673, "repo_name": "haisum/flask-starting-template", "id": "f6c2ff1229d37e61dd8f534e509976d6b9acd535", ...
import json import requests from collections import OrderedDict from redash.query_runner import * # TODO: make this more general and move into __init__.py class ResultSet(object): def __init__(self): self.columns = OrderedDict() self.rows = [] def add_row(self, row): for key in row....
{ "content_hash": "e32b2d62a42bc632f932ca755f8e21db", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 137, "avg_line_length": 26.28148148148148, "alnum_prop": 0.5208568207440811, "repo_name": "guaguadev/redash", "id": "f467134ccc574f0eb07923017f7f74821fee6d85", "size": "35...
from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import volume_backend class TestShowVolumeCapability(volume_fakes.TestVolume): """Test backend capability functionality.""" # The capability to be listed capability = volume_fakes.FakeCapability.create_o...
{ "content_hash": "fd64d380c54d81f2e0458f71628d315f", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 78, "avg_line_length": 31.474025974025974, "alnum_prop": 0.6007839900969671, "repo_name": "dtroyer/python-openstackclient", "id": "db1886608734a1d64146e326051d356b2f6716a7",...
import mock from openstackclient.identity.v3 import token from openstackclient.tests.identity.v3 import fakes as identity_fakes class TestToken(identity_fakes.TestIdentityv3): def setUp(self): super(TestToken, self).setUp() # Get a shortcut to the Service Catalog Mock self.sc_mock = moc...
{ "content_hash": "0ca9712ddba587ec0a49775a1fd0ef32", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 71, "avg_line_length": 31.940298507462686, "alnum_prop": 0.6242990654205608, "repo_name": "sjsucohort6/openstack", "id": "6ad4845da703a928c17aff74b0a9bf91b7d15dba", "size":...
from m5.params import * from m5.proxy import * from VirtIO import VirtIODeviceBase from Serial import SerialDevice class VirtIOConsole(VirtIODeviceBase): type = 'VirtIOConsole' cxx_header = 'dev/virtio/console.hh' qRecvSize = Param.Unsigned(16, "Receive queue size (descriptors)") qTransSize = Param.Un...
{ "content_hash": "dd03ace0bb38821fed542320db823b37", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 72, "avg_line_length": 34, "alnum_prop": 0.751131221719457, "repo_name": "TUD-OS/gem5-dtu", "id": "bce5e1de2451a5f69cffb476ae4f49475c637f82", "size": "2565", "binary": fa...
from waitress.server import create_server import logging def serve(app, **kw): _server = kw.pop('_server', create_server) # test shim _quiet = kw.pop('_quiet', False) # test shim _profile = kw.pop('_profile', False) # test shim if not _quiet: # pragma: no cover # idempotent if logging has alrea...
{ "content_hash": "7a0dd3af69952978657a12022a98925a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 34.142857142857146, "alnum_prop": 0.596931659693166, "repo_name": "rfguri/vimfiles", "id": "27210d40afd3b1dfa55b4aa0c59fb7cbf566d04b", "size": "1434"...
import re import os import argparse import subprocess import threading import logging import sys #Setup arguments parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog='''Avaliable groups:\n s - System information \n p - Package information \n c - Camera information''') parser...
{ "content_hash": "28396ed284e2cde36ddc46ade3d1f7f8", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 174, "avg_line_length": 40.62406015037594, "alnum_prop": 0.6017027577271886, "repo_name": "IntelRealSense/realsense_sdk", "id": "87088ed371f8c1aa79b178a01c459b042e5960c3", ...
import cv2 import numpy as np import os ################################################################################################### def main(): capWebcam = cv2.VideoCapture(0) # declare a VideoCapture object and associate to webcam, 0 => use 1st webcam if capWebcam.isOpened() == F...
{ "content_hash": "939bfeb8d781cd465f03bae2ba7bbc33", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 180, "avg_line_length": 63.18032786885246, "alnum_prop": 0.5321743642968345, "repo_name": "lucasbrsa/OpenCV-3.2", "id": "2f241f959926e93f7e37b41774326aa40cfe05ef", "size": ...
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
{ "content_hash": "0aa00b110fc9db2095385eba97a7ee53", "timestamp": "", "source": "github", "line_count": 1056, "max_line_length": 119, "avg_line_length": 44.65340909090909, "alnum_prop": 0.577172668278407, "repo_name": "rynomster/django", "id": "b6349e5c495c0d6b93a800bc8964bbf96560f598", "size": "47...
import os from base64 import b64encode from unittest import mock import pytest from airflow.exceptions import AirflowException from airflow.models import DAG from airflow.providers.sftp.hooks.sftp import SFTPHook from airflow.providers.sftp.operators.sftp import SFTPOperation, SFTPOperator from airflow.providers.ssh....
{ "content_hash": "8cacd1c7a9d7a10fb8cdc0469a63406b", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 103, "avg_line_length": 42.2970297029703, "alnum_prop": 0.5866690074906367, "repo_name": "danielvdende/incubator-airflow", "id": "544b7cc5eacf0f89fc3f28295317912009cee84f", ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/dungeon/corellian_corvette/shared_corvette_search_rebel_destroy_01.iff" result.attribute_template_id = -1 result.stfName("frn_n","frn_metal_crate") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ##...
{ "content_hash": "32fe522d22c11c2a6a533599bca300c8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 107, "avg_line_length": 26.076923076923077, "alnum_prop": 0.7109144542772862, "repo_name": "anhstudios/swganh", "id": "b949aa5f197f9502bfaedb4ac44bfb5438aecf7a", "size": "4...
"""Context for storing options for loading a SavedModel.""" import contextlib import threading class LoadContext(threading.local): """A context for loading a model.""" def __init__(self): super(LoadContext, self).__init__() self._load_options = None def set_load_options(self, load_options): self....
{ "content_hash": "e989ee31dc5526777332232a77555c01", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 59, "avg_line_length": 20.68421052631579, "alnum_prop": 0.6972010178117048, "repo_name": "sarvex/tensorflow", "id": "23532eee1e2f58c8f56ce7e7558cca647e7b49b3", "size": "147...
from __future__ import absolute_import import ipaddress import platform import responses import pytest import tempfile from django.core.exceptions import SuspiciousOperation from mock import patch from sentry import http from sentry.testutils import TestCase class HttpTest(TestCase): @responses.activate @p...
{ "content_hash": "37a0781f65017e42907806b9ad141c67", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 87, "avg_line_length": 35.25, "alnum_prop": 0.6107171000788022, "repo_name": "BuildingLink/sentry", "id": "09c5596614585187c0e8ffba65667fb745070045", "size": "2538", "bin...