text
stringlengths
4
1.02M
meta
dict
from dnload.assembler_variable import AssemblerVariable from dnload.common import is_listing from dnload.common import is_verbose from dnload.common import labelify from dnload.platform_var import osarch_is_32_bit from dnload.platform_var import osarch_is_64_bit from dnload.platform_var import PlatformVar ############...
{ "content_hash": "b4b5dbf00f5bf5ce3d2fbf2a3d2e0ab4", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 131, "avg_line_length": 38.37264150943396, "alnum_prop": 0.5331284572833436, "repo_name": "trilkk/dnload", "id": "686fa9a3e17bc7dabf5db03c4632e5bf13234c47", "size": "8135"...
import os import shutil from fabric import api as fabric_api from path import path from cosmo_tester.framework import util from cosmo_tester.framework.testenv import TestCase class RestPluginsTests(TestCase): def test_install_rest_plugins(self): self._copy_manager_blueprint() self._update_manag...
{ "content_hash": "c38731b75b6641cc741e64ddf10b2184", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 77, "avg_line_length": 43.03846153846154, "alnum_prop": 0.5865355972594578, "repo_name": "codilime/cloudify-system-tests", "id": "c0385fc1fe49da335dc69754b1ebb9b57a0736ad", ...
def findDolls(size): size.sort() largest = size[-1] largestSmallerBox = largest//2 i = len(size)-1 lowerIndex, higherIndex = 0, len(size)-1 while(i > 0): if size[i] <= largestSmallerBox: lowerIndex = i break else: i -= 1 # We found lower in...
{ "content_hash": "9fb7d42ba0da7734fc5b84e6ba1f6afc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 63, "avg_line_length": 28.535714285714285, "alnum_prop": 0.5456821026282853, "repo_name": "saisankargochhayat/algo_quest", "id": "0270d70b28671ae7d1cd29cb0f74aa30eef2d4a8", ...
from pybuilder.core import use_plugin, init, Author use_plugin('python.core') use_plugin('python.install_dependencies') use_plugin('python.distutils') use_plugin('python.flake8') use_plugin('python.unittest') use_plugin('python.coverage') use_plugin('copy_resources') default_task = ['analyze', 'publish'] name = 'gi...
{ "content_hash": "37e57eb61b6b10cad05b5a347be94b77", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 81, "avg_line_length": 32.916666666666664, "alnum_prop": 0.7164556962025317, "repo_name": "jbspeakr/github-licker", "id": "3333c26c9105b276c821ddb05d3e4435401258fc", "size"...
from django import template register = template.Library() @register.filter def dozcomplete(complete_lookup, dozen): if complete_lookup[dozen]: return u'done' else: return u''
{ "content_hash": "e3b06b117a7ef8e0bc9c8d7276f4e651", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 16.916666666666668, "alnum_prop": 0.6748768472906403, "repo_name": "mjtamlyn/archery-scoring", "id": "56064f204f16e051b77a3145cb8cb5d4e59d12ec", "siz...
import Gaffer import GafferUI import GafferUITest class NameWidgetTest( GafferUITest.TestCase ) : def test( self ) : n = Gaffer.Node() w = GafferUI.NameWidget( n ) self.assertEqual( w.getText(), n.getName() ) n.setName( "somethingElse" ) self.assertEqual( w.getText(), "somethingElse" ) def testC...
{ "content_hash": "40f08fbb8b2e96144856c86fb2a0fa7b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 50, "avg_line_length": 21.846153846153847, "alnum_prop": 0.6596244131455399, "repo_name": "davidsminor/gaffer", "id": "962d67a8fc08e3dba3c0404630fd11c7e4a817c4", "size": "2...
import json import six import time from six.moves.urllib import parse as urlparse from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import exceptions from manila_tempest_tests.common import constants from manila_tempest_tests.services.share.json import shares_client from mani...
{ "content_hash": "16c8764c1f1b8253d3ac3ab2327f3e73", "timestamp": "", "source": "github", "line_count": 1292, "max_line_length": 79, "avg_line_length": 42.97755417956656, "alnum_prop": 0.5489041367262774, "repo_name": "NetApp/manila", "id": "0ccc18b712c7c1e730ee77b5c2f04a9ea5291b52", "size": "56154...
"""Ce paquet contient les commandes du module systeme.""" from . import systeme from . import syslog
{ "content_hash": "81cfd05a874a87835936b12270f59393", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 57, "avg_line_length": 25.5, "alnum_prop": 0.7450980392156863, "repo_name": "stormi/tsunami", "id": "e53577e348607b1326936777b1f305d04fbf03af", "size": "1667", "binary": f...
import hashlib import random from django.db import load_backend, transaction, IntegrityError from sso.services import BaseDBService from django.conf import settings class QMSService(BaseDBService): """ QMS Class, allows registration and sign-in """ settings = { 'require_user': False, ...
{ "content_hash": "61ed3cfdd951b6476410027b6f3e81c9", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 121, "avg_line_length": 36.2, "alnum_prop": 0.6006314127861089, "repo_name": "nikdoof/test-auth", "id": "378619441c43aaed638307ee59944dc510ed91ac", "size": "2534", "binar...
"""Wrappers for protocol buffer enum types.""" import enum class Cluster(object): class Status(enum.IntEnum): """ The current status of the cluster. Attributes: STATUS_UNSPECIFIED (int): Not set. PROVISIONING (int): The PROVISIONING state indicates the cluster is bein...
{ "content_hash": "28209d777080c4aa7f94588f87cdb513", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 114, "avg_line_length": 35.31294964028777, "alnum_prop": 0.6203524498319242, "repo_name": "tswast/google-cloud-python", "id": "f9663fc54d4c2f4a4f44b8440aa750a8f65b7dad", "...
import sys from argparse import ArgumentParser class MultipleDefaultCommands(Exception): pass class SubcommParser(ArgumentParser): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.subparsers = self.add_subparsers(help='Subcommands.') self.subparsers._parse...
{ "content_hash": "e29571f619389c0c2f38b4a7e691929e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 29, "alnum_prop": 0.5758620689655173, "repo_name": "jpmelos/subcomm", "id": "11e479403800733f08a2e9fb3e1c9cea98909219", "size": "1450", "binary": f...
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
{ "content_hash": "a4be556c83f5369ae797c38d4bd0e82b", "timestamp": "", "source": "github", "line_count": 3411, "max_line_length": 89, "avg_line_length": 37.088537085898565, "alnum_prop": 0.5614778395212989, "repo_name": "slozier/ironpython2", "id": "882b12dd1e0f72017ad6fc48459f1159048053fd", "size":...
import requests import unidecode import urllib from flask import render_template from flask import Flask from flask import jsonify app = Flask(__name__) def find_path(start_page, end_page): end_page = end_page.lower() queue = [] benched_queue = [start_page] family_trie={start_page.lower():''} found=0 if s...
{ "content_hash": "034ae91f98e351e427d0c9b6b618b5a3", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 152, "avg_line_length": 29.63157894736842, "alnum_prop": 0.6198934280639432, "repo_name": "makinj/wikidist", "id": "fb8b282446647795ca1f9b9ca3006ed703ef0184", "size": "2252...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import state_ops from tensorflow.python.framework import ops from tensorflow.python.train...
{ "content_hash": "d50eb0d7a5fd637e97a6df70bf2f2928", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 163, "avg_line_length": 40.44285714285714, "alnum_prop": 0.6895090074178736, "repo_name": "255BITS/HyperGAN", "id": "50a51c5e5d78014c9e7b6d851867062572ce4450", "size": "286...
import cmd import os import sys import socket import threading from gppylib.commands.base import WorkerPool, REMOTE from gppylib.commands.unix import Hostname, Echo from gpssh_modules import gppxssh_wrapper sys.path.insert(1, sys.path[0] + '/lib') from pexpect import pxssh class HostNameError(Exception): def __i...
{ "content_hash": "b0c82f65e89dbf34879f69a310b7442e", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 109, "avg_line_length": 32.797583081571, "alnum_prop": 0.5607958732498157, "repo_name": "Quikling/gpdb", "id": "92fdfe5c81cfc993753e2382cd19e70a4e3ef5db", "size": "11010",...
"""empty message Revision ID: 0218_another_letter_org Revises: 0217_default_email_branding """ # revision identifiers, used by Alembic. revision = "0218_another_letter_org" down_revision = "0217_default_email_branding" from alembic import op NEW_ORGANISATIONS = [ ("511", "NHS"), ] def upgrade(): for nume...
{ "content_hash": "7650e831335b0d31b4e62fbfb4b055cd", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 46, "avg_line_length": 19.571428571428573, "alnum_prop": 0.5024330900243309, "repo_name": "alphagov/notifications-api", "id": "7d57c803fe8be56decda17e9d362d90d2089f6e3", "s...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re import os from flexget import plugin from flexget.event import event log = logging.getLogger('rtorrent_magnet') pat = re.compile('xt=urn:btih:([^...
{ "content_hash": "549369f33108d5e4d89896392e7b846b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 108, "avg_line_length": 34.397260273972606, "alnum_prop": 0.6113102349661489, "repo_name": "JorisDeRieck/Flexget", "id": "d7e8195b8a26f5359313548296dedd63e7c5e3bc", "size":...
from __future__ import division, unicode_literals, print_function from django.conf.urls import patterns, url from hawaii.apps.hotel.views import HotelDetailView from hawaii import const urlpatterns = patterns('', url(r'^%s/$' % const.URL_ID, HotelDetailView.as_view(), name="hotel_detail_view"), )
{ "content_hash": "b45a64d0f407ac7771771715c02fc7f7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 86, "avg_line_length": 37.875, "alnum_prop": 0.7491749174917491, "repo_name": "chenchiyuan/hawaii", "id": "c17a25609701e7f0bd506396a16a78008df34323", "size": "355", "binar...
from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'special_random.views.hom...
{ "content_hash": "49fa9058b51e4e6a06d30683e47dcfca", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 139, "avg_line_length": 54.71739130434783, "alnum_prop": 0.6324990067540723, "repo_name": "msheldyakov/itg-msk-3", "id": "54c7008f1814e01af28db15a63cc3aed7cfd050b", "size":...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Ge...
{ "content_hash": "88d6fb90f9f7489e6a265b8e64403ce2", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 109, "avg_line_length": 37.38392857142857, "alnum_prop": 0.5829949844757583, "repo_name": "OSGeo/homebrew-osgeo4mac", "id": "b6465a712f3a96a13b9af46749723c26302dfe4e", "si...
import datetime import flask import flask_restful from flask_restful import fields import json import pytz from scoreboard import attachments from scoreboard import auth from scoreboard import cache from scoreboard import controllers from scoreboard import context from scoreboard import csrfutil from scoreboard import...
{ "content_hash": "f798bd9d5b9da29825d61b7f4ac4199c", "timestamp": "", "source": "github", "line_count": 1089, "max_line_length": 79, "avg_line_length": 31.754820936639117, "alnum_prop": 0.5899482374714439, "repo_name": "google/ctfscoreboard", "id": "cf92b3d66a384d2fa8552b770cb44ec11a5f4037", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracker', '0011_system_color_code'), ] operations = [ migrations.AlterField( model_name='system', name='color_code', ...
{ "content_hash": "fdb4cff1e5c211260899d5ce7b914c70", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 50, "avg_line_length": 21.166666666666668, "alnum_prop": 0.5905511811023622, "repo_name": "paftree/WHturk", "id": "55ace0e14d0a18cdaedeaf79d79e7b920b865230", "size": "453",...
import os import re import subprocess from pants.backend.codegen.ragel.java.java_ragel_library import JavaRagelLibrary from pants.backend.codegen.ragel.subsystems.ragel import Ragel from pants.backend.jvm.targets.java_library import JavaLibrary from pants.base.build_environment import get_buildroot from pants.base.exc...
{ "content_hash": "476624189a7a7b00579fa845863e1b27", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 98, "avg_line_length": 36.75581395348837, "alnum_prop": 0.6368237899398924, "repo_name": "wisechengyi/pants", "id": "a009eb6cd826cc4b1d6295b078b19dc1e5416e6a", "size": "329...
''' Copyright 2017, Fujitsu Network Communications, 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 w...
{ "content_hash": "f90619237ecf3abd16d44f5522de561d", "timestamp": "", "source": "github", "line_count": 1045, "max_line_length": 100, "avg_line_length": 53.85933014354067, "alnum_prop": 0.5382797647602295, "repo_name": "warriorframework/warriorframework", "id": "951142d19c358afee060a9e2ab7b5f3f3ed5e5...
import os, sys, warnings from pyremotevbox.ZSI import _get_idstr from pyremotevbox.ZSI.wstools.logging import getLogger as _GetLogger from pyremotevbox.ZSI.wstools import WSDLTools from pyremotevbox.ZSI.wstools.WSDLTools import SoapAddressBinding,\ SoapBodyBinding, SoapBinding,MimeContentBinding,\ HttpUrlEncode...
{ "content_hash": "479b1ebc046556a1bbf295aaf804883c", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 103, "avg_line_length": 36.18065693430657, "alnum_prop": 0.584203359055833, "repo_name": "rameshg87/pyremotevbox", "id": "d5ec63beb010ac2abc2daeff7054e5adbc05fae9", "size"...
import _plotly_utils.basevalidators class TickprefixValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="tickprefix", parent_name="surface.colorbar", **kwargs ): super(TickprefixValidator, self).__init__( plotly_name=plotly_name, par...
{ "content_hash": "39134270f2690b172140c3e3bd00531a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 33, "alnum_prop": 0.6153846153846154, "repo_name": "plotly/plotly.py", "id": "8b34891075dcd72a563c734183e27f4e2bcde1f3", "size": "429", "binary": f...
import sys SUPPORTED_VERSIONS = [(2, 7), (3, 6)] python_major_version = sys.version_info[0] python_minor_version = sys.version_info[1] if (python_major_version, python_minor_version) not in SUPPORTED_VERSIONS: formatted_supported_versions = ['{}.{}'.format(mav, miv) for mav, miv in SUPPORTED_VERSIONS] err_ms...
{ "content_hash": "0c7a3dd97e1b1f53a308c95c73957ac7", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 120, "avg_line_length": 43.42857142857143, "alnum_prop": 0.694078947368421, "repo_name": "scoates/Zappa", "id": "13bcf0a7bf731fb68edbaf387befe61244b18814", "size": "608", ...
from horizon.test import helpers as test class ServicesTests(test.JasmineTests): sources = [ 'horizon/js/horizon.js', 'horizon/js/angular/horizon.conf.js', 'horizon/js/angular/horizon.js', 'horizon/js/angular/services/horizon.utils.js', 'horizon/js/angular/hz.api.module.js'...
{ "content_hash": "eba1bb8068153eabf40439d5ae13fe16", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 61, "avg_line_length": 42.0958904109589, "alnum_prop": 0.6371623820370973, "repo_name": "TechBK/horizon-dev", "id": "fd6511564c6e72605aa53b408f8c687e5dbce5ea", "size": "362...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import with_setup, raises from landlab import RasterModelGrid def setup(): globals()['rmg'] = RasterModelGrid(4, 4) @with_setup(setup) def test_unit_grid_all_cells(): assert_array_equal(rmg.area_of_cell, np.ones(4)) @with_set...
{ "content_hash": "1c86f1ea4ff1ac3045e509b64dddaa55", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 58, "avg_line_length": 20.21951219512195, "alnum_prop": 0.6911942098914354, "repo_name": "SiccarPoint/landlab", "id": "b1d83a760b969cb6b4a30a80717df4dcf11d548e", "size": "8...
"""Command for describing url maps.""" from googlecloudsdk.compute.lib import base_classes class Describe(base_classes.GlobalDescriber): """Describe a URL map.""" @staticmethod def Args(parser): cli = Describe.GetCLIGenerator() base_classes.RegionalDescriber.Args(parser, 'compute.urlMaps', cli, ...
{ "content_hash": "ccc1bb83cf7582559bf5265fa877954e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 24.633333333333333, "alnum_prop": 0.6400541271989174, "repo_name": "wemanuel/smry", "id": "a0b4eba88d4f45d6069073636cfa2c080d50fa7c", "size": "789", ...
import web import paypalv2 as paypal urls = [ '/create', 'PaymentCreate', '/pay', 'PaymentExecute', '/payout', 'PayoutCreate', '/payout/(.*)', 'PayoutInfo' ] app = web.application(urls, globals()) class PaymentCreate: def GET(self): i = web.input() if not i.get('amt') or not i.get...
{ "content_hash": "b3c7323338598775c6b0d60ded963fe0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 74, "avg_line_length": 25.18032786885246, "alnum_prop": 0.5384114583333334, "repo_name": "ongspxm/webpy-paypal_transaction", "id": "8658787261730330ae449fda9da1114ce851deec",...
import inspect import numpy as np # Import Data Assimilation class from pyda.assimilation.assimilation_current2horizon import DA_current2horizon # Import Ensemble Generation class from pyda.ensemble_generator.SIRensemble import SIRensemble # Import analysis class from pyda.analysis_generator.pf.pf_naive import PF_NA...
{ "content_hash": "c457688ed4248c99d11bcc117bd2502b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 109, "avg_line_length": 35.017857142857146, "alnum_prop": 0.7093319734829169, "repo_name": "hickmank/pyda", "id": "5096a5190a0400e6084eae1d9b924ac414e3e931", "size": "1961"...
from setuptools import setup, find_packages setup( name='textlytics', version='0.0.1', packages=find_packages(exclude=['docs', 'tests', '*.tests']), package_data={ 'textlytics': ['data/*'], }, author=u'Lukasz Augustyniak', author_email='luk.augustyniak@gmail.com', license='BSD',...
{ "content_hash": "a2ab752b8d9d2c8d568d1a92199db7cc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 35.87096774193548, "alnum_prop": 0.6196043165467626, "repo_name": "laugustyniak/textlytics", "id": "f00d147b3dd93eb723cbba46b2195d35766e3865", "size"...
""" establish a tunnel to first available remote port using pathos.util.portnumber Usage: python pathos_tunnel.py [hostname] [hostname] - name of the host with which to establish a ssh tunnel """ from pathos.core import * if __name__ == '__main__': ##### CONFIGURATION & INPUT ######################## # set t...
{ "content_hash": "617d3d528d0124e3c394becb3581d4ba", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 27.1, "alnum_prop": 0.6369003690036901, "repo_name": "mathieudesro/pathos", "id": "223f7cf64f7e3576494793132f7fa430847f5bfb", "size": "1646", "bina...
"""Contains data about certain markup, like HTML tags and external links.""" from __future__ import unicode_literals __all__ = ["get_html_tag", "is_parsable", "is_visible", "is_single", "is_single_only", "is_scheme"] URI_SCHEMES = { # [mediawiki/core.git]/includes/DefaultSettings.php @ 374a0ad943 ...
{ "content_hash": "d117a915808cdebfb9fc16bafe151e0b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 34.582089552238806, "alnum_prop": 0.6258092360811394, "repo_name": "wikimedia/operations-debs-python-mwparserfromhell", "id": "cdacb3d6183239049b50f74a...
import time import requests import numpy as np import multiprocessing from concurrent import futures from multicpu import multi_cpu def process_job(job): time.sleep(1) count = 100 while count>0: count -= 1 return job jobs = [str(i) for i in range(30)] def test_multi_cpu_...
{ "content_hash": "37a5bbb39cab44ffc9c5ad86b25fa22e", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 77, "avg_line_length": 26.814285714285713, "alnum_prop": 0.6153436334576452, "repo_name": "cyh24/multicpu", "id": "067f608d31d871b7a0bc139650e6d161258d71a7", "size": "1877"...
import copy import conditions import effects import f_expression import pddl_types class Action(object): def __init__(self, name, parameters, precondition, effects): self.name = name self.parameters = parameters self.condition = precondition self.effects = effects self.uniq...
{ "content_hash": "b18fbe70ccf2fa0a79031bbfedd14b50", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 97, "avg_line_length": 44.75471698113208, "alnum_prop": 0.5621838111298483, "repo_name": "thierry1985/project-1022", "id": "3991dd4cec1f7aff2752b166a8c6f3a996ac2bae", "siz...
import logging import os import psutil import utils.dockerutils from icrawl_plugin import IContainerCrawler from utils.features import ProcessFeature from utils.namespace import run_as_another_namespace, ALL_NAMESPACES logger = logging.getLogger('crawlutils') class ProcessContainerCrawler(IContainerCrawler): d...
{ "content_hash": "21014f27b0fb489ef494cf7ccb246873", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 74, "avg_line_length": 33.35087719298246, "alnum_prop": 0.4889531825355076, "repo_name": "cloudviz/agentless-system-crawler", "id": "88723631c9f5ad5355cbb9ffd6405ac96270a5ae...
import six from ...errors.httpexception import HttpException from ...errors.saklientexception import SaklientException from ..client import Client from .resource import Resource from .icon import Icon from .iface import Iface from .serverplan import ServerPlan from .serverinstance import ServerInstance from .isoimage i...
{ "content_hash": "ce51ef819e950ced874dbd6bc478642c", "timestamp": "", "source": "github", "line_count": 541, "max_line_length": 171, "avg_line_length": 32.931608133086876, "alnum_prop": 0.5690390660080826, "repo_name": "sakura-internet/saklient.python", "id": "3baa9aea7ddbeaefa02c55e9a8602dd8fa8c28a3...
""" Python program to play around with the American Time Use Survey from BLS. Goal is to replicate charts found here: http://www.nytimes.com/interactive/2015/01/06/upshot/how-nonemployed-americans-spend-their-weekdays-men-vs-women.html Data structure: The data is divided into four files. In general, people in the surve...
{ "content_hash": "1d85761f0e1ee0c2550890b6b6c6339a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 212, "avg_line_length": 42.33898305084746, "alnum_prop": 0.7445956765412329, "repo_name": "DaveBackus/Data_Bootcamp", "id": "9a92e49b750001aa41cf09322254b5fc56fd6f02", "siz...
# -*- coding: utf-8 -*- # ProjectEuler/src/python/problem094.py # # Almost equilateral triangles # ============================ # Published on Friday, 29th April 2005, 06:00 pm # # It is easily proved that no equilateral triangle exists with integral length # sides and integral area. However, the almost equilateral tr...
{ "content_hash": "037ede058f4ebd4be8112798eec6a0e8", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 35.09090909090909, "alnum_prop": 0.7098445595854922, "repo_name": "olduvaihand/ProjectEuler", "id": "bac1becc51aa02b956782d465501d7b86e005e3f", "size...
from .resource import Resource class ApplicationSecurityGroup(Resource): """An application security group in a resource group. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype...
{ "content_hash": "60afa3f6cfd214f6488ae38072d9e9fa", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 101, "avg_line_length": 37.49122807017544, "alnum_prop": 0.6148806738418343, "repo_name": "lmazuel/azure-sdk-for-python", "id": "f14f84e29b868ac85bcfa8d1a3d01eb7de5c1700", ...
"""Tests for the Cocoa time implementation.""" import decimal import unittest from dfdatetime import cocoa_time class CocoaTimeEpochTest(unittest.TestCase): """Tests for the Cocoa time epoch.""" def testInitialize(self): """Tests the __init__ function.""" cocoa_time_epoch = cocoa_time.CocoaTimeEpoch() ...
{ "content_hash": "a0456d9b842b5577905af4ceacca85b8", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 80, "avg_line_length": 37.00617283950617, "alnum_prop": 0.7339449541284404, "repo_name": "joachimmetz/dfdatetime", "id": "b7d7caa6b0bf5aec191bcbeb99b4156d630244d2", "size"...
import argparse import os import sys from libs import colorprint from libs import workspaces from libs.cli import run_command from libs.manifest import RUNWAY_DEFAULTS as manifest_defaults from libs.manifest import Manifest import setup_and_run_ansible_on_guest SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) ...
{ "content_hash": "d58b72ae0b1f4aee798ef5ed4c9562d3", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 44.11888111888112, "alnum_prop": 0.5845617372008243, "repo_name": "swiftstack/runway", "id": "496cb7ebcbf0fc9372428268118aa9ea1d05376b", "size": "64...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/torton/shared_lair_torton_grassland.iff" result.attribute_template_id = -1 result.stfName("lair_n","torton_grassland") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "edf2943cbb320c0b50c2c9425a9ee2c0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 24.23076923076923, "alnum_prop": 0.7015873015873015, "repo_name": "obi-two/Rebelion", "id": "1ba1e884c62622afc3f22a270f009deb9ddfdd06", "size": "460"...
import numpy as np import collections class Vocabulary(object): def __init__(self): self.content = {} def addTerm(self, term, cf, df): termId = len(self.content) self.content[term] = { "id": termId, "cf": cf, "df": df } return termId def incrementCF(self, term, n): if self.isATerm(term): ...
{ "content_hash": "e3f270dd29214093b0dca6be25f71328", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 107, "avg_line_length": 24.90990990990991, "alnum_prop": 0.6408679927667269, "repo_name": "Juancard/parallel-and-distributed-IR", "id": "62fb93d9da4c2373b60b15d7f86b212a723f...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^patient/$', views.patients, name='patient_list'), url(r'^social_work/(?P<id>[0-9]+)/$', views.social_work, name='social_work'), url(r'^clinical_history/(?P<id>[0-9]+)/$', views.clinical_history, name='clinical_history'), url(r...
{ "content_hash": "2d638bd5448ba5f9d95a8cfc9863716c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 126, "avg_line_length": 69.54166666666667, "alnum_prop": 0.6776512881965249, "repo_name": "nanomolina/JP", "id": "c4065b8ca523acd307d3ab72c076d972c79fd25d", "size": "1669",...
""" Tests for L{twisted.internet._sslverify}. """ from __future__ import division, absolute_import import sys import itertools from zope.interface import implementer skipSSL = None skipSNI = None try: import OpenSSL except ImportError: skipSSL = "OpenSSL is required for SSL tests." skipSNI = skipSSL els...
{ "content_hash": "06109333ff6a10b6ecf3bf565ddfc7ed", "timestamp": "", "source": "github", "line_count": 2458, "max_line_length": 79, "avg_line_length": 34.08543531326281, "alnum_prop": 0.6207896684251988, "repo_name": "bertucho/epic-movie-quotes-quiz", "id": "8a112742d4d7642f5ddec04668df4aeb45b8f58b"...
import time import datetime from Adafruit_LEDBackpack import LEDBackpack # =========================================================================== # Bargraph Display # =========================================================================== # This class is meant to be used with the 24-LED bicolor bargraph # di...
{ "content_hash": "12c5db8cf6a4c90613e8a687541ab46e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 86, "avg_line_length": 25.0188679245283, "alnum_prop": 0.5188536953242836, "repo_name": "cmuphyscomp/physcomp-examples", "id": "804991fa3311cecc655ad5b4e44e95218dbe630d", "...
"""Module for reading and writing MATLAB .mat files""" # Authors: Travis Oliphant, Matthew Brett """ Module for reading and writing matlab (TM) .mat files """ import os import sys import warnings from numpy.compat import asbytes from miobase import get_matfile_version, docfiller from mio4 import MatFile4Reader, Mat...
{ "content_hash": "97379f4c625f171137eba7fcd0bbf273", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 86, "avg_line_length": 33.58520900321543, "alnum_prop": 0.6106270943034945, "repo_name": "teoliphant/scipy", "id": "1181a71e1b33c3b3fd90273134e4573de778ea9c", "size": "104...
import time import gevent.pool import gevent.queue import gevent.event import gevent.local import gevent.lock from .exceptions import * class HeartBeatOnChannel(object): def __init__(self, channel, freq=5, passive=False): self._channel = channel self._heartbeat_freq = freq self._input_qu...
{ "content_hash": "730a63579506ffe22b6781a952321e3e", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 31.321100917431192, "alnum_prop": 0.5626830697129467, "repo_name": "donatello/zerorpc-python", "id": "92421af8684d459a9a4bac3d9df8154afd40387c", "si...
import cv2 import numpy as np import rospy from cv_bridge import CvBridge from sensor_msgs.msg import Image import sys def main(): FILE = "/home/tsender/rosbags/gold_chip_rpac.avi" TOPIC = "/forward/image_undistorted" loop = False if len(sys.argv) >= 2: FILE = sys.argv[1] if len(sys.arg...
{ "content_hash": "42f1efbe1d2361f02a470173dd88a9c1", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 54, "avg_line_length": 22.918367346938776, "alnum_prop": 0.5752448797862867, "repo_name": "JustBenj/riptide_software", "id": "6d0e0860dc6f84df0e4b48890209a3c0b9915780", "si...
__author__ = 'nata' from model.contact import Contact class ContactHelper: def __init__(self, app): self.app = app def fill_contacts_form(self, contact): self.change_field_value("firstname", contact.first_name) self.change_field_value("middlename", contact.middle_name) self.c...
{ "content_hash": "3625c21bc391896cd80ae926aa0fc406", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 105, "avg_line_length": 41.25766871165644, "alnum_prop": 0.6090706319702602, "repo_name": "ilnatvl/python_training", "id": "5c565a424a64a700afaed0d65bcd41e69afe0898", "siz...
import subprocess import re import argparse import contextlib import os import sys class Wrapper: def __init__(self, port, extra_arguments=None): self.port = port self.extra_arguments = extra_arguments def run_networksetup_command(self, *arguments): return subprocess.check_output( ...
{ "content_hash": "dc6a1d8bf77114430ec52d377ce5ac68", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 110, "avg_line_length": 36.23717948717949, "alnum_prop": 0.5922519016451442, "repo_name": "xaxa89/mitmproxy", "id": "eade0fe2fed2f49cc6c60db543cbc8cbf570e223", "size": "58...
import click import random from alg.pla import PLA from alg.pocket import Pocket @click.command() @click.option('--alg', default='pla') @click.option('--input_train') @click.option('--input_test') @click.option('--learning_rate', default=1.0) @click.option('--shuffle', default=1) @click.option('--times', default=2000)...
{ "content_hash": "330b3465c726f9c3113f314f6409012b", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 122, "avg_line_length": 32.43333333333333, "alnum_prop": 0.6603288797533402, "repo_name": "abawchen/PLA", "id": "c34e9081c29327f4c4ec9baf96da765bafdc0874", "size": "1946", ...
import django.contrib.postgres.fields.jsonb from django.db import migrations import saleor.core.utils.json_serializer class Migration(migrations.Migration): dependencies = [("checkout", "0019_checkout_gift_cards")] operations = [ migrations.AddField( model_name="checkout", n...
{ "content_hash": "70bb857d29775a76ee50e028d52f18ea", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 29.46875, "alnum_prop": 0.5641569459172853, "repo_name": "maferelo/saleor", "id": "cc77c55ad370f6c38e72052f26d040e8d753c7ac", "size": "992", "binar...
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLES1 import _types as _cs # End users want this... from OpenGL.raw.GLES1._types import * from OpenGL.raw.GLES1 import _errors from OpenGL.constant import Constant as _C import...
{ "content_hash": "8432b800c80db9459cdacb93837b2135", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 117, "avg_line_length": 36.5, "alnum_prop": 0.7448630136986302, "repo_name": "alexus37/AugmentedRealityChess", "id": "04af3536ba0c63197ca704fea0e5dc5a71ae82f9", "size": "58...
from __future__ import unicode_literals import frappe, unittest from frappe.model.delete_doc import delete_doc from frappe.utils.data import today, add_to_date from frappe import _dict from frappe.utils import get_url from frappe.core.doctype.user.user import get_total_users from frappe.core.doctype.user.user import ...
{ "content_hash": "7aab12d1da047916d41924a8714fd09b", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 106, "avg_line_length": 37.63179916317991, "alnum_prop": 0.698020902824105, "repo_name": "adityahase/frappe", "id": "fb1fa4aff9894769908fe574be45da288f99a4af", "size": "90...
""" Online Convolutional Dictionary Learning with Spatial Mask ========================================================== This example demonstrates the use of :class:`.dictlrn.onlinecdl.OnlineConvBPDNMaskDictLearn` for learning a convolutional dictionary from a set of training images. The dictionary is learned using t...
{ "content_hash": "4b60df101bb7cdf04dbec95f779f7c12", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 272, "avg_line_length": 24.781512605042018, "alnum_prop": 0.6578501186842998, "repo_name": "bwohlberg/sporco", "id": "4042b57ae4976d7b15bcc7f4d128cd96759aa36a", "size": "3...
__author__ = 'caninemwenja' from twisted.protocols.basic import LineReceiver from twisted.internet import reactor from twisted.internet.protocol import ClientFactory import sys def quit(): reactor.stop() print "Bye!" class Console(object): def __init__(self): self.history = [] def write(...
{ "content_hash": "2ed5ff7632d96e2f8486773f918429b5", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 95, "avg_line_length": 25.13684210526316, "alnum_prop": 0.6122278056951423, "repo_name": "caninemwenja/siafu", "id": "3bd499af237a765fd20702760cf32e765a53b496", "size": "23...
registry = {}
{ "content_hash": "9302e82d20f2c22ca95a1030d60d5001", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 13, "avg_line_length": 14, "alnum_prop": 0.5714285714285714, "repo_name": "codeinn/vcs", "id": "e381a8011a4ee994466cced1477e7fd4419f946f", "size": "15", "binary": false, ...
try: import eventlet except: raise ImportError("These tests require the 'eventlet' library to run. Available via 'pip install eventlet'.") import tradesocket, os, atexit, sys, unittest from eventlet.greenio import trampoline from eventlet.green import socket eventlet.import_patched('multiprocessing.process'...
{ "content_hash": "9b990f7ec1c1a7d7e3e9105806d2002e", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 114, "avg_line_length": 34.55813953488372, "alnum_prop": 0.5771646478241363, "repo_name": "DeadWisdom/tradesocket", "id": "fd80b8d813215608808006e7a13640e3b56ef0ad", "size...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('trigger', '0003_auto_20151202_1325'), ] operations = [ migrations.AlterField( model_name='triggerrule', name='name', ...
{ "content_hash": "9d5ae102190b7fe83c44f3572a97a547", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 23.210526315789473, "alnum_prop": 0.5941043083900227, "repo_name": "ngageoint/scale", "id": "fc6187c63cc3253f8ce695be46384e663645a21e", "size": "465"...
""" Creates chroots to be used for building. Uses the chroothelper program to do final processing and chrooting. """ import errno import fcntl import grp import itertools import os import pwd import shutil import sys import stat #conary from conary import conarycfg from conary import conaryclient from conary...
{ "content_hash": "d25154c20c66813138aacc7974da3389", "timestamp": "", "source": "github", "line_count": 664, "max_line_length": 116, "avg_line_length": 38.743975903614455, "alnum_prop": 0.5577625748270233, "repo_name": "fedora-conary/rmake-2", "id": "764720eb42f3ac9cda34fcb5937a56c5c7c3a593", "size...
import copy import numpy as np from scipy import signal from astropy.io import fits as pyfits from astropy.stats import sigma_clip from tqdm import tqdm import oktopus import requests from bs4 import BeautifulSoup from .utils import running_mean, channel_to_module_output, KeplerQualityFlags from matplotlib import pyplo...
{ "content_hash": "66602e7edfafc32835366bd43b9c9d0b", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 128, "avg_line_length": 36.635714285714286, "alnum_prop": 0.5833105868590368, "repo_name": "christinahedges/PyKE", "id": "e8875a5d5e6fbf8117ebf5cd8a737b78fc2bf8a0", "size"...
""" GPU driver for C kernels (with CUDA) To select cuda, use SAS_OPENCL=cuda, or SAS_OPENCL=cuda:n for a particular device number. If no device number is specified, then look for CUDA_DEVICE=n or a file ~/.cuda-device containing n for the device number. Otherwise, try all available device numbers. TODO: docs are ou...
{ "content_hash": "3871f75666dbb799f3fbc3b343e3114d", "timestamp": "", "source": "github", "line_count": 583, "max_line_length": 92, "avg_line_length": 35.98284734133791, "alnum_prop": 0.6342358661454858, "repo_name": "SasView/sasmodels", "id": "20721c56d0d7ba40e31afd96397d3aed52789b51", "size": "20...
""" Class for BH1750FVI """ from enum import Enum import smbus class DeviceAddressValues(Enum): """ Valid device addresses """ I2C_ADDRESS_35 = 35 I2C_ADDRESS_92 = 92 class BH1750FVI: """ Rohm Light Sensor """ REGISTER_CONTINUOUSHRES2MODE = 17 REGISTER_CONTINUOUSHRESMODE = ...
{ "content_hash": "a1b25a644178a727bda45b09ca780a4a", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 67, "avg_line_length": 22.262857142857143, "alnum_prop": 0.5423511293634496, "repo_name": "google/cyanobyte", "id": "32248def7ecf6fd842dcbf1a77af3ad015cf8261", "size": "45...
import sahara.exceptions as ex from sahara.plugins import base as plugin_base CONVERT_TO_TEMPLATE_SCHEMA = None def check_convert_to_template(plugin_name, version, **kwargs): if not plugin_base.PLUGINS.is_plugin_implements(plugin_name, 'convert'): raise ex.InvalidException( "Requested plugin...
{ "content_hash": "c20444e12f5da21ca6056cb0164956f4", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 76, "avg_line_length": 34.833333333333336, "alnum_prop": 0.7129186602870813, "repo_name": "tellesnobrega/storm_plugin", "id": "af477d2528fa1ed817c3798d6b9d81c4cbeb114f", "s...
import autosar def setup(): ws = autosar.workspace(version="4.2.2") package=ws.createPackage('ApplicationTypes', role='DataType') package.createSubPackage('DataConstrs', role='DataConstraint') package.createSubPackage('CompuMethods', role='CompuMethod') package.createSubPackage('Units', role...
{ "content_hash": "590d02af6a3af1a38fdd0a4d66360d2b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 113, "avg_line_length": 50.8, "alnum_prop": 0.7746062992125984, "repo_name": "cogu/autosar", "id": "2b26c210260bdf5dedf6a1244ad9128e712800ad", "size": "1016", "binary": f...
""" A catch-all file that imports the whole framework. :file: __init__.py :date: 27/08/2015 :authors: - Gilad Naaman <gilad@naaman.io> """ # Core classes. from .base import * from .struct import * # Serializers from .scalars import * from .enum import * # Misc. from .validators import *
{ "content_hash": "1ce97a86e714d562a587df285e810546", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 50, "avg_line_length": 15.578947368421053, "alnum_prop": 0.6790540540540541, "repo_name": "Gilnaa/Hydra", "id": "046343a1787f7c3f8295aa3488496d20b2eb3534", "size": "296", ...
from sqlalchemy import Column, Integer, inspect from sqlalchemy.ext.declarative import as_declarative, declared_attr @as_declarative() class Base(object): @declared_attr def __tablename__(cls): return cls.__name__.lower() __table_args__ = { 'mysql_engine': 'InnoDB', 'mysql_charset'...
{ "content_hash": "f7dc8b83036273e540e55457a3764d3e", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 70, "avg_line_length": 32.8125, "alnum_prop": 0.5803174603174603, "repo_name": "DmitryFillo/rknfilter", "id": "54eb3b8afe90f7072f2ac35c8842ac858088b99a", "size": "1575", ...
from collections import namedtuple import numpy as np from numpy.testing import assert_equal from numpy.testing.decorators import skipif from skimage import data from skimage.viewer import ImageViewer, viewer_available from skimage.viewer.canvastools import ( LineTool, ThickLineTool, RectangleTool, PaintTool) from...
{ "content_hash": "f26e53dea2304cf7da9ba1410d6bee54", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 73, "avg_line_length": 28.794258373205743, "alnum_prop": 0.6488866733133931, "repo_name": "SamHames/scikit-image", "id": "6663c465567cc4714a85f1d4fe11f8300141ebdc", "size"...
""" wsgi.py This is the file that is responsible for running the application and and other commands like the database migrations. It shouldn't have any extensive logic. """ from townsquare import TownSquare from flask_script import Manager application = TownSquare.create_app() manager = Manager(application) @man...
{ "content_hash": "21426bc6e18636c399569a30c360a3c7", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 68, "avg_line_length": 16.586206896551722, "alnum_prop": 0.7297297297297297, "repo_name": "sc3/townsquare-flask", "id": "e437c9a5eef2d6e3c8d691a3df3fc62b61d90254", "size": ...
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="layout.scene.xaxis.title.font", **kwargs, ): super(FamilyValidator, self).__init__( plotly_name=pl...
{ "content_hash": "807bcadae2b64582b2f737d3c5861352", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 68, "avg_line_length": 30.72222222222222, "alnum_prop": 0.5678119349005425, "repo_name": "plotly/plotly.py", "id": "f8681f0c2288e9c552e6160d56b916e3374ef316", "size": "553"...
from __future__ import print_function import sys import os BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) sys.path.insert(0, ROOT) sys.path.insert(0, BASE_DIR) # This is required for ReadTheDocs.org, but isn't a bad idea anyway. os.environ['DJANGO_SE...
{ "content_hash": "328aa2fb5eb89c05538f672ae4cf5763", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 79, "avg_line_length": 33.43703703703704, "alnum_prop": 0.6377935312361542, "repo_name": "rickerc/ceilometer_audit", "id": "98646df2d3d6d1a04278740431107dd015bdb117", "siz...
from django.conf import settings DEFAULT_IMAGE_CATEGORY_CHOICES = getattr(settings, "DEFAULT_IMAGE_CATEGORY_CHOICES") AUTH_USER_MODEL = getattr( settings, "AUTH_USER_MODEL", "auth.User" )
{ "content_hash": "74539702de37f3d9e6cd7a91aa30244c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 84, "avg_line_length": 22.444444444444443, "alnum_prop": 0.7227722772277227, "repo_name": "unomena/unobase", "id": "95767076c35453be2ddf34c87e38331b6b42da8b", "size": "202",...
import semantic_version import datetime import time from decimal import getcontext, Decimal from collections import OrderedDict class MetricStorage(object): def __init__(self, registry=None): self.registry = registry # metrics data # _meta is for per-package data self.metrics = {...
{ "content_hash": "21f3dfd98fc87fe3077584e43573ba8d", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 96, "avg_line_length": 28.232323232323232, "alnum_prop": 0.6356887298747764, "repo_name": "zulumulu/npm-metrix", "id": "977d7526c0928e5e1d437d04a2d5d2bbdbcbca8a", "size": ...
def demo_map(int_list, str_list): print 'demo map:' res_int_list = map(lambda ele: ele * ele, int_list) print res_int_list res_len_list = map(lambda ele: len(ele), str_list) print res_len_list def demo_filter(int_list, str_list): print 'demo filter:' res_int_list = filter(lambda ele: ele ...
{ "content_hash": "949912f12f938a8f6db132970d957ce4", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 28.45945945945946, "alnum_prop": 0.6134852801519468, "repo_name": "YcheLanguageStudio/CPP11Study", "id": "2767b086fb4376aebcc40981de514899c3d9f1b3", ...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class CredentialListTestCase(IntegrationTestCa...
{ "content_hash": "8261cf978f8b1d6d832136cf2ed2d85a", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 156, "avg_line_length": 40.88636363636363, "alnum_prop": 0.5725403001667593, "repo_name": "tysonholub/twilio-python", "id": "d7a065a2ebe542f65780bd6937f9ed068837591f", "si...
from django.test import TestCase import os import datetime class SimpleTestCase(TestCase): def test_license_year(self): BASE_TEMPLATE = "./vutman/templates/base.html" self.assertEqual(os.path.exists(BASE_TEMPLATE), True) now = datetime.datetime.now() current_year = datetime.dateti...
{ "content_hash": "b93034c33e14bcf73b8abd7fad0b34d4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 69, "avg_line_length": 34.266666666666666, "alnum_prop": 0.6789883268482491, "repo_name": "daniellawrence/django-vutman", "id": "3efeae9cd80acaedb54a860009dede0c38b57f12", ...
import os, types, re from twisted.python import runtime from twisted.internet import reactor from buildbot.process.buildstep import BuildStep from buildbot.process.buildstep import SUCCESS, FAILURE from twisted.internet import error from twisted.internet.protocol import ProcessProtocol import pprint class MasterShellC...
{ "content_hash": "fb4e151e4019ca37a00fb28ea7c57025", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 96, "avg_line_length": 38.416666666666664, "alnum_prop": 0.5885303687635575, "repo_name": "denny820909/builder", "id": "52e75de3c7ddf584c1cb9c0ab4443e65d6485f64", "size": ...
from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .version import VERSION from msrest.pipeline import ClientRawResponse from . import models class SpellCheckAPIConfiguration(Configuration): """Configuration for SpellCheckAPI Note that all parameter...
{ "content_hash": "f8c0f5212a44e7e8cea0c132c9f0cb1d", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 383, "avg_line_length": 59.71944444444444, "alnum_prop": 0.6873342946183544, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "6d565fdadd415bd1e6b51a48ac776cc5f867bfde"...
""" Package for configuration of version numbers. """ class IncomparableVersions(TypeError): """ Two versions could not be compared. """ class Version(object): def __init__(self, package, major, minor, patch, prerelease=None): """ Args: package (str): Package name ...
{ "content_hash": "985df05f8c985f4c3a739924a1d236fa", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 25.634615384615383, "alnum_prop": 0.5243810952738185, "repo_name": "mdrohmann/txtemplates", "id": "931aef222b4eff6744ec311faceb5597d834e9ef", "size"...
import abc import re import six @six.add_metaclass(abc.ABCMeta) class NameMatchingPolicy(object): @abc.abstractmethod def match(self, name): """Tests that name is acceptable. :param name: the name to test :type name: str :returns: True if yes otherwise False """ @...
{ "content_hash": "6588cc3508796ac8b3af4ecd71592047", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 61, "avg_line_length": 24.555555555555557, "alnum_prop": 0.6199095022624435, "repo_name": "huntxu/fuel-web", "id": "4726e94fd46de7e73252c88b6a6d1daacd5058a4", "size": "1961...
from keystoneclient import exceptions as ksexception # NOTE(deva): import auth_token so oslo.config pulls in keystone_authtoken from keystonemiddleware import auth_token # noqa from oslo.config import cfg from six.moves.urllib import parse from ironic.common import exception from ironic.common.i18n import _ CONF = c...
{ "content_hash": "cb64391115d33d796b86ba8679cf4723", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 79, "avg_line_length": 37.442477876106196, "alnum_prop": 0.6646182935476247, "repo_name": "Tehsmash/ironic", "id": "64ea34202c65d59aeeafbac4603543e9a66ab22d", "size": "479...
from argparse import ArgumentParser from server import RequestHandler from server import Server def main(): parser = ArgumentParser() parser.add_argument('-p', '--port', required=True) parser.add_argument('-f', '--file_dir', required=True) args = parser.parse_args() port = int(args.port) file...
{ "content_hash": "3fcdd0de10569d6a927021ab82a12e22", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 58, "avg_line_length": 25.75, "alnum_prop": 0.6504854368932039, "repo_name": "feiyanzhandui/tware", "id": "3121a27322dba6cfe2ec364154d69fc2acd0fee4", "size": "533", "bina...
""" Created on Thu Aug 13 13:52:23 2015 @author: wirkert """ import unittest import copy import numpy as np from msi.test import helpers import msi.msimanipulations as mani class TestMsiManipulations(unittest.TestCase): def setUp(self): self.msi = helpers.getFakeMsi() self.specialmsi = helper...
{ "content_hash": "ed0b4a0973b63ef4a6d51ab4737db4d3", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 82, "avg_line_length": 41.84653465346535, "alnum_prop": 0.5768366260499231, "repo_name": "iwegner/MITK", "id": "9b895a6cf45eda27396e2e0b1d39ddf1618d62aa", "size": "8477", ...
"""Rozwiązanie zadania 203.""" import math def calc_idf(simple_index, term): """Oblicza wartość IDF.""" count = 1 if term in simple_index.inverted_index: count += len(set(simple_index.inverted_index[term])) return math.log(len(simple_index.documents)/float(count), 2)
{ "content_hash": "1be0c09d03a76fbc3de9580a23ccc8fe", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 64, "avg_line_length": 32.44444444444444, "alnum_prop": 0.6746575342465754, "repo_name": "katzoo/amu", "id": "dc43250dc20bea3297aa14268728942d769d26db", "size": "319", "bi...
""" Testing! """ import os import os.path import stat import sys import unittest import shutil import tempfile import timeit import time import platform import watchers from watchers import Watcher, SimpleWatcher, Manager # For faster testing. CHECK_INTERVAL = 0.25 # Shortcuts. def create_file(*path, data='hello w...
{ "content_hash": "b7492690b3c4f614b03a9a408d1b9230", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 89, "avg_line_length": 25.216247139588102, "alnum_prop": 0.5417214937156858, "repo_name": "lecnim/watchers.py", "id": "82eaaf5ec15d35a5a2aded36ec25a0fee71ec258", "size": "...
""" Interprocess mutex based on file locks """ import fcntl class Lock: def __init__(self, filename): self.filename = filename # This will create it if it does not exist already unbuffered = 0 self.handle = open(filename, 'a+', unbuffered) def acquire(self): fcntl.fl...
{ "content_hash": "72d0fb53b85318e649e4e1427614578b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 22.51851851851852, "alnum_prop": 0.6217105263157895, "repo_name": "endlessm/chromium-browser", "id": "e9970e135f933f4d226323984a24d82e6321bf01", "siz...
from gbpservice.nfp.orchestrator.openstack import openstack_driver from gbpservice.nfp.orchestrator.coal.networking import( nfp_network_driver_base as ndb ) class NFPNeutronNetworkDriver(ndb.NFPNetworkDriverBase): def __init__(self, config): self.network_handler = openstack_driver.NeutronClient(config...
{ "content_hash": "9e60333c695253bfeb17e34c74f54054", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 34.3469387755102, "alnum_prop": 0.5935828877005348, "repo_name": "jiahaoliang/group-based-policy", "id": "0ee00dcf8457efed181477ab48943b86c6bc26a9", ...
from symbol.builder import add_anchor_to_arg from symbol.builder import ResNetV1bFPN as Backbone from models.FPN.builder import FPNNeck as Neck from models.FPN.builder import FPNRoiAlign as RoiExtractor from models.FPN.builder import FPNBbox2fcHead as BboxHead from mxnext.complicate import normalizer_factory from mode...
{ "content_hash": "cd9c8294f8fbc756249ec008ab4d0823", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 147, "avg_line_length": 29.785074626865672, "alnum_prop": 0.5674483864501905, "repo_name": "TuSimple/simpledet", "id": "e98a4c2646cab1799d4d936415b4fc3d15e7c1b1", "size": ...
from __future__ import unicode_literals from time import time from random import shuffle def quick_sort(init_list): return_list = init_list[:] _quick_sort2(return_list, 0, len(return_list) - 1) return return_list def _quick_sort2(init_list, low, high): if low < high: # if there's more than one item...
{ "content_hash": "6e0ed77cbbc4b10c81947afab5e7c97c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 89, "avg_line_length": 30.256756756756758, "alnum_prop": 0.5895489057615007, "repo_name": "kaka0525/data-strutctures-partII", "id": "2dba9cfa543e265a9667bb465ad075e69af409c6"...
from ._models_py3 import AadAuthenticationParameters from ._models_py3 import AddressSpace from ._models_py3 import ApplicationGateway from ._models_py3 import ApplicationGatewayAuthenticationCertificate from ._models_py3 import ApplicationGatewayAutoscaleConfiguration from ._models_py3 import ApplicationGatewayAvailab...
{ "content_hash": "06c431fbf354da53b9e1539e8c87f78e", "timestamp": "", "source": "github", "line_count": 1157, "max_line_length": 105, "avg_line_length": 44.29645635263613, "alnum_prop": 0.8256229146748356, "repo_name": "Azure/azure-sdk-for-python", "id": "e30288b6ca577ecc1d786926fdd25e68ff052098", ...
from anthill.common.options import define # Main define("host", default="http://localhost:9514", help="Public hostname of this service", type=str) define("listen", default="port:9514", help="Socket to listen. Could be a port number (port:N), or a unix domain socket (unix:PATH)", ...
{ "content_hash": "55b06453313bd142542597270ed5aa04", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 101, "avg_line_length": 22.196969696969695, "alnum_prop": 0.5918088737201365, "repo_name": "anthill-platform/anthill-social", "id": "1eae1fecc6c2e6a6379c57679587f0a8526ad910"...
from sqlalchemy.orm import subqueryload_all from changes.api.base import APIView from changes.models import LogSource, TestCase class TestCaseDetailsAPIView(APIView): def get(self, test_id): testcase = TestCase.query.options( subqueryload_all('artifacts') ).get(test_id) if te...
{ "content_hash": "29f11a8b1722db4d63737e902576c31a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 30.96153846153846, "alnum_prop": 0.6484472049689441, "repo_name": "wfxiang08/changes", "id": "46fa2e9260a4ef5e8bab864180cc674cf9ce8feb", "size": "805...
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from guardian.admin import GuardedModelAdmin from apps.ecidadania.voting.models import Poll, Choice, Voting, ConfirmVote class ChoiceInline(admin.TabularInline): model = Choice class PollAdmin(GuardedModelAdmin): ...
{ "content_hash": "f228680a13089e842f732f6ff201f7a1", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 77, "avg_line_length": 27.743589743589745, "alnum_prop": 0.6654343807763401, "repo_name": "cidadania/e-cidadania", "id": "99953d52e0709a707d94f811dcc72ee3f973fba9", "size":...
import json import datetime from nameko.rpc import rpc from statsd import StatsClient class AccountTransactionsService: name = "account_transactions_service" statsd = StatsClient('statsd-agent', 8125, prefix='simplebank-demo.account-transactions') @rpc @statsd.timer('request_...
{ "content_hash": "534f8cfac2bf1e613a9291008431a403", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 30.142857142857142, "alnum_prop": 0.6571879936808847, "repo_name": "morganjbruce/microservices-in-action", "id": "0f2a35a54324b682917d6ca71c7cc4a49da33...
"""Test the ViCare config flow.""" from unittest.mock import patch from PyViCare.PyViCareUtils import PyViCareInvalidCredentialsError from homeassistant import config_entries, data_entry_flow from homeassistant.components import dhcp from homeassistant.components.vicare.const import CONF_CIRCUIT, DOMAIN, VICARE_NAME ...
{ "content_hash": "45c4bc49e3797308de0106fc10b4deb5", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 83, "avg_line_length": 33.987854251012145, "alnum_prop": 0.6263251935675997, "repo_name": "rohitranjan1991/home-assistant", "id": "0bedb0d73b80064c04abfa0de42a4d5292b2e422",...
"""Test getting the sum project volume. """ import datetime from ceilometer.publisher import utils from ceilometer import sample from ceilometer.tests import api as tests_api from ceilometer.tests import db as tests_db class TestSumProjectVolume(tests_api.TestBase, tests_db.MixinTestsWit...
{ "content_hash": "093284bb4efda2c2ffa00ab6809cdf4c", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 75, "avg_line_length": 38.04705882352941, "alnum_prop": 0.54421768707483, "repo_name": "tanglei528/ceilometer", "id": "788e3ee3e96388312451c060c8b532ecd25db317", "size": "3...