text
stringlengths
4
1.02M
meta
dict
import copy import os from io import StringIO from unittest.mock import MagicMock from django.core.management import call_command from django.test import TestCase from data_refinery_common.models import ( OriginalFile, ProcessorJobOriginalFileAssociation, SurveyJob, ProcessorJob, Sample, Origina...
{ "content_hash": "fa5a827eb5f87fe1388e7c3458183873", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 139, "avg_line_length": 31.182608695652174, "alnum_prop": 0.6427774679308421, "repo_name": "data-refinery/data_refinery", "id": "5201a853b9230711b63ef9d51e32ba27c6702823", ...
import scipy.signal as signal import scipy.interpolate as interpolate import pylab as pl import astronomy as ast import os import string os.system('ls -l') filename = raw_input('Open which file ? : ') os.system('less %s' % filename) cols = string.split(raw_input('Use which columns ? : ')) # load a lightcurve X = pl...
{ "content_hash": "e5ec3e4f0c58cf7fa3ce6f56c50355e5", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 93, "avg_line_length": 21.57471264367816, "alnum_prop": 0.6435801811401172, "repo_name": "ezietsman/msc-thesis", "id": "6acb90c9f8f0cebcab268901133087549b89fe0f", "size": "...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "7e48aa427d25264722cae7ae6a09eb29", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 168, "avg_line_length": 38.285714285714285, "alnum_prop": 0.7089552238805971, "repo_name": "antoinecarme/pyaf", "id": "cacbabfbe9d24e7b268f7b98fca9c8703ffbecdd", "size": "26...
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseBadRequest,\ HttpResponseForbidden from bootcamp.feeds.models import Feed from bootcamp.activities.models import Activity from django.core.paginator import Paginator, EmptyPage, PageNotAnInte...
{ "content_hash": "8c192b358af620e815cc2c70bce5768a", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 78, "avg_line_length": 30.924170616113745, "alnum_prop": 0.5750191570881226, "repo_name": "okwow123/freebaram", "id": "a64f8ce9196cb0799dd4b140c724cfc4776b87d8", "size": "...
import os import sys import requests import hashlib import json class download_if_changed(object): def process(self,input,output,url,filename): data = requests.get(url).content data_hash = hashlib.md5(data).hexdigest() current = "" try: current = file(filename).read() ...
{ "content_hash": "3e9b93b877c9c2c9a99d75cd40b31203", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 55, "avg_line_length": 27.63157894736842, "alnum_prop": 0.6, "repo_name": "OpenBudget/open-budget-data", "id": "c77e77dc8e04498fea3c9c37bc72e93fb014381e", "size": "542", ...
from datetime import datetime from django.db import models from django.utils.http import urlquote attachment_url_format = 'https://www.ccxp.nthu.edu.tw/ccxp/INQUIRE/JH/output/6_6.1_6.1.12/%s.pdf' # noqa class Course(models.Model): """Course database schema""" no = models.CharField(max_length=20, unique=True...
{ "content_hash": "5767f11af7351c87624a1e0480c00bbc", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 105, "avg_line_length": 32.25, "alnum_prop": 0.6655038759689923, "repo_name": "leVirve/NTHU_Course", "id": "1d9d8c957b9a6a117c45a6b6a1b92f637e51b0f0", "size": "2625", "bi...
"""Support for RFXtrx sirens.""" from __future__ import annotations from typing import Any import RFXtrx as rfxtrxmod from homeassistant.components.siren import ( SUPPORT_TONES, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SirenEntity, ) from homeassistant.components.siren.const import ATTR_TONE from homeassis...
{ "content_hash": "2d2818c272def90480d35973f5c5b81b", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 81, "avg_line_length": 30.286324786324787, "alnum_prop": 0.6160575701989558, "repo_name": "GenericStudent/home-assistant", "id": "9a4a475998da378253c1095388374a484474203c", ...
""" Conjunto de modelos relacionais para o controle da app (Usuarios, auditorias, logs, etc) Os modelos do catálogo do OPAC (periódicos, números, artigos) estão definidos na lib: opac_schema (ver requirements.txt) """ import os from sqlalchemy.event import listens_for from sqlalchemy.ext.hybrid import hybr...
{ "content_hash": "d69c73d6abb9992e04d8d9b0abbd45fc", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 107, "avg_line_length": 32.973333333333336, "alnum_prop": 0.6502224019409624, "repo_name": "jamilatta/opac", "id": "a6e8a0b020c57cb18ec97a1cf8ac8df17134568e", "size": "499...
import time from .common import EventBuilder, EventCommon, name_inner_event from .. import utils from ..tl import types from ..tl.custom.sendergetter import SenderGetter _IGNORE_MAX_SIZE = 100 # len() _IGNORE_MAX_AGE = 5 # seconds # IDs to ignore, and when they were added. If it grows too large, we will # remove o...
{ "content_hash": "0f0066c8c6f8a94a7d62cdf2fd40bb10", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 91, "avg_line_length": 37.43356643356643, "alnum_prop": 0.5535213898748366, "repo_name": "expectocode/Telethon", "id": "2ba1e61b0d6c5857a50dc344aac58e1719834f23", "size": ...
import ephem._libastro as _libastro from math import pi __version__ = '3.7.5.1' twopi = pi * 2. halfpi = pi / 2. quarterpi = pi / 4. eighthpi = pi / 8. degree = twopi / 360. arcminute = degree / 60. arcsecond = arcminute / 60. half_arcsecond = arcsecond / 2. tiny = arcsecond / 360. c = 299792458. # exact speed of ...
{ "content_hash": "5c302604d3788d0427a7c9968338308b", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 78, "avg_line_length": 33.62308998302207, "alnum_prop": 0.6040698848717431, "repo_name": "bennettscience/PySky", "id": "d26722004691de81b465af53192eff2411c54d4d", "size": ...
from .chardistribution import SJISDistributionAnalysis from .codingstatemachine import CodingStateMachine from .enums import MachineState, ProbingState from .jpcntx import SJISContextAnalysis from .mbcharsetprober import MultiByteCharSetProber from .mbcssm import SJIS_SM_MODEL class SJISProber(MultiByteCharSetProber)...
{ "content_hash": "958af939fd40f0b9fa11d4521253c9f5", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 86, "avg_line_length": 36.394366197183096, "alnum_prop": 0.5626934984520123, "repo_name": "pfmoore/pip", "id": "3bcbdb71d1639b5cac8ff9c4461e1e36f6f4bb17", "size": "3749", ...
''' Test cached responses and requests with bodies ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the ...
{ "content_hash": "4810ceb54dc7b066c005b17479111068", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 207, "avg_line_length": 58.958333333333336, "alnum_prop": 0.7287228672387683, "repo_name": "chitianhao/trafficserver", "id": "a8dabae52aa9e5539cd014a53ceb143c2ed460d6", "s...
""" Setup file for TimeseriesDB. This file was generated with PyScaffold 2.5.6, a tool that easily puts up a scaffold for your new Python project. Learn more under: http://pyscaffold.readthedocs.org/ """ import sys from setuptools import setup def setup_package(): needs_sphinx = {'build_sphinx',...
{ "content_hash": "cc5a156b386ae50118bc20c17be529b5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 26.571428571428573, "alnum_prop": 0.6612903225806451, "repo_name": "slac207/cs207project", "id": "4cb277b4c5b8a27d0fc777a76d49ae0c3904bf9c", "size": ...
import socket import sys from random import choice config = None app_exfiltrate = None def send(data): if config.has_key('proxies') and config['proxies'] != [""]: targets = [config['target']] + config['proxies'] target = choice(targets) else: target = config['target'] port = confi...
{ "content_hash": "c801ec13a19fb62cb9396611ed0d36e3", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 84, "avg_line_length": 33.407407407407405, "alnum_prop": 0.5554323725055432, "repo_name": "chokepoint/DET", "id": "8b0b1da45b863911e86735208e6225e234a19914", "size": "2706"...
"""empty message Revision ID: 272e7cd352f9 Revises: 2e825c2c80c7 Create Date: 2016-01-19 19:57:57.224831 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '272e7cd352f9' down_revision = '2e825c2c80c7' def upgrade(): op.add_column('workflow', sa.Column('resul...
{ "content_hash": "8407d3a7881060a330c2ee7992bcecc8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 59, "avg_line_length": 18.761904761904763, "alnum_prop": 0.7233502538071066, "repo_name": "stackforge/solum", "id": "fdc93138d40f5262742eee8ec90435bfd929f6ad", "size": "941...
from __future__ import unicode_literals import os from datetime import datetime from itertools import islice from django.http import FileResponse, HttpResponse, HttpResponseRedirect, JsonResponse, StreamingHttpResponse from six import BytesIO from channels import Channel from channels.handler import AsgiHandler from...
{ "content_hash": "02fbd9fc1bb58ca51c052eb5fd781ba8", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 109, "avg_line_length": 37.859154929577464, "alnum_prop": 0.5759672619047619, "repo_name": "Krukov/channels", "id": "ffecf8bb7910ee947e9b4982f03c9b4c48035558", "size": "13...
""" This module provides methods to read the configuration file, process the referenced resources and """ import argparse import codecs import os import subprocess import yaml import cmdiresource import cmdiheader from lxml import etree PARSER = argparse.ArgumentParser() PARSER.add_argument( 'resources', hel...
{ "content_hash": "256e747a4a10b0a9d56a3c6f94c69dd7", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 93, "avg_line_length": 34.522222222222226, "alnum_prop": 0.6338107499195366, "repo_name": "fkuhn/dgd2cmdi", "id": "54b434aa452e5937a4904961616edb45986efa0a", "size": "1242...
from os import path from . import path from .. import path from ..foo import path from os import path as shmath import os import sys, os import os.path import os.path as path2 import os.path, dir.foo
{ "content_hash": "95fc166cb31fb7453ed15b08d3983fe7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 29, "avg_line_length": 20, "alnum_prop": 0.765, "repo_name": "rocky/python-spark", "id": "9b0ff6f43071395079a9284577996e78cb657bf4", "size": "819", "binary": false, "co...
from setuptools import find_packages, setup def with_versioneer(f, default=None): """Attempts to execute the supplied single-arg function by passing it versioneer if available; else, returns the default. """ try: import versioneer return f(versioneer) except ModuleNotFoundError: return default ...
{ "content_hash": "4d108341a000a53268630e7c4e7b005f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 72, "avg_line_length": 25.896551724137932, "alnum_prop": 0.6158455392809588, "repo_name": "google/uv-metrics", "id": "fca1e1711ba4abfa5030393001017641c41c013f", "size": "20...
from neutron_lib.api.definitions import subnet_onboard from neutron_lib.tests.unit.api.definitions import base class OnboardSubnetDefinitionTestCase(base.DefinitionBaseTestCase): extension_module = subnet_onboard extension_attributes = ()
{ "content_hash": "8142ff81b604e18a2aa8350d56e491d8", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 67, "avg_line_length": 35.57142857142857, "alnum_prop": 0.8152610441767069, "repo_name": "openstack/neutron-lib", "id": "5fd4240c4ad378c5ac9688e80d3b33ef49df75e9", "size": "...
import functools import io import importlib import os import sys from time import sleep import unittest from unittest import mock from requests import RequestException from requests.structures import CaseInsensitiveDict from urllib.parse import urlparse, ParseResult from swiftclient import client as c from swiftclient...
{ "content_hash": "8c899b2e4b5a0205ff56422ead006fe0", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 78, "avg_line_length": 35.91534391534392, "alnum_prop": 0.5317226478098606, "repo_name": "openstack/python-swiftclient", "id": "87d32107843c6d8d1516e083a81f82b0ef2f764e", ...
from django.db import models class Fruit(models.Model): """ A simple model of fruit """ name = models.CharField(max_length=255) def __unicode__(self): return self.name class FavoriteFruit(models.Model): """A simple model to test foreign keys to fruits""" name = models.Cha...
{ "content_hash": "e279114b9e1b88280fab454d59291d43", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 60, "avg_line_length": 27.444444444444443, "alnum_prop": 0.6342780026990553, "repo_name": "callowayproject/django-selectablewrapper", "id": "6551ca3d5142a9840127baee7ad7c2cb7...
import subprocess import sys import os import time from subprocess import PIPE import socket import params def extract_errors(output): match_list = [ 'DIAGNOSTICS ANALYTICAL RMS H:', 'DIAGNOSTICS ANALYTICAL RMS U:', 'DIAGNOSTICS ANALYTICAL RMS V:', 'DIAGNOSTICS ANALYTICAL MAXABS H:', 'DIAGNOSTICS ANALYTIC...
{ "content_hash": "b662393d1a6b7acbfc8881564a99b420", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 124, "avg_line_length": 26.8265306122449, "alnum_prop": 0.6356028908330164, "repo_name": "schreiberx/sweet", "id": "34ee9ba443748e2396791d847ea4f62b02867b5c", "size": "527...
from django.db import models from django.utils import timezone # from django.contrib.auth.models import User # Create your models here. class Activity(models.Model): # user = models.ForeignKey(User) full_description = models.CharField(max_length=255) units = models.CharField(max_length=40) class Me...
{ "content_hash": "21770577bdb0ffa6fa8baf1795f75928", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 66, "avg_line_length": 26.757575757575758, "alnum_prop": 0.6138165345413363, "repo_name": "jal-stats/django", "id": "ad3bfb98ea951eaa4baafea0378023f572075272", "size": "883...
from google.analytics import admin_v1beta def sample_get_property(): # Create a client client = admin_v1beta.AnalyticsAdminServiceClient() # Initialize request argument(s) request = admin_v1beta.GetPropertyRequest( name="name_value", ) # Make the request response = client.get_pro...
{ "content_hash": "7cf66fb01e6757f6ad05ecff2ff43794", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 24.736842105263158, "alnum_prop": 0.7212765957446808, "repo_name": "googleapis/python-analytics-admin", "id": "ede4a2edfd6d4f42a8adaf903db3435a74db470e...
class Solution(object): def reconstructQueue(self, people): """ :type people: List[List[int]] :rtype: List[List[int]] """ people.sort(key=lambda (h, k): (-h, k)) blocks = [[]] for p in people: index = p[1] for i, block in enumerat...
{ "content_hash": "eaf203bf826e5938ec66c92bc8827473", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 56, "avg_line_length": 26.86842105263158, "alnum_prop": 0.4730656219392752, "repo_name": "githubutilities/LeetCode", "id": "7863a79ff1bc9c69e872a684eff5f072477d6bfd", "size...
from unittest import TestCase from kingpin import config_utils class PathConversionTestCase(TestCase): example_config_path = '/var/config/config.manageddata.spam.domain_hidelist' example_zk_path = '/config/manageddata/spam/domain_hidelist' def test_get_config_file_path(self): self.assertEquals( ...
{ "content_hash": "7d7af3dde6cfe50972617634c1f44341", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 32.5, "alnum_prop": 0.6871794871794872, "repo_name": "pinterest/kingpin", "id": "4110ae1c0c5c1801f2e9c7472eefce5fd7d56860", "size": "1184", "binary...
"""Support for Homekit device discovery.""" from __future__ import annotations import asyncio from typing import Any import aiohomekit from aiohomekit.model import Accessory from aiohomekit.model.characteristics import ( Characteristic, CharacteristicPermissions, CharacteristicsTypes, ) from aiohomekit.mo...
{ "content_hash": "777e920a6aec625aff4161bfe1155971", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 115, "avg_line_length": 35.17482517482517, "alnum_prop": 0.6577534791252485, "repo_name": "jawilson/home-assistant", "id": "f91355906dceaf5dc35aff79a2892131fa6820ba", "siz...
import time import mock from oslo_config import cfg from nova import context from nova import db from nova.db.sqlalchemy import api as db_api from nova import test from nova.tests import fixtures as nova_fixtures from nova.tests.functional.api import client from nova.tests.functional import integrated_helpers from no...
{ "content_hash": "b172302bbf9f13166a0ac5ed94db896f", "timestamp": "", "source": "github", "line_count": 788, "max_line_length": 79, "avg_line_length": 42.954314720812185, "alnum_prop": 0.6127983928149374, "repo_name": "cloudbase/nova", "id": "281fbb4ae1ae943e93fc2e92faf5448f0c5a7b45", "size": "3447...
"""Parse (absolute and relative) URLs. See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June 1995. """ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag", "urlsplit", "urlunsplit", "parse_qs", "parse_qsl"] # A classification of schemes ('' means apply by def...
{ "content_hash": "e7e66e5c69ed41a105cc506d5b7c25f5", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 102, "avg_line_length": 35.13002364066194, "alnum_prop": 0.5116419919246299, "repo_name": "chvrga/outdoor-explorer", "id": "2c982d5a6a66a1e9278ab5aaad7dec09798ad317", "siz...
import pytest import unittest from modules.sfp_spamhaus import sfp_spamhaus from sflib import SpiderFoot @pytest.mark.usefixtures class TestModuleSpamhaus(unittest.TestCase): def test_opts(self): module = sfp_spamhaus() self.assertEqual(len(module.opts), len(module.optdescs)) def test_setup...
{ "content_hash": "4a157b02117cd1603967da024fd15fe4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 64, "avg_line_length": 28.192307692307693, "alnum_prop": 0.694406548431105, "repo_name": "smicallef/spiderfoot", "id": "9d551be9b0dfa524c208ae060e0a2cd95d572c27", "size": "...
import textwrap from AttributeNodes import ATTRIBUTE_NODES from AvailabilityNodes import AVAILABILITY_NODES from CommonNodes import COMMON_NODES # noqa: I201 from DeclNodes import DECL_NODES # noqa: I201 from ExprNodes import EXPR_NODES # noqa: I201 from GenericNodes import GENERIC_NODES # noqa: I201 from PatternNo...
{ "content_hash": "109c1b61f2c1482eec05830586e84af4", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 75, "avg_line_length": 35.08653846153846, "alnum_prop": 0.6207180049328583, "repo_name": "huonw/swift", "id": "9aba6ef6642f9a39641ddcca161de7db30e09b55", "size": "3649", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ('markets', '0061_auto_20170510_0748'), ] operations = [ migrations.CreateModel( ...
{ "content_hash": "5c3390d52233eeab66a6216e5bb5dd89", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 119, "avg_line_length": 38.01754385964912, "alnum_prop": 0.5657591139824643, "repo_name": "uktrade/navigator", "id": "1a14036622950d49fe07d42152d3df9214e13b5a", "size": "22...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'gnucash_explorer.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
{ "content_hash": "419ab5a5a4121a6d03726afb03557278", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 61, "avg_line_length": 25.583333333333332, "alnum_prop": 0.6579804560260586, "repo_name": "peap/gnucash_explorer", "id": "48882ee073a3b098ed0a6218bd4137c9ba43bb3e", "size":...
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../../") import h2o from h2o.grid.grid_search import H2OGridSearch from h2o.estimators.glm import H2OGeneralizedLinearEstimator from tests import pyunit_utils def benign_grid(): training_data = h2o.import_file(pyunit_u...
{ "content_hash": "b802ebbda953e56c9d00e92661a5294a", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 140, "avg_line_length": 39.95, "alnum_prop": 0.7175636211931581, "repo_name": "h2oai/h2o-3", "id": "5fd14d0f83e650ee8c6a96a5e879b6d5275567be", "size": "2397", "binary": f...
import json import pprint import shutil import synapse.exc as s_exc import synapse.common as s_common import synapse.cores.common as s_cores_commmon import synapse.lib.cli as s_cli import synapse.lib.auth as s_auth import synapse.lib.tufo as s_tufo class AuthCmd(s_cli.Cmd): ''' Helper for managing AuthMixin...
{ "content_hash": "ca73f7d16ae01c7b2fbf16131bb3b7e9", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 97, "avg_line_length": 34.851190476190474, "alnum_prop": 0.4883005977796755, "repo_name": "vivisect/synapse", "id": "d64d0b849d0d859b3766ee343c3bb834ba629390", "size": "58...
"""Accesses the google.monitoring.v3 UptimeCheckService API.""" import functools import pkg_resources import warnings from google.oauth2 import service_account import google.api_core.client_options import google.api_core.gapic_v1.client_info import google.api_core.gapic_v1.config import google.api_core.gapic_v1.metho...
{ "content_hash": "effd5cf611d0c10e4d13a5d518cc8c96", "timestamp": "", "source": "github", "line_count": 752, "max_line_length": 171, "avg_line_length": 43.89627659574468, "alnum_prop": 0.6078461072402302, "repo_name": "tswast/google-cloud-python", "id": "d9dd41a0b5c54488bd22a299163f3a9dce85d159", "...
import unittest import defaulting from random import random from django.dispatch import dispatcher class emptyo(object): "Just sits there to have attributes assigned to it" pass class TestDefaulting(unittest.TestCase): """Test Defaultin.""" def setUp(self): """Create a few DefaultingCharFie...
{ "content_hash": "75501db394f417dac632df6ae50b47d0", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 27.976744186046513, "alnum_prop": 0.6550290939318371, "repo_name": "hudora/huDjango", "id": "7d9b3854809b296cbcc318f13dfbce5c76d769c0", "size": "1251...
import sys sys.path.append('../') from WeatherConfig import* from lucidatypes.ttypes import QuerySpec from lucidaservice import LucidaService from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from thrift.server import TServer import json import ...
{ "content_hash": "2b718d530bcc86216ea6c07abae31a0c", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 96, "avg_line_length": 35.89411764705882, "alnum_prop": 0.5811209439528023, "repo_name": "claritylab/sirius", "id": "8ae390520eaf6f16a7cdbb742015196cdd651094", "size": "307...
"""Tests for the PHDI image path specification implementation.""" import unittest from dfvfs.path import phdi_path_spec from tests.path import test_lib class PHDIPathSpecTest(test_lib.PathSpecTestCase): """Tests for the PHDI image path specification implementation.""" def testInitialize(self): """Tests th...
{ "content_hash": "06e287754aed14eeeab120fd78bcf299", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 72, "avg_line_length": 26.725, "alnum_prop": 0.7043966323666978, "repo_name": "joachimmetz/dfvfs", "id": "01e90c17ca57b2e290a5660aa90f420664991ef1", "size": "1115", "bina...
# BSD 3-Clause License # ======= # Copyright (c) 2020, Xilinx # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, this # li...
{ "content_hash": "6499a84c8b16c87c1082e23192442b34", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 140, "avg_line_length": 53.40963855421687, "alnum_prop": 0.666704263478457, "repo_name": "Xilinx/BNN-PYNQ", "id": "f8689dec5ad564574cb891a8bc4834ab2b61f4b1", "size": "8866...
"""empty message Revision ID: 298bbf22bdb8 Revises: b976e7a7dc35 Create Date: 2017-04-02 13:11:00.655727 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '298bbf22bdb8' down_revision = 'b976e7a7dc35' branch_labels = None depends_on = None def upgrade(): # ...
{ "content_hash": "7476f4516b02309e2aaf39009ca6d8da", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 85, "avg_line_length": 31.166666666666668, "alnum_prop": 0.6737967914438503, "repo_name": "CapitalD/taplist", "id": "25f1970b18bcd9b8f90cffabbd29a6cbd65cf459", "size": "112...
import MySQLdb import Apriori # get tags data from db db = MySQLdb.connect( "localhost", "", "", "" ) cursor = db.cursor() sql = "SELECT * FROM article_tags LIMIT 0,50000" tagsdata = {} try: cursor.execute( sql ) result = cursor.fetchall() for row in result: tags = [] id = row[0] articleid = row[1] tagid = ...
{ "content_hash": "6ec2701ac81a68c3d04f19fbf77c533a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 24.928571428571427, "alnum_prop": 0.6547277936962751, "repo_name": "jjyoung/Apriori", "id": "57b338d3e57a1c4e2cb7cd574c2f5005ebcc5bf3", "size": "788"...
import codecs from collections import defaultdict, OrderedDict import json import re import glob, os import math import itertools f_in = "tweets_taxonomy_clean.JSON" f_in_user_ids = "user_IDs.dat" IN_DIR = "../DATA/taxonomy_stats/" def read_user_IDs(): user_ids = defaultdict(str) with codecs.open(f_in_user_...
{ "content_hash": "a9ad2cf221db3fc42365ff9f9d7edd16", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 90, "avg_line_length": 32.984375, "alnum_prop": 0.49313121743249644, "repo_name": "sanja7s/SR_Twitter", "id": "2ceaa1301c8a4a200b8bb9fee0f53fdac6f2689c", "size": "6380", ...
import functools import sys from oslo_config import cfg from nova.compute import utils as compute_utils from nova import exception from nova.image import glance from nova.openstack.common import log as logging from nova import utils from nova.virt.xenapi import vm_utils CONF = cfg.CONF CONF.import_opt('num_retries',...
{ "content_hash": "6900d20a88d6b038077fd280ed4eba19", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 38.151898734177216, "alnum_prop": 0.6184472461844724, "repo_name": "sajeeshcs/nested_quota_final", "id": "85599b11a02a7484450ecb7bdfd497ad69a09dd3", ...
""" CalDAV support for Twext.Web2. See RFC 4791. """ # # Load in suitable file extension/content-type map from OS X # from txweb2.static import File, loadMimeTypes File.contentTypes = loadMimeTypes(("/etc/apache2/mime.types", "/etc/httpd/mime.types",)) # # Register additional WebDAV XML elements # import twistedc...
{ "content_hash": "9376642ad47b895a246cd3208990155c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 114, "avg_line_length": 31.785714285714285, "alnum_prop": 0.801123595505618, "repo_name": "red-hood/calendarserver", "id": "c8453d5d7eb410f5c68e160f3dd09663117027e2", "size...
""" Include Commons template in home wiki. This bot functions mainly in the en.wikipedia, because it compares the names of articles and category in English language (standard language in Commons). If the name of an article in Commons will not be in English but with redirect, this also functions. Run: Syntax: pyt...
{ "content_hash": "1c86e1fc5aeee52fae7c01bc8d078d38", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 76, "avg_line_length": 33.5359477124183, "alnum_prop": 0.5145195868251803, "repo_name": "Darkdadaah/pywikibot-core", "id": "3ddffaf5d093141550d2f0941e9656b18e1ce9a0", "siz...
"""Generic linux scsi subsystem utilities.""" from nova import exception from nova.openstack.common import log as logging from nova import utils LOG = logging.getLogger(__name__) def echo_scsi_command(path, content): """Used to echo strings to scsi subsystem.""" args = ["-a", path] kwargs = dict(process...
{ "content_hash": "c8bc74fb125fb9826c75206ba6416606", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 75, "avg_line_length": 31.040650406504064, "alnum_prop": 0.5041906757464641, "repo_name": "gspilio/nova", "id": "739092b2e8d03424aef9236730ec9f8753ac2af6", "size": "4501",...
import pytest import numpy as np from scipy import sparse from scipy.sparse import csgraph from scipy.linalg import eigh from sklearn.manifold.spectral_embedding_ import SpectralEmbedding from sklearn.manifold.spectral_embedding_ import _graph_is_connected from sklearn.manifold.spectral_embedding_ import _graph_conn...
{ "content_hash": "19e8b0cd909f95cd0722458256b58e5c", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 79, "avg_line_length": 41.694736842105264, "alnum_prop": 0.6159219052427838, "repo_name": "BiaDarkia/scikit-learn", "id": "bc32b58c6e7ffc5b729230e95d7f6b33bc570893", "size...
from model.group import Group from random import randrange def test_delete_some_group(app): if app.group.count()==0: app.group.create(Group(name="test")) old_groups=app.group.get_group_list() index=randrange(len(old_groups)) app.group.delete_group_by_index(index) new_groups=app.group.get_gr...
{ "content_hash": "7b0f79f46338ec2267c498f8949216f8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 34.07692307692308, "alnum_prop": 0.6952595936794582, "repo_name": "ritatsetsko/python_training", "id": "c9d54db1171e918958a376b3f28813f43133d3b8", "s...
"""Generates test input data for Causomatic that tries to mimic the scale of Causes' datasets for scoring algorithm performance benchmarking. In particular, this will generate a few *very large* sets, more sets with 10x less users, ad nauseum""" import random if __name__ == '__main__': # generate a nice, decreasing...
{ "content_hash": "7e53db477fa034c056b4ea0a17a9a5b1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 37.3448275862069, "alnum_prop": 0.6472760849492152, "repo_name": "causes/suggestomatic", "id": "ef1829b3e169c8c581234a6aa0aad063d9433436", "size": "1...
import warnings import numpy as np try: import scipy.stats as stats except ImportError: pass from .common import Benchmark class Anderson_KSamp(Benchmark): def setup(self, *args): self.rand = [np.random.normal(loc=i, size=1000) for i in range(3)] def time_anderson_ksamp(self): with ...
{ "content_hash": "cb07b01f7da576c7c1e2fe52f7863153", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 98, "avg_line_length": 32.55172413793103, "alnum_prop": 0.591454802259887, "repo_name": "pizzathief/scipy", "id": "56ef5ac457d5c9faa7ea25951ae50670f460e1e2", "size": "5664...
import os from typing import Optional import aiohttp import link_header from async_timeout import timeout import aiogithub from aiogithub import objects from aiogithub.objects import response from aiogithub.exceptions import HttpException GITHUB_DEFAULT_CONTENT_TYPE = 'application/vnd.github.v3+json' GITHUB_PREVIEW_...
{ "content_hash": "36c03b8e17ab995ca489be66f8ea1a1f", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 79, "avg_line_length": 37.016, "alnum_prop": 0.5446293494704992, "repo_name": "reupen/aiogithub", "id": "2086532182845328d5945e10a19e6cc378c3faa3", "size": "9254", "bina...
from collections import defaultdict from . import core # noqa F401 from .core import ReachableObjectType """ Just a kitchen sink of methods that may be useful when analyzing the reachability graph. We may want to refine / prune this file in the future. """ def classify_nodes(nodes): """ Return a summary c...
{ "content_hash": "0737755639ae0e7bda36bb7003ed441f", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 81, "avg_line_length": 28.23404255319149, "alnum_prop": 0.5987942727957799, "repo_name": "facebook/redex", "id": "afdf4909785691e84907c80a54f77823ec36bcbf", "size": "6838"...
from django.contrib.admin.apps import SimpleAdminConfig class MyCustomAdminConfig(SimpleAdminConfig): verbose_name = "My custom default admin site." default_site = "admin_default_site.sites.CustomAdminSite"
{ "content_hash": "82d71e47d925c7d114bac2dd96c9ff06", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 61, "avg_line_length": 36.166666666666664, "alnum_prop": 0.7926267281105991, "repo_name": "takis/django", "id": "d2dde8784f0bedafd85a5532583161cf6b3700fb", "size": "217", ...
import nntplib import re import time import StringIO # We need setting.forward_host, which is the nntp server we forward to import papercut.settings settings = papercut.settings.CONF() # This is an additional backend for Papercut, currently it's more or less proof-of-concept. # It's a "forwarding proxy", that merely...
{ "content_hash": "f4c5fe38e46263d13b317b5955598175", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 91, "avg_line_length": 31.463276836158194, "alnum_prop": 0.5514455018854373, "repo_name": "jgrassler/papercut", "id": "6fa5f4858fa5b3bbcb189eff470c4b25670c2e09", "size": "...
try: from djangoappengine.settings_base import * has_djangoappengine = True except ImportError: has_djangoappengine = False DEBUG = True TEMPLATE_DEBUG = DEBUG import os # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # al...
{ "content_hash": "6196715927aaf6586f58ebbf262c04c8", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 83, "avg_line_length": 31.041666666666668, "alnum_prop": 0.7261744966442953, "repo_name": "DJMelonz/basic-blog", "id": "7b807d43ee757e33ccd2df168237af2af9004557", "size": "...
from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI class ObjectServerAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("ObjectServerAI") def setName(self, todo0): pass def setDcHash(self, todo0): ...
{ "content_hash": "76303c16169cdce89b3f0cb90c45cd50", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 25.533333333333335, "alnum_prop": 0.7519582245430809, "repo_name": "silly-wacky-3-town-toon/SOURCE-COD", "id": "cb2c3804f3da2b0527b9ccf4d2fee2bddfe7c8c...
""" Helpers for reusable contract components. Now that we have preconditions, postconditions, and invariants, let us provide some abstractions: 1. a "returns" predicate. This is a postcondition that tests the return value. 2. an "args" predicate. This tests the parameters with additional predicates. 3. a "const" predi...
{ "content_hash": "c02a32198fbb36a38c1802b3775d4c7e", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 121, "avg_line_length": 40.71764705882353, "alnum_prop": 0.6668592892227679, "repo_name": "ccoakley/dbcbet", "id": "d5074701792edcce4011994b29541d7b80d1bb26", "size": "3461...
"""Functions for helping running NeRF-based networks.""" import math import tensorflow as tf from tensorflow_graphics.geometry.transformation import rotation_matrix_3d from tensorflow_graphics.util import shape pi = math.pi def match_intermediate_batch_dimensions(tensor1, tensor2): """Match the batch dimensions. ...
{ "content_hash": "4b79828311b7b917ffcbbe858d5ebda4", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 124, "avg_line_length": 38.16425120772947, "alnum_prop": 0.6237974683544304, "repo_name": "tensorflow/graphics", "id": "1246b28f057def07c324acbcee538d4973affde9", "size": ...
"""pidaemon.py Usage: pidaemon.py [--brightness=<b>] [--sleep=<s>] [--interval=<s>] [--wait=<s>] pidaemon.py (-h | --help) pidaemon.py --version Options: -h --help Show this screen. --version Show version --brightness=<b> Default brightness level 1-255 [default: 2] --interval=<s> Def...
{ "content_hash": "6634f30c6b1f4dfeab1507f4011a7e00", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 100, "avg_line_length": 29.181818181818183, "alnum_prop": 0.5852803738317757, "repo_name": "ollej/piapi", "id": "9a713ff09ee505899d214450c2a3c4d64e7f9702", "size": "2568", ...
from app import db class clients(db.Model): idclients = db.Column(db.Integer, primary_key=True) fname = db.Column(db.String(45), index=True) lname = db.Column(db.String(45), index=True) phone = db.Column(db.String(10)) dob = db.Column(db.Date, index=True) def __repr__(self): return '<clients %r...
{ "content_hash": "817c94c2e3627fd52bfaf17ba6f18c0d", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 68, "avg_line_length": 29.322580645161292, "alnum_prop": 0.658965896589659, "repo_name": "nickster5001/ctracker", "id": "cab1f190be9de9a1f66d714bd5eb8cf5429708dd", "size": ...
import datetime from typing import List from django.db import transaction from quickbooks.exceptions import QuickbooksException from rest_framework import generics, response, status from rest_framework.authentication import SessionAuthentication from rest_framework.exceptions import PermissionDenied from huxley.api....
{ "content_hash": "c3404b93184f3daf4e98589a16ad81a5", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 96, "avg_line_length": 38.675862068965515, "alnum_prop": 0.6135877318116976, "repo_name": "bmun/huxley", "id": "cfde1adbf5001c596019d8fa8a4c537cb0472c71", "size": "5756", ...
import EMUtils import SrcUtils
{ "content_hash": "fd18112f11292c843d88711b911d7096", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 15, "avg_line_length": 15, "alnum_prop": 0.9, "repo_name": "simpeg/simpegem", "id": "6e430cf90793bea8aebc3152c92d93bd3b71c609", "size": "76", "binary": false, "copies": ...
import psycopg2 import click import getpass from tabulate import tabulate def print_results(cursor): headers = map(lambda column: column.name, cursor.description) def truncate_row(row): return map(truncate_column, row) def truncate_column(column): column = str(column) return (column[:90] + '....
{ "content_hash": "12a7b04df3fe6160e3d2ad2de643ae0d", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 132, "avg_line_length": 31.30640668523677, "alnum_prop": 0.6630483139069312, "repo_name": "nata79/pgh", "id": "15be1fb5f6ec36d44974335b72631119e0438de8", "size": "11239", ...
import logging from dart.model.action import ActionType _logger = logging.getLogger(__name__) class RedshiftActionTypes(object): start_datastore = ActionType( name='start_datastore', description='create or restore this Redshift cluster', params_json_schema={ 'type': 'object',...
{ "content_hash": "32f150405f21a6781f40662264445760", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 220, "avg_line_length": 55.1968085106383, "alnum_prop": 0.49898814686325527, "repo_name": "RetailMeNotSandbox/dart", "id": "49747b8f010884e56df406f044aa549506c684c7", "siz...
""" Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = get_config("DEBUG") TEMPLATES[0]['OPTIONS...
{ "content_hash": "723b876348a41dc270adc89dd8183989", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 80, "avg_line_length": 29.279411764705884, "alnum_prop": 0.49472626820693116, "repo_name": "TexasLAN/texaslan.org", "id": "60ce193ca5eb834de4c41c2a50eb22ecac6b9322", "size"...
import os import re import sys import pytest from conans.model.ref import ConanFileReference, PackageReference from conans.test.utils.tools import TestClient @pytest.mark.tool_meson @pytest.mark.skipif(sys.version_info.major == 2, reason="Meson not supported in Py2") @pytest.mark.tool_pkg_config def test_meson_lib_...
{ "content_hash": "c93fecea30baa38e2bfdec3c4902b0bb", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 85, "avg_line_length": 34.48148148148148, "alnum_prop": 0.6928034371643395, "repo_name": "conan-io/conan", "id": "e182af683e72284e767eaaaef21fa51f89c883bd", "size": "1862",...
from suit import * class Card(object): value_to_index = {} for card_value in range(2, 10): value_to_index[str(card_value)] = card_value - 2 value_to_index['T'] = 8 value_to_index['J'] = 9 value_to_index['Q'] = 10 value_to_index['K'] = 11 value_to_index['A'] = 12 index_to_value...
{ "content_hash": "f4eab0ede7d59af18c42c0913f24a4ae", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 94, "avg_line_length": 29.426470588235293, "alnum_prop": 0.5872063968015993, "repo_name": "abortz/saycbridge", "id": "2bc37d383a311c0c50ca8ce6c6a0142fb5bf3ebb", "size": "21...
from sys import exit def start(): print """ You are violently woken by what feels like a punch to your gut, but is actually a massive grey cat jumping onto your stomach. He settles on your chest, his enormous weight shoving the air out of your lungs. He folds his little grey paws under him and peers intensely into yo...
{ "content_hash": "8372efd862dafbadadd49fe5f52a327c", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 69, "avg_line_length": 35.66990291262136, "alnum_prop": 0.7367991290146979, "repo_name": "redlandcannibal/morning-cats", "id": "24958302fa046c53562f2c0c637ce7a891aab0ca", ...
from telemetry.page import legacy_page_test from telemetry.timeline import model from telemetry.timeline import tracing_config from telemetry.value import scalar class DrawProperties(legacy_page_test.LegacyPageTest): def __init__(self): super(DrawProperties, self).__init__() def CustomizeBrowserOptions(self...
{ "content_hash": "62d3e8328ce6d0d6a91e0ba8194e6e73", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 73, "avg_line_length": 35.84313725490196, "alnum_prop": 0.737417943107221, "repo_name": "google-ar/WebARonARCore", "id": "3021930188375570f71fa391bba76cfcd91b9394", "size":...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "21abe1ee866570255b531d78cf5cb516", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 34.041666666666664, "alnum_prop": 0.7205222358221134, "repo_name": "alexryndin/ambari", "id": "efebfc50d5f317b61dcf49c90d2c52762ea7827f", "size": "24...
import unittest import time from functools import partial import pwm.widgets import test.util as util class TestWidgets(unittest.TestCase): def setUp(self): util.setup() def tearDown(self): util.tear_down() def _call_widgets(self): widgets = [partial(pwm.widgets.time(), "%H-%M",...
{ "content_hash": "365229994c70672e46831dbac7705a7b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 25.56, "alnum_prop": 0.5805946791862285, "repo_name": "mibitzi/pwm", "id": "142dee5f57009ed6853532b5fd168b1261314115", "size": "743", "binary": fal...
import os from setuptools import setup version_file = os.path.abspath(os.path.join("driftconfig", "VERSION")) with open(version_file) as f: version = f.readlines()[0].strip() setup( name='python-driftconfig', version=version, license='MIT', author='Directive Games', author_emai...
{ "content_hash": "8d55daae5eeb39a5d1b880871ac6ea86", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 105, "avg_line_length": 29.166666666666668, "alnum_prop": 0.5395238095238095, "repo_name": "dgnorth/drift-config", "id": "b29a881bdd4592edbc2802f6e9f6c9d53a9685a7", "size":...
from csrv.model import modifiers from csrv.model.cards import card_info from csrv.model.cards import upgrade class Card01079(upgrade.Upgrade): NAME = u'Card01079' SET = card_info.CORE NUMBER = 79 SIDE = card_info.CORP FACTION = card_info.NETCORP INFLUENCE = 2 UNIQUE = True KEYWORDS = set([ card...
{ "content_hash": "817127d0de973cc7db0d53aa41dd27e7", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 51, "avg_line_length": 22.526315789473685, "alnum_prop": 0.6705607476635514, "repo_name": "mrroach/CentralServer", "id": "711c73a90bc850eb7f043a2f54184e64785240df", "size":...
from util.tipo import tipo class S_USER_LEVELUP(object): def __init__(self, tracker, time, direction, opcode, data): print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
{ "content_hash": "4f5f62ad47b32ac3251cadab7770fc9f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 103, "avg_line_length": 45.2, "alnum_prop": 0.6150442477876106, "repo_name": "jeff-alves/Tera", "id": "dc0ca282ac3062f3bffbe8a4ae47483e7a8a62d4", "size": "226", "binary": ...
__author__ = "Vivek Dhayaal" __copyright__ = "Copyright 2014, Reliance Jio Infocomm Ltd." from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from horizon_jiocloud.change_phone import views urlpatterns = patterns('', url(r'^$', views.PhoneView.as_view(), name='index'), ...
{ "content_hash": "fac484ec92b1ceb12848a63d58bd0e59", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 31.166666666666668, "alnum_prop": 0.6844919786096256, "repo_name": "JioCloud/horizon", "id": "75c2a4ca54132edfe47df2e09f73a620edf95339", "size": "419...
''' Space Efficient Counting sort version. Sorts using regular counting sort algorithm except for the fact there is wrapping and unwrapping of vlaues in the array to make space efficient frequency Table in the counting sort Time Complexity = O(N) Space Complexity = O(Max - Min) ''' def unWrapIn...
{ "content_hash": "5de8f20eec556cb0ba871e433aa19fc2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 29.076923076923077, "alnum_prop": 0.6177248677248677, "repo_name": "tejasnikumbh/Algorithms", "id": "6376f2ab30f56b9f4aae3677c40176819c4a497b", "size...
from juriscraper.AbstractSite import logger from juriscraper.lib.string_utils import convert_date_string from juriscraper.OpinionSite import OpinionSite class Site(OpinionSite): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.court_id = self.__module__ self.case...
{ "content_hash": "e09c0294fa409a01977bb36eaed1d6d6", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 102, "avg_line_length": 39.95798319327731, "alnum_prop": 0.5383806519453207, "repo_name": "freelawproject/juriscraper", "id": "3405e90074effa6df39a4464cace1b6c85e7b5ea", "...
"""Defines interface for DB access. Functions in this module are imported into the cinder.db namespace. Call these functions from cinder.db namespace, not the cinder.db.api namespace. All functions in this module return objects that implement a dictionary-like interface. Currently, many of these objects are sqlalchem...
{ "content_hash": "7bdab67aa5deb0e8484d43a58c2369e6", "timestamp": "", "source": "github", "line_count": 967, "max_line_length": 79, "avg_line_length": 33.153050672182005, "alnum_prop": 0.6721357497114695, "repo_name": "yanheven/cinder", "id": "f0726fea9d360c18d3ef7c8241e125e20f7b01ec", "size": "328...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetListsByEntity(Choreography): def __init__(self, temboo_session): """ Creat...
{ "content_hash": "149be0c12e4483cd6f67de1a9ff52e8a", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 185, "avg_line_length": 40.57575757575758, "alnum_prop": 0.7064973861090366, "repo_name": "jordanemedlock/psychtruths", "id": "a8066ea73741784c3528331d87c1c0f8be9f919a", "s...
from __future__ import unicode_literals, print_function """ Execute Patch Files To run directly python lib/wnf.py patch patch1, patch2 etc python lib/wnf.py patch -f patch1, patch2 etc where patch1, patch2 is module name """ import frappe, frappe.permissions, time # for patches import os class PatchError(Exce...
{ "content_hash": "f3ebdd08704e5414aa74df92619112f1", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 95, "avg_line_length": 27.65671641791045, "alnum_prop": 0.7031840259039396, "repo_name": "vjFaLk/frappe", "id": "b3237b8b76eae4634af959f2da411039828a1da5", "size": "3807",...
from pandac.PandaModules import NodePath from pandac.PandaModules import VBase4 from pandac.PandaModules import BitMask32 from pandac.PandaModules import DirectionalLight as PDirectionalLight class DirLight: """Creates a simple directional light""" def __init__(self,manager,xml): self.light = PDirectionalLight...
{ "content_hash": "9632483af513ff9955e29b71504c39ea", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 84, "avg_line_length": 35.5, "alnum_prop": 0.5661971830985916, "repo_name": "frainfreeze/FPS-kit", "id": "d427c817ba807b2dce63d67f9c3e85e7d0e83d7c", "size": "3098", "bina...
from elasticapm.instrumentation.packages.dbapi2 import ( ConnectionProxy, CursorProxy, DbApi2Instrumentation, extract_signature, ) class PyMySQLCursorProxy(CursorProxy): provider_name = "mysql" def extract_signature(self, sql): return extract_signature(sql) class PyMySQLConnectionPr...
{ "content_hash": "6c39de00bddc294b59d2b0c100b1ac08", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 68, "avg_line_length": 24.884615384615383, "alnum_prop": 0.732612055641422, "repo_name": "beniwohli/apm-agent-python", "id": "69b5e91b700133efe3eabe4b41b406d03cd6af7e", "si...
import json import sys import moviepy.editor as mpy from numpy import cumsum from replayenhancer.RaceData import RaceData config = json.load(open(sys.argv[1])) data = RaceData(config['source_telemetry']) clip = mpy.VideoFileClip(config['source_video']).subclip( config['video_skipstart'], config['video_skipend'])...
{ "content_hash": "17dae5fdd4a723b6ddc27b87e990108b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 110, "avg_line_length": 30.821428571428573, "alnum_prop": 0.6998841251448435, "repo_name": "SenorPez/project-cars-replay-enhancer", "id": "8383e2ddcf18fd2b75fa6ac1ca89fce2c2b...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "1f58100ee97ce799177b5ee36ca1b72f", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 593, "avg_line_length": 38.72027972027972, "alnum_prop": 0.7200650171573054, "repo_name": "ryfeus/lambda-packs", "id": "58cec56bbb21450255b6aaae283df7e05eaeec9d", "size": ...
__all__ = ['ckplayer_download'] from xml.etree import cElementTree as ET from copy import copy from ..common import * #---------------------------------------------------------------------- def ckplayer_get_info_by_xml(ckinfo): """str->dict Information for CKPlayer API content.""" e = ET.XML(ckinfo) vi...
{ "content_hash": "1d5b1c94f567e75b21905391bd53d5ae", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 104, "avg_line_length": 36.25806451612903, "alnum_prop": 0.5094899169632265, "repo_name": "qzane/you-get", "id": "9115989796b76e11990e4b3e2e94329bae854b43", "size": "3514",...
from __future__ import absolute_import import os from celery import Celery from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'neurovault.settings') nvcelery = Celery('neurovault') # Using a string here means the worker will not have to # pickle the object when using Windows. nvcelery.co...
{ "content_hash": "4220ed844fdd0dcb7b531fb8d76a3f33", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 29.541666666666668, "alnum_prop": 0.8039492242595204, "repo_name": "NeuroVault/NeuroVault", "id": "79431ee5f1fdbab271353d8c0f851f6f12d1f0d0", "size":...
import octo def do_client(taskfile, type=type, **options): octo.do_client(taskfile=taskfile, type=type, **options)
{ "content_hash": "3ee9614602b5b2255426ccb87472357b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 24.2, "alnum_prop": 0.71900826446281, "repo_name": "zaqwes8811/micro-apps", "id": "355af8fae9d18be91f9e670b7429b6b19811846b", "size": "138", "binary...
import pika import sys, getopt def main(argv): server = '' queueName = '' if len(sys.argv) != 5: print 'log.py -s <server> -q <queue>' sys.exit(2) try: opts, args = getopt.getopt(argv,"hs::q:",["server=","queue="]) except getopt.GetoptError: print 'log.py -s <server> -q <queue>...
{ "content_hash": "3afdb20e99ca8ad16d93e0966e53d7eb", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 26.36842105263158, "alnum_prop": 0.591816367265469, "repo_name": "HowardLander/DataBridge", "id": "8eeb358ec6d79b0d811f4fda463010d895f9ca69", "size":...
from docutils.parsers.rst import Directive, directives from docutils import nodes try: import requests except ImportError: requests = None # NOQA from nikola.plugin_categories import RestExtension from nikola import utils class Plugin(RestExtension): name = "rest_gist" def set_site(self, site): ...
{ "content_hash": "a3aa1c59ca42767861ea4a88d118abe8", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 98, "avg_line_length": 30.887323943661972, "alnum_prop": 0.5649794801641587, "repo_name": "damianavila/nikola", "id": "f47edad2b73c50cddcbd3465d0bdd8b65e359407", "size": "2...
"""Error controller""" from tg import request, expose __all__ = ['ErrorController'] class ErrorController(object): """ Generates error documents as and when they are required. The ErrorDocuments middleware forwards to ErrorController when error related status codes are returned from the application...
{ "content_hash": "34088d7603ad6cd8855434f60ddbf137", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 35.10344827586207, "alnum_prop": 0.6444007858546169, "repo_name": "ralphbean/moksha", "id": "3b2c3589d3e9980b9d774c646102c20eaa0847ec", "size": "1042...
from __future__ import print_function, division from string import Template import argparse import json import math import sys import re class Point: """Represents a pixel that will be painted.""" def __init__(self, x, y, color=4): self.x = x self.y = y self.color = color def __str...
{ "content_hash": "9b66d86c2e9c28dc803172760bfef3c1", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 155, "avg_line_length": 36.67391304347826, "alnum_prop": 0.5900019758940921, "repo_name": "possatti/pixelbot", "id": "bc3c350d113a0a38f8d256e2d0ee11e3e69195e2", "size": "5...
from scrapy import Item, Field class PcrawlerItem(Item): name = Field() street = Field() district = Field() city = Field() open_time = Field() address = Field() close_time = Field() open_close = Field() price = Field() ratings = Field() lat = Field() lon = Field()
{ "content_hash": "6719bf69334db0ca63ead30e0821985f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 30, "avg_line_length": 19.6875, "alnum_prop": 0.5682539682539682, "repo_name": "fmlvn/anphode", "id": "68366db7bb7e8f8f7dc2df602a893ba3d6fb30ba", "size": "467", "binary":...
"""Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import warnings from abc import ABCMeta, abstractmethod from ..externals.joblib import Parallel, delayed from .base import LinearClassifierMixin, SparseCoefMixin from .base import make_dataset from ..base import BaseEsti...
{ "content_hash": "e2525c7eb4e76d18e99387f5f0b0312f", "timestamp": "", "source": "github", "line_count": 1340, "max_line_length": 79, "avg_line_length": 41.50820895522388, "alnum_prop": 0.5563905719062944, "repo_name": "clemkoa/scikit-learn", "id": "68c2704860ec4063a13c4ab709982ca1ece08a19", "size":...
"""Tests for prop_initializer.""" from absl.testing import absltest from absl.testing import parameterized from dm_control import composer from dm_control import mjcf from dm_control.composer.initializers import prop_initializer from dm_control.composer.variation import distributions from dm_control.entities import pr...
{ "content_hash": "60688cfd8c7f1d6173426153a0bd4130", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 80, "avg_line_length": 41.3287037037037, "alnum_prop": 0.6845524812366977, "repo_name": "deepmind/dm_control", "id": "ac4acc09fcee5acf588496eec7010510dc31842e", "size": "9...
''' Created by auto_sdk on 2014.11.07 ''' from top.api.base import RestApi class TmallBrandcatControlGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) def getapiname(self): return 'tmall.brandcat.control.get'
{ "content_hash": "4c3e435b06abd754ec34383fbc915c0f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 28.8, "alnum_prop": 0.7048611111111112, "repo_name": "colaftc/webtool", "id": "03f96cff948ad99caad7f1440a695869c7ed1e91", "size": "288", "binary": ...
def extractDmtranslationscnWordpressCom(item): ''' Parser for 'dmtranslationscn.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('TSLDB', 'The Strongest Legend of Dragon Ball',...
{ "content_hash": "7e72c26e9226c1bfbaa73d10d12ca9b1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 104, "avg_line_length": 37, "alnum_prop": 0.5726807888970051, "repo_name": "fake-name/ReadableWebProxy", "id": "b96edb52e79b43edd3c89534ddbed69cab76e14b", "size": "1371", ...
"""Build rules for C/C++.""" __all__ = [ 'init', ] import itertools import iga.filetype from iga.core import ImmutableOrderedSet from iga.core import group from iga.core import traverse from iga.fargparse import oneof from iga.label import Label from iga.ninja import NinjaBuildstmt from iga.ninja import NinjaRul...
{ "content_hash": "e5b465039acfd05342fbedfdacb84800", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 77, "avg_line_length": 27.083798882681563, "alnum_prop": 0.6062293729372937, "repo_name": "clchiou/iga", "id": "abef55247b3955119a2e4b790690f57ea62c4ee6", "size": "4848", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0042_auto_20150516_0737'), ] operations = [ migrations.RenameField( model_name='loanaccount', old_name='state', ...
{ "content_hash": "fd4ab18c25158daef2174c5ef096c9ca", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 241, "avg_line_length": 35.93939393939394, "alnum_prop": 0.5733558178752108, "repo_name": "AjabWorld/ajabsacco", "id": "0c9f4736f3e5cc6f0269fd24bffad5a5d830837c", "size": "...