text
stringlengths
4
1.02M
meta
dict
"""TVM operator upsampling compute.""" from __future__ import absolute_import import topi from ..util import simplify def upsampling(data, scale, layout="NCHW", method='nearest_neighbor', align_corners=False): """Perform upsampling on the data. Nearest neighbor and bilinear upsampling are supported. P...
{ "content_hash": "89c35b29cf53f4e2772b59480efd7bbe", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 91, "avg_line_length": 33.65853658536585, "alnum_prop": 0.6239130434782608, "repo_name": "Huyuwei/tvm", "id": "609213637cf458a9f34689890e12854a1f22e730", "size": "2165", ...
from django.utils.translation import ugettext as _ from taiga.base import exceptions as exc from taiga.base import response from taiga.base.api.viewsets import GenericViewSet from taiga.base.utils import json from taiga.projects.models import Project from .exceptions import ActionSyntaxException class BaseWebhookAp...
{ "content_hash": "7785e47eb3afeb72570db62b752d88e0", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 80, "avg_line_length": 33.10769230769231, "alnum_prop": 0.6514869888475836, "repo_name": "curiosityio/taiga-docker", "id": "6590832e5c7934debaade0d11fdd6e798b2ab6ab", "size...
import os import pytest import time from multiprocessing import Process from astropy import units as u from pocs import POCS from pocs import _check_config from pocs import _check_environment from pocs.utils import error from pocs.utils.messaging import PanMessaging @pytest.fixture def pocs(config): os.environ...
{ "content_hash": "8a941f38424e336f4e854c5c2d223bf0", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 99, "avg_line_length": 29.11898016997167, "alnum_prop": 0.5684405097772157, "repo_name": "joshwalawender/POCS", "id": "84ac9209126f142a305ddce5e087eafd32f104d8", "size": "...
""" Django settings for blog project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Buil...
{ "content_hash": "45e7bac23b0b2a84b0407347fec2ac3c", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 91, "avg_line_length": 23.445859872611464, "alnum_prop": 0.6791632708503124, "repo_name": "codingforentrepreneurs/Advancing-the-Blog", "id": "043e39384ea885c232c133b2eef6429...
import sys import subprocess import shutil import os import signal import stat import time # required for iscsi # Use simplejson or Python 2.6 json, prefer simplejson. try: import simplejson as json except ImportError: import json import urllib2 import ftplib import mimetypes import bz2 import tarfile # used ...
{ "content_hash": "2eef5b0297d5ef8d1ab8fbc914711618", "timestamp": "", "source": "github", "line_count": 896, "max_line_length": 80, "avg_line_length": 28.395089285714285, "alnum_prop": 0.5384403741844195, "repo_name": "ewindisch/nodestored", "id": "f779607df5b7366de7fe30bd47494df411dcadf9", "size":...
from pyxb_114.bundles.opengis.citygml.raw.building import *
{ "content_hash": "aa35200a73c1564daf219543b00c1d94", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 59, "avg_line_length": 60, "alnum_prop": 0.8166666666666667, "repo_name": "msherry/PyXB-1.1.4", "id": "30b9b4dc3726db53830cbdfdeea5929e3b4d94dd", "size": "60", "binary": f...
from rest_framework.renderers import JSONRenderer from djangorestframework_camel_case.util import camelize class CamelCaseJSONRenderer(JSONRenderer): def render(self, data, *args, **kwargs): return super(CamelCaseJSONRenderer, self).render(camelize(data), *args, ...
{ "content_hash": "686374a00cc8c9abf7404bd5851fb142", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 79, "avg_line_length": 42.875, "alnum_prop": 0.6501457725947521, "repo_name": "virtusize/djangorestframework-camel-case", "id": "13c36bdb36a13afcd70fd464601b7981f9895e00", "...
import unittest from biicode.common.model.brl.brl_block import BRLBlock from biicode.common.model.brl.cell_name import CellName from biicode.common.model.symbolic.block_version import BlockVersion from biicode.common.model.symbolic.reference import Reference, References import copy class ReferenceTest(unittest.TestC...
{ "content_hash": "8fdbbf6143756835eb1ec8e19576eadf", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 84, "avg_line_length": 33.476190476190474, "alnum_prop": 0.620199146514936, "repo_name": "franramirez688/common", "id": "4d8fad2d12da2ff24b7b937ee509324558f1e046", "size": ...
from fun_views.patterns.update.render import update_render_pattern from fun_views.views.utils import (get_context_base, make_base_view, not_set_get_form_class, not_set_get_obj, not_set_get_template_name, prefer_func, ...
{ "content_hash": "a046119a4c18a4439db2abc00d363388", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 39.54054054054054, "alnum_prop": 0.5645933014354066, "repo_name": "keithasaurus/django_fun_views", "id": "d20de46851b4741b832e367c89ee174703d08231", ...
import redis import time from bigdl.serving.schema import * import httpx import json import uuid from bigdl.serving.log4Error import invalidInputError RESULT_PREFIX = "cluster-serving_" def http_json_to_ndarray(json_str): # currently there is no http user use batch predict, so batch is not implemented here ...
{ "content_hash": "4bdbe511f8efdfc13609977cc9a1ebe0", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 98, "avg_line_length": 34.10181818181818, "alnum_prop": 0.5468116869268501, "repo_name": "yangw1234/BigDL", "id": "03d2a980db9f20c6e5f0ece822d2c9e7f8c61117", "size": "9965...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import errno import os import shutil import tarfile from pants.util.contextutil import open_tar from pants.util.dirutil import safe_mkdir, safe_mkdir_for, safe_walk ...
{ "content_hash": "2f49e895917e547be95a9a4acf0c15e4", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 101, "avg_line_length": 34.48091603053435, "alnum_prop": 0.6572946646003985, "repo_name": "manasapte/pants", "id": "53b5906b9bd2391830d2bf5e68b7caf45bd64fc8", "size": "466...
import urllib2 import re import dao import time from datetime import datetime import threading,thread from task_model import Task import sys,os # 条件变量 cv = threading.Condition() def http_crawler(url,type): content = http_request(url) if type == 0: page = parse_page_list(content) else: pag...
{ "content_hash": "2e69820dc792d0fdeee512a04facac48", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 110, "avg_line_length": 26.38095238095238, "alnum_prop": 0.5646209386281589, "repo_name": "xpao24/Crawler", "id": "6a87ac3e5d6e693dab8431bbadd5be5f1da43025", "size": "2918...
import copy import inspect from django.db import router from django.db.models.query import QuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist from django.utils import six from django.utils.deprecation import RenameMethodsBase def ensure_default_manager(sender, **kwarg...
{ "content_hash": "6b7e8399d92b6bd9d266f15a4af4251b", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 125, "avg_line_length": 39.14746543778802, "alnum_prop": 0.6309593878752208, "repo_name": "ZhaoCJ/django", "id": "4f16b5ebfebfa818da401920112398a872b03dce", "size": "8495"...
__author__ = 'farooq.sheikh' from setuptools import setup, find_packages setup( name = 'asposeemailcloud', packages = find_packages(), version = '1.0.1', description = 'Aspose.Email Cloud SDK for Python allows you to use Aspose.Email APIs in your Python applications', author='Farooq Sheikh', a...
{ "content_hash": "9e1e91d10df7bb31ad6013b65d7024c0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 118, "avg_line_length": 31.272727272727273, "alnum_prop": 0.6380813953488372, "repo_name": "asposeemail/Aspose_Email_Cloud", "id": "faf3107b277c46265d324ad2654b0856ec4ce9da",...
''' Luhn modulo 10 ~~~~~~~~~~~~~~ Used ie. in credit card numbers and Finnish BBAN. ''' from ..checksum import ( ChecksumStrategy, ) class Luhn10(ChecksumStrategy): ''' Provides Luhn modulo 10 checksum algorithm. ''' name = 'luhn' def checksum(self, body): digits = self._prepare(b...
{ "content_hash": "81c6db999416cfdbc7073bd1ddba277f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 53, "avg_line_length": 19, "alnum_prop": 0.5503759398496241, "repo_name": "vaiski/checksum", "id": "bbb49cc33c15152e7edc17ed311cbe9ca85a4492", "size": "690", "binary": fa...
from thrift.transport import TTransport class TBase(object): __slots__ = () def __repr__(self): L = ['%s=%r' % (key, getattr(self, key)) for key in self.__slots__] return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) def __eq__(self, other): if not isinstance(other, self.__c...
{ "content_hash": "be9a46f4cd759f5e2fcb3605d19b9efd", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 31.47761194029851, "alnum_prop": 0.5599810336652442, "repo_name": "yongju-hong/thrift", "id": "6c6ef18e877619b4cf5946eac3b898fba5a0c2dd", "size": "28...
# Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foundation, either version 2.0 of the License, o...
{ "content_hash": "5a4a150fa03ed65cda1ed7e1fc0c0f32", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 134, "avg_line_length": 24.142857142857142, "alnum_prop": 0.6168639053254438, "repo_name": "hivesolutions/netius", "id": "4b49ad53faaf504d0fb67af67132c85cd1d3f9c4", "size"...
"""Module: Mosfet This module implements a MosfetTemplate class for creating MOS transistor PyCells. MosfetTemplate provides the following capabilities: - (float ) transistor width - (float ) transistor length - (integer) fingers, number of transistors - (boolean) left diffusion contact -...
{ "content_hash": "22fc236eb842e357d3ff0027c5720b08", "timestamp": "", "source": "github", "line_count": 1006, "max_line_length": 135, "avg_line_length": 31.77037773359841, "alnum_prop": 0.5115296767935922, "repo_name": "seyedmaysamlavasani/GorillaPP", "id": "4f3746b72e594fe9ef76a0adac6281d49e9956d5",...
import random class RandomRiver: def __init__(self, points_part=0.1): self.points_part = points_part def generate(self, map_obj): random.seed(map_obj.seed) # calculate Corner.downslope and Corner.downslope_edge for corner in map_obj.corners: downslope = corner ...
{ "content_hash": "608a1f14dae7abbdfe58b7503a9ca918", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 33.904761904761905, "alnum_prop": 0.5603932584269663, "repo_name": "Alerion/fantasy_map", "id": "4fc0afd7bb328994f76ae4436ca3d24a0a7b0c8c", "size": "...
from .dev import * # noqa: F401 # Here be settings used for tests
{ "content_hash": "509f22bba76486fd063514e42eb81d75", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6911764705882353, "repo_name": "Alien1993/bank-reader", "id": "38193f32b564a7d1f769f6f3236c7e19e8ccfa91", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipe', '0028_auto_20181016_1349'), ] operations = [ migrations.AlterField( model_name='recipetype', name='name', ...
{ "content_hash": "062494565247116d0ca4905be2d4ca33", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 63, "avg_line_length": 21.77777777777778, "alnum_prop": 0.5969387755102041, "repo_name": "ngageoint/scale", "id": "af3373e3f9df3108ae71bde4e0c422b7fb611c5d", "size": "465",...
import datetime import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports if TYPE_CHECKING: ...
{ "content_hash": "3c31dfc9a2b0854cdd9d610b0eef0599", "timestamp": "", "source": "github", "line_count": 815, "max_line_length": 282, "avg_line_length": 36.74723926380368, "alnum_prop": 0.6204547731142943, "repo_name": "Azure/azure-sdk-for-python", "id": "2d352e7ea640239523b719d3cdec4dbc3c027b37", "...
import contextlib import logging import os from teuthology import misc as teuthology from teuthology import packaging from teuthology.orchestra import run log = logging.getLogger(__name__) def _get_builder_project(ctx, remote, config): return packaging.get_builder_project()( config.get('project', 'ceph'...
{ "content_hash": "64dec173fca6324b56d3db02fd40ebf8", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 79, "avg_line_length": 27.15032679738562, "alnum_prop": 0.5185363505055368, "repo_name": "SUSE/teuthology", "id": "dce71ec2b6e28ec7f64a049bbe470c9357e54f8e", "size": "4154...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "speedycrew.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "99348e8b09b0bd44bde30768113241f2", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 25.666666666666668, "alnum_prop": 0.7142857142857143, "repo_name": "michaelmaguire/twosidedsearch", "id": "7245e49c080d70d6710a5c850c4cfebc2886d43d", ...
""" Fork of pynxos library from network to code and mzbenami Reimplemented by ktbyers to support XML-RPC in addition to JSON-RPC """ from __future__ import print_function, unicode_literals from typing import List, Optional, Any, Union from napalm.nxapi_plumbing.errors import NXAPIError, NXAPICommandError from napal...
{ "content_hash": "7e1ae64091412e94f5ac8c8a506e4049", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 90, "avg_line_length": 31.191860465116278, "alnum_prop": 0.557502329916123, "repo_name": "napalm-automation/napalm", "id": "3f2ac5f5bcb84d669184fa0b427908b9160bb23b", "siz...
try: #pragma: no cover from .tw2widgets.widgets import * except ImportError: #pragma: no cover from .tw1widgets.widgets import *
{ "content_hash": "98ddb1b8e509390f6b73577eafb2bc60", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 37, "avg_line_length": 34, "alnum_prop": 0.7352941176470589, "repo_name": "gjhiggins/sprox", "id": "0e67c57c41fcc7f97b0ed015ff6417608ff0b3c6", "size": "136", "binary": fal...
from .. import base from girder.models.model_base import AccessControlledModel, Model, AccessType from girder.utility.model_importer import ModelImporter class FakeAcModel(AccessControlledModel): def initialize(self): self.name = 'fake_ac' self.exposeFields(level=AccessType.READ, fields='read') ...
{ "content_hash": "0e8de9ca2d2738151ffab0ac32346bce", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 78, "avg_line_length": 31.224137931034484, "alnum_prop": 0.5949751518498068, "repo_name": "chrismattmann/girder", "id": "7c0a67144928f45fc971fe6642bb2a777f0c21dc", "size":...
""" RPyC **registry server** implementation. The registry is much like `Avahi <http://en.wikipedia.org/wiki/Avahi_(software)>`_ or `Bonjour <http://en.wikipedia.org/wiki/Bonjour_(software)>`_, but tailored to the needs of RPyC. Also, neither of them supports (or supported) Windows, and Bonjour has a restrictive licen...
{ "content_hash": "fdd45ce65e00d738b75333971ae4b119", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 102, "avg_line_length": 35.556277056277054, "alnum_prop": 0.5578011809825287, "repo_name": "gleon99/rpyc", "id": "711ed2327df90866622b0759303308e2209502bb", "size": "16427...
import collections XMLNS_11 = "http://docs.openstack.org/compute/api/v1.1" XMLNS_V3 = "http://docs.openstack.org/compute/api/v1.1" # NOTE(danms): This is just a silly implementation to help make generating # XML faster for prototyping. Could be replaced with proper etree gorp # if desired class Element(object): ...
{ "content_hash": "c99c151d35a5cd3b977ca21c54aafd9c", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 74, "avg_line_length": 31.084745762711865, "alnum_prop": 0.5627044711014176, "repo_name": "adkerr/tempest", "id": "860dd5b4d20ffe972fd459757daa6ae514093621", "size": "4339...
def register_all(): # NOTE(danms): You must make sure your object gets imported in this # function in order for it to be registered by services that may # need to receive it via RPC. __import__('nova.objects.agent') __import__('nova.objects.aggregate') __import__('nova.objects.bandwidth_usage') ...
{ "content_hash": "5b60a6a45c229a48ec412ec23407ddad", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 43.945945945945944, "alnum_prop": 0.6439114391143912, "repo_name": "shakamunyi/nova", "id": "6ab4ee0fad6a311f66ab7ca26f9bd019c65774ff", "size": "2612...
from sequana.enrichment.mart import Mart import pytest @pytest.mark.xfail(reason="too slow or service may be down") def test_mart(): conv = Mart(dataset="mmusculus_gene_ensembl") # you could choose hsapiens_gene_ensembl for instance df = conv.query() df.set_index("ensembl_gene_id") # conv.save(...
{ "content_hash": "c4685523577776f52827dcee9b26e6f9", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 27.083333333333332, "alnum_prop": 0.6984615384615385, "repo_name": "sequana/sequana", "id": "72c322ea6f92b1b0b6e38100918c49908f76392f", "size": "325"...
"""Support for SimpliSafe alarm control panels.""" import logging import re import homeassistant.components.alarm_control_panel as alarm from homeassistant.const import ( CONF_CODE, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED) from homeassistant.core import callback from homeassistant....
{ "content_hash": "291a798c725127ca8d467cc67c46ac78", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 79, "avg_line_length": 31.94927536231884, "alnum_prop": 0.6182807892946246, "repo_name": "aequitas/home-assistant", "id": "2cbe5632b6b5d0b7b6fec2523420b6d90079507e", "size...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('spidergraphs.views', url(r'^$','index'), url(r'^(?P<institution>[a-z_]+)$','institution'), url(r'^(?P<institution>[a-z_]+)/(...
{ "content_hash": "24c4b4357fad753a68a034eb067cb9c2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 91, "avg_line_length": 39.888888888888886, "alnum_prop": 0.649025069637883, "repo_name": "LaneCommunityCollege/dqpprototype", "id": "df017ddc0a868f7a0b022be27a4894b2b4c771c4"...
class FlankingRegionCollection(object): """ Used to store information genomic regions that are 'flanking', meaning they are not really involved in the structural variant; use this to identify reads mapping to the flanking regions to provide more context for events and to better categorize ambiguously m...
{ "content_hash": "dffc58b322b2473dcfe313169e5e2d9f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 103, "avg_line_length": 35.03225806451613, "alnum_prop": 0.6206261510128913, "repo_name": "gatoravi/svviz", "id": "68441d1bd42bac2391b338a769aa8a469c005ff8", "size": "2172"...
import pytest import doctest from insights.parsers.hostname import Hostname as HnF from insights import SkipComponent from insights.parsers.lssap import Lssap from insights.parsers.saphostctrl import SAPHostCtrlInstances from insights.combiners import sap from insights.combiners.sap import Sap from insights.combiners....
{ "content_hash": "98e45f6926e846b8453c02cd961d29f7", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 114, "avg_line_length": 41.030434782608694, "alnum_prop": 0.5972236939705415, "repo_name": "RedHatInsights/insights-core", "id": "b4b7a196b7f285ae47b634b9e8c3cbcb93454b19", ...
"""Generates a Recamen's sequence.""" import sys from itertools import count from itertools import islice def sequence(): """Generate Recamen's sequence.""" seen = set() a = 0 for n in count(1): yield a seen.add(a) c = a - n if c < 0 or c in seen: c = a + n ...
{ "content_hash": "b66b0e785c79c46277917c62fcb2a293", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 58, "avg_line_length": 23.5, "alnum_prop": 0.5425531914893617, "repo_name": "carlb15/Python", "id": "ab706f506443b6b3dc6387c6e23d64d141bb8724", "size": "658", "binary": f...
import json from django import forms from django.test.utils import override_settings from django_webtest import WebTest from . import build_test_urls class SelectForm(forms.Form): test_field = forms.ChoiceField( choices=((None, 'Select Card Type'), ('V', 'Visa'), ('M', 'MasterCard'), ('P', 'Paypal')), ...
{ "content_hash": "4508bdc88a299b74cda7ca606cae4fbb", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 122, "avg_line_length": 37.32283464566929, "alnum_prop": 0.6046413502109704, "repo_name": "viewflow/django-material", "id": "8e6ab8252930233a8f3b0f2879af7f3389c9298e", "si...
from .streamer import Streamer from .router import Router from .about import (__name__, __version__, __author__, __author_email__, __description__, __license__, __url__) read_json = Streamer.read_json __all__ = [Router, Streamer, read_json, __name__, __version__, __author__, __author_ema...
{ "content_hash": "e10d9ce9c6b656ef726058183457e27a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 72, "avg_line_length": 36.27272727272727, "alnum_prop": 0.5513784461152882, "repo_name": "mediawiki-utilities/python-mwcli", "id": "3e0b26632872810416ad11de32d7f5be422aba83",...
""" # Ordered Player The ordered player, plays the first available move from top to bottom, from left to right """ from supercat.classes import BasePlayer from supercat.utils import boxes class Player(BasePlayer): name = 'meta' def play(self, world, game, move_num, last_move): # lazy game i...
{ "content_hash": "828be7b44ace78ff9820c2991595c407", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 29.387096774193548, "alnum_prop": 0.5389681668496158, "repo_name": "developingo/supercat", "id": "b0f63c115f9bbcbb2e0223b9a7e889d272403aa6", "size": ...
from django.http import HttpResponse from django.template import Context from django.template.loader import render_to_string, get_template from django.conf import settings from django.core.exceptions import ValidationError from confy import env import json from django.utils.safestring import SafeText from django.utils....
{ "content_hash": "f4a7611bdcd2fed448d396eba6244a74", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 83, "avg_line_length": 32.833333333333336, "alnum_prop": 0.7654822335025381, "repo_name": "parksandwildlife/statdev", "id": "4b9d07cd3748b3137700f58f41deea530b27573c", "siz...
import sys import os import unittest from mock import patch, MagicMock, ANY, call import pylacuna.cachedmap as cachedmap import ast from sys import version_info if version_info.major == 2: import __builtin__ as builtins # pylint:disable=import-error else: import builtins # pylint:disable=import-error def ...
{ "content_hash": "7e575e50f7bd9b85395d59fbbec1a890", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 76, "avg_line_length": 25.754716981132077, "alnum_prop": 0.6454212454212455, "repo_name": "miketwo/pylacuna", "id": "e780dad2fde0121fd2411aa68a4359547ff7b56c", "size": "138...
import flask import requests mailgun_key = None def set_mailgun_key(mgkey): global mailgun_key mailgun_key = mgkey def send_welcome(addr, link, other_email): return requests.post( "https://api.mailgun.net/v2/tokd.wtf/messages", auth=("api", mailgun_key), data={ "from":...
{ "content_hash": "d65619880b1a99ef11819dc942db8387", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 35.945945945945944, "alnum_prop": 0.5473684210526316, "repo_name": "haldean/chess", "id": "02d537a245d783be631e77cbda05e313f28ec026", "size": "1330",...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/base/shared_base_pauldron_both.iff" result.attribute_template_id = 11 result.stfName("wearables_name","default_pauldrons") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return re...
{ "content_hash": "2131eccc70852734954e2ae91f24715d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 24.923076923076923, "alnum_prop": 0.7129629629629629, "repo_name": "obi-two/Rebelion", "id": "fa0c6ce734b401c04a5055091c96155ae2d84d7b", "size": "469...
from django.core.exceptions import ValidationError from django.forms import fields as django_fields from django.utils.translation import ugettext_lazy as _ from metashare.repository import validators from metashare.repository.editor.widgets import LangDictWidget class DictField(django_fields.Field): """ A fo...
{ "content_hash": "ca47006fe0bcdd113471bc51ce91d6fa", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 76, "avg_line_length": 39.053333333333335, "alnum_prop": 0.6237623762376238, "repo_name": "JuliBakagianni/META-SHARE", "id": "b05dc2faf9adef84c8cf54248b39de1561617a83", "si...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/food/crafted/shared_dish_vercupti_of_agazza_boleruuee.iff" result.attribute_template_id = 5 result.stfName("food_name","vercupti") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return resu...
{ "content_hash": "e06e1be2e24f26091b88d5bde3df7b21", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 94, "avg_line_length": 24.76923076923077, "alnum_prop": 0.7080745341614907, "repo_name": "anhstudios/swganh", "id": "65970063b5a640a7654846e14126350a8f3196dc", "size": "467...
import os import sys import urllib2 import xbmc import xbmcgui import xbmcplugin import socket from pulsar.config import PULSARD_HOST from pulsar.addon import ADDON, ADDON_ID from pulsar.platform import PLATFORM try: import simplejson as json except ImportError: import json HANDLE = int(sys.argv[1]) class c...
{ "content_hash": "4d0e86aec5e684597465869af3b19be2", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 137, "avg_line_length": 35.61702127659574, "alnum_prop": 0.6574074074074074, "repo_name": "steeve/plugin.video.pulsar", "id": "489e33f8b837c6add94739bb7283fcc19d2c4dad", "s...
"""Encode the data using pre-trained VAE on dataspace. This script encodes the instances in dataspace (x) from the training set into distributions in the latent space (z) using the pre-trained the models from `train_dataspace.py` """ from __future__ import absolute_import from __future__ import division from __future...
{ "content_hash": "7e0da7362320a6331f6f2d382e1e2a83", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 29.023622047244096, "alnum_prop": 0.6638632664134563, "repo_name": "adarob/magenta", "id": "a8c140c40f977a450c64db3846987b1a19f08c28", "size": "4271...
from oslo_config import cfg from oslo_log import log as logging from sahara import conductor from sahara import context from sahara.plugins import utils from sahara.plugins.vanilla import abstractversionhandler as avm from sahara.plugins.vanilla.hadoop2 import config as c from sahara.plugins.vanilla.hadoop2 import edp...
{ "content_hash": "c1b1eaf0b08400cea6145a61f2fbf9ac", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 78, "avg_line_length": 31.96590909090909, "alnum_prop": 0.6226448631354425, "repo_name": "redhat-openstack/sahara", "id": "d0e186ed4636cd6e83d739df3a7f18c30c202064", "size...
from flask import Flask, jsonify, abort, request import os import socket import logging import sys from subprocess32 import check_call, CalledProcessError, call from werkzeug.exceptions import HTTPException, default_exceptions from netaddr import IPAddress, IPNetwork from pycalico.datastore import IF_PREFIX from pyca...
{ "content_hash": "e268354188974a8ab40170499c7e9bd9", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 78, "avg_line_length": 32.41803278688525, "alnum_prop": 0.6203961230509903, "repo_name": "L-MA/calico-docker", "id": "5c5dfedaf5a0e95238e8d810243aaeac95dbf115", "size": "1...
import json import datetime from django.shortcuts import render from django.shortcuts import render_to_response from django.http import HttpResponse from dashboard.handler import Handler from libs.decorator.decorator import render_json from django.views.decorators.csrf import csrf_exempt import os # Create your ...
{ "content_hash": "4220f450926252d5db65d4ba94eca035", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 103, "avg_line_length": 26.419098143236074, "alnum_prop": 0.5606425702811245, "repo_name": "zym1115718204/xspider", "id": "d4b020b5ee0335ff104cfc2e2f7d4c1afcaf7d2b", "size...
from task import Task from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, failure, returnValue from voltha.extensions.omci.omci_defs import ReasonCodes, EntityOperations from voltha.extensions.omci.omci_me import MEFrame from voltha.extensions.omci.omci_frame import OmciFrame from v...
{ "content_hash": "8148d27d6dcf701ecbea7ccf7ab373b8", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 100, "avg_line_length": 35.12820512820513, "alnum_prop": 0.6051094890510949, "repo_name": "opencord/voltha", "id": "da7bff5b5a6ca36b0522f987bc8baa2cec218d18", "size": "608...
from sahara import exceptions as ex from sahara.i18n import _ from sahara.service import api import sahara.service.validations.base as b NODE_GROUP_TEMPLATE_SCHEMA = { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 50, ...
{ "content_hash": "f0ed0e2d57d9d632cfb9843650d6d10d", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 29.009174311926607, "alnum_prop": 0.48070841239721696, "repo_name": "mapr/sahara", "id": "4ec89629f0dfe7fc6531be49555c9c80ac9c52f7", "size": "3745",...
import gevent from locust import HttpUser, task from locust.env import Environment from locust.stats import stats_printer, stats_history from locust.log import setup_logging setup_logging("INFO", None) class MyUser(HttpUser): host = "https://docs.locust.io" @task def t(self): self.client.get("/"...
{ "content_hash": "9867639d7e866a798c14f24840359fa7", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 24.545454545454547, "alnum_prop": 0.7444444444444445, "repo_name": "locustio/locust", "id": "5d74d1a69a0585f28480a767094055651b080f58", "size": "1080...
from django.conf.urls import patterns, url from .views import notification_list, notification_detail urlpatterns = patterns( '', url(r'^$', notification_list, name='api-notification-list'), url(r'^(?P<pk>[0-9]+)/$', notification_detail, name='api-notification-detail'), )
{ "content_hash": "f828489c9cff2083ff56112f4487721a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 57, "avg_line_length": 30.1, "alnum_prop": 0.6578073089700996, "repo_name": "donkawechico/arguman.org", "id": "fefa7373f867a3a2f78dd5113ec881b47b4a1c61", "size": "301", "...
""" Sample code for sampling a multivariate Gaussian using emcee. """ from __future__ import print_function import numpy as np import emcee # First, define the probability distribution that you would like to sample. def lnprob(x, mu, icov): diff = x-mu return -np.dot(diff,np.dot(icov,diff))/2.0 # We'll samp...
{ "content_hash": "fffb067c2dc9d13d8c97e75c80d8f6d6", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 75, "avg_line_length": 30.515625, "alnum_prop": 0.7306707629288275, "repo_name": "drphilmarshall/emcee", "id": "337fdcae5ac4f8400b9e2904b6e00fb8c7a1f88a", "size": "1975", ...
class Error(Exception): pass class AuthError(Error): pass class RepoNotFoundError(Error): pass class UninitializedBuildError(Error): pass
{ "content_hash": "665314382177ee5df7cf468c9ac95c39", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 37, "avg_line_length": 14.272727272727273, "alnum_prop": 0.7261146496815286, "repo_name": "percy/python-percy-client", "id": "575ef059d4ce72d383cf10fe49eebb4b66a6a83c", "si...
"""Implementation of JSONEncoder """ import re c_encode_basestring_ascii = None c_encode_basestring = None c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(b'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', '\b...
{ "content_hash": "83610b8b730b0e98293a913f5402da30", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 84, "avg_line_length": 36.86711711711712, "alnum_prop": 0.5270938970004276, "repo_name": "sejust/pykit", "id": "6389cf7d61f1a5c3b35a3f981174212f5d4e64ce", "size": "16369",...
import os import unittest import numpy import dadi class ResultsTestCase(unittest.TestCase): def test_1d_ic(self): # This just the standard neutral model func_ex = dadi.Numerics.make_extrap_log_func(dadi.Demographics1D.snm) fs = func_ex([], (17,), [100,120,140]) answer = dadi.Spect...
{ "content_hash": "2a73183e038d52110a08e5efbc01ee85", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 77, "avg_line_length": 33.791666666666664, "alnum_prop": 0.6097410604192355, "repo_name": "niuhuifei/dadi", "id": "d766f002302a32eda8cad61e5ca2243f9ef58da3", "size": "1622"...
from __future__ import unicode_literals from future.builtins import str, super import os import datetime from django import forms from django.conf import settings from django.core.files.storage import default_storage from django.db.models.fields import Field from django.db.models.fields.files import FileDescriptor fr...
{ "content_hash": "2e09290625d9aed1c7e7f1229ca38fb3", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 138, "avg_line_length": 37.88721804511278, "alnum_prop": 0.6413971025997222, "repo_name": "ryneeverett/filebrowser-safe", "id": "62db66322e21052161f6f0541297c187a3d89ae4", ...
r"""Classes to deal with the Takin resolution calculation engine """ import os import pipes import sys from .tas_instrument import TripleAxisInstrument from .tof_instrument import TimeOfFlightInstrument class TakinTripleAxis(TripleAxisInstrument): r"""Interface between TripleAxisInstrument and Takin engine ...
{ "content_hash": "dd83b9ce5bc049b19f733e6df4256047", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 65, "avg_line_length": 21.857142857142858, "alnum_prop": 0.6582633053221288, "repo_name": "granrothge/neutronpy", "id": "3c4a6ca9307e6a391d4068a01bf80d70b8529cd1", "size": ...
__author__ = 'jitrixis' from sniffery import Sniffery class Harvest: def __init__(self): self.__sniffery = Sniffery() def check(self, pks, pkt): pks = self.__sniffery.sniff(str(pks)) pkt = self.__sniffery.sniff(str(pkt)) if pks is None or pkt is None: return False ...
{ "content_hash": "445938fac8d46a0961b3d1c5c4ea39f4", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 62, "avg_line_length": 29.04494382022472, "alnum_prop": 0.47775628626692457, "repo_name": "Jitrixis/2ARC-Network-stack", "id": "bdc3a5bf5c6bed0f7d12e69722540b4be9464408", "...
from PIL import Image, ImageDraw, ImageFont import random import string class SimpleCaptchaException(Exception): pass class SimpleCaptcha(object): def __init__(self, length=5, size=(200, 100), fontsize=36, random_text=None, random_bgcolor=None): self.size = size self.text = ...
{ "content_hash": "74477ad6fe522d47ca46f0752bd68300", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 84, "avg_line_length": 31.57, "alnum_prop": 0.5603420969274627, "repo_name": "pletisan/python-data-viz-cookbook", "id": "ef14a186aa5665bb72ee47093cd64c8a97be91fc", "size":...
"""Shard life cycle abstract class.""" class _ShardLifeCycle(object): """Abstract class for objects that live along shard's life cycle. Objects that need to plug in business logic into a shard's life cycle should implement this interface. The life cycle is: * begin_shard is called at the beginning of e...
{ "content_hash": "20070ac6ae9c76ad979d311d6f23e27f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 74, "avg_line_length": 26.47945205479452, "alnum_prop": 0.6875323331608898, "repo_name": "gauribhoite/personfinder", "id": "18a2144a410149447b873d68bcf3db81f88a696f", "size...
__all__ = ['create_test_spatial_db', 'get_geo_where_clause', 'SpatialBackend'] from django.contrib.gis.db.backend.base import BaseSpatialBackend from django.contrib.gis.db.backend.oracle.adaptor import OracleSpatialAdaptor from django.contrib.gis.db.backend.oracle.creation import create_test_spatial_db from djang...
{ "content_hash": "900464e0c8fbc84d5896b28f99dc45c4", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 86, "avg_line_length": 59.65714285714286, "alnum_prop": 0.4540229885057471, "repo_name": "greggian/TapdIn", "id": "4c54b8f60565d4454f056d14b7a12ab328ffc684", "size": "2088"...
todayFile = file ( 'today.htm', 'w' ) print >> todayFile, '<!-- DO NOT edit this file, edit the following file \nJ:\\outlines\\today.py\n -->' tables = { '1 Today': """\ basement mold squirrels check libraries security lights rethink Internet configuration PBS Price Pottenger Rae auto search Hamilton career web site...
{ "content_hash": "8744d4602e18f2f73d840e47fd8087bc", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 104, "avg_line_length": 23.91025641025641, "alnum_prop": 0.6536193029490617, "repo_name": "ActiveState/code", "id": "5a99696c1cd448145355a5a5780040830f2de992", "size": "186...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/base/shared_poi_all_lair_rock_shelter_large.iff" result.attribute_template_id = -1 result.stfName("lair_n","rock_shelter") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "01bb1c1d493c52c4332bf81028b55f22", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 24.53846153846154, "alnum_prop": 0.6959247648902821, "repo_name": "anhstudios/swganh", "id": "785dbb49ed52fd6040a59ab0ee886b7b68c45854", "size": "464...
import time import requests import os import errno import ast import sys import argparse import configparser import threading import logging from pathlib import Path from datetime import timedelta, datetime __version__ = '0.17' prog_description = ("Generates kodi-compatible strm files from torrents on " ...
{ "content_hash": "e7d68e98848b6b6026b20ccee7d01bf8", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 101, "avg_line_length": 40.768149882903984, "alnum_prop": 0.4954044117647059, "repo_name": "dommtardif/premium2lib", "id": "74e1444c0c099b76399948e58878f3619c3d906a", "siz...
from cement.core.foundation import CementApp from cement.utils.misc import init_defaults from cement.core.controller import CementBaseController, expose from sets import Set from core.Util import Util from core.Parser import Parser import string import slugify import feedparser import re import os defaults = init_defa...
{ "content_hash": "2556629492199b71b89d4f11515390ce", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 104, "avg_line_length": 36.4025974025974, "alnum_prop": 0.601855155190867, "repo_name": "jayrod/wordify", "id": "1ece06666d707ba67b20ef029673d29bccf8be02", "size": "2803", ...
"""Model for aircraft flights""" class Flight: """A flight with a particular passenger aircraft""" def __init__(self, number, aircraft): if not number[:2].isalpha(): raise ValueError("No airline code in '{}'".format(number)) if not number[:2].isupper(): raise ValueErro...
{ "content_hash": "043d60495da044177d2a4c80d976e0d2", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 85, "avg_line_length": 30.91812865497076, "alnum_prop": 0.5770758464157367, "repo_name": "marencas/LearningPython", "id": "7048ee1ad1d189fb8166aac89f67ec012f579496", "size...
import os try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='elyse', version='0.1.1', description='A simple static website generator.', author='Frank Smit', author_email='[email protected]', license='MIT', long_description=open('README...
{ "content_hash": "97abb8d8ae6055001fed35f559a8cb11", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 53, "avg_line_length": 23.742857142857144, "alnum_prop": 0.5667870036101083, "repo_name": "FSX/elyse", "id": "76f79e6860f447d229507109c52c4393f413b94d", "size": "831", "b...
import os import sys import pdb import unittest sys.path.insert(0, os.path.abspath('../deep/tools')) sys.path.insert(0, os.path.abspath('./')) import state class EV_one(state.event): pass class EV_two(state.event): pass class EV_three(state.event): pass class EV_four(state.event): pass class ST_A(state.state): ...
{ "content_hash": "8f9c52aeaa76d4d33792b67f534cd4fb", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 62, "avg_line_length": 21.7196261682243, "alnum_prop": 0.5516351118760757, "repo_name": "deepgrant/deep-tools", "id": "d844193535553bfbce7cd68870ae0dae8e6a389b", "size": "...
from __future__ import division import numpy as np import matplotlib.pyplot as plt def main(): #error("oba_our_errors_train.dat", "train_error.png", 0, "Train") error("oba_our_errors_test.dat", "test_error.pdf", 0) def error(filename, output_filename, sched_error_value): data = np.loadtxt(filename) ...
{ "content_hash": "54eaacde09da22d2b92768fe43b7a47b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 86, "avg_line_length": 33.609756097560975, "alnum_prop": 0.6211901306240929, "repo_name": "sameersingh/onebusaway", "id": "9d5fa5bfe3a53ed51e402596b83bfef7013d5df1", "size"...
from netforce.model import Model, fields, get_model class Tax(Model): _name = "hr.payslip.tax" _fields = { "payslip_id": fields.Many2One("hr.payslip", "Payslip"), "name": fields.Char("Description", size=255), "code": fields.Char("Code"), "amount": fields.Decimal("Amount"), ...
{ "content_hash": "ca62674dd63fa7a9a22f9d7b31399663", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 63, "avg_line_length": 25.166666666666668, "alnum_prop": 0.5827814569536424, "repo_name": "anastue/netforce", "id": "2c64e2578367a111d8796c3ef50169c5aab8ead7", "size": "155...
""" MIT License Copyright (c) 2013-2016 Frantisek Uhrecky 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 u...
{ "content_hash": "c62810e44e06722b5d69af11b72a4fba", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 127, "avg_line_length": 35.76288659793814, "alnum_prop": 0.6140098010954166, "repo_name": "FrUh/userpass-manager", "id": "c92522ddf5cead9cdf4c592991adfaa4ce314449", "size":...
''' The Clients subpackage exists for one purpose - providing implementations of the MACI Client IDL interface for Python. Most developers will only care about looking at the SimpleClient module as it contains the documentation for PySimpleClient, but the BaseClient module can be quite interesting also. The final thing...
{ "content_hash": "80cdb67c93cee9d47464a3dd743b7d61", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 77, "avg_line_length": 58.8, "alnum_prop": 0.7959183673469388, "repo_name": "csrg-utfsm/acscb", "id": "116a346b4f8f3023c81f6057a5e3082e47d4331c", "size": "588", "binary":...
from django.urls import reverse from wakawaka.tests.base import BaseTestCase class IndexTestCase(BaseTestCase): """ Index and WikiIndex tests. """ def test_calling_home_redircts_to_wikiindex(self): """ Calling the homepage `/` will automatically redirect to the `WikiIndex` in...
{ "content_hash": "13ddeb8b168e73b1c249385567da2e46", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 82, "avg_line_length": 33.2972972972973, "alnum_prop": 0.5982142857142857, "repo_name": "bartTC/django-wakawaka", "id": "ffe9bae7c87dcd43eb7981dd18ae69b655813471", "size": ...
import os from twisted.cred.portal import Portal from txweb2 import responsecode from txweb2.auth import basic from txweb2.stream import MemoryStream from txweb2.dav.util import davXMLFromStream from txweb2.dav.auth import TwistedPasswordProperty, IPrincipal, DavRealm, TwistedPropertyChecker, AuthenticationWrapper fr...
{ "content_hash": "43d514d9405a0f9089ba441a2ded3c2c", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 120, "avg_line_length": 36.675461741424805, "alnum_prop": 0.5077697841726618, "repo_name": "macosforge/ccs-calendarserver", "id": "75adc984dc05734a019d87c9f5624978213a2ba6",...
import sys import re import git import requests from datetime import datetime CHANGELOG = 'CHANGES' API_URL = 'https://forge-allura.apache.org/rest/p/allura/tickets/search?limit=1000&q=ticket_num:({0})' def main(): from_ref, to_ref, version = get_versions() tickets, changes_without_tickets = get_tickets(fro...
{ "content_hash": "f84ef9081a83a754a1e2c35cb467562b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 102, "avg_line_length": 30.775862068965516, "alnum_prop": 0.6352941176470588, "repo_name": "heiths/allura", "id": "61aafddd65a02cf7cc321167417b08c27efcdbc2", "size": "2678"...
from tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() top_label = Label(frame, text="New AMC question") top_label.grid(row=0, columnspan=3) self.question_label = StringVar() label_label = Label(frame, text="Question label:") label_label.grid(r...
{ "content_hash": "895d1633c820ae411f51f5d73dd52601", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 76, "avg_line_length": 30.823529411764707, "alnum_prop": 0.6335877862595419, "repo_name": "jarthurgross/amc_question_creator", "id": "d8f84b20347d91db582bfeda8aa88ca38309baf0...
import sys import os # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # Get the proje...
{ "content_hash": "ff62cbee20bb11fe73d6cf9611b375fd", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 76, "avg_line_length": 30.68076923076923, "alnum_prop": 0.7036479879654005, "repo_name": "seagatesoft/dateparser", "id": "99d941e7d42c8cfc094d97e9caf9845ea90742cd", "size"...
import re import os class VirtualFsHandler(object): def usage(self): return get_help() def triage_message(self, message, client): if message['type'] != 'stream': return False original_content = message['content'] return original_content.startswith('fs ') def h...
{ "content_hash": "8d0dc08f187bc0b9aca18377da3f4cb1", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 72, "avg_line_length": 28.463519313304722, "alnum_prop": 0.5553377563329313, "repo_name": "Diptanshu8/zulip", "id": "9df542e4c0a2a50ca76b7dbf3ddfef6882adbcbe", "size": "66...
import math from klampt import * from klampt.glprogram import * from klampt import vectorops from klampt import so3 #import numpy as np class GLIKTest(GLRealtimeProgram): def __init__(self,world): GLRealtimeProgram.__init__(self,"GLIKTest") self.world = world self.position = (0...
{ "content_hash": "49128b3399a1633af7e99b608812a3a3", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 81, "avg_line_length": 34.5125, "alnum_prop": 0.5900036218761319, "repo_name": "bbgw/Klampt", "id": "6cc1fe90b496cd0a26f21c20976c637ca4bba976", "size": "2761", "binary": ...
import sublime_plugin class RenameFileCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().run_command("rename_path", {"paths": [self.view.file_name()]})
{ "content_hash": "4d684243a611078b32baf64af852f3cf", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 83, "avg_line_length": 30.5, "alnum_prop": 0.73224043715847, "repo_name": "Loamhoof/sublime-plugins-dump", "id": "a30ba7418206a2e196810a113d053fd76dc2c89d", "size": "183", ...
from celery import task @task(max_retries=3) def dummy_task(arg): return arg + arg
{ "content_hash": "8e3cd24588a7d45ea76b5cbc0b6e9189", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 23, "avg_line_length": 14.833333333333334, "alnum_prop": 0.6966292134831461, "repo_name": "strycore/djung", "id": "085a3e1d3803aece9859ff2170c780da492f5e5a", "size": "89", ...
"""Wrappers for various units of text, including the main :class:`TextBlob <textblob.blob.TextBlob>`, :class:`Word <textblob.blob.Word>`, and :class:`WordList <textblob.blob.WordList>` classes. Example usage: :: >>> from textblob import TextBlob >>> b = TextBlob("Simple is better than complex.") >>> b.tags...
{ "content_hash": "a74b570cb6fa031469cb078aa8538dc2", "timestamp": "", "source": "github", "line_count": 769, "max_line_length": 101, "avg_line_length": 37.04291287386216, "alnum_prop": 0.6068244049708629, "repo_name": "mab1290/GHOST", "id": "f8182f207ec90a5f69cb0a6d9be5a1623d14abd1", "size": "28510...
"""Support for Amcrest IP cameras.""" import asyncio from datetime import timedelta from functools import partial import logging from amcrest import AmcrestError from haffmpeg.camera import CameraMjpeg import voluptuous as vol from homeassistant.components.camera import ( CAMERA_SERVICE_SCHEMA, SUPPORT_ON_OFF...
{ "content_hash": "d173185f87af6d1d71ed827ca8ba6360", "timestamp": "", "source": "github", "line_count": 603, "max_line_length": 93, "avg_line_length": 34.998341625207296, "alnum_prop": 0.5974696739954511, "repo_name": "titilambert/home-assistant", "id": "5ac6acb2071baa1af7e0930c4e05449aa38ed342", "...
"""Tests for the Renault integration.""" from __future__ import annotations from types import MappingProxyType from homeassistant.const import ( ATTR_ICON, ATTR_IDENTIFIERS, ATTR_MANUFACTURER, ATTR_MODEL, ATTR_NAME, ATTR_SW_VERSION, STATE_UNAVAILABLE, ) from homeassistant.core import HomeA...
{ "content_hash": "78ee9d4af4b4373292205f01590f3847", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 88, "avg_line_length": 39.98947368421052, "alnum_prop": 0.7104501184522243, "repo_name": "lukas-hetzenecker/home-assistant", "id": "7b3bb9e3d0ac4cb740e8dfbd2049fc53aea76e37",...
from oslo_db.sqlalchemy import test_fixtures import glance.tests.functional.db.migrations.test_pike_expand01 as tpe01 import glance.tests.utils as test_utils # no TestPikeMigrate01Mixin class needed, can use TestPikeExpand01Mixin instead class TestPikeMigrate01MySQL( tpe01.TestPikeExpand01Mixin, test_fixtu...
{ "content_hash": "9c0fe423b225db2e190ccb2b252433f7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 29.066666666666666, "alnum_prop": 0.8165137614678899, "repo_name": "openstack/glance", "id": "2e5a3d6ab3d5f32c27b44396f3c1fa532cfbbe67", "size": "100...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2016 Alex Forencich 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...
{ "content_hash": "d23a42bbe04535d38307ddbf1ca94c22", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 86, "avg_line_length": 38.43181818181818, "alnum_prop": 0.7374334713187463, "repo_name": "Diti24/python-ivi", "id": "1b0ddfa30b4dcb0dc674f2d7aab795ae3c1e9ce9", "size": "169...
from collections import OrderedDict import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from goog...
{ "content_hash": "641a8faad80512e12690b181b1344aaa", "timestamp": "", "source": "github", "line_count": 1629, "max_line_length": 171, "avg_line_length": 40.41252302025783, "alnum_prop": 0.5781534815895005, "repo_name": "googleapis/python-dataproc", "id": "aa4eb2ae46c2b005c9f990f37ef13ee58424b486", ...
''' Created on 18/11/2018 @author: david ''' import logging import time from threading import Thread from sensor.imu6050 import Imu6050 class AngleProvider(object): def __init__(self, period): self._imu = Imu6050() self._period = period self._angle = 0.0 self._isR...
{ "content_hash": "c57749357f0028ea40c11608034804b1", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 76, "avg_line_length": 21.094827586206897, "alnum_prop": 0.5860237024928484, "repo_name": "dpm76/Bot1", "id": "8af6296de874c74aaea40e3e155d8b11f57bb056", "size": "2451", ...
"""Tests that do require database setup"""
{ "content_hash": "048a3645020329517bdd79dee64df38a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.7209302325581395, "repo_name": "steder/goose", "id": "c6b61235f2cfe3ad77e50492988fe1456a60f028", "size": "43", "binary": false, ...
from QUANTAXIS.QAUtil import QA_util_log_info from QUANTAXIS.QAUtil import QA_util_date_valid,QA_util_date_stamp from pandas import DataFrame from bson.objectid import ObjectId import numpy import datetime """ 按要求从数据库取数据,并转换成dataframe结构 """ def QA_fetch_data(code,startDate,endDate,collections): #print(datetime.da...
{ "content_hash": "e840427fb056f36f41b84374bfb2b034", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 142, "avg_line_length": 33.567567567567565, "alnum_prop": 0.6111111111111112, "repo_name": "lijiabogithub/QUANTAXIS", "id": "9672a47407de8d466d373a6311d2bbda8119fb0c", "siz...
from django.conf.urls import patterns, url from users import views urlpatterns = patterns('', # URL pattern for the UserListView # noqa url( regex=r'^$', view=views.UserListView.as_view(), name='list' ), # URL pattern for the UserRedirectView url( regex=r'^~redirec...
{ "content_hash": "f34db0cca83722e897c309b4724c8dcd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 50, "avg_line_length": 24.685714285714287, "alnum_prop": 0.5555555555555556, "repo_name": "c-rhodes/hack2014", "id": "0283cfebecc23157daaca0aa1102024b940964d3", "size": "88...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Confirmation' db.create_table('viveum_confirmation', ( ('id', self.gf('django.db.models.fields.AutoField...
{ "content_hash": "ca62bae1d0e0beda0955acf5d0708f39", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 182, "avg_line_length": 71.79807692307692, "alnum_prop": 0.5607338958082229, "repo_name": "philippeowagner/django-shop-viveum", "id": "b9286b9de9fd4af4d974c7af7b512d876115ec...
from scrapy.spiders import CrawlSpider, Rule from scrapy.selector import Selector from scrapy.linkextractors import LinkExtractor from censible_links.items import Page class CensibleCrawlSpider(CrawlSpider): name = 'censible_crawl' allowed_domains = ['censible.co'] start_urls = ['https://censible.co/'] ...
{ "content_hash": "afcdf1ac3c9bf5c27cd3ab76438b4b0c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 89, "avg_line_length": 33.888888888888886, "alnum_prop": 0.6371584699453552, "repo_name": "pmart123/censible_links", "id": "1add8f8cd5ee3a14ea0feb8cc872d08dadacdfc8", "size...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dream.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "f3f2515c4ef0013358f821fb633ffa26", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 25.11111111111111, "alnum_prop": 0.7079646017699115, "repo_name": "Yuecai/com-yuecai-dream", "id": "8d136d71665ef47b34c195bad5e186f0f206e51f", "size":...
""" Version agnostic psutil hack to fully support both old (<2.0) and new (>=2.0) psutil versions. The old <1.0 psutil API is dropped in psutil 3.0 Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6) Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html """ # No exception handl...
{ "content_hash": "5c4a39a3243869b1a901bb977434dfe7", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 109, "avg_line_length": 33.17857142857143, "alnum_prop": 0.5777717976318623, "repo_name": "saltstack/salt", "id": "e6684e5ca46fb262dc082562f6da73939ee08f02", "size": "3716...
"""The schema module provides the building blocks for database metadata. Each element within this module describes a database entity which can be created and dropped, or is otherwise part of such an entity. Examples include tables, columns, sequences, and indexes. All entities are subclasses of :class:`~sqlalchemy.s...
{ "content_hash": "5b9db55bc713ec12292af40b6a907cd1", "timestamp": "", "source": "github", "line_count": 5793, "max_line_length": 101, "avg_line_length": 37.26532021405144, "alnum_prop": 0.5906669507777541, "repo_name": "zzzeek/sqlalchemy", "id": "f1caf79be8335d39f3585d558d1c46e96bcebb96", "size": "...
"""Renderers that render RDFValues into JSON compatible data structures.""" import base64 import numbers from grr.lib import rdfvalue from grr.lib import registry from grr.lib import utils from grr.lib.rdfvalues import structs class ApiValueRenderer(object): """Baseclass for API renderers that render RDFValues...
{ "content_hash": "70075e9ef55a356908425af41dd3d50d", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 78, "avg_line_length": 27.41317365269461, "alnum_prop": 0.6503931847968545, "repo_name": "wandec/grr", "id": "9ff468d54f0c93dff2486019e20af61685b283a8", "size": "9178", ...