text
stringlengths
4
1.02M
meta
dict
from boto.regioninfo import RegionInfo, get_regions from boto.regioninfo import connect def regions(): """ Get all available regions for the AWS Config service. :rtype: list :return: A list of :class:`boto.regioninfo.RegionInfo` """ from boto.configservice.layer1 import ConfigServiceConnectio...
{ "content_hash": "310fb7203bcadb936b6586fa7d140386", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 33.68421052631579, "alnum_prop": 0.7390625, "repo_name": "todaychi/hue", "id": "62b3ea24200ea766d56da48ed5ba1fbc5e8731a7", "size": "1764", "binary"...
import os import tweepy import config import logging import requests import json import ssl import pymongo from pymongo import MongoClient import watson_developer_cloud from watson_developer_cloud import conversation_v1 # mongoClient = MongoClient('mongodb://admin:NCTIBVKHDVJBWDGN@sl-us-south-1-portal.3.dblayer.com:...
{ "content_hash": "e19681034f5d585439435f9dd196484e", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 210, "avg_line_length": 28.738317757009344, "alnum_prop": 0.744390243902439, "repo_name": "johnhurdle23/webPortal", "id": "944152d881a9f36dee3d51bd7d4b5e66bbb9e106", "size...
from blinker import Signal init_schema = Signal() class_prepared = Signal() pre_init = Signal() post_init = Signal()
{ "content_hash": "37309ebe3464a23202ef3f3a4f870446", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 26, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7203389830508474, "repo_name": "jhgg/graphene", "id": "ccb9ef0f9b7b64fe990d5f66f467056265cc4cff", "size": "118", ...
import datetime import mock from oslo_config import cfg from oslo_policy import policy from oslo_utils import timeutils from six.moves.urllib import parse as urlparse from wsme import types as wtypes from magnum.api.controllers.v1 import node as api_node from magnum.common import utils from magnum.tests import base f...
{ "content_hash": "f933633ab80b7576b02d5d9aecae6899", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 79, "avg_line_length": 41.68944099378882, "alnum_prop": 0.591626936829559, "repo_name": "paulczar/magnum", "id": "67e196b7ba4139a2472b96f08388ec8a715e033b", "size": "13993...
from __future__ import print_function from __future__ import division import sys import glob import pandas as pd import numpy as np import scipy as sp # My package from ngskit.utils import dna # Normalize Read counts def norm_TC(df, scalar_factor = 1): """Very basic normalization. Total Counts. scalar_factor = ...
{ "content_hash": "2a8515f12b1d9e2e8b512515aae03155", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 207, "avg_line_length": 25.167870036101082, "alnum_prop": 0.5814387147672667, "repo_name": "kimlaborg/NGSKit", "id": "0d557804b4589c75529f75dd1afb6815b1113c6e", "size": "1...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
{ "content_hash": "bf3a2b7773c25d6537b2f75f8195ad75", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 177, "avg_line_length": 46.566265060240966, "alnum_prop": 0.5961190168175938, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "f5299f18a8ec32788a189b70d3a11542fd635b85", ...
""" Used only for REPL Completion. """ import inspect import os import sys from jedi.parser_utils import get_cached_code_lines from jedi._compatibility import unwrap from jedi import settings from jedi.cache import memoize_method from jedi.inference import compiled from jedi.file_io import FileIO from jedi.inference...
{ "content_hash": "123c58c9a227bcc3a76bf2369dad2783", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 88, "avg_line_length": 36.91776315789474, "alnum_prop": 0.6494698387240488, "repo_name": "sserrot/champion_relationships", "id": "ce31d7e07bc6017431dbb44026bc6ca39a1ffd41", ...
from __future__ import unicode_literals import itsdangerous import mock import pytest import pytz from django.utils import timezone from addons.base.utils import get_mfr_url from addons.github.models import GithubFileNode from addons.osfstorage import settings as osfstorage_settings from addons.osfstorage.listeners i...
{ "content_hash": "d021fde2feaf3d6763772463d6bb248c", "timestamp": "", "source": "github", "line_count": 963, "max_line_length": 109, "avg_line_length": 36.12980269989616, "alnum_prop": 0.5592216825223465, "repo_name": "mattclark/osf.io", "id": "78d36975af292667e5666606ea27af05d92ddbf6", "size": "34...
import json import tangelo from htmlparser import MyHTMLParser import google import onion def search_onion(term): quoted_term = '"%s"' % term (results, user_agent_onion) = onion.get_search_results(quoted_term) return results def search_google(term): quoted_term = '"%s"' % term parser = MyHTMLPa...
{ "content_hash": "cb6ba35235f0b8ca10da05eda353737e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 88, "avg_line_length": 27.545454545454547, "alnum_prop": 0.6963696369636964, "repo_name": "Sotera/datawake-prefetch", "id": "4b44465a0239231dd5a215babb0cceb943192830", "siz...
""" Django settings """ from django.core.urlresolvers import reverse_lazy DEBUG = True TESTING = False SESSION_COOKIE_SECURE = False CSRF_COOKIE_SECURE = False ADMINS = ( ('admin', 'code@pkimber.net'), ) MANAGERS = ADMINS # Local time zone for this installation. Choices can be found here: # http://en.wikipedia...
{ "content_hash": "078b96578048e9e1985d88046e0e2c8e", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 79, "avg_line_length": 31.13684210526316, "alnum_prop": 0.6859364435429344, "repo_name": "pkimber/old-contact-migrated-to-gitlab", "id": "1f339336cea8a09e2b95460d2bce8ad6d1a...
"""Script replacing flowcell_summary_uppload_LIMS.py Gets data from the sequencing step and uploads it to statusdb. Denis Moreno, Science for Life Laboratory, Stockholm, Sweden. """ import argparse import os import yaml import logging import logging.handlers import LIMS2DB.objectsDB.process_categories as pc_cg from...
{ "content_hash": "e131b6a0badf1bd5ce6fbb6ae8b0acdc", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 155, "avg_line_length": 35.197916666666664, "alnum_prop": 0.6762355726546315, "repo_name": "Galithil/LIMS2DB", "id": "db4431988b4b8f064a70719ed6b929a970534dcd", "size": "34...
"""Collection of first-party plugins. This module exists to isolate tensorboard.server from the potentially heavyweight build dependencies for first-party plugins. This way people doing custom builds of TensorBoard have the option to only pay for the dependencies they want. This module also grants the flexibility to ...
{ "content_hash": "dbd5bac7f158871dc689e3218a3397f8", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 37.2, "alnum_prop": 0.780241935483871, "repo_name": "ryfeus/lambda-packs", "id": "741722f5e5b01655970734bdfbf08ef736233fa1", "size": "3665", "binar...
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^vc_browser/', include('vc_browser.urls', namespace='vc_browser')), # Examples: # ...
{ "content_hash": "8f51499d8e90788106715b80ec4d79f5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 101, "avg_line_length": 38.9, "alnum_prop": 0.6838046272493573, "repo_name": "mksachs/WebVC", "id": "59c7721300972ddd5a02e8398d213d9a704e4e3f", "size": "778", "binary": f...
import subprocess import sys import setup_util import os def start(args, logfile, errfile): try: subprocess.check_call("mvn clean package", shell=True, cwd="spring", stderr=errfile, stdout=logfile) subprocess.Popen(("java -Ddatabase.host=" + args.database_host + " -jar spring.war").rsplit(" "), cwd="spring/t...
{ "content_hash": "cff58fe33492553f873db4f74bc5d2fe", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 154, "avg_line_length": 36.91304347826087, "alnum_prop": 0.6796230859835101, "repo_name": "dmacd/FB-try1", "id": "f256e621e019971943b191431f16c9a46b2bcca9", "size": "849", ...
from fabkit import task from fablib.test_bootstrap import Libvirt @task def setup(): libvirt = Libvirt() libvirt.setup()
{ "content_hash": "fa4f0bce3a2ccdac27ad84606156a5ed", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 41, "avg_line_length": 16.375, "alnum_prop": 0.7175572519083969, "repo_name": "fabrickit-fablib/fabkit_tools", "id": "8c63a8afd15565b724a72d7b79d29a22f53ed1d3", "size": "149...
"""Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. Meta-Data ================================================================================ Author:...
{ "content_hash": "9d3e4f248e6f5c7c80af035b160e0a5c", "timestamp": "", "source": "github", "line_count": 1971, "max_line_length": 117, "avg_line_length": 39.6494165398275, "alnum_prop": 0.5741980063724423, "repo_name": "skyostil/tracy", "id": "c834efc8bc0bf60affa6324789798b0e5b4fa496", "size": "7823...
try: from setuptools import setup except ImportError: from distutils.core import setup setup( name = "py-applescript", version = "1.0.0", description = "An easy-to-use Python wrapper for NSAppleScript, allowing Python scripts to communicate with AppleScripts and AppleScriptable applications.", platforms = ['...
{ "content_hash": "b54799b826d703fa00fc3156ada6ac9b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 158, "avg_line_length": 29.636363636363637, "alnum_prop": 0.6840490797546013, "repo_name": "encima/NeuroSocket", "id": "02087323fde17b663af990c5493ed6aea1392c6d", "size": "...
"""Simple test suite for toolchains espcially llvm arm toolchains. Sample invocations tools/toolchain_tester/toolchain_tester.py [options]+ test1.c test2.c ... where options are --config <config> --append <tag>=<value> --verbose --show_console --exclude=<filename> --tmp=<path> --check_excludes --concurrency=<numbe...
{ "content_hash": "b46ccfcf11c4d84c725d6ad16de20232", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 78, "avg_line_length": 29.709150326797385, "alnum_prop": 0.6161038389616104, "repo_name": "leighpauls/k2cro4", "id": "2ffc0fa03a3d89297a48d37a588461542e2d0f32", "size": "9...
from __future__ import print_function, division from sympy.core.basic import C from sympy.core.singleton import S from sympy.core.function import Function from sympy.core import Add from sympy.core.evalf import get_integer_part, PrecisionExhausted ######################################################################...
{ "content_hash": "63fdec4b0606622c233e3e1a865943c8", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 88, "avg_line_length": 28.809782608695652, "alnum_prop": 0.5199019053008866, "repo_name": "dqnykamp/sympy", "id": "946fa31ff1da5d0dfaf9f6da45078666fc99f159", "size": "5301...
import cattle import os import pytest import random import time import inspect from datetime import datetime, timedelta NOT_NONE = object() DEFAULT_TIMEOUT = 90 _SUPER_CLIENT = None @pytest.fixture(scope='session') def cattle_url(): default_url = 'http://localhost:8080/v1/schemas' return os.environ.get('CATT...
{ "content_hash": "a8e47e0385429bee5981684dea00599b", "timestamp": "", "source": "github", "line_count": 640, "max_line_length": 79, "avg_line_length": 28.3, "alnum_prop": 0.5880631625441696, "repo_name": "dx9/cattle", "id": "61f1ed8709a3ce0a62e2524fc8ea2b5eb4f4628b", "size": "18112", "binary": fa...
import itertools import logging import sys import six from django import template from django.template import loader from django.utils import datastructures from horizon.tables import base as horizon_tables LOG = logging.getLogger(__name__) class FormsetCell(horizon_tables.Cell): """A DataTable cell that kno...
{ "content_hash": "47b64ef95405dafe584db781ddc64b44", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 79, "avg_line_length": 38.40718562874252, "alnum_prop": 0.5966635484876832, "repo_name": "vladryk/horizon", "id": "3377f426883358d8df1bbf8c1c95498af3eb4303", "size": "6987...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/base/shared_poi_all_lair_thicket_large_evil_fire_red.iff" result.attribute_template_id = -1 result.stfName("lair_n","thicket") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return res...
{ "content_hash": "ec5f14f3f4e6cbc9c92e01da575de95c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 98, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6965944272445821, "repo_name": "obi-two/Rebelion", "id": "822070481f406eb833b2e30c9ef50ac51b069769", "size": "468...
from __future__ import absolute_import, division, print_function from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip) import pytest import yaml with open('tests/vars/bro.vars', 'r') as f: try: ...
{ "content_hash": "5f6742bb4e71d500448279d8df3444c1", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 89, "avg_line_length": 32.61971830985915, "alnum_prop": 0.6493955094991365, "repo_name": "spartan782/rock", "id": "aa1b84e26298ce810593861db8f86d22236a6a0b", "size": "2316"...
import sys import pytest from PyQt5 import QtGui, QtWidgets # Local from sas.qtgui.Plotting.PlotProperties import PlotProperties class PlotPropertiesTest: '''Test the PlotProperties''' @pytest.fixture(autouse=True) def widget(self, qapp): '''Create/Destroy the PlotProperties''' w = Plo...
{ "content_hash": "1c0d2e300740a561b01887780bde5e47", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 103, "avg_line_length": 34.104166666666664, "alnum_prop": 0.6007941356139279, "repo_name": "SasView/sasview", "id": "a6b53e12f65206dc7682bddcc9466f10fa76b536", "size": "327...
import copy import fnmatch import io import itertools import logging import os from jenkins_jobs.constants import MAGIC_MANAGE_STRING from jenkins_jobs.errors import JenkinsJobsException from jenkins_jobs.formatter import deep_format import jenkins_jobs.local_yaml as local_yaml from jenkins_jobs import utils __all__ ...
{ "content_hash": "2420e9b109a99f1ca4cb2996194c848b", "timestamp": "", "source": "github", "line_count": 374, "max_line_length": 79, "avg_line_length": 40.155080213903744, "alnum_prop": 0.4954055133839393, "repo_name": "tamac-io/jenkins-job-builder", "id": "904345c2ca00deeab6fe45c5f767907cc702c70b", ...
from __future__ import absolute_import, unicode_literals, print_function, division import datetime import json import pytz from django import forms from django.contrib.postgres.forms import JSONField from django.core.exceptions import ValidationError from .models import Project, Site, Dataset DATUM_BOUNDS = { 4...
{ "content_hash": "fd72763487fa367708f970585016c87a", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 112, "avg_line_length": 32.67407407407408, "alnum_prop": 0.6005440943096804, "repo_name": "serge-gaia/biosys", "id": "3eeb178a09782c7705be373ec87f94cb6e6dd792", "size": "4...
"""This test simulates the first time a database has to be split in a multi-vttablet-single-mysql environment We have 2 keyspaces. One keyspace is in managing mode. It's vttablets own the MySQL instances and can reparent, start/stop server, start/stop replication etc. Other keyspace is in non-managing mode and cannot...
{ "content_hash": "3a5bdf237f414f294c41e2b73e008a0a", "timestamp": "", "source": "github", "line_count": 780, "max_line_length": 133, "avg_line_length": 43.94230769230769, "alnum_prop": 0.6287381473377097, "repo_name": "enisoc/vitess", "id": "11c06c30aeaa2c7c39d2e3149367c9997707c1b0", "size": "34875...
from __future__ import absolute_import from __future__ import print_function import io import re from glob import glob from os.path import basename from os.path import dirname from os.path import join from os.path import splitext from setuptools import find_packages from setuptools import setup def read(*names, **k...
{ "content_hash": "2997c1d51285c8a5650cea1c9f6ed91e", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 164, "avg_line_length": 36.56164383561644, "alnum_prop": 0.6137130011240165, "repo_name": "abnerjacobsen/tinydb-jsonorm", "id": "5c197b139dee7655a7e5ec128a743ecab11aba80", ...
''' Long term strategy should probably be to deprecate everything here in favor of api.py. ''' import itertools from datetime import datetime from bs4 import BeautifulSoup import requests from sarpur import logger # noqa def duration_to_seconds(duration): """ Takes a string in the format hh:mm:ss or...
{ "content_hash": "cf5c047a7ba8269fa58d2e407887013e", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 25.71851851851852, "alnum_prop": 0.5581797235023042, "repo_name": "Dagur/sarpur-xbmc", "id": "b9b3cc11f8928bff9e06e0e6e6af21f8c6dd76bd", "size": "35...
import math import fetch_api import rospy def wait_for_time(): """Wait for simulated time to begin. """ while rospy.Time().now().to_sec() == 0: pass def print_usage(): print 'Usage: rosrun applications base_demo.py move 0.1' print ' rosrun applications base_demo.py rotate 30' def...
{ "content_hash": "84e85cf8dd1a2607c6376f6d3cb71f49", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 61, "avg_line_length": 19.605263157894736, "alnum_prop": 0.5664429530201343, "repo_name": "hcrlab/access_teleop", "id": "0b1165aaad0c2c0fbd609ecb20516faf302eb990", "size": ...
from foglamp.services.core.api import auth from foglamp.services.core.api import audit as api_audit from foglamp.services.core.api import browser from foglamp.services.core.api import common as api_common from foglamp.services.core.api import configuration as api_configuration from foglamp.services.core.api import sche...
{ "content_hash": "9cd0ef0effc924765dea9c8225e6c519", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 142, "avg_line_length": 56.51271186440678, "alnum_prop": 0.7207767863837444, "repo_name": "foglamp/FogLAMP", "id": "c18cb390c72ce62ed5e15e28046e9684740de608", "size": "134...
MD_CORE_MODEL = { 'typename': 'pycsw:CoreMetadata', 'outputschema': 'http://pycsw.org/metadata', 'mappings': { 'pycsw:Identifier': 'identifier', 'pycsw:Typename': 'typename', 'pycsw:Schema': 'schema', 'pycsw:MdSource': 'mdsource', 'pycsw:InsertDate': 'insert_date', ...
{ "content_hash": "88c39f43e7116f9a05b571bd70573021", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 83, "avg_line_length": 42.87096774193548, "alnum_prop": 0.617005267118134, "repo_name": "geopython/pycsw", "id": "cfb2a4d34b8a94bff2153661479b712a56f39762", "size": "4212",...
from conans.client.build.cppstd_flags import cppstd_flag from conans.model import Generator from conans.paths import BUILD_INFO_COMPILER_ARGS from conans.client.build.compiler_flags import (architecture_flag, sysroot_flag, format_defines, format_include_paths, ...
{ "content_hash": "535dbdb0d959ed8871932320d619fc26", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 108, "avg_line_length": 45.423529411764704, "alnum_prop": 0.6102046102046103, "repo_name": "luckielordie/conan", "id": "c2ea0503941c9ce2cdec29562d02434eabec3d20", "size": "...
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
{ "content_hash": "a79fbdcc9fd4cbb5a0a6573a1faddb85", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 89, "avg_line_length": 36.94117647058823, "alnum_prop": 0.7006369426751592, "repo_name": "mrknow/filmkodi", "id": "fd0f0676e1350f69623a53b4f3db77a548ed553c", "size": "1256"...
from __future__ import annotations import os from .api import PlatformDirsABC class MacOS(PlatformDirsABC): """ Platform directories for the macOS operating system. Follows the guidance from `Apple documentation <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSys...
{ "content_hash": "54c58c4d486f880354e7eedae135f11f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 160, "avg_line_length": 41.484375, "alnum_prop": 0.6666666666666666, "repo_name": "pybuilder/pybuilder", "id": "a01337c7764e1e1aba1f3ba378a1c9241f31806d", "size": "2655", ...
from django.shortcuts import render,render_to_response from django.http import HttpResponse,JsonResponse,HttpResponseRedirect from .models import Goods,Order import json,datetime,MySQLdb from django.template import RequestContext from django import forms from collections import Iterable class shop(object): # 商品列...
{ "content_hash": "fcb0293823b9d31cf3bdda7eaa53c8c4", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 120, "avg_line_length": 31.486486486486488, "alnum_prop": 0.5467811158798284, "repo_name": "yephper/django", "id": "b07a88659daa67f8a8149675701bf7218f53b439", "size": "2422...
FROM = 'low-qs' TO = 'llan-qs' XHEIGHT = 500 WIDTH = 685 from_layer = Font.glyphs[FROM].layers[0] to_layer = Font.glyphs[TO].layers[0] = from_layer.copyDecomposedLayer() for path in to_layer.paths: for node in path.nodes: # mess with node.x and node.y node.x = WIDTH - node.x
{ "content_hash": "d064a6eecb76245d8a7d606f0b514323", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 21.571428571428573, "alnum_prop": 0.6423841059602649, "repo_name": "adiabatic/abbots-morton-experiment", "id": "43e4a8c5fecb3aa50a2d12da18528d9139b5894...
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', 'users.views.sign_up'), url(r'^signup/$', 'users.views.sign_up', name='sign_up'), url(r'^login/$', 'users.views.login', name='login'), url(r'^logout/$', '...
{ "content_hash": "d77ec03b18e83d3c6fed5c400904ed8f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 35.90909090909091, "alnum_prop": 0.6303797468354431, "repo_name": "dongwonKim/coco-server-was", "id": "a286262de8bdea111b89b563c6625df6d9315cea", "si...
from __future__ import annotations from abc import abstractmethod from typing import ClassVar from pants.base.exiter import ExitCode from pants.base.specs import Specs from pants.build_graph.build_configuration import BuildConfiguration from pants.engine.target import RegisteredTargetTypes from pants.engine.unions im...
{ "content_hash": "40c7725619cb06036581074e83f850b7", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 100, "avg_line_length": 31.8, "alnum_prop": 0.6920973475526387, "repo_name": "benjyw/pants", "id": "c103e30cb589527d70b4e3224f47f64e9808eafa", "size": "3789", "binary": ...
from nose.tools import * from tikplay.provider.retriever import Retriever class TestRetriever(object): def __init__(self): self.retriever = Retriever({}) @raises(NotImplementedError) def test_handles(self): self.retriever.handles_url("") @raises(NotImplementedError) def test_get(s...
{ "content_hash": "52cca6a3d26795774587b8f9977e0e52", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 26.764705882352942, "alnum_prop": 0.6681318681318681, "repo_name": "tietokilta-saato/tikplay", "id": "326587ea3dd2af6a3849b34225b40c151ddc17b4", "siz...
""" Copyright 2012 GroupDocs. 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 w...
{ "content_hash": "43cf2a6ba64d8b4462b4324e5a842aa7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 31.324324324324323, "alnum_prop": 0.6540120793787748, "repo_name": "liosha2007/temporary-groupdocs-python-sdk", "id": "a4f7f0b3c90337413c54466a5630d64d...
from ..Qt import QtGui, QtCore from . import ArrowItem import numpy as np from ..Point import Point import weakref from .GraphicsObject import GraphicsObject __all__ = ['CurvePoint', 'CurveArrow'] class CurvePoint(GraphicsObject): """A GraphicsItem that sets its location to a point on a PlotCurveItem. Also rot...
{ "content_hash": "b47bf84a3ecbcc42a19e44ff2b4c0849", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 115, "avg_line_length": 38.33606557377049, "alnum_prop": 0.5781483857173402, "repo_name": "nmearl/pyqtgraph", "id": "f7682a4361c937f4a5b3c3dba62a61aa9b26a8c8", "size": "46...
import plyplus import os import re import datatypes def isfloat(value): try: float(value) return True except: return False def isint(value): try: int(value) return True except: return False def iskeyword(s): return s.startswith(":") class Futho...
{ "content_hash": "11b27f5262119e5a2ab680e176ab06eb", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 73, "avg_line_length": 22.46938775510204, "alnum_prop": 0.5572207084468664, "repo_name": "delihiros/futhon", "id": "9fe8ce457a2bb304f52b291e4c7fc80d88d0ccb5", "size": "2202...
from logging import getLogger, StreamHandler, DEBUG logger = getLogger(__name__) handler = StreamHandler() handler.setLevel(DEBUG) logger.setLevel(DEBUG) logger.addHandler(handler) from flask import Flask, request, jsonify, redirect from .extractor import * app = Flask(__name__) @app.route("/") def inde...
{ "content_hash": "8b271f0bd19f94b3b855f45825df82b0", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 57, "avg_line_length": 25.23076923076923, "alnum_prop": 0.641260162601626, "repo_name": "u6k/extract-content", "id": "4b578ee7b16ef59f04466d5d769effa8c2f63cb6", "size": "98...
from tkinter import * try: from tkinter.filedialog import messagebox, colorchooser except ImportError: from tkinter import messagebox, colorchooser import ctypes import glob from os.path import exists import os from time import sleep from math import sqrt from Levels import Level from Processbar import Processb...
{ "content_hash": "ba6afa26d92b214f4f02a2364104dde7", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 134, "avg_line_length": 32.45940170940171, "alnum_prop": 0.6656572970837996, "repo_name": "Chapelier/Dat.Dot", "id": "3ad3b09238c233e61161f08104af12b912b56f16", "size": "1...
from __future__ import with_statement import requests from stackspy.result import Result import logging from stackspy.utils import create_request try: from lxml.html import document_fromstring except ImportError: document_fromstring = None log = logging.getLogger(__name__) class FailedResponse(object): status_co...
{ "content_hash": "35e8c154a140755245d80c7a6e10ed47", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 111, "avg_line_length": 26.42105263157895, "alnum_prop": 0.701195219123506, "repo_name": "akx/stackspy", "id": "f3ade04259557cb71d9c16e0c237401b6274a541", "size": "2534", ...
import sys, os, string try: # md5 module is deprecated on python 2.6 # so try the newer hashlib first import hashlib md5_new = hashlib.md5 except ImportError: import md5 md5_new = md5.new if os.geteuid() != 0: sys.stderr.write("Sorry, root permission required.\n"); sys.exit(1) split_ar...
{ "content_hash": "b24c36a65ddce29020ca2293b1ff7f0c", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 86, "avg_line_length": 33.5353982300885, "alnum_prop": 0.5794959757223909, "repo_name": "philwo/pysk", "id": "8830a24268f61733ac6f86865e3ac658f0fb271f", "size": "12468", ...
from pandac.PandaModules import * from toontown.toonbase import ToontownGlobals from direct.task import Task def acquirePetManager(): if not hasattr(base, 'petManager'): PetManager() base.petManager.incRefCount() def releasePetManager(): base.petManager.decRefCount() class PetManager: CollT...
{ "content_hash": "ec5dc81c6da1bfe08625a21394dc41aa", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 111, "avg_line_length": 25.666666666666668, "alnum_prop": 0.6673326673326674, "repo_name": "linktlh/Toontown-journey", "id": "2544aec906ddfc847311b079cbe5d8a1cddf67f1", "si...
from importlib import import_module import django from django.core.exceptions import ImproperlyConfigured def import_attribute(import_path=None, options=None): if import_path is None: raise ImproperlyConfigured("No import path was given.") try: dot = import_path.rindex('.') except ValueEr...
{ "content_hash": "f6db63b0a51fd5dd0ae8e9cea16e74f7", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 31.928571428571427, "alnum_prop": 0.6420581655480985, "repo_name": "melfelr/django-queued-storage", "id": "0f1cfe100a4829fe770247c81a90bcce22472bf3", ...
""" Copyright 2022 Google LLC 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 writing, software dis...
{ "content_hash": "65f26cee995a6eae189ffdb37ea3eb4f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 33.638888888888886, "alnum_prop": 0.6577208918249381, "repo_name": "googleworkspace/python-samples", "id": "a5823724abd3cc43b63c53b0e6817cc7d1a96f06", ...
import ast import os import re import pep8 import six """ Guidelines for writing new hacking checks - Use only for Nova specific tests. OpenStack general tests should be submitted to the common 'hacking' module. - Pick numbers in the range N3xx. Find the current test with the highest allocated number and the...
{ "content_hash": "5a8883e79e291ede8ea46233892ddba8", "timestamp": "", "source": "github", "line_count": 831, "max_line_length": 79, "avg_line_length": 35.46089049338147, "alnum_prop": 0.6284104791638387, "repo_name": "Juniper/nova", "id": "bc6fcddca96071c1d11f9aa72ebe2f048fa4bc80", "size": "30074",...
from .datasets import * # noqa
{ "content_hash": "e1e9ff921d220ce29fe3efb0b7131cde", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 32, "alnum_prop": 0.6875, "repo_name": "devmessias/gmaps", "id": "fc9f14b77e25952da0350c89c9391e3fe840d981", "size": "33", "binary": false, "copie...
from req import Service from service.base import BaseService from utils.form import form_validation class SchoolService(BaseService): def __init__(self, db, rs): super().__init__(db, rs) SchoolService.inst = self def get_school_list(self): res = yield self.db.execute('SELECT * FROM sch...
{ "content_hash": "df82c34e5e833d426f691c9156972850", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 88, "avg_line_length": 32.666666666666664, "alnum_prop": 0.5714285714285714, "repo_name": "Tocknicsu/nctuoj", "id": "dffd9b432f6bdcfeb9ac6e939b26d96ef1213bac", "size": "784...
""" Driver base-classes: (Beginning of) the contract that compute drivers must follow, and shared types that support that contract """ import sys from oslo.config import cfg from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova import utils from nova.virt i...
{ "content_hash": "1ea5eaea69d7df61bd6a1ccc77bd9f20", "timestamp": "", "source": "github", "line_count": 921, "max_line_length": 79, "avg_line_length": 40.385450597176984, "alnum_prop": 0.6439037505041, "repo_name": "Triv90/Nova", "id": "71bcaef42c34e3654303db1ac174ab7f75051ca2", "size": "37876", ...
from packaging.version import Version import pytest import numpy as np from numpy import ma from numpy.testing import assert_allclose, assert_equal from astropy.visualization.mpl_normalize import ImageNormalize, simple_norm, imshow_norm from astropy.visualization.interval import ManualInterval, PercentileInterval from...
{ "content_hash": "f4ed2c1ed737c407973bcd186eebc3a8", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 88, "avg_line_length": 39.30419580419581, "alnum_prop": 0.5924739791833467, "repo_name": "StuartLittlefair/astropy", "id": "dc8c8ecdf5eb2d1ff10085f5025285bb6614bd29", "siz...
""" Django settings for Ben project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths in...
{ "content_hash": "51060c1c19d4db791bf8a42ea91f340d", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 84, "avg_line_length": 25.427272727272726, "alnum_prop": 0.6775116195924205, "repo_name": "liuzheng712/Ben", "id": "595a856887be7d0877fd5301b89eaebfa4e73ac7", "size": "279...
from __future__ import unicode_literals import frappe, os, copy, json, re from frappe import _ from frappe.modules import get_doc_path from jinja2 import TemplateNotFound from frappe.utils import cint, strip_html from frappe.utils.pdf import get_pdf,cleanup from PyPDF2 import PdfFileWriter, PdfFileReader no_cache = ...
{ "content_hash": "0c5b017e59bb735263b55b196df23265", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 126, "avg_line_length": 34.3, "alnum_prop": 0.7241533976227854, "repo_name": "RicardoJohann/frappe", "id": "ca6ff8c2d306873bf4a4fe0c8e1b4d7ffd074f66", "size": "4459", "b...
import pytest from pupa.scrape import Event as ScrapeEvent from pupa.importers import (EventImporter, OrganizationImporter, PersonImporter, BillImporter, VoteEventImporter) from opencivicdata.legislative.models import VoteEvent, Bill, Event from opencivicdata.core.models import (Person, Memb...
{ "content_hash": "2066b69641b60061ed616141abdeaac7", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 98, "avg_line_length": 34.91519434628975, "alnum_prop": 0.6166379921060622, "repo_name": "datamade/pupa", "id": "989a900ed1b1f5c8e7f2dadaa03f930dcfcd6c40", "size": "9881",...
import struct DHCP_MESSAGE_PARSE_STRING = '!ccccIHHIIII6s10s192s4s' DHCP_MAGIC_BYTES = b'\x63\x82\x53\x63' DHCP_TAG_PAD = 0x00 # 0 DHCP_TAG_END = 0xff # 255 DHCP_TAG_SUBNET_MASK = 0x01 # 1 DHCP_TAG_ROUTER_ADDRESSES = 0x03 # 3 DHCP_TAG_DOMAIN_NAME_SERVERS = 0x06 # 6 DHCP_TAG_HOST_NAME = 0x0C # 12 DHCP_TAG_DOMA...
{ "content_hash": "7e6f259e77a9bf14401d93046fe7e708", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 109, "avg_line_length": 36.05555555555556, "alnum_prop": 0.630457113507961, "repo_name": "Don42/wild_lantern", "id": "1591d604a4217b04cd11030b162327f41ac9f887", "size": "3...
import json from hearthbreaker.agents.basic_agents import RandomAgent from hearthbreaker.cards.heroes import hero_for_class from hearthbreaker.constants import CHARACTER_CLASS from hearthbreaker.engine import Game, Deck, card_lookup from hearthbreaker.cards import * import timeit def load_deck(filename): cards = ...
{ "content_hash": "38d3502bf36e9e54868ed030429ac424", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 98, "avg_line_length": 28.379310344827587, "alnum_prop": 0.5801944106925881, "repo_name": "jirenz/CS229_Project", "id": "ee29fd4e002d06022e45ffa7864a0ebb5641fc40", "size": ...
$[/myProject/wsadmin_scripts/preamble.py] scope = ''' $[/myJobStep/tmpl/specScope] '''.strip() # this parameter is responsible for flow api = ''' $[/myJobStep/tmpl/wasApi] '''.strip() requestParams = ''' $[/myJobStep/tmpl/requestParameters] '''.strip() resName = ''' $[specAdministrativeName] '''.strip() mode = "cr...
{ "content_hash": "0fbac5f525b265de6f1278d5734224bd", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 88, "avg_line_length": 23.88679245283019, "alnum_prop": 0.6872037914691943, "repo_name": "electric-cloud/EC-WebSphere", "id": "6621bfc49f8bfa585129d61e7d2269921ba072f4", "s...
from comport.public.forms import LoginForm from comport.user.forms import RegisterForm from comport.department.models import Department from comport.user.models import Invite_Code class TestRegisterForm: def test_validate_user_already_registered(self, user): # Enters username that is already registered ...
{ "content_hash": "968a385f56db8f575d049c8aa2d2c493", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 135, "avg_line_length": 46.08571428571429, "alnum_prop": 0.6909485430874147, "repo_name": "codeforamerica/comport", "id": "4509e8725195d9f7c8ff043bfe7e8d36aa4cf2c2", "size"...
import os import sys import doctest from setuptools import setup from distutils.core import Command from unittest import TextTestRunner, TestLoader from glob import glob from os.path import splitext, basename, join as pjoin try: import epydoc # NOQA has_epydoc = True except ImportError: has_epydoc = Fals...
{ "content_hash": "3510c3aaaaac9138647e936499111cfa", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 79, "avg_line_length": 32.077777777777776, "alnum_prop": 0.5872301119963053, "repo_name": "aviweit/libcloud", "id": "f64a6dc2096e99fefee23d49e68af5d3b30f9f8c", "size": "94...
__version_info__ = { 'major': 0, 'minor': 9, 'micro': 0, 'releaselevel': 'beta', 'serial': 6 } def get_version(short=False): assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final') vers = ["%(major)i.%(minor)i" % __version_info__, ] if __version_info__['micro']: ve...
{ "content_hash": "31608fa6003dd052cf3b6dd960d92532", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 95, "avg_line_length": 32.166666666666664, "alnum_prop": 0.5474956822107081, "repo_name": "pombredanne/django-avocado", "id": "537f34ba5cb42c15ac40737c57914df35b2e5db9", "s...
from django.conf.urls import patterns, url from smartfields.views import FileUploadView urlpatterns = patterns('', url(r'upload/(?P<app_label>\w+)/(?P<model>\w+)/(?P<field_name>\w+)/(?:(?P<pk>\d+)/)?' r'(?:(?P<parent_field_name>\w+)/(?P<parent_pk>\d+)/)?$', FileUploadView.as_view(), name='upload')...
{ "content_hash": "0ee79b0a0bc580d7c5f00144f36d5854", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 89, "avg_line_length": 35.888888888888886, "alnum_prop": 0.6006191950464397, "repo_name": "un33k/django-smartfields", "id": "7a15073e3c74d3439b34f8b9a48ac0675f2dc370", "size...
from keys import SigningKey, VerifyingKey, BadSignatureError, BadDigestError from curves import NIST192p, NIST224p, NIST256p, NIST384p, NIST521p, SECP256k1 _hush_pyflakes = [SigningKey, VerifyingKey, BadSignatureError, BadDigestError, NIST192p, NIST224p, NIST256p, NIST384p, NIST521p] del _hush_pyflak...
{ "content_hash": "5624b74164fea61d3c416dea82b74d0b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 34.06666666666667, "alnum_prop": 0.7279843444227005, "repo_name": "kazcw/NGCCCBase", "id": "ba47ebc8a599d94da1ef78527cc5091738f5a89d", "size": "512",...
import sys import os import word2vec word2vec_model = None ############################################################ # Basic ############################################################ def setup_model(input, output, binary=1, cbow=0, size=30...
{ "content_hash": "d99b3011ff24003e6037d4f2ea05073a", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 189, "avg_line_length": 25.36036036036036, "alnum_prop": 0.48454706927175845, "repo_name": "usc-isi-i2/WEDC", "id": "027b2ff6f9ca62de438837d65ecf96630f2a29af", "size": "28...
import tornado from tornado.ioloop import IOLoop from tornado.web import RequestHandler, Application, RedirectHandler, StaticFileHandler from tornado import netutil from tornado.httpserver import HTTPServer import wordsaver.dbop as dbop from datetimeutil import JSONEncoderWithDatetime import json import os from wordsav...
{ "content_hash": "ee5f1798df67b7f83ef11c8d28576329", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 87, "avg_line_length": 32.161904761904765, "alnum_prop": 0.5883920639620965, "repo_name": "emliunix/wordsaver", "id": "a9ac0d60c456c122623a9c4c6a84fd7230acaa0d", "size": "...
import os import sqlite3 import requests import json # DBからファイルリスト取得 def get_list(path, table): images = [] result = { 'time' : 0, 'image_count' : 0, 'tweet_count' : 0} if os.path.exists(path): conn = sqlite3.connect(path) else: raise ValueError conn.row_factory = sqlite3.Row cu...
{ "content_hash": "fc6ff788def1b98e048136333d13e3ab", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 98, "avg_line_length": 31.152173913043477, "alnum_prop": 0.5708304256803908, "repo_name": "marron-akanishi/TPTS_web", "id": "510decfff17255a916873f4ce7f0711b1ee52b57", "siz...
from threading import Thread from time import sleep from os.path import abspath from avatar2.targets import PandaTarget from ..watchmen import watch from .target import action_valid_decorator_factory, TargetStates class PyPandaTarget(PandaTarget): ''' The pypanda target is a PANDA target, but uses pypanda to...
{ "content_hash": "6b1327fd3a4e602190a00118625b262f", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 96, "avg_line_length": 32.02919708029197, "alnum_prop": 0.6018687329079307, "repo_name": "avatartwo/avatar2", "id": "5233c17e1cc164216963570813bb723f5673eb36", "size": "43...
from __future__ import print_function, absolute_import import sys import time from conductor.conductor import WFClientMgr from threading import Thread import socket hostname = socket.gethostname() class ConductorWorker: def __init__(self, server_url, thread_count, polling_interval, worker_id=None): wfcMg...
{ "content_hash": "3889aee5e570f852f5b72ea4aef15863", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 191, "avg_line_length": 38.04615384615385, "alnum_prop": 0.63040841083704, "repo_name": "grfeng/conductor", "id": "51de0921861a5561098449233244b69f5dcb0ddf", "size": "3062"...
"""Artifacts that are specific to Windows.""" from grr.lib import artifact_lib from grr.lib import constants # Shorcut to make things cleaner. Artifact = artifact_lib.GenericArtifact # pylint: disable=g-bad-name Collector = artifact_lib.Collector # pylint: disable=g-bad-name # pylint: disable=g-line-too-lon...
{ "content_hash": "87bbe232c4bf36bfc295a8d24ad8707f", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 152, "avg_line_length": 34.80705394190871, "alnum_prop": 0.6131012695952792, "repo_name": "simsong/grr-insider", "id": "01e3b17d7b71f540cf606ad91d4d2172b8ad6684", "size": ...
import sys import os import glob import tempfile import shutil import time import urllib2 import netrc import json from urlparse import urlparse, urljoin from subprocess import Popen, PIPE, check_call from w3lib.form import encode_multipart from scrapy.command import ScrapyCommand from scrapy.exceptions import UsageE...
{ "content_hash": "17d8035158f2765a58b80697679f9680", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 91, "avg_line_length": 32.27441860465116, "alnum_prop": 0.5863957342556564, "repo_name": "mouadino/scrapy", "id": "ce9cb3f42998abb49373bbbff28a0a7ca283138f", "size": "6939...
"""Command line script for making sky maps.""" import os import click import numpy as np class ListOfType(click.ParamType): """Click option type that accepts a list of objects of a given type. Must be a type accepted by a Python literal eval. Parameters ---------- name : str Name of c...
{ "content_hash": "8db9327bc1620dc489283eee9969a29d", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 116, "avg_line_length": 31.013274336283185, "alnum_prop": 0.586745612783564, "repo_name": "radiocosmology/cora", "id": "a6f609460123d177f48522336714d081520e6ef7", "size": ...
""" Client and server implementations of http authentication """
{ "content_hash": "698e06c361533f47391186303c6f2bb9", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 56, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7692307692307693, "repo_name": "trevor/calendarserver", "id": "2939d310f06bd759534fcc3161041f266eb2c431", "size": ...
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class FarmersConfig(AppConfig): name = 'farmers' verbose_name = _('Farmers')
{ "content_hash": "3720b524009f64089e87811549cba29f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 25.285714285714285, "alnum_prop": 0.7401129943502824, "repo_name": "tm-kn/farmers-api", "id": "c6d556fed2a67c164329dc477e4bcd53a7e90032", "size": "177...
"""Test client standard actions.""" import gzip import hashlib import os import time from grr.client.client_actions import standard from grr.lib import action_mocks from grr.lib import config_lib from grr.lib import flags from grr.lib import test_lib from grr.lib import utils from grr.lib.rdfvalues import client as r...
{ "content_hash": "c25dde0073ab1d6f544e7b0aacca054e", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 80, "avg_line_length": 33.74924471299094, "alnum_prop": 0.6943872527079044, "repo_name": "destijl/grr", "id": "e3f13846b2f1fb32b61663c0b2618af108380b05", "size": "11233", ...
import xkcdpass.xkcd_password as xp from flask_script import Command, Option from imports import move_import from model import db, User, Move, Sample class AddUser(Command): """ Adds an user to the database """ def __init__(self, app_context, app_bcrypt): super(AddUser, self).__init__() self...
{ "content_hash": "f6f9f355f68097d983b1d61db1c6b2dc", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 124, "avg_line_length": 31.602040816326532, "alnum_prop": 0.5770100096867937, "repo_name": "bwaldvogel/openmoves", "id": "88ae166f5662e004f3be865c9fe22321de3e7a40", "size":...
from django.contrib.sitemaps import Sitemap from geography.models import Place from django.core.urlresolvers import reverse class MapSitemap(Sitemap): def location(self, item): return '/#/view/' + item.code + '/' class ContinentsSitemap(MapSitemap): priority = 0.5 def items(self): retur...
{ "content_hash": "bf4eecf2d1f9ea10762c4cff4ec2c971", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 22.108695652173914, "alnum_prop": 0.632251720747296, "repo_name": "slaweet/autoskola", "id": "574155c4c16fbe339c806a95b25cb037d34885ab", "size": "101...
"""Summary info about tickets.""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI.command import SLCommand as SLCommand from SoftLayer.CLI import environment from SoftLayer.CLI import formatting @click.command(cls=SLCommand) @environment.pass_env def cli(env): """Summary info abou...
{ "content_hash": "2c81a856d97303648800a4ac8ebff8f7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 66, "avg_line_length": 36.294117647058826, "alnum_prop": 0.6912479740680713, "repo_name": "softlayer/softlayer-python", "id": "3668b89ecda01083a3fed4a36fabb06100b9c3ef", "s...
def narcissistic(value): return sum([int(x)**len(str(value)) for x in list(str(value))]) == value print(narcissistic(7)) print(narcissistic(371)) print(narcissistic(112)) print(narcissistic(4887))
{ "content_hash": "6ca3b84480748e2669892429bd125bbb", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 76, "avg_line_length": 25.375, "alnum_prop": 0.7192118226600985, "repo_name": "CajetanP/coding-exercises", "id": "9e773e8a63e7d6a9bd109ff6546a8d94ebba6da0", "size": "204", ...
hrs = raw_input("Enter Hours:") pay = raw_input("Enter Hourly Rate: ") total = float(hrs) * float(pay) print total
{ "content_hash": "f24b8b2ead2af98b26f2e62fba6a252a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 38, "avg_line_length": 17.857142857142858, "alnum_prop": 0.624, "repo_name": "peasfrog/coursera", "id": "fa12370df6cda68f4d79136c42ba414394e9a464", "size": "125", "binary"...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0031_auto_20210810_1232'), ] operations = [ migrations.AddField( model_name='sponsorcontact', name='accounting', field=models.BooleanField(de...
{ "content_hash": "0098a7ed4f56de69f51f93c9d700508f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 141, "avg_line_length": 27.4375, "alnum_prop": 0.6355353075170843, "repo_name": "python/pythondotorg", "id": "b450a7c740b837738670972170893c31e2c89522", "size": "489", "b...
""" jadeR This module contains only one function, jadeR, which does blind source separation of real signals. Hopefully more ICA algorithms will be added in the future. jadeR requires NumPy. """ from numpy import abs, append, arange, arctan2, argsort, array, concatenate, \ cos, diag, dot, eye, float32, float64, load...
{ "content_hash": "cadcc41e1aa8921afb6d966cd7509006", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 137, "avg_line_length": 40.45169082125604, "alnum_prop": 0.6734340478891742, "repo_name": "camilleanne/pulse", "id": "4768cc8c34d5eb078cfd5065b9e392ff13a6b1ba", "size": "1...
from ray.air.config import RunConfig, ScalingConfig from ray.train.rl import RLTrainer trainer = RLTrainer( run_config=RunConfig(stop={"training_iteration": 5}), scaling_config=ScalingConfig(num_workers=2, use_gpu=False), algorithm="PPO", config={ "env": "CartPole-v0", "framework": "tf"...
{ "content_hash": "f0dd43dd91c54ad9864b7b4418321608", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 63, "avg_line_length": 29.75, "alnum_prop": 0.6365546218487395, "repo_name": "ray-project/ray", "id": "b2d15ca32b329ac91f4fc29a83b9a9d29369a031", "size": "476", "binary":...
"""Declare Variablenames""" from lib.templates import TEMPLATES class Variables: """Static variable names""" def __init__(self): self.name_fields = [] for key, template in TEMPLATES.items(): for row in template['fields']: for column in row: if colu...
{ "content_hash": "a7f74533d0ceeb953081d0ecc8f40e5c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 45.526315789473685, "alnum_prop": 0.5132947976878612, "repo_name": "JB26/Bibthek", "id": "fac7e0dc8816bbe48a78d4e97d79e42c0b9ac80f", "size": "1730", ...
"""A library of common shape functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.framework import tensor_shape def _broadcast_shape_helper(shape_x, shape_y): """Helper functions for is_broadcast_compatible and...
{ "content_hash": "ac1c39dd699f2cd77fcac5b81b4b5431", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 34.708333333333336, "alnum_prop": 0.6740696278511404, "repo_name": "frreiss/tensorflow-fred", "id": "27c7f465d1233ce1a19da80a2e062c6064ef0a8c", "size...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0017_make_some_fields_optional'), ] operations = [ migrations.AlterField( model_name='reimbursement', name='issue_da...
{ "content_hash": "71e39a86f395a02b624cfb3061201ef3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 22.5, "alnum_prop": 0.6049382716049383, "repo_name": "marcusrehm/serenata-de-amor", "id": "857699283c6112f8b5f794322c2b9d0f0f9ef12e", "size": "478", ...
import logging import os from aeromancer.db import models from aeromancer.oslo import models as oslo_models from aeromancer import project from aeromancer import utils from cliff.lister import Lister from sqlalchemy import distinct from sqlalchemy.orm import aliased class List(Lister): """List the Oslo modules...
{ "content_hash": "d3e07f0f64e652d79a33e19a402fcb74", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 78, "avg_line_length": 29.689655172413794, "alnum_prop": 0.6149825783972126, "repo_name": "dhellmann/aeromancer", "id": "e873a32064930f4f230af346f1b496c59fd9f54d", "size": ...
import sys import asyncio from charfinder import UnicodeNameIndex #1 CRLF = b'\r\n' PROMPT = b'?>' index = UnicodeNameIndex() #2 @asyncio.coroutine def handle_queries(reader, writer): #3 while True: #4 w...
{ "content_hash": "8f0acd304ef583e20a755962f65fd80d", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 78, "avg_line_length": 38.75438596491228, "alnum_prop": 0.46129470348574014, "repo_name": "stephenl6705/fluentPy", "id": "e231b50baa1588e9791261a65c9056c2e508c640", "size":...
''' @author: sheng @license: ''' import unittest from meridian.acupoints import yanggang21 class TestYanggang21Functions(unittest.TestCase): def setUp(self): pass def test_xxx(self): pass if __name__ == '__main__': unittest.main()
{ "content_hash": "6584abbc88884850e90771546690adc3", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 49, "avg_line_length": 13.35, "alnum_prop": 0.6329588014981273, "repo_name": "sinotradition/meridian", "id": "ceb0c85f5657029cfcf550e4abd373096767a59b", "size": "301", "b...
from swgpy.object import * def create(kernel): result = Installation() result.template = "object/installation/battlefield/destructible/shared_bfield_gungan_cleft_wall_lg.iff" result.attribute_template_id = -1 result.stfName("battlefield","gungan_cleft_wall") #### BEGIN MODIFICATIONS #### #### END MODIFICA...
{ "content_hash": "cc6793725c80b9c4e80bcda4e520cc55", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 104, "avg_line_length": 26.76923076923077, "alnum_prop": 0.7241379310344828, "repo_name": "obi-two/Rebelion", "id": "6b3bf6318357bd539a62ce57e846113235383801", "size": "493...
from webkitpy.common.net.resultsjsonparser import ResultsJSONParser from webkitpy.common.system.deprecated_logging import log from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer from webkitpy.layout_tests.models import test_results from webkitpy.layout_tests.models import test_failures # FIXME: ...
{ "content_hash": "243869bf47fef6d23bbba9d7e1dbf94d", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 135, "avg_line_length": 45.47260273972603, "alnum_prop": 0.6737460460912789, "repo_name": "leighpauls/k2cro4", "id": "f0d807edc24ad8738a2d513e716bac4b50cf250c", "size": "8...
from __future__ import unicode_literals from django.shortcuts import render, redirect, get_object_or_404 from django.forms import ModelForm from annoying.decorators import render_to from annoying.decorators import ajax_request from annoying.functions import get_object_or_None from django.views.decorators.csrf import cs...
{ "content_hash": "26ac2b390eb3720fae7d9d0d30d24179", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 165, "avg_line_length": 34.774647887323944, "alnum_prop": 0.7355204536249493, "repo_name": "renanaugustom/Ferramenta-de-transformacao-de-requisitos-para-arquitetura-de-tres-cam...
try: from setuptools import setup except ImportError: from distutils.core import setup version_tuple = __import__('pymysql').VERSION if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name = "PyMySQL", version = version, ...
{ "content_hash": "4c62f8b1d96ec237ce42ec6f0b1a826a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 64, "avg_line_length": 27.541666666666668, "alnum_prop": 0.649016641452345, "repo_name": "AlanZatarain/pymysql", "id": "d229e9b15904c5219694abdc0f3ebbc243730931", "size": "...
""" This module manages the HTTP and HTTPS connections to the backend controllers. The main class it provides for external use is ServerPool which manages a set of ServerProxy objects that correspond to individual backend controllers. The following functionality is handled by this module: - Translation of rest_* func...
{ "content_hash": "95769433be64d8d99d096ec150857128", "timestamp": "", "source": "github", "line_count": 562, "max_line_length": 79, "avg_line_length": 43.42170818505338, "alnum_prop": 0.5666926197598656, "repo_name": "vijayendrabvs/hap", "id": "8792290af6cf8582184f805031a8fe634e6cfe63", "size": "25...
import argparse import ConfigParser import sys import os import pkg_resources import time from datetime import datetime, timedelta from termcolor import colored from fake_section_head import FakeSectionHead from live_logs import download_live_logs from s3_logs import download_s3_logs from search import find_cached_logs...
{ "content_hash": "dd94c1e4ecf38c7c76c59f53345b5bb1", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 221, "avg_line_length": 58.08, "alnum_prop": 0.6604191263282172, "repo_name": "PacktPublishing/Mastering-Mesos", "id": "0c53150e3df35a7a6e1c46a512d6b7f51f0805a0", "size": ...
"""Tests for the webapp2 parser""" import urllib import json import pytest from webargs.core import PY2 from .compat import text_type from webargs import Arg, ValidationError pytestmark = pytest.mark.skipif(not PY2, reason='webapp2 is only compatible with Python 2') import webtest if PY2: # everything should be...
{ "content_hash": "1abb49d4c209d3208b0e90f782846de0", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 92, "avg_line_length": 34, "alnum_prop": 0.6633731617647058, "repo_name": "nealrs/webargs", "id": "1a1d8a8733a0304e26552ea7b48831b377d9ba12", "size": "4376", "binary": f...
""" Tests for the code in `opsimsummary/opsim_out.py` """ from __future__ import print_function, division, absolute_import import os import pytest import numpy as np import pandas as pd import opsimsummary as oss from opsimsummary import (OpSimOutput, SynOpSim, PointingTree) import healpy as hp from numpy.testing impor...
{ "content_hash": "b301fabba480b0d27ef23b469a086bb6", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 76, "avg_line_length": 39.685534591194966, "alnum_prop": 0.6028526148969889, "repo_name": "rbiswas4/simlib", "id": "9d3a60fd30d8f84e808a5164ca42cda4fc99858a", "size": "631...
""" * Copyright 2008 Google Inc. * * 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 writing, s...
{ "content_hash": "280b888fa58422497a61ce859d941900", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 26.627906976744185, "alnum_prop": 0.6855895196506551, "repo_name": "emk/pyjamas", "id": "468d1f17e03c042ecf40274b81e380c5cae84d3f", "size": "1145", ...