text
stringlengths
4
1.02M
meta
dict
import benchexec.util as util import benchexec.tools.template import benchexec.result as result class Tool(benchexec.tools.template.BaseTool): """ Wrapper for a PAGAI tool (http://pagai.forge.imag.fr/). """ def executable(self): return util.find_executable("pagai") def name(self): ...
{ "content_hash": "4c5c95dfeb6bfc0ef8d5650a691e2fd6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 76, "avg_line_length": 31.032258064516128, "alnum_prop": 0.6101871101871101, "repo_name": "sosy-lab/benchexec", "id": "2fd447ae2a782e091d4db9727a23a09bfa86519f", "size": "1...
"""Implements a DOM for MediaQuery, see http://www.w3.org/TR/css3-mediaqueries/. A cssutils implementation, not defined in official DOM. """ __all__ = ['MediaQuery'] __docformat__ = 'restructuredtext' __version__ = '$Id$' import cssutils import re import xml.dom class MediaQuery(cssutils.util.Base): ...
{ "content_hash": "6c897d47428d5156160596f62124c8cb", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 90, "avg_line_length": 39.690821256038646, "alnum_prop": 0.505842259006816, "repo_name": "bslatkin/8-bits", "id": "97b1c5fd651466db60cd89aa824fc119c28a79c5", "size": "8216...
"""IRB Test Case HLD: **config** - L2 MAC learning enabled in l2bd - 2 routed interfaces untagged, bvi (Bridge Virtual Interface) - 2 bridged interfaces in l2bd with bvi **test** - sending ip4 eth pkts between routed interfaces - 2 routed interfaces - 2 bridged interfaces - 64B, 5...
{ "content_hash": "693e48027a8b449a61d93f40d826e3bd", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 84, "avg_line_length": 34.12323943661972, "alnum_prop": 0.5886905376122176, "repo_name": "chrisy/vpp", "id": "ac3b30ba71da34d312774fe744f2637308c44c4a", "size": "9714", ...
import mock from oslo_log import log as logging from oslo_utils import uuidutils import testtools from webob import exc from neutron import context from neutron.db import models_v2 from neutron.extensions import external_net as external_net from neutron import manager from neutron.tests.unit.api.v2 import test_base fr...
{ "content_hash": "59634b75a150fe66c587e529434d0bc7", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 79, "avg_line_length": 44.099378881987576, "alnum_prop": 0.5829577464788732, "repo_name": "yanheven/neutron", "id": "cf833b9d737116810dc77220b92cd50e4af9c0ff", "size": "77...
import logging from django.conf import settings from django.core.files.storage import get_storage_class from storages.backends.s3boto import S3BotoStorage logger = logging.getLogger('us_ignite.common.storage') STATIC_LOCATION = 'static/%s' % settings.STATIC_FILES_VERSION class StaticS3Storage(S3BotoStorage): ...
{ "content_hash": "0a99eb1d5d015ec60b06e55233292684", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 76, "avg_line_length": 33.204081632653065, "alnum_prop": 0.6601106330669945, "repo_name": "us-ignite/us_ignite", "id": "7ed94eb2ae992ff5417e45c7f11f866582419537", "size": "...
from . import indexstoredb from . import product class SourceKitLSP(product.Product): @classmethod def product_source_name(cls): return "sourcekit-lsp" @classmethod def is_build_script_impl_product(cls): return False def build(self, host_target): indexstoredb.run_build_sc...
{ "content_hash": "1d051c7ce69d27f8c61a13b6dc3f57cc", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 58, "avg_line_length": 27.666666666666668, "alnum_prop": 0.6454388984509466, "repo_name": "shajrawi/swift", "id": "794a29f6e5a4b5e6be3bd0fd3286684ab64d73ea", "size": "1089"...
""" ======================================== Plot multi-class SGD on the iris dataset ======================================== Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the three one-versus-all (OVA) classifiers are represented by the dashed lines. """ print __doc__ i...
{ "content_hash": "5628436bc293206e766d1ef87ed9a657", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 75, "avg_line_length": 27.1625, "alnum_prop": 0.6171191900598251, "repo_name": "mrshu/scikit-learn", "id": "9f2a90008b31bf4720788197845c7b3aa1c9a608", "size": "2173", "bi...
import logging import pyvex import archinfo from .... import options, BP_BEFORE from ....blade import Blade from ....annocfg import AnnotatedCFG from ....exploration_techniques import Slicecutor from .resolver import IndirectJumpResolver l = logging.getLogger(name=__name__) class MipsElfFastResolver(IndirectJum...
{ "content_hash": "b299f6e8e555324c01a2c6515e674b89", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 125, "avg_line_length": 41.27522935779817, "alnum_prop": 0.5596799288730829, "repo_name": "iamahuman/angr", "id": "8e8369cfc24a1dbc2dad2ff618c0449e6a995759", "size": "4500...
"""The registration server used to register tasks. The registration server is started by the test controller and allows the tasks to register themselves when they start. Authentication of the tasks controllers is based on an OTP passed to the run_task binary on startup. """ import logging import threading #pylint: d...
{ "content_hash": "c31e7d7b88c8f5f65a302b895a304fde", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 31.537037037037038, "alnum_prop": 0.708162066940693, "repo_name": "Workday/OpenFrame", "id": "a4ac4cb8cb01dfdc31411dcc5ff60b2ef7e01532", "size": "186...
from django.urls import reverse from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon.utils import memoized from openstack_dashboard import api from openstack_dashboard.dashboards.project.routers.extensions.extraroutes\ import forms as erforms...
{ "content_hash": "640577dd0a9115beae8a4288b05ea197", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 75, "avg_line_length": 34.675, "alnum_prop": 0.6669069935111752, "repo_name": "openstack/horizon", "id": "9303867542a244c54fdb95c5b3a81cc36cc087b5", "size": "2023", "bina...
import sys import pickle import numpy.oldnumeric as Numeric """ This script converts a Numeric (Omega matrix) tableaux database as built by buildtableauxdb.py -n to a simple fixed field width ASCII format useful for parsing by other programs (especially FORTRAN). The format of the input is pickled Numeric.array valu...
{ "content_hash": "3add19fc20b08af24298cb291bcfc8be", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 77, "avg_line_length": 27.94495412844037, "alnum_prop": 0.6152330925804333, "repo_name": "NirBenTalLab/proorigami-ptgraph", "id": "7630bfe3597618784de0b5b23df00525e3342de9",...
""" Central module for calculating the tidal amplitudes, phases, etc. """ import numpy as np from ._time_conversion import _normalize_time from ._ut_constants import constit_index_dict from .confidence import _confidence from .constituent_selection import ut_cnstitsel from .diagnostics import ut_diagn from .ellipse_p...
{ "content_hash": "4ace1ae74b5f26ded663f8eebcdf3730", "timestamp": "", "source": "github", "line_count": 535, "max_line_length": 88, "avg_line_length": 31.97570093457944, "alnum_prop": 0.5517624364295318, "repo_name": "ocefpaf/UTide", "id": "2295d1550b71db85ade332ebd45fdbe628552c66", "size": "17107"...
""" Django settings for solnce project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
{ "content_hash": "9ab2a0aad164a6249d173ef7cf0d9063", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 91, "avg_line_length": 27.176470588235293, "alnum_prop": 0.687012987012987, "repo_name": "DenysGurin/solnce", "id": "2cfec9b3a6243c929e940fdef4038f61800edd4e", "size": "46...
from django.db import models class ContactManager(models.Manager): def sample(self, count): """ Efficient random selection of contacts. We have this because randomly ordering the database is insanely slow. We use to ensure that when hitting the panic button, we don't know who it ...
{ "content_hash": "55d697b06a81bb6f0dcc43f27c1a1476", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 78, "avg_line_length": 34.71153846153846, "alnum_prop": 0.6498614958448753, "repo_name": "hwayne/safehouse", "id": "76e28657a9e7943e3129d2b5bb260dcf37f91714", "size": "1805...
import pytest from tests.providers.google.cloud.utils.gcp_authenticator import GCP_BIGQUERY_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context @pytest.mark.backend("mysql", "postgres") @pytest.mark.credential_file(GCP_BIGQUERY_KEY) class TestGoogleCloudStorage...
{ "content_hash": "3ab7164c533bff3c57b0f38db94c6cd1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 103, "avg_line_length": 35.22222222222222, "alnum_prop": 0.749211356466877, "repo_name": "apache/incubator-airflow", "id": "5971e94ba614232a82448bfeee8bfb2da6be5159", "size...
from __future__ import absolute_import from time import time import datetime def utc_now(): return datetime.datetime.utcnow() def local_now(): return datetime.datetime.now() def now_str(): return local_now().strftime("%Y-%m-%d %H:%M:%S") def get_timestamp(): return int(time()) def g...
{ "content_hash": "de3dfd0e910b6282f3dcfde59c4551f8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 88, "avg_line_length": 24, "alnum_prop": 0.6435185185185185, "repo_name": "panweifeng/openunipay", "id": "ebce914f6f6a96e72398791c59951cc37bc76750", "size": "432", "binar...
import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller from .. import models class RedisOperations(object): """RedisOperations operations. :param client: Client for service requests. :para...
{ "content_hash": "1d2f5e686a2115284b2be80f4de2508f", "timestamp": "", "source": "github", "line_count": 830, "max_line_length": 144, "avg_line_length": 45.26385542168675, "alnum_prop": 0.6391705927759589, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "576489be008fcb6b9e4b57f980272e0cef31dfa8"...
import os, glob from distutils.core import setup from core.constants import COREDPY_VERSION setup(name = "core-python", version = COREDPY_VERSION, packages = [ "core", "core.addons", "core.api", "core.emane", "core.misc", "core.bsd", "core.netns", ...
{ "content_hash": "ac62f9b7a541fc55315517327ca02d88", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 29.4, "alnum_prop": 0.5741496598639456, "repo_name": "guidotack/coreemu", "id": "fd033e233ae6b88a97bee9797bb8c921104e1b8a", "size": "835", "binary"...
''' Used by :class:`hystrix.command.Command` to record metrics.''' from __future__ import absolute_import import logging import six from pyhystrix.rolling_number import RollingNumber log = logging.getLogger("pyhystrix") class Metrics(object): """ Base class for metrics Args: counter (:class:`hystr...
{ "content_hash": "1c30cbcb411afbd26c69899c867d4772", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 30.007194244604317, "alnum_prop": 0.569647566530808, "repo_name": "cookingkode/pyhystrix", "id": "9387b100b7d4dff70a3f437fcf9da27909c98516", "size":...
import json from unittest import mock from imhotep.http_client import BasicAuthRequester def test_auth(): ghr = BasicAuthRequester("user", "pass") auth = ghr.get_auth() assert auth.username == "user" assert auth.password == "pass" def test_empty_auth(): ghr = BasicAuthRequester("", "") auth...
{ "content_hash": "8c7462ae3507c29e4d7d43ffcfeebf6b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 25.73170731707317, "alnum_prop": 0.623696682464455, "repo_name": "justinabrahms/imhotep", "id": "d1ad475b39c52e8bb17092acbdf72ff81d0f7096", "size": "...
""" HTML Widget classes """ import copy import datetime import re from itertools import chain from django.conf import settings from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats from django.utils.dates import MONTHS from dja...
{ "content_hash": "c5d2e3776691e33ef364d89ef6887f18", "timestamp": "", "source": "github", "line_count": 1043, "max_line_length": 115, "avg_line_length": 33.95397890699904, "alnum_prop": 0.5799683740893432, "repo_name": "mojeto/django", "id": "164b0c38c1aa1b6efe87652bdff62647fd9109ca", "size": "3541...
"""The start subcommand for opsdroid cli.""" import gettext import logging import click from opsdroid.cli.utils import ( check_dependencies, configure_lang, path_option, welcome_message, ) from opsdroid.configuration import load_config_file from opsdroid.const import DEFAULT_CONFIG_LOCATIONS from ops...
{ "content_hash": "3a667d47491a6c51a2d0a2e3e30f9eca", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 24.41860465116279, "alnum_prop": 0.7304761904761905, "repo_name": "jacobtomlinson/opsdroid", "id": "df7e5f4cfbf33f76652a26d3e3122381d36b346b", "size"...
""" Empirical Likelihood Linear Regression Inference The script contains the function that is optimized over nuisance parameters to conduct inference on linear regression parameters. It is called by eltest in OLSResults. General References ----------------- Owen, A.B.(2001). Empirical Likelihood. Chapman and Hall...
{ "content_hash": "3de2110c74770bbb3fac5375bc989c02", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 80, "avg_line_length": 33.967032967032964, "alnum_prop": 0.552895503073439, "repo_name": "rgommers/statsmodels", "id": "20a0bd1433c87fa7fe99cdbf245447227f208157", "size": "...
""" Dual-tree complex wavelet transform (DTCWT) module. Author: Laurent P. René de Cotret """ from itertools import cycle import numpy as n from pywt import dwt, idwt, dwt2, idwt2, dwt_max_level from ._wavelets import dualtree_wavelet, dualtree_first_stage __all__ = ['dualtree', 'idualtree', 'dualtree_max_level', 'ap...
{ "content_hash": "df5e20675781e5da2735968169160ba0", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 162, "avg_line_length": 40.048469387755105, "alnum_prop": 0.6399133702783617, "repo_name": "LaurentRDC/dualtree", "id": "6135c400b0fdcc7177ab2cb739aede0881ba3d58", "size":...
import shutil import sys import os import re from optparse import OptionParser from androguard.core.androgen import Androguard from androguard.core import androconf from androguard.core.analysis import analysis from androguard.core.bytecodes import dvm from androguard.core.bytecode import method2dot, method2format fr...
{ "content_hash": "df5ed5dca677c7f4fe0249d159105537", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 126, "avg_line_length": 43.88108108108108, "alnum_prop": 0.4873121458487312, "repo_name": "alireza-87/RansomeAnalyzLDA", "id": "ea33b92081821e08f2fd19aa63db0b15c596b5dc", ...
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the followi...
{ "content_hash": "19f8c84efd297c8536e6f9e7acf995dc", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 73, "avg_line_length": 34.26851851851852, "alnum_prop": 0.6706295595784924, "repo_name": "ericlink/adms-server", "id": "8414771af1a7407ebeecf3e7cd586e58811f0198", "size": ...
from __future__ import unicode_literals import uuid from keystoneclient import fixture def unscoped_token(): return fixture.V2Token(token_id='3e2813b7ba0b4006840c3825860b86ed', expires='2012-10-03T16:58:01Z', user_id='c4da488862bd435c9e6c0275a0d0e49a', ...
{ "content_hash": "b153d243dd5013f122e9384e8e9a0fd1", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 78, "avg_line_length": 41.91304347826087, "alnum_prop": 0.5448132780082987, "repo_name": "sjsucohort6/openstack", "id": "0ce318d32ac7f636e0b7a2e0b80f8eb16f63e26a", "size":...
from .service_bus_management_client import ServiceBusManagementClient from .version import VERSION __all__ = ['ServiceBusManagementClient'] __version__ = VERSION
{ "content_hash": "af7eff48e8c9d4c55fcf60ee369a6515", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 23.571428571428573, "alnum_prop": 0.7818181818181819, "repo_name": "v-iam/azure-sdk-for-python", "id": "d26139d3e8b7063a0fc691f2b900193a5b1d4cd7", "si...
from __future__ import absolute_import, division, print_function, unicode_literals import unittest from amaascore.assets.sukuk import Sukuk from amaascore.tools.generate_asset import generate_sukuk class SukukTest(unittest.TestCase): def setUp(self): self.longMessage = True # Print complete error mess...
{ "content_hash": "9d499b5eec773cde47fdbe5c5bf0b5a1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 82, "avg_line_length": 25.217391304347824, "alnum_prop": 0.6879310344827586, "repo_name": "nedlowe/amaas-core-sdk-python", "id": "ffe213ab29465150b2b875c5674bfcd42485042b", ...
from .bot import Tsukino __all__ = ['Tsukino']
{ "content_hash": "35af9c28e3bb662e36671374e84ea66d", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 24, "avg_line_length": 15.666666666666666, "alnum_prop": 0.6382978723404256, "repo_name": "Linzolle/tsukino", "id": "c25b228fd71fcb919dd28d4caeed9e401d799402", "size": "47",...
print('bootstrap3_settings.py') # Setting for django-bootstrap3 BOOTSTRAP3 = { # The URL to the jQuery JavaScript file 'jquery_url': '//code.jquery.com/jquery.min.js', # The Bootstrap base URL 'base_url': '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/', # The complete URL to the Bootstrap CSS file (N...
{ "content_hash": "a794a3cad0d3fb5def71eff49717aa4b", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 107, "avg_line_length": 34.75, "alnum_prop": 0.6834532374100719, "repo_name": "yeongseon/django_beautifulseodang", "id": "2eba1ae12d3ffabff7d02b399ed82d52abca22ee", "size":...
from __future__ import with_statement from django.test import TestCase from tastypie.contrib.contenttypes.fields import GenericForeignKeyField from content_gfk.models import Note, Quote, Definition from content_gfk.api.resources import NoteResource, QuoteResource class ContentTypeFieldTestCase(TestCase): def ...
{ "content_hash": "05a28634e884944a5e886d67d9e860b0", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 89, "avg_line_length": 32.129411764705885, "alnum_prop": 0.6111314536799707, "repo_name": "SeanHayes/django-tastypie", "id": "0c8c3ced6112ac562ff3389f6dd00878462066fa", "si...
""" Utilities for HMM. Copyright (C) 2017, Lucas Ondel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pu...
{ "content_hash": "2d3ab596bebb6d8288128173f55e16f2", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 77, "avg_line_length": 37.16393442622951, "alnum_prop": 0.6541685046316719, "repo_name": "amdtkdev/amdtk", "id": "60442d5539b5ba4611430cf9aee134f341b42045", "size": "4535"...
from django.conf import settings if __name__ == '__main__': # When running this file in isolation, we need to set up the configuration # before importing 'template'. settings.configure() import os import unittest from datetime import datetime, timedelta from django import template from django.core import...
{ "content_hash": "be3355e9da848ed0953b909c3bfaa2d9", "timestamp": "", "source": "github", "line_count": 981, "max_line_length": 319, "avg_line_length": 65.17125382262996, "alnum_prop": 0.49426743622229524, "repo_name": "dcramer/django-compositepks", "id": "cdf56ab56ca3baccb5f04a7bd20aed41eea90671", ...
""" Convert fitpot parameters `in.vars.fitpot` to pmd param file `in.params.XXX`. Usage: fp2prms.py [options] <pot-type> <in-file> Options: -h, --help Show this message and exit. --specorder SPECORDER Species order in comma-separated format, e.g.) Li,P,O. [default: None] --pairs PAIRS ...
{ "content_hash": "fd36a703d44d027982d8c5ff3f2a7696", "timestamp": "", "source": "github", "line_count": 520, "max_line_length": 106, "avg_line_length": 31.217307692307692, "alnum_prop": 0.5122897800776197, "repo_name": "ryokbys/nap", "id": "11a7b0665bef365d4cf5fa1169180c588c4ca81c", "size": "16255"...
""" This module contains helper functions and data structures for running tests. """ import numpy as np from kid_readout.measurement import core, basic, acquire from kid_readout.roach import baseband # TODO: incorporate heterodyne, r2heterodyne from kid_readout.roach.tests import mock_roach, mock_valon bad_node_path...
{ "content_hash": "d76f5fe87e9f4de3cad8feda137abe6a", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 120, "avg_line_length": 49.815602836879435, "alnum_prop": 0.5525341685649203, "repo_name": "ColumbiaCMB/kid_readout", "id": "6c490ff9c2f71e0a21fea0cb03282cc682d21073", "si...
"""Support for Traccar device tracking.""" from datetime import datetime, timedelta import logging from pytraccar.api import API from stringcase import camelcase import voluptuous as vol from homeassistant.components.device_tracker import ( PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA, SOURCE_TYPE_GPS, ) from ho...
{ "content_hash": "7fc158e26b94b8fcd34d78bfa1195b9e", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 88, "avg_line_length": 32.14093959731544, "alnum_prop": 0.5867613280434328, "repo_name": "sander76/home-assistant", "id": "16cd9ba94e52da7736ca2a0c8b837e04aa0ced8d", "size...
from peak.util.proxies import LazyProxy from pyparsing import ( Word, QuotedString, oneOf, CaselessLiteral, White, OneOrMore, Optional, alphanums, srange, ZeroOrMore, CaselessKeyword, nestedExpr, Forward, Group) from .grammar_parsers import ( parse_logical_expression, parse_compare_expression, parse_fre...
{ "content_hash": "29f90eb2d8a2d5103c8deb54ad0c9154", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 82, "avg_line_length": 38.858369098712444, "alnum_prop": 0.6410426330903468, "repo_name": "Aplopio/plasticparser", "id": "f9b03a2de301ee822558a0da70eb34a7e74ab6de", "size"...
""" This file contains unit tests for the KML DOM Python SWIG bindings. """ import unittest import kmlbase import kmldom class VerySimpleParseTestCase(unittest.TestCase): """ This simply verifies the existence of the binding to ParseKml() """ def runTest(self): assert kmldom.ParseKml('<kml/>') class VeryS...
{ "content_hash": "b7966507e503a7443fa308e3ae808dad", "timestamp": "", "source": "github", "line_count": 1628, "max_line_length": 80, "avg_line_length": 35.91400491400491, "alnum_prop": 0.7159471847848395, "repo_name": "libkml/libkml", "id": "4762d6ed5ffb55da775c1fd6fd982b3bd694f88a", "size": "59981...
import copy import datetime import hashlib import logging import os import alerts import enhancements import jsonschema import ruletypes import yaml import yaml.scanner from opsgenie import OpsGenieAlerter from staticconf.loader import yaml_loader from util import dt_to_ts from util import dt_to_ts_with_format from ut...
{ "content_hash": "7f778ecbf9049329043f42c09b2d6995", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 131, "avg_line_length": 40.55528255528255, "alnum_prop": 0.635647643281231, "repo_name": "dvopsway/elastalert", "id": "cdac2a5d8201fbcd251a5965119aecf879a0b81c", "size": "...
"""Tests for dnn_linear_combined.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import tempfile import numpy as np import six from tensorflow.core.example import example_pb2 from tensorflow.core.example import feature_pb2 from tensor...
{ "content_hash": "980eaf0d88a0c473ee869ac7310b464d", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 80, "avg_line_length": 37.78032036613272, "alnum_prop": 0.6549666868564507, "repo_name": "rabipanda/tensorflow", "id": "84675bf2a4a1655026bbba37c5d7a63d2f788c46", "size": ...
"""tests for the astng variable lookup capabilities """ import sys from os.path import join, abspath from logilab.common.testlib import TestCase, unittest_main from logilab.astng import builder, nodes, scoped_nodes, \ InferenceError, NotFoundError from logilab.astng.scoped_nodes import builtin_lookup from unittes...
{ "content_hash": "4f736381123ea96be5d14bfd179bde22", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 87, "avg_line_length": 31.501845018450183, "alnum_prop": 0.585920112451681, "repo_name": "dbbhattacharya/kitsune", "id": "6878a45d9a258acd025166e818fcc12e11ee7e25", "size"...
import asyncio import random from typing import Tuple from urllib import parse from aiohttp import web ENTITY_INJECTION_TEMPLATE = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' \ '<!DOCTYPE stuff [<!ELEMENT data ANY> <!ENTITY goodies {0}>]> <data>&goodies;</data>' router = web...
{ "content_hash": "378cf71f92a57268b2d56dd80801c6c8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 113, "avg_line_length": 34.391304347826086, "alnum_prop": 0.6809945217024863, "repo_name": "orf/xcat", "id": "bc84d38aaac852c042770be6a06a50d4d1ecab02", "size": "2373", "...
"""Fast decoding routines for non-autoregressive generation.""" import flax import jax from jax import lax import jax.numpy as jnp from maskgit.libml import mask_schedule # Confidence score for known tokens to avoid masking or repredicting them. # Here we don't use 1.0 because the upper bounder of the probability can...
{ "content_hash": "3a50406724a069e14780b5b9a7153243", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 95, "avg_line_length": 40.32484076433121, "alnum_prop": 0.6791975991154636, "repo_name": "google-research/maskgit", "id": "d9e995d73d2cf52e14400f78737847da357744a0", "size...
# Regenerate the Scintilla and SciTE source files that list # all the lexers and all the properties files. # Should be run whenever a new lexer is added or removed. # Requires Python 2.4 or later # Most files are regenerated in place with templates stored in comments. # The VS .NET project file is generated into...
{ "content_hash": "77971937dc5dc323a1555659650b0b7a", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 107, "avg_line_length": 39.2972027972028, "alnum_prop": 0.5916896521042797, "repo_name": "Josiastech/vuforia-gamekit-integration", "id": "82899c2b53df8bbf00d7c5faec72dd7ca4d...
from connect import * def commit_exists(conn,user, repo, sha, v_class): return conn.exists('commit:%s:%s:%s:%s'%(user, repo, sha, v_class)); def add_commit(r, idf, user, repo, vclass, sha, shap, vuln, line, tool_res, obs, commit_url): pip = r.pipeline(); pip.hmset('commit:%s:%s:%s:%s'%(user, repo, sha, vc...
{ "content_hash": "2fc8c62d6c8537c58bc6a1ee0a2498be", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 127, "avg_line_length": 31.33884297520661, "alnum_prop": 0.5640822784810127, "repo_name": "TQRG/secbench", "id": "6680c5cf8838e86ffbda22dc60c241794420a7a8", "size": "3792"...
__author__ = "Taylor Oshan Tayoshan@gmail.com" from .kernels import * from .search import golden_section, equal_interval, flexible_bw from .gwr import GWR from crankshaft.regression.glm.family import Gaussian, Poisson, Binomial import pysal.spreg.user_output as USER from .diagnostics import get_AICc, get_AIC, get_BIC,...
{ "content_hash": "d89d4cd005dbc30ca874f7fb89d44621", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 88, "avg_line_length": 39.56115107913669, "alnum_prop": 0.5160938352427714, "repo_name": "CartoDB/crankshaft", "id": "8074b204ea30da46dd480c5aa64b54e8fba848e2", "size": "1...
from docutils import core, io def parse_tag_names(tag_string, delimiter=','): """ :param tag_string: :param delimiter: :return list of tag strings: """ if not tag_string: return [] tags = tag_string.split(delimiter) return [tag.strip() for tag in tags] def make_tag_string(...
{ "content_hash": "914e7f5d8fb0b27c407f2de95ff364c9", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 77, "avg_line_length": 35.85, "alnum_prop": 0.6628312412831241, "repo_name": "logston/plog-work", "id": "1bc9d6ae331b00811a0f3353ebe5a7d079d12b0b", "size": "2868", "binar...
import base64 import os import json import shared from flask import Flask, request app = Flask(__name__) @app.route("/", methods=["POST"]) def index(): """ Receives messages from a push subscription from Pub/Sub. Parses the message, and inserts it into BigQuery. """ event = None # Check req...
{ "content_hash": "4884a98ab54919b2670274c74a7a004f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 80, "avg_line_length": 29.466666666666665, "alnum_prop": 0.609049773755656, "repo_name": "GoogleCloudPlatform/fourkeys", "id": "6803cdfee284f91237f364ebbb38ce67d148e80e", "...
import gameobj from colors import BLUE class Block(gameobj.GameObj): def __init__(self, x, y, width, height): """ Constructor for the wall that the player can run into. """ # Call the parent's constructor super(Block, self).__init__(x, y) # Make a blue wall, of the size specified in the parameters self....
{ "content_hash": "f13b75fe2de2bf1a8c949082740606d5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 64, "avg_line_length": 27.263157894736842, "alnum_prop": 0.6872586872586872, "repo_name": "michael-stanin/PackmanReturns", "id": "9b806e1c4d8f5533b31054730c7a9aa9ffa01f74", ...
import mock import oslo_messaging from cinder.api.contrib import capabilities from cinder import context from cinder import exception from cinder import test from cinder.tests.unit.api import fakes from cinder.tests.unit import fake_constants as fake def rpcapi_get_capabilities(self, context, host, discover): c...
{ "content_hash": "eca2eacb9b40a7d8b6b357e2c7edf705", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 38.33913043478261, "alnum_prop": 0.5579496484463597, "repo_name": "ge0rgi/cinder", "id": "5e39943e71e578a494142a8b8927bbf8dc9203f4", "size": "5055",...
import abc from alembic import script as alembic_script from contextlib import contextmanager import os from oslo_config import cfg from oslo_config import fixture as config_fixture from oslo_db.sqlalchemy import session from oslo_db.sqlalchemy import test_base from oslo_db.sqlalchemy import test_migrations from oslo_d...
{ "content_hash": "ce23076bfdef86b2ce96a7ea57be0715", "timestamp": "", "source": "github", "line_count": 600, "max_line_length": 79, "avg_line_length": 41.70666666666666, "alnum_prop": 0.5812420076726342, "repo_name": "klmitch/neutron", "id": "0cab71ab2f21e3986896d0f9590c9b308b942678", "size": "2563...
"""Contains private utilities used mainly by the base Layer class.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections as collections_lib import threading import enum from tensorflow.python.eager import context from tensorflow.python.frame...
{ "content_hash": "861e9fedb756ba9fea8d82870ae2ba8a", "timestamp": "", "source": "github", "line_count": 531, "max_line_length": 102, "avg_line_length": 36.19020715630885, "alnum_prop": 0.6994848311390955, "repo_name": "theflofly/tensorflow", "id": "95f709fd425f2d386ffd2fa93ec0b8ef6061d5c4", "size":...
""" small utility for hot-syncing a svn repository through ssh. uses execnet. """ from __future__ import print_function import os import sys import execnet import py def usage(): arg0 = sys.argv[0] print(arg0, "[user@]remote-host:/repo/location localrepo [ssh-config-file]") def main(args): remote = ...
{ "content_hash": "e207b4e469c65feada81483bfd4face8", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 80, "avg_line_length": 28.828125, "alnum_prop": 0.5390243902439025, "repo_name": "alfredodeza/execnet", "id": "b5f95a653307121ea01835729beac4f722fa83c7", "size": "3736", ...
"""A demo client for Open Pixel Control http://github.com/zestyping/openpixelcontrol Sends red, green, and blue to the first 3 LEDs. To run: First start the gl simulator using, for example, the included "wall" layout make bin/gl_server layouts/wall.json Then run this script in another shell to send colors t...
{ "content_hash": "468105873fd2aff20ecc162cbb571095", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 136, "avg_line_length": 25.827067669172934, "alnum_prop": 0.6055312954876274, "repo_name": "beneckart/future-robotics", "id": "117b4d1917c2bafc333dbde948303542fce6d389", "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hashlib import logging import requests import StringIO import PyPDF2 import boto3 from .. import base logger = logging.getLogger(__name__) # Module API def proc...
{ "content_hash": "8beda14ef2903247ca4dd71651aa9cf6", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 85, "avg_line_length": 32.223404255319146, "alnum_prop": 0.566358534169693, "repo_name": "arthurSena/processors", "id": "b8e1a61f142fe27b340a2151cdb89edb5cb3816c", "size":...
""" Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
{ "content_hash": "3aa35253952792f13ffaf39a14f3c674", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 77, "avg_line_length": 26.802919708029197, "alnum_prop": 0.5582788671023965, "repo_name": "jlongever/redfish-client-python", "id": "099ed7a2a46bb69d0e6184f9ded66451c16a364a"...
import logging from oslo_messaging._drivers import base from oslo_messaging._drivers.zmq_driver.server.consumers\ import zmq_consumer_base from oslo_messaging._drivers.zmq_driver.server import zmq_incoming_message from oslo_messaging._drivers.zmq_driver import zmq_address from oslo_messaging._drivers.zmq_driver im...
{ "content_hash": "a1b647b7ab7c0dc67e34b660dd839656", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 78, "avg_line_length": 37.92941176470588, "alnum_prop": 0.608560794044665, "repo_name": "dukhlov/oslo.messaging", "id": "010eecb6239d03a665b8156c7bbd115a3eae46bc", "size": ...
''' This is the file containing functions related to archiving of files. ''' import tarfile, zipfile import os, shutil # Function to find the XOR of 2 objects (true if exactly one of them is not null). def xor(a, b): return bool(a) != bool(b) # Class that acts as an API for archived files. Uses the built-in tarf...
{ "content_hash": "a7eb20acce2bbcb79f3d740becdf67e9", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 152, "avg_line_length": 39.80487804878049, "alnum_prop": 0.6362745098039215, "repo_name": "kartikshah1/Test", "id": "3c5a626cc7c01324369cc1c6e781cb8edcf93cc4", "size": "81...
from django.db import migrations import waldur_core.core.fields class Migration(migrations.Migration): dependencies = [ ('waldur_jira', '0018_project_runtime_state'), ] operations = [ migrations.AlterField( model_name='project', name='action_details', ...
{ "content_hash": "c036227fd0360bbe7eef449143ca288a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 21.833333333333332, "alnum_prop": 0.6106870229007634, "repo_name": "opennode/nodeconductor-assembly-waldur", "id": "902eacb9df26f325978ce7ce1914a8fccf4...
""" An interface for running test cases as unattended jobs. """ import sys import os from functools import partial from pycopia import logging from pycopia import shparser from pycopia import getopt from pycopia.QA import testloader from pycopia.QA.db import models def _parse_parameters(text): def _ParserCB(d...
{ "content_hash": "5a9687c51aa4b15d985516c60eaad410", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 86, "avg_line_length": 27.288343558282207, "alnum_prop": 0.5897032374100719, "repo_name": "kdart/pycopia3", "id": "a50d6d6e964f3d93076c59d850b270fb92bac3cc", "size": "5061...
"""Identity v3 Consumer action implementations""" import six import sys from eclcli.common import command from eclcli.common import utils class CreateConsumer(command.ShowOne): """Create new consumer""" def get_parser(self, prog_name): parser = super(CreateConsumer, self).get_parser(prog_name) ...
{ "content_hash": "97777b8318667ae399e72db3584acf5f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 74, "avg_line_length": 30.271929824561404, "alnum_prop": 0.6053317878875688, "repo_name": "nttcom/eclcli", "id": "69aca5011134f0a6ab9a7b4340a074f79806d3ec", "size": "4064"...
import uuid class Message(object): def __init__(self, kind, timestamp, raw_data): self.kind = kind self.timestamp = timestamp self.raw_data = raw_data self.uuid = str(uuid.uuid4()) def _asdict(self): return { 'kind': self.kind, 'timestamp': self...
{ "content_hash": "6d172c62fa4ae289923af25306b90063", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 59, "avg_line_length": 24.347826086956523, "alnum_prop": 0.5017857142857143, "repo_name": "ericflo/hurricane", "id": "42faa478c98edc7e43520c1e76c93b612e769679", "size": "56...
def extractKoreYoriHachidori(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'Seiun wo kakeru'.lower() in item['title'].lower(): return buildReleaseMessageWithType(item, 'Seiun wo Kakeru', vol, c...
{ "content_hash": "747a37c684aa94943afdf7bae5a42cbd", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 174, "avg_line_length": 58.142857142857146, "alnum_prop": 0.7346437346437347, "repo_name": "fake-name/ReadableWebProxy", "id": "5313408494de1aa4ab10daadaea0f5a2b623cd75", "...
import unittest import arbor as arb from .. import cases # check Arbor's configuration of mpi and gpu mpi_enabled = arb.__config__["mpi"] gpu_enabled = arb.__config__["gpu"] """ all tests for distributed arb.domain_decomposition """ # Dummy recipe class homo_recipe(arb.recipe): def __init__(self, n=4): ...
{ "content_hash": "6c8fb35f122b32547e9ded203771e16c", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 119, "avg_line_length": 31.642384105960264, "alnum_prop": 0.5629970699037254, "repo_name": "eth-cscs/nestmc-proto", "id": "e19bd55c0f67d1cc6fcafeb2b0d7ae677d272c67", "size...
""" DAG designed to test what happens when a DAG with pooled tasks is run by a BackfillJob. Addresses issue #1225. """ from datetime import datetime from airflow.models import DAG from airflow.operators.dummy_operator import DummyOperator dag = DAG(dag_id='test_backfill_pooled_task_dag') task = DummyOperator( tas...
{ "content_hash": "4e9afa455c2af8d671b6243fca6bd4ed", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 27.529411764705884, "alnum_prop": 0.7350427350427351, "repo_name": "wileeam/airflow", "id": "ced09c67ecff6ad26b43f7b99ab355d652adc8a5", "size": "1257...
import binascii import netaddr from oslo_log import log as logging from oslo_utils import excutils import six from neutron.agent.l3 import dvr_fip_ns from neutron.agent.l3 import dvr_router_base from neutron.agent.linux import ip_lib from neutron.common import constants as l3_constants from neutron.common import exce...
{ "content_hash": "76e409f6cf52bef721840d7c4b10d1a7", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 79, "avg_line_length": 45.48872180451128, "alnum_prop": 0.5639669421487603, "repo_name": "javaos74/neutron", "id": "6e5b37028309b3b63c33ab08f1fed00a990c2b98", "size": "187...
from django.conf.urls import patterns, url from django.contrib.auth.decorators import login_required from go.scheduler.views import ( SchedulerCreatePendingTask, SchedulerDelete, SchedulerListView, SchedulerModifyDate) urlpatterns = patterns( '', url(r'^$', login_required(SchedulerListView.as_view()),...
{ "content_hash": "b12a404c83ce6c8f1f8fbf1d35ed0108", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 75, "avg_line_length": 32.68181818181818, "alnum_prop": 0.6467315716272601, "repo_name": "praekelt/vumi-go", "id": "e0958b73a711d189b2f033ca2aa47f1518c5a907", "size": "719"...
from gluon.storage import Storage settings = Storage() settings.migrate = True settings.title = 'ConCoct' settings.subtitle = T('Upload, compile and check!') settings.author = 'Christian Wichmann' settings.author_email = 'christian@freenono.org' settings.keywords = '' settings.description = T('ConCoCt is a web applic...
{ "content_hash": "20787379724672417b906f47d4c9662a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 145, "avg_line_length": 37.94117647058823, "alnum_prop": 0.7736434108527132, "repo_name": "wichmann/ConCoCt", "id": "2ed74b7df13b5bf43e5cab2a51db301e8c221f7d", "size": "670...
''' This is a special web proxy designed for testing *client only* web applications that require AJAX requests on a different domain. This effectively bypasses the "same origin policy" for XMLHttpRequest. It is easy to use. Simply navigate to the root directory of your client application and run `python path/to/this/p...
{ "content_hash": "659fd6b7899a0cf2293684cb422c2546", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 34.09473684210526, "alnum_prop": 0.5949367088607594, "repo_name": "dossier/sortingdesk", "id": "c4eac64fba8a851abb7d57ff758111899f94f372", "size": "3...
from openerp import exceptions from openerp.osv import osv, fields from openerp.tools.translate import _ class ir_filters(osv.osv): _name = 'ir.filters' _description = 'Filters' def _list_all_models(self, cr, uid, context=None): cr.execute("SELECT model, name FROM ir_model ORDER BY name") ...
{ "content_hash": "3a84b3dedf1e5432bac2964d88bb2d4b", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 132, "avg_line_length": 46.80952380952381, "alnum_prop": 0.5681586978636826, "repo_name": "chjw8016/GreenOdoo7-haibao", "id": "f302fe5c7bfa1bd27ba70085d305e3e2e7bc48a2", "...
"""Base test class for DNS authenticators.""" import typing import configobj import josepy as jose from acme import challenges from certbot import achallenges from certbot.compat import filesystem from certbot.plugins.dns_common import DNSAuthenticator from certbot.tests import acme_util from certbot.tests import uti...
{ "content_hash": "d56264b9d0e965e69b6be7d2ef20d05f", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 105, "avg_line_length": 28.211111111111112, "alnum_prop": 0.6943678613627412, "repo_name": "stweil/letsencrypt", "id": "7a8df9329da4d2ad13016e35ada0ed3e93e0ccbf", "size": "...
class GetNotificationFilterResponse(object): def __init__(self): self.notificationFilter = None self.jmsConnectionInfo = None def getNotificationFilter(self): return self.notificationFilter def setNotificationFilter(self, notificationFilter): self.notificationFilter = noti...
{ "content_hash": "2deefd97df18544172f4ec64cbd51248", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 56, "avg_line_length": 30.41176470588235, "alnum_prop": 0.7350096711798839, "repo_name": "mjames-upc/python-awips", "id": "81e2e8b39e636e1db46a1d9f67767aa11f51d8da", "size"...
from compressor.filters.css_default import CssAbsoluteFilter from compressor.utils import staticfiles from django_libsass import SassCompiler # based on: http://stackoverflow.com/a/17033883/145349 class CustomCssAbsoluteFilter(CssAbsoluteFilter): def find(self, basename): if basename and staticfiles.find...
{ "content_hash": "81815f09f9d0340af65032427824b425", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 91, "avg_line_length": 35.63157894736842, "alnum_prop": 0.7666174298375185, "repo_name": "fixmydjango/fixmydjango", "id": "d56b92c7b71ea13c4bb33cac4b0945a347e7bd21", "size"...
from satchmo.configuration import * from django.utils.translation import ugettext_lazy as _ PAYMENT_MODULES = config_get('PAYMENT', 'MODULES') PAYMENT_MODULES.add_choice(('PAYMENT_PAYPAL', _('Paypal Payment Settings'))) PAYMENT_GROUP = ConfigurationGroup('PAYMENT_PAYPAL', _('Paypal Payment Module Settings'), ...
{ "content_hash": "b6cc4f486cc4dfcf95fe0864c70fef75", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 161, "avg_line_length": 30.734939759036145, "alnum_prop": 0.680125441003528, "repo_name": "roadhead/satchmo", "id": "a9147d1a5ce25cb941314bc5b29fe87cf04afb2e", "size": "255...
from faasclient.client import Client credential = get_credentials_for( Environment.objects.get(name='dev'), CredentialType.FAAS ) faas_client = Client( authurl=credential.endpoint, user=credential.user, key=credential.password, tenant_name=credential.project, insecure=False ) for vol in Volume.objects...
{ "content_hash": "b86660ce7bfa9fbfc3e35d5f8d43a6c9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 31.814814814814813, "alnum_prop": 0.6856810244470314, "repo_name": "globocom/database-as-a-service", "id": "8b98fb6278679de7b157f3ad5642c855ef832b3c", ...
import rpyc import uuid import os from rpyc.utils.server import ThreadedServer DATA_DIR="/tmp/minion/" class MinionService(rpyc.Service): class exposed_Minion(): blocks = {} def exposed_put(self,block_uuid,data,minions): with open(DATA_DIR+str(block_uuid),'w') as f: f.write(data) if le...
{ "content_hash": "0b9c74e727c58aa98caf8745e1213b58", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 52, "avg_line_length": 24.386363636363637, "alnum_prop": 0.6393289841565704, "repo_name": "sanketplus/PyDFS", "id": "8cf051379e76ad3c6920151a3cce95fdd7c33e42", "size": "107...
"""Unit tests for UI.utilities package."""
{ "content_hash": "d68469a963660cb003295442c993f4dc", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.6976744186046512, "repo_name": "lakewik/storj-gui-client", "id": "1bd09f6cddd10b5957de87e8008630a7ac07e0c9", "size": "67", "bina...
import warnings from django.db.models.query_utils import Q from django.db.utils import IntegrityError from django.db import transaction from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import BaseUserManager from django.core.exceptions import ImproperlyCon...
{ "content_hash": "b9b4c942687a957fcd5e97190f19ee34", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 102, "avg_line_length": 41.12, "alnum_prop": 0.6519130998702983, "repo_name": "Ali-aqrabawi/ezclinic", "id": "5815d9146d194762df61c3f173a598c8ef61fc39", "size": "6168", ...
from asio.file import File, DEFAULT_BUFFER_SIZE from asio.interfaces.base import Interface import os NULL = 0 if os.name == 'nt': from asio.interfaces.windows.interop import WindowsInterop class WindowsInterface(Interface): @classmethod def open(cls, file_path, parameters=None): """ :t...
{ "content_hash": "fb7ea8ebf22f5fa07a03a9480aa82b29", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 110, "avg_line_length": 26.67379679144385, "alnum_prop": 0.5924218123496391, "repo_name": "pannal/Subliminal.bundle", "id": "20ce0bdc2ab225f1edb11162c5c20e931f0c9ca7", "si...
import os import re import warnings from copy import deepcopy import numpy as np from astropy.io import registry as io_registry from astropy import units as u from astropy.table import Table, serialize, meta, Column, MaskedColumn from astropy.time import Time from astropy.utils.data_info import serialize_context_as f...
{ "content_hash": "3ea252ede5d59c9e41d920d6e567e685", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 89, "avg_line_length": 37.545012165450125, "alnum_prop": 0.6125332123647204, "repo_name": "aleksandr-bakanov/astropy", "id": "dcd2d79d550bb26830ba36cc6f79816a7c9b7d34", "s...
from __future__ import absolute_import from celery.contrib.abortable import AbortableTask, AbortableAsyncResult from celery.result import AsyncResult from celery.tests.utils import Case class MyAbortableTask(AbortableTask): def run(self, **kwargs): return True class test_AbortableTask(Case): def ...
{ "content_hash": "649c30395a1f869774228d2ec2d8dafa", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 72, "avg_line_length": 26.764705882352942, "alnum_prop": 0.5882783882783883, "repo_name": "mozilla/firefox-flicks", "id": "a72f6453478bcebd4417f51abb68cec99172d193", "size"...
"""Views for Zinnia comments""" from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponsePermanentRedirect from django.template.defaultfilters import slugify from django.views.generic.base import TemplateResponseMixin from django.views.generic.base import View import django_comments as...
{ "content_hash": "c555cb1c475ad28e874c8dfaee1cb7b6", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 35.67567567567568, "alnum_prop": 0.6643939393939394, "repo_name": "Fantomas42/django-blog-zinnia", "id": "73a144d81fe1fb74c4df0b1723b403cda4fe9d71", ...
''' Created on Jan 10, 2017 @author: hegxiten ''' import sys from imposm.parser import OSMParser import geo.haversine as haversine import numpy import time from scipy import spatial import csv import codecs import networkx as nx import station_nodes import way_network import network_process import NX_instantiate impo...
{ "content_hash": "3fc69bf026836bf74929c183c47fa81a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 104, "avg_line_length": 26.892857142857142, "alnum_prop": 0.8160690571049137, "repo_name": "hegxiten/Worldwide-Railway-Network", "id": "54b0519590407322f136f3b68fb14d24b7c1bf...
from threading import Event from time import time from earwigbot.wiki.copyvios.markov import EMPTY, EMPTY_INTERSECTION __all__ = ["CopyvioSource", "CopyvioCheckResult"] class CopyvioSource: """ **EarwigBot: Wiki Toolset: Copyvio Source** A class that represents a single possible source of a copyright vi...
{ "content_hash": "200232840d98c2a30f29b073b4378f44", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 99, "avg_line_length": 37.77124183006536, "alnum_prop": 0.5990655822806714, "repo_name": "earwig/earwigbot", "id": "9997be6315e1b8ca6c746b5650e434989bcde759", "size": "692...
from os.path import abspath, basename, dirname, join import sys from fabric.api import env from fabric.decorators import roles, runs_once, task import distutils.core # # Project-specific settings, alter as needed # # env.project_name = basename(dirname(__file__)) env.project_name = 'TimelineJS' # # Add paths # def ad...
{ "content_hash": "354f6aff791e997a35b1d3050e7fa4ac", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 129, "avg_line_length": 26.618181818181817, "alnum_prop": 0.6857923497267759, "repo_name": "jaz7290/starterkit", "id": "adf8a25b64cbd2ada71652ca0e670baff84d3d43", "size": "...
from pyspark.context import SparkContext from pyspark.sql.context import SQLContext from pyspark.mllib.recommendation import ALS, MatrixFactorizationModel, Rating import spss.pyspark.runtime from pyspark.sql.functions import udf from pyspark.sql.types import StringType, IntegerType, DoubleType, StructField, StructType ...
{ "content_hash": "9a2511474bc597ad473248771b60d24d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 120, "avg_line_length": 44.431372549019606, "alnum_prop": 0.7594880847308032, "repo_name": "IBMPredictiveAnalytics/MLlib-CF", "id": "983a29bf306e91fa79fcc4afaf96af380e0a2847"...
""" Uses: http://code.google.com/p/python-weather-api/ https://github.com/Packetslave/strava https://github.com/tweepy/tweepy/ https://github.com/cd34/birdcage """ import os.path import sys import ConfigParser import pywapi from strava import Athlete import tweepy import webhelpers.date from birdca...
{ "content_hash": "051292feb1b6ee2d796110f8e1249652", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 80, "avg_line_length": 32.573913043478264, "alnum_prop": 0.614522156967432, "repo_name": "cd34/stravatweet", "id": "e0725aa92c2bbd293f8cb3f6320280a8e9fa8e8e", "size": "376...
import os import utfutil def main(): # Absolute Path Stop Test stop_file = 'junk_test.out' # Clean up the stop file if it already exists. if os.path.exists(stop_file): os.remove(stop_file) current_directory = os.getcwd() stop_file = os.path.join(current_directory, stop_file) repy_args = ['--stop', s...
{ "content_hash": "bbdcadfbf077e8927fdb60165cbb5322", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 57, "avg_line_length": 19.875, "alnum_prop": 0.6084905660377359, "repo_name": "sburnett/seattle", "id": "f71d897b2ad779b64bd0964168f18be61800f51f", "size": "636", "binary...
import vcr from scrapi.base import helpers class TestHelpers(object): def test_format_one_tag(self): single_tag = ' A single tag ' single_output = helpers.format_tags(single_tag) assert single_output == ['a single tag'] assert isinstance(single_output, list) def test_format_...
{ "content_hash": "924f8e07900b9bd1592bc14be67a991b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 121, "avg_line_length": 38.19298245614035, "alnum_prop": 0.6040422599908131, "repo_name": "ostwald/scrapi", "id": "e9e0c5b971ead9ffa73faa22a1c51e873869c667", "size": "2177"...
import capybara from capybara.exceptions import Ambiguous, ElementNotFound, ExpectationNotMet from capybara.queries.ancestor_query import AncestorQuery from capybara.queries.selector_query import SelectorQuery from capybara.queries.sibling_query import SiblingQuery class FindersMixin(object): """ If the drive...
{ "content_hash": "d10915341fa1478019d99a07ce2edf7b", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 100, "avg_line_length": 37.18359375, "alnum_prop": 0.6060510557831705, "repo_name": "elliterate/capybara.py", "id": "a731605d3304b7d2d30ae82a90022f7b5c071d88", "size": "95...
'''local, adjusted version from scipy.linalg.basic.py changes: The only changes are that additional results are returned ''' from __future__ import print_function from statsmodels.compat.python import lmap, range import numpy as np from scipy.linalg import svd as decomp_svd #decomp_svd #check which imports we need ...
{ "content_hash": "76ec67ae56bdeaeafcb61448dc0651d2", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 80, "avg_line_length": 30.62857142857143, "alnum_prop": 0.6071206467661692, "repo_name": "rgommers/statsmodels", "id": "f3255e630dc6821cbab7ab815f397d5bb710f94f", "size": ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'LandingRegister.details' db.add_column(u'landing_landingregister', 'details', self.gf('django....
{ "content_hash": "2cde71f893d884545dc7c96edf8e7cdf", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 126, "avg_line_length": 51.81012658227848, "alnum_prop": 0.5470315172245297, "repo_name": "andresfcardenas/marketing-platform", "id": "aceb5cf5d29efcfc4e311f3bfbf7939adebb539...
import logging log = logging.getLogger(__name__) #import os #from path import path from django.core.management.base import BaseCommand from itest.models import * import json def toDict(obj): t = {} if obj.title: t['title'] = obj.title.encode('utf-8') if obj.num: t['num'] = obj.num if ob...
{ "content_hash": "5ac3f1d8e28012284e278a3b1ce3f6bb", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 27.59722222222222, "alnum_prop": 0.5218922999496729, "repo_name": "xuender/test", "id": "513a3d7379fecbd1cb0fb24fd312bcb0cd059601", "size": "2035", ...
"""Script Language Operators. See the @{$python/script_ops} guide.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading # Used by py_util.cc to get tracebacks. import traceback # pylint: disable=unused-import im...
{ "content_hash": "82eb430ee3783cab0a0ff3b059572f7c", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 80, "avg_line_length": 38.93565683646113, "alnum_prop": 0.6924189217103904, "repo_name": "yanchen036/tensorflow", "id": "16c73213d59821723483b72f18357fb3583f6777", "size":...
from typing import Any, Hashable, Mapping, Optional, Sequence, Union import numpy as np import torch from monai.config import KeysCollection, SequenceStr from monai.config.type_definitions import NdarrayOrTensor from monai.data.meta_obj import get_track_meta from monai.transforms.smooth_field.array import ( RandS...
{ "content_hash": "7db979e9422adb58a81dbd8dbd28bc09", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 116, "avg_line_length": 38.157706093189965, "alnum_prop": 0.6527334210031936, "repo_name": "Project-MONAI/MONAI", "id": "08fb71edb466d4542b4c7e8fd70b339d67d5929d", "size":...
import sys import os import json import collections from shapely.geometry.point import BaseGeometry from shapely.geometry import shape, mapping from .. common import util from .. common import base class GeoFeature(base.BaseAttribute, base.BaseProperty): """Class for single feature. Handle `geome...
{ "content_hash": "8d2b87cdb3fa93eda8bb6b8f95564179", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 81, "avg_line_length": 35.09708737864078, "alnum_prop": 0.5149377593360995, "repo_name": "codefortokyo/data", "id": "e8284512a55bc4f55b2fdcb7b656f7d0e31aa7f5", "size": "72...
from sqlalchemy.orm import joinedload, subqueryload from indico.core.db import db from indico.core.db.sqlalchemy.principals import clone_principals from indico.core.db.sqlalchemy.util.models import get_simple_column_attrs from indico.modules.events.cloning import EventCloner from indico.modules.events.sessions import ...
{ "content_hash": "c5a0acafb82f0acde56f27f1f59ea343", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 118, "avg_line_length": 48.75, "alnum_prop": 0.6275058275058275, "repo_name": "ThiefMaster/indico", "id": "240a20b0a8ea0079c532058520bf99cf14f4d75a", "size": "4504", "bin...
import unittest from pyramid import testing class TutorialViewTests(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def test_home(self): from tutorial.views import home request = testing.DummyRequest() res...
{ "content_hash": "ddd8197da48091aba8dd41ae2450d37e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 56, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6307692307692307, "repo_name": "FedericoStra/pyramid_tutorial", "id": "08b13b3453d64e54413a6959bab8eb7268ff4c7c", ...
import os from admin_scripts.tests import AdminScriptTestCase from django.apps import apps from django.core import management from django.core.management import BaseCommand, CommandError, find_commands from django.core.management.utils import find_command, popen_wrapper from django.db import connection from django.te...
{ "content_hash": "e47113f70cce9c1c4ae13749fc678e65", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 104, "avg_line_length": 40.67661691542288, "alnum_prop": 0.6429794520547946, "repo_name": "Endika/django", "id": "9c27fb666921e3dc5b61333c4096d8e4ec133fda", "size": "8176"...