text
stringlengths
4
1.02M
meta
dict
"""Tests for tensorflow.ops.control_flow_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.core.protobuf ...
{ "content_hash": "dc69c31aad065e64086e14a1023e830f", "timestamp": "", "source": "github", "line_count": 3033, "max_line_length": 112, "avg_line_length": 36.15891856247939, "alnum_prop": 0.6052156469408224, "repo_name": "Kongsea/tensorflow", "id": "35ae89ed33fc2c2f1dbce1ee7bd724555b4fb0a2", "size": ...
""" XML utilities. """ import contextlib import io from xml.sax import saxutils class XMLBuilder: """ XML document builder. The code is purposely namespace ignorant: it's up to user to supply appropriate `xmlns` attributes as needed. >>> xml = XMLBuilder() >>> with xml.within('root', xmlns='tag:...
{ "content_hash": "31f139efe25307c303e5d522b74ef2c2", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 102, "avg_line_length": 28.517241379310345, "alnum_prop": 0.5711406690850463, "repo_name": "kgaughan/adjunct", "id": "a8910a3db6c4584d8bb48a0a7159654773d58409", "size": "24...
from plutil import * import sys if __name__ == '__main__': if len(sys.argv) != 7: print 'usage: %s [socialize_config] [api_config] [url] [secureurl] [key] [secret]' % sys.argv[0] sys.exit(1) socialize_config, api_config, url, securl, key, secret = sys.argv[1:] socialize_update = { 'URLs': { '...
{ "content_hash": "9dca632134c55db0d9426392e829016d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 100, "avg_line_length": 24.142857142857142, "alnum_prop": 0.6082840236686391, "repo_name": "dontfallisleep/socialize-sdk-ios", "id": "490cb064ffff3c3d5b91f1d7526c7363e6e86a18...
"""CounterGroup Handler that tracks moving interval percentiles over 4 periods (1m, 10m, 1h, 1d). """ from taba.handlers.counter_group import CounterGroup from taba.handlers.moving_interval_percentile import MovingIntervalPercentile MOVING_INTERVAL_PERCENTILE = MovingIntervalPercentile() class MovingIntervalPercenti...
{ "content_hash": "af56a7e55e5005b65bb4a2ea4f736571", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 30.84, "alnum_prop": 0.6880674448767834, "repo_name": "tellapart/taba", "id": "9bed43cf57069e90f77c88500d5d233f9a6590f0", "size": "2122", "binary":...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Folder', fields=[ ('id', models.AutoField(auto_created=True...
{ "content_hash": "6dc6166c3b0e1c6d64ec64a8e14b7f54", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 122, "avg_line_length": 38.666666666666664, "alnum_prop": 0.5531609195402298, "repo_name": "asommer70/strangway", "id": "c3520ef15b290938a802cd4f56bd5489d36734ea", "size": ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Page.orderid' db.alter_column('pages_page', 'orderid', self.gf('django.db.models.fields.DecimalField')(unique=Tru...
{ "content_hash": "a3bbf6a34b06d550436574e7e6b2d6c9", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 144, "avg_line_length": 52.27777777777778, "alnum_prop": 0.5807651434643996, "repo_name": "LambdaCast/LambdaCast", "id": "654de6edc03edb44ebb25d6e299554dbbaba532b", "size":...
from __future__ import absolute_import, unicode_literals import collections import contextlib import logging import operator from mopidy import compat, exceptions, models from mopidy.compat import urllib from mopidy.internal import deprecation, validation logger = logging.getLogger(__name__) @contextlib.contextma...
{ "content_hash": "84132d7c4a3deceb05366b2cb767ef38", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 79, "avg_line_length": 37.681697612732094, "alnum_prop": 0.587146276221315, "repo_name": "vrs01/mopidy", "id": "04fe0a7e5ba42c0394cb90c0f6311f7dac358e4c", "size": "14206",...
import unittest from maec.utils.nsparser import MAEC_NAMESPACES class NSParserTests(unittest.TestCase): def test_import(self): """Verify that the namespace list was imported successfully.""" self.assertTrue(MAEC_NAMESPACES) self.assertEqual(3, len(MAEC_NAMESPACES)) if __name__ == "__ma...
{ "content_hash": "6e516394b972f056e53fd0045c45a771", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 23.133333333333333, "alnum_prop": 0.6858789625360231, "repo_name": "MAECProject/python-maec", "id": "6215e129b4dba51bfe620a99cf894052cc59e77d", "size...
import numpy as np from STObject import STObject from hagelslag.util.munkres import Munkres class ObjectMatcher(object): """ ObjectMatcher calculates distances between two sets of objects and determines the optimal object assignments based on the Hungarian object matching algorithm. ObjectMatcher supports...
{ "content_hash": "eb0f292fabe13818b0e2c55d1fdc40c0", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 119, "avg_line_length": 40.390243902439025, "alnum_prop": 0.6234299516908213, "repo_name": "djgagne/hagelslag-unidata", "id": "cfae3f002032ab8f3bc29f48ea9f22d0b67c19ce", "...
# import unittest import os import sys import glob import unittest def getSuite(auto=True): pythonFiles = glob.glob(os.path.join(os.path.dirname(__file__), "*.py")) sys.path.insert(0, os.path.dirname(__file__)) testSuite = unittest.TestSuite() for fname in pythonFiles: if os.path.basename(fname...
{ "content_hash": "369f797fd61b332002d76f83b8cb4dcb", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 28.13157894736842, "alnum_prop": 0.5958840037418148, "repo_name": "vasole/fisx", "id": "91b7c59e76c8b2c16414ac2e7361e9466f2b1263", "size": "2459", ...
import logging from tracker.configs.celeryconfig import CELERY_TRACKER_PLUGINS from tracker.plugins.fluent import FluentPlugin try: from .utils import MockStorage except (ImportError, ValueError): from tests.utils import MockStorage config = CELERY_TRACKER_PLUGINS["fluent"] def get_kwargs(): return { ...
{ "content_hash": "39146e26c7dab241aef7d00900f5a119", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 63, "avg_line_length": 22.416666666666668, "alnum_prop": 0.6530359355638166, "repo_name": "ikeikeikeike/celery-tracker", "id": "20bce9e9a5ad563390a6bf9d3051cff8dac52c48", "...
"""This module is used for CLI module initialization and execution""" import os import inspect from lightbulb.core.utils.ipc import Pipe from threading import Thread import imp import sys META = { 'author': 'George Argyros, Ioannis Stais', 'name': 'MANAGE', 'description': 'Executes Core Modules', 'ty...
{ "content_hash": "3c6d3ab2e1a6a26bde5da184c94d0cdd", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 101, "avg_line_length": 32.669291338582674, "alnum_prop": 0.6331646179802362, "repo_name": "lightbulb-framework/lightbulb-framework", "id": "f7ad653bea7c7873bdf4788e10185539...
from .bloc import * import pygame, configparser from pygame.locals import * class Tile: """Classe représentant un tile, cad une case de la carte""" def __init__(self, nombreCouches): self._bloc, self._praticabilite, self._praticabiliteEau, self._nombreCouches, self._blocsSupplementaires = list(), [Fals...
{ "content_hash": "fee88ec1b4e2f8fccb0a399c6d7954a6", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 174, "avg_line_length": 45.5, "alnum_prop": 0.6459968602825745, "repo_name": "Rastagong/narro", "id": "a0581dc45a7a75da3f51fed759efdb7063c0309a", "size": "2570", "binary"...
from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver # CUSTOM FILE SIZE VALIDATOR def validate_image(fieldfile_obj): """ Limit image size upload """ ...
{ "content_hash": "357c8ca86600cb6760586b8cc62196e2", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 76, "avg_line_length": 22.397959183673468, "alnum_prop": 0.6182232346241457, "repo_name": "django-id/website", "id": "82385952ca66d768cdbc258d526c5a44db449556", "size": "21...
from ciphertext import Ciphertext import time c = Ciphertext() c.text_in('hello') assert c.text_out() == 'hello' d = Ciphertext() d.text_in('No King of the Isles had ever needed a Hand') with open('sample.txt','r') as source: natural_text = source.read() natural = Ciphertext() natural.text_in(natural_text) natur...
{ "content_hash": "3ec45c0b0c7a681dc6a83fa5e6657a29", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 56, "avg_line_length": 23.823529411764707, "alnum_prop": 0.7333333333333333, "repo_name": "paulsbrookes/subcipher", "id": "9e9aaa0fbaff5dd353ea40ce5bf702c625d79509", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0047_auto_20170507_0913'), ] operations = [ migrations.AlterField( model_name='glossaryterm', name='term', ...
{ "content_hash": "a0629960c859da33b1a1d03ade3b4c38", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 22.555555555555557, "alnum_prop": 0.603448275862069, "repo_name": "uccser/cs-unplugged", "id": "4007aa59158d834d49e03b2d601441789f13a17c", "size": "4...
import json import yaml import os import sys import re from collections import OrderedDict from ptemplate.template import Template GIT_REPO = "https://github.com/jboss-openshift/application-templates.git" REPO_NAME = "application-templates/" TEMPLATE_DOCS = "docs/" APPLICATION_DIRECTORIES = ("amq","eap","webserver","d...
{ "content_hash": "45a5c7b851449eaa8c9bbfe8e40f93e5", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 166, "avg_line_length": 45.69653179190752, "alnum_prop": 0.5912971981531845, "repo_name": "rcernich/application-templates", "id": "a9a7d5a8ac0391d8d7eb4afa65319ad1f2de42b2",...
from mailsync import defaults class Settings(object): def __init__(self): # update this dict from the defaults dictionary (but only for ALL_CAPS settings) for setting in dir(defaults): if setting == setting.upper(): setattr(self, setting, getattr(defaults, setting))
{ "content_hash": "ca885d92c24ac59dead54c83e670db69", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 88, "avg_line_length": 35.111111111111114, "alnum_prop": 0.6455696202531646, "repo_name": "rebelact/mailsync-app", "id": "5843a9b11a61f33c06f545ead0aa4fa614bfa401", "size": ...
""" Scheduler base class that all Schedulers should inherit from """ from oslo.config import cfg from cinder import db from cinder.openstack.common import importutils from cinder.openstack.common import timeutils from cinder import utils from cinder.volume import rpcapi as volume_rpcapi scheduler_driver_opts = [ ...
{ "content_hash": "91e4f555f6e5da80fad485026e7ad996", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 79, "avg_line_length": 37.14102564102564, "alnum_prop": 0.6534345875043148, "repo_name": "inkerra/cinder", "id": "13114c6aabecacc0d680eafdaa4dff9eb67114cf", "size": "3711",...
import _plotly_utils.basevalidators class FillValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="fill", parent_name="volume.slices.x", **kwargs): super(FillValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "372bd8ea05cfc776ecb0170ccc8fb31f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 84, "avg_line_length": 36.30769230769231, "alnum_prop": 0.5847457627118644, "repo_name": "plotly/plotly.py", "id": "6bd4ea8cdb65ea911f710780fd17d011a66ee62a", "size": "472"...
""" Notes regarding the implementation of smallest and largest: Both functions must take two keyword arguments: max_factor -- int min_factor -- int, default 0 Their return value must be a tuple (value, factors) where value is the palindrome itself, and factors is an iterable containing both factors of the pal...
{ "content_hash": "86cbd189f0caaa1ce6685023397df575", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 76, "avg_line_length": 38.114583333333336, "alnum_prop": 0.6848865810330691, "repo_name": "smalley/python", "id": "3735efb21c7ac2121e25805bf4e2d972e67b9fa4", "size": "3659"...
""" Move packages between labels. """ # Standard library imports from __future__ import unicode_literals, print_function import logging # Local imports from binstar_client import errors from binstar_client.utils import get_server_api, parse_specs logger = logging.getLogger('binstar.move') def main(args): aser...
{ "content_hash": "9fa6f76841a2f026e9303ec46858cd03", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 26.432692307692307, "alnum_prop": 0.579119679883594, "repo_name": "Anaconda-Platform/anaconda-client", "id": "89fe4280046570f1a6ed5872aa874dc121f0bee7...
import stripe import logging from django.conf import settings from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('simple_stripe') if (not hasattr(settings, 'STRIPE_PUBLIC_KEY') or settings.STRIPE_PUBLIC_KEY is None): raise ImproperlyConfigured( 'STRIPE_PUBLIC_KEY no...
{ "content_hash": "e23bf473677bd745204dac525d9b08c8", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 55, "avg_line_length": 29.473684210526315, "alnum_prop": 0.7321428571428571, "repo_name": "Khabi/django-stripejs", "id": "027115d005d26fa2a9f2f3507d18d9e9d6afc67b", "size":...
from pydbg import * from pydbg.defines import * import logging import struct import utils import sys #this code left intentionally undocumented dbg = pydbg() found_imvu = False print "\n\nIMVU HOOK by Exploit\n\n\n\n" pattern = raw_input("\n[?] What string to search for? > \n") logme = raw_input("\n[...
{ "content_hash": "7e3e2ef373ac62d7b59966516adceef9", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 83, "avg_line_length": 27.285714285714285, "alnum_prop": 0.576497963932519, "repo_name": "0xicl33n/pyimvudbg", "id": "91d3b31a013bb222423d12391585d80c3acfd63e", "size": "17...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: cobbler_system version_added: '2.7' short_description: Manag...
{ "content_hash": "564aedb334711450f67e81d2a7780999", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 143, "avg_line_length": 32.1280487804878, "alnum_prop": 0.6187132283165686, "repo_name": "SergeyCherepanov/ansible", "id": "a7768973febe4398ae7f75022ddbcc2534058c5e", "siz...
""" Trove Management Command line tool """ import json import os import sys from troveclient.compat import common # If ../trove/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... possible_topdir = os.path.normpath(os.path.join(os.p...
{ "content_hash": "a3b9f53e16054619d60f65f4fe28723f", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 79, "avg_line_length": 27.85433070866142, "alnum_prop": 0.5674911660777385, "repo_name": "openstack/python-troveclient", "id": "e3efbae9a8b128d0e546666f4a7e0c19a8d07b70", ...
BOT_NAME = 'ZhenAi' SPIDER_MODULES = ['ZhenAi.spiders'] NEWSPIDER_MODULE = 'ZhenAi.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent #USER_AGENT = 'ZhenAi (+http://www.yourdomain.com)' # Obey robots.txt rules ROBOTSTXT_OBEY = False # Configure maximum concurrent requests per...
{ "content_hash": "c92c89d56cc620a27b5d920d71c6c103", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 109, "avg_line_length": 37.51685393258427, "alnum_prop": 0.7433363282419886, "repo_name": "huangchuchuan/Spider", "id": "34b05e62d88507951bba4841aa9c4c2274ca2078", "size": ...
""" Author: Daniel E. Cook User profile """ from flask import render_template, Blueprint, session, flash, redirect, url_for from base.models import user_ds from logzero import logger user_bp = Blueprint('user', __name__) @user_bp.route('/profile/<string:username>') def user(username): """...
{ "content_hash": "33fe8569de8c114fb60a6615f0b2f49a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 24.62962962962963, "alnum_prop": 0.6210526315789474, "repo_name": "AndersenLab/CeNDR", "id": "eacb7592eff9e85f62bb4aeb31ef91d279d88b5d", "size": "711...
""" GEMPRO ====== """ import logging import os import os.path as op import shutil from copy import copy import pandas as pd from Bio import SeqIO from bioservices import KEGG from bioservices import UniProt from cobra.core import DictList from six.moves.urllib.error import HTTPError from slugify import Slugify impor...
{ "content_hash": "f269e92920e1e0fdcdf32d819eec12a3", "timestamp": "", "source": "github", "line_count": 1610, "max_line_length": 161, "avg_line_length": 48.55652173913043, "alnum_prop": 0.5932639173147769, "repo_name": "nmih/ssbio", "id": "9e6690574d5f9438123bcd44c45c5bc6b3ba554b", "size": "78176",...
""" Enumerations related to text in WordprocessingML files """ from __future__ import absolute_import, print_function, unicode_literals class WD_BREAK_TYPE(object): """ Corresponds to WdBreakType enumeration http://msdn.microsoft.com/en-us/library/office/ff195905.aspx """ COLUMN = 8 LINE = 6 ...
{ "content_hash": "a90a45dcf0b84b7d629a018216d78cc5", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 72, "avg_line_length": 24.16, "alnum_prop": 0.6672185430463576, "repo_name": "sk1tt1sh/python-docx", "id": "9260e6fa09feec23a257b97b5591fb20a31c5d77", "size": "623", "bin...
from hackru import manager if __name__ == '__main__': manager.run()
{ "content_hash": "5681706435fb068b5a16bd721e42b6a6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 26, "avg_line_length": 18.25, "alnum_prop": 0.589041095890411, "repo_name": "HackRU/FlaskRU", "id": "72fc993c2b95d8cd2336f754bfb2fbbe49658f6e", "size": "92", "binary": fal...
from collections import namedtuple from itertools import chain, izip import re from pycparser import c_ast from decomp import ida, utils from decomp.c import types as ep_ct from decomp.cpu import regs from decomp.cpu.mips import abi, data, insns next_ea_and_c = namedtuple('next_ea_and_c', ['next_ea', 'c']) def reg_st...
{ "content_hash": "8e299e669579de691dd1627c3a85812b", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 81, "avg_line_length": 39.98030634573304, "alnum_prop": 0.5423348475726562, "repo_name": "drvink/epanos", "id": "05373604621f5b89d3cc2e02a5da9ffdc73ea9e8", "size": "18271"...
from __future__ import unicode_literals from django.apps import AppConfig class WebConfig(AppConfig): name = 'web'
{ "content_hash": "881626e1ccb1066e93be5b12902377ee", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.428571428571427, "alnum_prop": 0.6976744186046512, "repo_name": "ieiayaobb/lushi8", "id": "9d7d5b4b6d66a5fcbfab3d7b538cce0be1f0df8c", "size": "129"...
""" ===================================================== Convert a 3-color image (JPG) to separate FITS images ===================================================== This example opens an RGB JPEG image and writes out each channel as a separate FITS (image) file. This example uses `pillow <http://python-pillow.org>`_...
{ "content_hash": "c0543ae0495191cf3e85d3cc5b9424a4", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 83, "avg_line_length": 30.71604938271605, "alnum_prop": 0.5409967845659164, "repo_name": "kelle/astropy", "id": "c3bb5d0819dc2c5014dc311d705dbbacfa2333df", "size": "2512", ...
import inspect import logging import types from concurrent import futures import six from taskflow.engines.worker_based import endpoint from taskflow.engines.worker_based import server from taskflow.openstack.common import importutils from taskflow import task as t_task from taskflow.utils import reflection from tas...
{ "content_hash": "ccea5ae10f7ccef8a0546d91daf95196", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 34.85087719298246, "alnum_prop": 0.5779008306065945, "repo_name": "varunarya10/taskflow", "id": "609339de80e6c1f47c6a0c3aaf3d1139d7c1b229", "size": ...
import io import os import tarfile import zipfile from .distribution import Distribution class SDist(Distribution): def __init__(self, filename, metadata_version=None): self.filename = filename self.metadata_version = metadata_version self.extractMetadata() @classmethod def _get_...
{ "content_hash": "8af83a5489599af99137037bc1b5778b", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 73, "avg_line_length": 31.493333333333332, "alnum_prop": 0.5520745131244708, "repo_name": "sonntagsgesicht/regtest", "id": "33d7844faff23da1511c1efc72dc2e3abd0dd632", "size...
"""Tests for grr.parsers.osx_file_parser.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import io import os from absl import app import biplist from grr_response_core.lib import parsers from grr_response_core.lib.parsers import osx_file_parser from ...
{ "content_hash": "4a8dcf4329a3828dbbb6bbd5a98551dd", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 40.582352941176474, "alnum_prop": 0.6831424844180316, "repo_name": "demonchild2112/travis-test", "id": "f4a1d90cd81f895ec8dec81de2f029ac84e99a11", "...
import pendulum from flexmock import flexmock, flexmock_teardown from ... import OratorTestCase from ...utils import MockConnection from orator.query.builder import QueryBuilder from orator.query.grammars import QueryGrammar from orator.query.processors import QueryProcessor from orator.query.expression import QueryEx...
{ "content_hash": "fc5661918e576ae85c551d29c6ce86b2", "timestamp": "", "source": "github", "line_count": 655, "max_line_length": 88, "avg_line_length": 42.577099236641224, "alnum_prop": 0.6040949512335054, "repo_name": "sdispater/orator", "id": "ef3a858833f84fb9e2d1779ad219868e348bcf67", "size": "27...
import pytest from UnofficialDDNS import __doc__ as uddns_doc from UnofficialDDNS import __version__ as uddns_ver from docopt import docopt import libs def test_config_file_and_cli_complimentary_with_full_valid_data(config_file): config_file.write("domain: mydomain.com") config_file.flush() argv = ['-c', ...
{ "content_hash": "e55e9d61e230cc2218956eff8b4012aa", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 109, "avg_line_length": 49.62903225806452, "alnum_prop": 0.6509587260318492, "repo_name": "Robpol86/UnofficialDDNSnix", "id": "5f6335db731df8a59718d6d659194fd0a22352e1", "s...
from django.conf.urls import url from ..views import QuoteList urlpatterns = [ url(r'^$', QuoteList.as_view(), name='quote_list'), ]
{ "content_hash": "c3a4b5a2a193c876bb6776d83127c3f3", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 17.5, "alnum_prop": 0.6714285714285714, "repo_name": "onepercentclub/bluebottle", "id": "4cd426ffdca9d252e5fb7d6f2e98d87d777fa0e1", "size": "140", "...
""" Created on 2015-06-13 @author: lujin """ from django.conf.urls import url from app.setup import views urlpatterns = [ url(r'^website/$', views.website), url(r'^personal/$', views.personal), ]
{ "content_hash": "d7da60e34d3a613b5179ae1ac3c1365d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 17.083333333333332, "alnum_prop": 0.6682926829268293, "repo_name": "myangeline/rorobot", "id": "4948fde4c123b705f86ced28d3d1cca6b7ef91cf", "size": "2...
from django.shortcuts import render, redirect from django.http import Http404 from django.forms import EmailField from django.core.cache import cache from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.d...
{ "content_hash": "4212dd4ca3a5eeb0f9e825d1642be386", "timestamp": "", "source": "github", "line_count": 446, "max_line_length": 119, "avg_line_length": 44.026905829596416, "alnum_prop": 0.4833469138317376, "repo_name": "AlexStarov/Shop", "id": "7cdb0def004c2297cad0536a727814c10c324079", "size": "20...
""" Python Enumerations NOTE: This module is to provide enum support in Python27. Technically, this module could be made as a dependency for symoro package. However, in order to reduce the number of dependencies, the source code is included here. See below under the LICENSE section for further details on usage of this...
{ "content_hash": "602f9e37159369aef2a04ed0a446f558", "timestamp": "", "source": "github", "line_count": 812, "max_line_length": 113, "avg_line_length": 37.60960591133005, "alnum_prop": 0.5502144798454436, "repo_name": "ELZo3/symoro", "id": "17a4fb2b108ebbaecec4e5bf50c241211d22d713", "size": "30539"...
''' Created on Mar 6, 2016 @author: Laurent Marchelli ''' import os import shutil import Command from generators.Generator import Generator from generators.linapple.linappleConfig import LinappleConfig import recalboxFiles class LinappleGenerator(Generator): ''' Command line generator for linapple-pie emulat...
{ "content_hash": "9c9cc343518e218907c0485f27e1927f", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 90, "avg_line_length": 34.105633802816904, "alnum_prop": 0.6083006400991121, "repo_name": "digitalLumberjack/recalbox-configgen", "id": "15c5320f3ba001dddec8f93ef20a4e78e844...
def checkCurNum(listNumbers,numToMatch): #print("Num match: "+str(numToMatch)+ " list: "+str(listNumbers)) if len(listNumbers) < 2: return False matchFound = False baseNum = listNumbers[0] for curNum in listNumbers[1:]: if (baseNum + curNum) == numToMatch: return True ...
{ "content_hash": "c352b18285ec6264b12e175341e59b86", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 95, "avg_line_length": 32.36538461538461, "alnum_prop": 0.6749851455733809, "repo_name": "caw13/adventofcode", "id": "b081f2fd2818a9aa7c7664ee8617516e70d47491", "size": "17...
import json import pkg_resources def get_pkg_license(pkgname): """ Given a package reference (as from requirements.txt), return license listed in package metadata. NOTE: This function does no error checking and is for demonstration purposes only. """ pkgs = pkg_resources.require(pkgname) ...
{ "content_hash": "9bd93c386f6c8f68649bbe07f24e1b84", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 57, "avg_line_length": 22.448275862068964, "alnum_prop": 0.5668202764976958, "repo_name": "cpenner461/tellmewhen", "id": "6e8fb807d9b1c6eb762c573241ff619085a3cf2b", "size":...
from __future__ import absolute_import, unicode_literals from django import forms class SyncDataForm(forms.Form): """ Form for running sync_data management command. """ pass
{ "content_hash": "c57a368e1cd5bd4a4abef4c844f696ba", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 17.636363636363637, "alnum_prop": 0.6958762886597938, "repo_name": "pythonindia/junction", "id": "fda778c2ae5e70e2c0c0754d2130b3c99bb09957", "size": ...
"""Add RepositoryOption Revision ID: 152c9c780e Revises: 4d302aa44bc8 Create Date: 2013-11-26 17:48:21.180630 """ # revision identifiers, used by Alembic. revision = '152c9c780e' down_revision = '4d302aa44bc8' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic...
{ "content_hash": "65efce0dc9c5754d98dc4833270d577c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 81, "avg_line_length": 29.771428571428572, "alnum_prop": 0.6842610364683301, "repo_name": "alex/changes", "id": "31969f2825609ee05abdaf0ca183d8e8c29a57f2", "size": "1042", ...
"""The scope builder interface.""" from __future__ import absolute_import from . import ty as _ty from . import expr as _expr from .._ffi import base as _base class WithScope(object): """A wrapper for builder methods which introduce scoping. Parameters ---------- enter_value: object The valu...
{ "content_hash": "bf266509078719535d9962358f31998c", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 98, "avg_line_length": 26.842364532019705, "alnum_prop": 0.5412002202238942, "repo_name": "Laurawly/tvm-1", "id": "726b3c6241fec9442e04e434dad978c114cf7752", "size": "6235...
import os import xml.dom.minidom as dom from .sound import Record, DataBase def check_year(year): if year not in [1, 2]: raise(ValueError, "Wrong year version: %d (should be 1 or 2)" % year) def _filter_XML(path): return (os.path.isfile(path) and os.path.splitext(path)[-1].lower() == '....
{ "content_hash": "88fadde78483a53f2c8b29dbc9029d4e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 31.864197530864196, "alnum_prop": 0.5749709414955444, "repo_name": "omangin/multimodal", "id": "c9aa4e901926092f034143b3be9db6ec67785681", "size": "2...
from __future__ import absolute_import from datetime import datetime import json from time import time import types import unittest import normalize.exc as exc from normalize.coll import list_of from normalize.record import Record from normalize.visitor import VisitorPattern from testclasses import acent from testcla...
{ "content_hash": "4a9cc3e2d05db70bbcdc511dd3c8dab4", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 79, "avg_line_length": 35.34313725490196, "alnum_prop": 0.6069348127600555, "repo_name": "samv/normalize", "id": "5bdb8068bf6d2850310d6bbac71391dd487b0a77", "size": "7772"...
from selenium import webdriver import argparse import os import os.path import sys from datetime import datetime import pandas as pd import json from pprint import pprint import glob import linecache import logging def get_driver(driver_option = None): driver = None if not driver_option: driver_option...
{ "content_hash": "fd61505970f8a9353828fc558f899162", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 127, "avg_line_length": 44.972727272727276, "alnum_prop": 0.6197695573074591, "repo_name": "xudesheng/stock36", "id": "0ccedd90ec3a667f68d98869139822245e2690e3", "size": "...
import numpy as np import scipy as sp import matplotlib.pylab as plt ''' objects for storing pest related control file ''' class controldata(object): ''' object containing paramaters in the control data section of the pestcontrol file Attributes: RSTFLE : "restart or norestart" Instructs PEST whether to w...
{ "content_hash": "72c0eb1c68eee7a6687726b3de5727dd", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 179, "avg_line_length": 37.794871794871796, "alnum_prop": 0.7057892356399819, "repo_name": "nvoss12838/APE", "id": "e7e7061e259e3ef6aeb65457d2e98e66c016b98c", "size": "132...
from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### endblock Header ### block ClassImplementation # NOTICE: Do not edit anything here, it is generated code class GX...
{ "content_hash": "a496a7969d8a89bae5492e380f105466", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 135, "avg_line_length": 25.991304347826087, "alnum_prop": 0.6155904984944798, "repo_name": "GeosoftInc/gxpy", "id": "e5621f7dc4c90e572c9eaae77217a899c3f00928", "size": "30...
from typing import Optional from itertools import product import numpy as np from openfermion.ops import InteractionOperator, InteractionRDM from openfermion.linalg import wedge from openfermion.transforms import get_fermion_operator from recirq.hfvqe.circuits import rhf_params_to_matrix def get_matrix_of_eigs(w: np....
{ "content_hash": "e293eb9c2763d1819ff2917eef358136", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 80, "avg_line_length": 40.926829268292686, "alnum_prop": 0.50119189511323, "repo_name": "quantumlib/ReCirq", "id": "39785d369a3fd03f5e89a4c2804f5fb129999f1a", "size": "896...
import logging from django.conf import settings from django.core.cache import cache from twython import Twython, TwythonAuthError, TwythonError logger = logging.getLogger(__name__) def get_user_timeline(screen_name): timeline = cache.get('twitter_timeline') if not timeline: try: twitter...
{ "content_hash": "b3d2ecf2d93ecb06a60e7097e050ab82", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 27.022222222222222, "alnum_prop": 0.5879934210526315, "repo_name": "kingsdigitallab/kdl-django", "id": "d8502e086acd3fee8c19d7dfb1536791ad790d34", "s...
import h5py from pyspark import SparkConf, SparkContext from pyspark.sql.types import Row, StructField, StructType, StringType, IntegerType, LongType from datetime import datetime, date, timedelta import sys from operator import add from pyspark.sql import SQLContext import os import json from sparkles.modules.utils.he...
{ "content_hash": "ab4017ceb1e1f59ed1580c192e356d7a", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 141, "avg_line_length": 37.41228070175438, "alnum_prop": 0.6794841735052755, "repo_name": "CSC-IT-Center-for-Science/spark-analysis", "id": "3675a8ab6460506a43ff72d75d8b4075...
from future import standard_library standard_library.install_aliases() from builtins import object from configparser import ConfigParser import os import io class MonolitheConfig(object): def __init__(self, path=None): self.path = path self.config = None self.mapping = None self....
{ "content_hash": "fe7c3b332dddc490d5a0315e7413037e", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 78, "avg_line_length": 29.73913043478261, "alnum_prop": 0.6223196881091618, "repo_name": "nuagenetworks/monolithe", "id": "e00823061bc3245747c0346fc1c6ef78581d3066", "size"...
"""Module level configuration. Blocks allows module-wide configuration values to be set using a YAML_ configuration file and `environment variables`_. Environment variables override the configuration file which in its turn overrides the defaults. The configuration is read from ``~/.blocksrc`` if it exists. A custom c...
{ "content_hash": "4797e860f9ea27e813952013bf5c3989", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 76, "avg_line_length": 35.9364161849711, "alnum_prop": 0.6459707254302718, "repo_name": "nke001/attention-lvcsr", "id": "dceee53a52caa0ce37de6195d1161005759ea405", "size":...
import six from django.utils.encoding import force_text try: from django.utils.functional import keep_lazy KEEP_LAZY = True except ImportError: from django.utils.functional import allow_lazy KEEP_LAZY = False def truncate_letters(s, num): """ truncates a string to a number of letters, similar ...
{ "content_hash": "e9da889cb3e740baf47d31b45963c98b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 72, "avg_line_length": 24.51851851851852, "alnum_prop": 0.6450151057401813, "repo_name": "kawamon/hue", "id": "17825807d4e76a95974defffb822df406d6f48fc", "size": "686", "...
from optparse import OptionParser import os import os.path import sys import shutil import stat def _nsinstall_internal(argv): usage = "usage: %prog [options] arg1 [arg2 ...] target-directory" p = OptionParser(usage=usage) p.add_option('-D', action="store_true", help="Create a single directory on...
{ "content_hash": "2cacf4ea254a013c6af08851bb7171ec", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 91, "avg_line_length": 34.09580838323353, "alnum_prop": 0.6413768879522305, "repo_name": "sergecodd/FireFox-OS", "id": "b0a81d17d983a14542182c439c64efd9b2384668", "size": ...
''' Significant lifting from https://jmetzen.github.io/2015-11-27/vae.html ''' import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import re, string from sklearn.feature_extraction.text import CountVectorizer def load_text(): fname = 'Oxford_English_Dictionary.txt' txt = [] with open(fname...
{ "content_hash": "0f39d4bc7e31a36902cfe30a304f325f", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 96, "avg_line_length": 43.77090909090909, "alnum_prop": 0.5739802276314696, "repo_name": "dricciardelli/vae2vec", "id": "5dae53d12c27089378a2a6798922c75c98cd6cda", "size":...
"""A time estimator by running TensorFlow operators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import logging import tensorflow as tf import numpy as np from six.moves import range from paleo.profilers.base import BaseProfiler, TimeMe...
{ "content_hash": "ddb9e806c67698c5c84f6e7b074fd33d", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 79, "avg_line_length": 42.465625, "alnum_prop": 0.514386636249908, "repo_name": "TalwalkarLab/paleo", "id": "9fcb057df310dca264aa9276118dcd84fb8fef5c", "size": "13589", ...
from django.shortcuts import render from django.conf import settings from django.core.files import File from protein.models import ProteinFamily, ProteinAlias, ProteinSet, Protein, ProteinSegment from common.views import AbsTargetSelection from common.views import AbsSegmentSelection from common.views import Abs...
{ "content_hash": "95d2beeb81fe8818c97cdce1b515e27c", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 261, "avg_line_length": 46.3394495412844, "alnum_prop": 0.5484722497195275, "repo_name": "fosfataza/protwis", "id": "9f7312e3558d4905b1d48f077855d8a6b6d130c5", "size": "15...
""" Requires python-chess """ import traceback import sys import os import random from threading import Thread from _thread import * from qboard import QBoard from client import Client from server import Server import chess import chess.engine import chess.pgn import chess.polyglot import chess.svg #import chess....
{ "content_hash": "963d0ed6b74552979d5f48f6f9bb956b", "timestamp": "", "source": "github", "line_count": 725, "max_line_length": 181, "avg_line_length": 35.98758620689655, "alnum_prop": 0.5682419225020122, "repo_name": "aole/Chess-Coach", "id": "915017f48972f6ed8abe80be3232c57e6e02d45c", "size": "26...
from codecs import open from setuptools import find_packages, setup __version__ = "0.1.0" __author__ = "SkyLothar" __email__ = "allothar@gmail.com" __url__ = "http://github.com" with open("README.rst", "r", "utf-8") as f: readme = f.read() with open("requirements.txt", "r", "utf-8") as f: install_requiremen...
{ "content_hash": "b59eba7ade05b0aae47466af9604a479", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 71, "avg_line_length": 32.266666666666666, "alnum_prop": 0.5945247933884298, "repo_name": "SkyLothar/certbot-dns-dnspod", "id": "c77e50ae0b5747db6f1384d3ebc72d74746e590b", ...
import json import urllib2 import urlparse import ssl def dcat_to_utf8_dict(url): ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE return json.loads(urllib2.urlopen(url, context=ctx).read().decode('utf-8')) def get_extension_from_url(u): # SEE: https:...
{ "content_hash": "034250ae0a34783102b1612dff2543c3", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 25.58823529411765, "alnum_prop": 0.6827586206896552, "repo_name": "mxabierto/ckanops", "id": "c0f9cc2034296f89747612701d4e1b136157a316", "size": "481...
import abc from neutron.api.v2 import attributes from oslo_log import log as logging import six from sqlalchemy.orm import exc as orm_exc from gbpservice.common import utils LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class PolicyTargetContext(object): """Context passed to policy engine f...
{ "content_hash": "ad7f3b29fde2ae067182da11c5a0f374", "timestamp": "", "source": "github", "line_count": 1760, "max_line_length": 80, "avg_line_length": 34.967045454545456, "alnum_prop": 0.6615644600435475, "repo_name": "tbachman/group-based-policy", "id": "1e9e9e1544404a512584e6a5c9ed995a4e72b629", ...
import os.path import numpy as np import argparse from glob import glob from scikits.audiolab import Sndfile from scikits.audiolab import Format from sklearn.mixture import GMM from MFCC import melScaling ####################################################################### # some settings framelen = 1024 fs = 4410...
{ "content_hash": "7e9cf901b324ec396be7d2b04a096646", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 182, "avg_line_length": 43.73762376237624, "alnum_prop": 0.6828522920203736, "repo_name": "daleloogn/singerID-smacpy-GMM", "id": "1ad7ea8fee7e55610dca1dc686c4e01aecf8edaa", ...
import datetime import time import json import arcpy import copy import os import tempfile import uuid from spatial import json_to_featureclass from geometry import Point, MultiPoint, Polygon, Polyline, SpatialReference from .._abstract.abstract import AbstractGeometry #from ..agol import featureservice as agolFeatureS...
{ "content_hash": "fcd205c999a9be9d29f01595a4ccf718", "timestamp": "", "source": "github", "line_count": 699, "max_line_length": 107, "avg_line_length": 39.58369098712446, "alnum_prop": 0.4661534569373667, "repo_name": "achapkowski/ArcREST", "id": "b308b16ab4979c22728cbb43cea011f6109ce927", "size": ...
"""Factories to help in tests.""" import factory from factory.base import Factory from faker import Faker from tests.models import Category, UberCategory, Widget fake = Faker() class WidgetFactory(Factory): """Widget factory.""" class Meta: """Factory configuration.""" model = Widget n...
{ "content_hash": "dc151cbcbe46b5ddf80634892df64235", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 55, "avg_line_length": 20.871794871794872, "alnum_prop": 0.6412776412776413, "repo_name": "xuru/flywheel-reference-field", "id": "0a78eb9ff6ecdb916b9f8eaa7ee38a2eb0eaa910", ...
import json import os from reviewInfo.models import ReviewInfo REPO_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) FILE_NAME = os.path.join(REPO_DIR,'data.json') count = 0.0 with open(FILE_NAME) as f: records = json.load(f) for record in records: ...
{ "content_hash": "f6d160aaa697982b29c5848481fdcd63", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 105, "avg_line_length": 26.607142857142858, "alnum_prop": 0.6174496644295302, "repo_name": "riffschelder/reviewshub", "id": "43825636b9c5dadb161388162ef95b462e0d0006", "siz...
""" Miscellaneous data helpers, including functions for converting integers to and from bytes and UTC timezone. Exports the following items: - OrderedDict() - int_from_bytes() - int_to_bytes() - timezone.utc - inet_ntop() - inet_pton() - uri_to_iri() - iri_to_uri() """ from __future__ import unicode_literals,...
{ "content_hash": "353d6016072618a223980c7689126660", "timestamp": "", "source": "github", "line_count": 710, "max_line_length": 97, "avg_line_length": 25.388732394366198, "alnum_prop": 0.5137579052479752, "repo_name": "xq262144/hue", "id": "2e55ef85834881f80376f3be871c58980a0ecedb", "size": "18043"...
"""Default tags used by the template system, available to all templates.""" import sys import re from itertools import groupby, cycle as itertools_cycle from google.appengine._internal.django.template import Node, NodeList, Template, Context, Variable from google.appengine._internal.django.template import TemplateSyn...
{ "content_hash": "b55277631e5f364365e5eb84e4874e89", "timestamp": "", "source": "github", "line_count": 1217, "max_line_length": 240, "avg_line_length": 35.16844700082169, "alnum_prop": 0.5832009345794392, "repo_name": "tungvx/deploy", "id": "e9a9d2e0c2b8f1266802fe080398b6857416753d", "size": "4280...
import simplejson as json def find(element, search, path=[]): for key, value in element.items() if isinstance(element, dict) else enumerate(element): if isinstance(value, (dict, list)): if find(value, search, path): path.append(key) return path elif value...
{ "content_hash": "eb680317907c96948a4834c1f63008c5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 91, "avg_line_length": 36.333333333333336, "alnum_prop": 0.563302752293578, "repo_name": "marcardioid/DailyProgrammer", "id": "1e6e440c523d724fd1042c8e0b2d5eca431cd65e", "s...
""" Use Bayesian Inference to trigger a binary sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.bayesian/ """ import asyncio import logging from collections import OrderedDict import voluptuous as vol import homeassistant.helpers.co...
{ "content_hash": "f299541b5eedd6449e3e2e4675adfee8", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 79, "avg_line_length": 33.9, "alnum_prop": 0.6440064360418343, "repo_name": "stefan-jonasson/home-assistant", "id": "f3dbc912ade1209f1760649c9379cbb93bb54564", "size": "74...
from twisted.python import log from autobahn.twisted import websocket import logging import os import time import pexpect import sys import threading from universe.vncdriver.vnc_proxy_server import VNCProxyServer from universe.rewarder.reward_proxy_server import RewardProxyServer from universe import utils logger = l...
{ "content_hash": "c1d2f8657520f6aea7de7a4f0f33fda2", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 117, "avg_line_length": 35.67741935483871, "alnum_prop": 0.6392405063291139, "repo_name": "rht/universe", "id": "088673a7e5838ff154d1eed5bc58a2c1c5d47842", "size": "2271", ...
import re from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import to_list from ansible.module_utils.network.eos.providers.providers import register_provider from ansible.module_utils.network.eos.providers.providers import CliProvider from ansible.module_utils.network.eos.pr...
{ "content_hash": "3522f3ba929d92a21e42767c58aca01a", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 143, "avg_line_length": 36.75471698113208, "alnum_prop": 0.5592060232717317, "repo_name": "thaim/ansible", "id": "a2f40affaea26972e6ec18faf06240c49b322f57", "size": "5977"...
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in core/fromnum...
{ "content_hash": "1358212dd08a4d79cf1698716bf9d4b5", "timestamp": "", "source": "github", "line_count": 6856, "max_line_length": 109, "avg_line_length": 29.510939323220537, "alnum_prop": 0.5922738932520129, "repo_name": "MSeifert04/numpy", "id": "dbe3d226fdef4efeec37522e1502f03c9e6e590f", "size": "...
import sys import os import shutil from tags import * import glob import subprocess from engine import create_context def find_bblayers(): """ Find and return a sanitized list of the layers found in BBLAYERS. """ try: builddir = os.environ["BUILDDIR"] except KeyError: print "BUILDD...
{ "content_hash": "20526f611a7774594bc454b33d944aba", "timestamp": "", "source": "github", "line_count": 1043, "max_line_length": 115, "avg_line_length": 31.17353787152445, "alnum_prop": 0.5958356400319862, "repo_name": "marcosbontempo/inatelos", "id": "ba68b60fcb1622ee3381c1c36317a4db113955a5", "si...
from twisted.internet import task from twisted.internet import reactor from twisted.web import resource, static from coherence import __version__ from coherence.extern.et import ET, indent from coherence.upnp.services.servers.switch_power_server import SwitchPowerServer from coherence.upnp.devices.basics import Roo...
{ "content_hash": "6f6238b1a1fc1f24834b6b4cd09afbff", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 126, "avg_line_length": 36.96875, "alnum_prop": 0.5680473372781065, "repo_name": "sreichholf/python-coherence", "id": "5e993752e7d373d9716d87aafe32c0785362df3d", "size": "3...
from conan.packager import ConanMultiPackager if __name__ == "__main__": builder = ConanMultiPackager(username="memsharded", channel="testing") builder.add_common_builds(shared_option_name="Protobuf:shared") filtered_builds = [] for settings, options in builder.builds: if settings["compiler.ve...
{ "content_hash": "20fc7067ef0ad926ff4daa2ec316ffe3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 74, "avg_line_length": 37.75, "alnum_prop": 0.6843267108167771, "repo_name": "memsharded/conan-protobuf", "id": "db31155c6bb3a39f9023f7458526916a2df1a94d", "size": "453", ...
import re import sys import os import subprocess import ssl import shlex if len(sys.argv) == 1: print("Usage: add_certificate.py <SERVER>") sys.exit(1) host = sys.argv[1] cert_file = "cert.pem" cert = ssl.get_server_certificate((host, 443)) f = open(cert_file, 'w') f.write(cert) f.close() bcjar = "tools/bcpr...
{ "content_hash": "fffe94d7523764784f7bec0bed55faca", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 138, "avg_line_length": 29.457142857142856, "alnum_prop": 0.6537342386032978, "repo_name": "raphaelm/opacclient", "id": "99292e35a4d2fbab3a3891d137914f337b6f0655", "size": ...
from django.contrib import admin from .models import Server class ServerAdmin(admin.ModelAdmin): prepopulated_fields = {'slug': ('name', )} admin.site.register(Server, ServerAdmin)
{ "content_hash": "eb5113595c2373bc752b7bbf9e974eaa", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 46, "avg_line_length": 19, "alnum_prop": 0.7421052631578947, "repo_name": "Jonpro03/Minecrunch_Web", "id": "f6ea9698c9f7d0bbb56ef87a3aaaeea0d361c166", "size": "190", "bin...
"""Displays all countries matching a search criteria. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication information" section of our README. """ # Import appro...
{ "content_hash": "057ed41a8804fd7a5123a95e3151971f", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 29.452380952380953, "alnum_prop": 0.698464025869038, "repo_name": "haveal/googleads-python-lib", "id": "4f79e613d37b28cee407fb920c0161aa891e089b", "s...
import asyncio from random import randint import common from discord.ext import commands class DrinkBank(commands.Cog): """Handles the DrankBank and registering drinks.""" def __init__(self, bot): self.bot = bot @commands.command(name='drink', aliases=['bottomsup', 'drank']) @commands.coold...
{ "content_hash": "7ffe38c7f81d49c12b19fe93c0235078", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 80, "avg_line_length": 35.839506172839506, "alnum_prop": 0.5470203238029625, "repo_name": "nluedtke/brochat-bot", "id": "d36ae3aaf63948ec98bfa28c2c705fa0a7be39af", "size":...
from django.conf import settings from django.conf.urls import patterns, include, url def autodiscover(): urlpatterns = patterns('') if 'grappelli' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^grappelli/', include('grappelli.urls')), ) if 'filebrowser' in set...
{ "content_hash": "c619637351124f7f05eddb996619cb0f", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 93, "avg_line_length": 34.10909090909091, "alnum_prop": 0.6092750533049041, "repo_name": "AmandaCMS/amanda-cms", "id": "8cbec014d0daca331af773071e94460793fa0f63", "size": "...
from builtins import object class Module(object): def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Change Login Message for the user.', ...
{ "content_hash": "aafa59505d1d9b60397544c26e0d83bb", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 107, "avg_line_length": 36.08730158730159, "alnum_prop": 0.5425555311194193, "repo_name": "byt3bl33d3r/Empire", "id": "c68f757d0fe5acfc50c2690d2b37bb12c78852e2", "size": "...
from office365.runtime.paths.resource_path import ResourcePath from office365.sharepoint.base_entity import BaseEntity from office365.sharepoint.permissions.roles.definitions.collection import RoleDefinitionCollection from office365.sharepoint.principal.principal import Principal class RoleAssignment(BaseEntity): ...
{ "content_hash": "28bf149528bdba1c24ba91d6d0a4456e", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 103, "avg_line_length": 46.142857142857146, "alnum_prop": 0.631578947368421, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "76af69799afe190029f1c4951610e859746d782...
"""Preview for Zinnia""" from __future__ import division from django.utils import six from django.utils.text import Truncator from django.utils.html import strip_tags from django.utils.functional import cached_property from django.utils.encoding import python_2_unicode_compatible from bs4 import BeautifulSoup from z...
{ "content_hash": "61048a30bb606ab428bf85f2cae2ba85", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 73, "avg_line_length": 29.458333333333332, "alnum_prop": 0.6084865629420085, "repo_name": "mfalcon/edujango", "id": "fd5f657ae164cfe70923de8b79c4139f5f097483", "size": "35...
from unittest.mock import patch import graphene from saleor.core.utils import get_country_name_by_code from saleor.graphql.payment.enums import ( OrderAction, PaymentChargeStatusEnum, PaymentGatewayEnum) from saleor.payment.models import ChargeStatus, Payment, TransactionKind from tests.api.utils import get_graph...
{ "content_hash": "ee950c73462bc4e6c6733e06f2a356b0", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 77, "avg_line_length": 34.86652542372882, "alnum_prop": 0.6083125721577445, "repo_name": "UITools/saleor", "id": "3a0eb4514311010286932d2642f80e3e01e4e862", "size": "16457...
import numpy as np from dipy.utils.optpkg import optional_package import itertools from dipy.viz.gmem import GlobalHorizon fury, have_fury, setup_module = optional_package('fury') if have_fury: from dipy.viz import actor, ui, colormap def build_label(text, font_size=18, bold=False): """ Simple utility funct...
{ "content_hash": "9a4ee5c55723c693287fd53938b62828", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 78, "avg_line_length": 34.509328358208954, "alnum_prop": 0.5070551981402389, "repo_name": "FrancoisRheaultUS/dipy", "id": "db998b85f5747707db7abc98ade93607e6ed65ad", "size...
descr = """Python interface to UMFPACK sparse direct solver.""" DISTNAME = 'scikit-umfpack' DESCRIPTION = 'Python interface to UMFPACK sparse direct solver.' LONG_DESCRIPTION = open('README.rst').read() MAINTAINER = 'Robert Cimrman' MAINTAINER_EMAIL = 'cimrman3@ntc.zcu.cz' URL ...
{ "content_hash": "f09ff3cff764132898ad72dc4b3f91ad", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 91, "avg_line_length": 36.29838709677419, "alnum_prop": 0.5383248167073984, "repo_name": "rc/scikit-umfpack", "id": "6425cb2652c918fcf331b32b9b04c35beb75bc2b", "size": "90...
''' Copyright (C) 2012 STFC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
{ "content_hash": "7ac198e8a525c5c1a4e1b92954c7b424", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 139, "avg_line_length": 41.24683544303797, "alnum_prop": 0.6123983427957649, "repo_name": "stfc/apel", "id": "29087a8c4acede93ff5d1f43b3db25cba8dce38a", "size": "13034", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('program', '0001_initial'), ] operations = [ migrations.AddField( model_name='host', name='is_always_visible', fi...
{ "content_hash": "da1ff76a345f3b5802fac90828f60365", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 22.833333333333332, "alnum_prop": 0.6058394160583942, "repo_name": "nnrcschmdt/helsinki", "id": "9abf2bdc3474a1e7a4f72c8ce794d90af18bde69", "size": "...
"""Fichier contenant le poste second.""" from . import Poste class Second(Poste): """Classe définissant le poste second.""" nom = "second" autorite = 90 points = 9 nom_parent = "capitaine"
{ "content_hash": "6f70e07ebe3d49f069bf3fa3a80a0e24", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 45, "avg_line_length": 17.75, "alnum_prop": 0.6291079812206573, "repo_name": "vlegoff/tsunami", "id": "b23b752631d2df0e6666e150e6682fdc919964a5", "size": "1781", "binary"...
import abc import six @six.add_metaclass(abc.ABCMeta) class CSMPlugin(object): """This is a base class for all plugins. Inheriting from this class is not mandatory, however the Plugin class must implement the `run` method. The object constructor must accept a single parameter which represents the :cl...
{ "content_hash": "201a3d81cd8f2bea7dca4e394edf48cb", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 107, "avg_line_length": 38.68518518518518, "alnum_prop": 0.675442795595979, "repo_name": "anushreejangid/csm-ut", "id": "d019f4db4d594c8f8429143039654ce3fc911c5c", "size": ...
"""Test the Bosch SHC config flow.""" from unittest.mock import PropertyMock, mock_open, patch from boschshcpy.exceptions import ( SHCAuthenticationError, SHCConnectionError, SHCRegistrationError, SHCSessionError, ) from boschshcpy.information import SHCInformation from homeassistant import config_ent...
{ "content_hash": "2a99a7d891990ea4da84aaf01c52ee26", "timestamp": "", "source": "github", "line_count": 629, "max_line_length": 88, "avg_line_length": 32.426073131955484, "alnum_prop": 0.5945773681113944, "repo_name": "FreekingDean/home-assistant", "id": "6d8ef9bd32ef4228e7788106c82881a027684ab8", ...
"""Processes a list of seeds; outputs the crash signatures for chunks of seeds.""" import argparse import re import sys from pathlib import Path from typing import List, Set, TextIO from gfauto import signature_util, util from gfauto.gflogging import log from gfauto.util import check def process_chunk( # pylint: d...
{ "content_hash": "d0bcab6b78c1d7497ed57396e7c21034", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 87, "avg_line_length": 29.294117647058822, "alnum_prop": 0.5642570281124498, "repo_name": "google/graphicsfuzz", "id": "835d51f65314f6d99b97d875a10b2ccbe9654b23", "size": ...
class Solution: def numberToWords(self, num: int) -> str: below_100 = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'] below_20 = ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen...
{ "content_hash": "763cd4f3ce1ed90c8429ae7096b45bb9", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 121, "avg_line_length": 41.88235294117647, "alnum_prop": 0.4571629213483146, "repo_name": "jiadaizhao/LeetCode", "id": "74dc69c849c453fbac806e5a12349f5b0ce6b06f", "size": "...