text
stringlengths
4
1.02M
meta
dict
""" Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
{ "content_hash": "2d3201c839c8204aa0dc72c4d5e64556", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 77, "avg_line_length": 30.332278481012658, "alnum_prop": 0.5833072509128847, "repo_name": "alexforencich/xfcp", "id": "5f305fbce7c575e297de08342f2759d143441b1e", "size": "...
""" Services templatetags """ from coffin import template from maker.core.rendering import render_to_string from jinja2 import contextfunction, Markup from django.template import RequestContext register = template.Library() @contextfunction def services_ticket_list(context, tickets, skip_group=False, ...
{ "content_hash": "830d003b1127637f972d8182d6950963", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 80, "avg_line_length": 38.15151515151515, "alnum_prop": 0.56791104050834, "repo_name": "alejo8591/maker", "id": "ec7f5414028e113fd61052c16b968e018bed4318", "size": "2570", ...
"""Config flow to configure the Freebox integration.""" import logging from aiofreepybox.exceptions import AuthorizationError, HttpRequestError import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_PORT from .const import DOMAIN # pylint: disable=unused-im...
{ "content_hash": "6da0d1cb9b40295ccc6c5e2a6b51299a", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 88, "avg_line_length": 31.71171171171171, "alnum_prop": 0.5946022727272727, "repo_name": "tchellomello/home-assistant", "id": "0589dfb2ef10fff713c5075eab9658443bf5ac87", "...
"""Support for esphome numbers.""" from __future__ import annotations import math from typing import cast from aioesphomeapi import NumberInfo, NumberState import voluptuous as vol from homeassistant.components.number import NumberEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core im...
{ "content_hash": "8f7f247ff710053aca7f7204805e8b3d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 79, "avg_line_length": 29.564102564102566, "alnum_prop": 0.6738941890719862, "repo_name": "lukas-hetzenecker/home-assistant", "id": "1a90cdbeb24cc21d260fe6e750bcb25f5218e233"...
"""Contains classes for the feeds""" from django.contrib.syndication.views import Feed from django.utils.feedgenerator import Atom1Feed from package.models import Package class RssLatestPackagesFeed(Feed): """RSS Feed for the packages""" title = "Latest Django packages added" link = "/packages/latest/" ...
{ "content_hash": "3623217bd5412ec29101c241ba16ea14", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 62, "avg_line_length": 31.71875, "alnum_prop": 0.6768472906403941, "repo_name": "cartwheelweb/packaginator", "id": "52cd16069c4734ac324fd3c575e37b336724e041", "size": "1015...
import spotipy import spotipy.oauth2 as oauth2 from models import artist, track, history, user import time from calendar import timegm class spotify: def __init__(self, config): self.PATTERN = '%Y-%m-%dT%H:%M:%S.%fZ' self.oauth = oauth2.SpotifyOAuth( config['client_id'], c...
{ "content_hash": "cf9ab8a1443e88cc60ef3e63e75952aa", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 146, "avg_line_length": 32.666666666666664, "alnum_prop": 0.4996355685131195, "repo_name": "babastienne/spotistory", "id": "c6e573aec31bc2971aa2f97e7d7cb56380f7831b", "size...
from django.core.urlresolvers import reverse from django.db import models from django.contrib.auth.models import User class Brief(models.Model): brief = models.CharField('七嘴八舌', max_length=1000) thumbnail = models.ImageField('配图', upload_to='brief', null=True, blank=True) user = models.ForeignKey(User, de...
{ "content_hash": "17709cdfd5a73acb4d0ce8577077eb05", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 30.608695652173914, "alnum_prop": 0.6775568181818182, "repo_name": "madre/PersonalWeb", "id": "39689220770eb105dc125687ded32c17ace250ab", "size": "73...
from os import sys import synth_common from synth_common import s_to_ns trace = synth_common.create_trace() trace.add_chrome_metadata(os_name="Android") track1 = 1234 track2 = 4567 gpu_track = 7890 trace.add_process_track_descriptor(track1, pid=0) trace.add_process_track_descriptor(track2, pid=2) trace.add_process...
{ "content_hash": "f993a8f00ee512cd080413f104933048", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 79, "avg_line_length": 30.81578947368421, "alnum_prop": 0.695132365499573, "repo_name": "google/perfetto", "id": "e7b612e819da2688ff2a159b3d4398016355d208", "size": "2966",...
import argparse import distutils.dir_util import os import re import shutil import subprocess import sys ########################################################################## # Globals ########################################################################## Corefx_url = 'https://github.com/dotnet/corefx.git' ...
{ "content_hash": "e55502fa4c0505e355a25e1c1ea4a913", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 100, "avg_line_length": 31.571428571428573, "alnum_prop": 0.5534439416792358, "repo_name": "neurospeech/coreclr", "id": "f0111da19cf5e6ede6588e2b8dbf3a1eccac12f7", "size":...
from .client import CatalogServiceClient from .async_client import CatalogServiceAsyncClient __all__ = ( "CatalogServiceClient", "CatalogServiceAsyncClient", )
{ "content_hash": "c3a9360072fb7f85bbafb92e6582e6e0", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 24.142857142857142, "alnum_prop": 0.7692307692307693, "repo_name": "googleapis/python-recommendations-ai", "id": "dcec94d439ff2a9ad23a15aa450afda81d6f8e...
import unittest2 class TestClient(unittest2.TestCase): def setUp(self): KLASS = self._getTargetClass() self.original_cnxn_class = KLASS._connection_class KLASS._connection_class = _MockConnection def tearDown(self): KLASS = self._getTargetClass() KLASS._connection_cla...
{ "content_hash": "721764bb2d26367284e8d043c3196af1", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 79, "avg_line_length": 32.837078651685395, "alnum_prop": 0.6295979469632165, "repo_name": "ikool/metact06-djan", "id": "77214ccbff3349646e63ff8ccca3c9b1a5b977d0", "size": ...
from django.shortcuts import render from .models import OrderItem from .forms import OrderCreateForm from cart.cart import Cart from .tasks import order_created from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts import get_object_or_404 from .models import Order def order_cre...
{ "content_hash": "f6d18a349b9ee7567863b58f89bd1baf", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 71, "avg_line_length": 37.27906976744186, "alnum_prop": 0.5527136618839675, "repo_name": "PikaDm/clave-online-shop-template", "id": "6416497cfe58b2063c137febc3a3a9d014dfb45e"...
from __future__ import absolute_import, print_function, unicode_literals import datetime import unittest from django.contrib.auth import get_user_model from django import forms from django.test import TestCase from model_mommy import mommy import six from core.forms import (ChecklistForm, SampleForm, SampleSelectOr...
{ "content_hash": "61b49b5a7991f5d9268a4d0c54a2e8f1", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 86, "avg_line_length": 34.35164835164835, "alnum_prop": 0.5889315419065899, "repo_name": "emergence-lab/emergence-lab", "id": "ba5536c662b6fa4ec5411845ab47005ea435e00e", "...
""" @file @brief @see cl Database """ from pyquickhelper.loghelper.flog import fLOG module_odbc = None class DatabaseObject: """ Methods for database related to object, see @see cl Database. """ def fill_table_with_objects( self, tablename, iterator_on, check_existence=False, skip_exce...
{ "content_hash": "286d26c264c7dfc5f23399c820428dc4", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 113, "avg_line_length": 36.827338129496404, "alnum_prop": 0.48427427231881226, "repo_name": "sdpython/pyensae", "id": "b8d01dd49581748c4d5283f759a92c4454d8a5d8", "size": "...
import csv import codecs # Pour le fuzzy matching permettant de faire le lien entre les noms et prénoms # selon le secrétariat et selon EDT ... from fuzzywuzzy import process from app.models import * def load_teachers(filename, encoding='cp1252'): #with open(filename, 'rb', encoding='cp1252') as csvfile: wi...
{ "content_hash": "ee3afe71fa4f100c416e4b33a5ed67d4", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 143, "avg_line_length": 34.825581395348834, "alnum_prop": 0.5894824707846411, "repo_name": "csud-reservation/flask-backend", "id": "3ab6a11c6dd91c4d484fc33637539b9ddc00c8f4"...
from CIM14.ENTSOE.Equipment.Core.IdentifiedObject import IdentifiedObject class BaseVoltage(IdentifiedObject): """Defines a nominal base voltage which is referenced in the system.For the 2010 ENTSOE IOP, the BaseVoltage association for SeriesCompensator and TransformerWinding is required. """ def __init__...
{ "content_hash": "de3d23553aa00756b262a3b6abc59960", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 182, "avg_line_length": 38.24, "alnum_prop": 0.6823570432357043, "repo_name": "rwl/PyCIM", "id": "1a7665b2f340c5c8da0fff6b0f179d969ae58b57", "size": "3968", "binary": fal...
"""Handles all requests to the conductor service.""" from oslo.config import cfg from nova import baserpc from nova.conductor import manager from nova.conductor import rpcapi from nova.openstack.common.gettextutils import _ from nova.openstack.common import log as logging from nova.openstack.common.rpc import common ...
{ "content_hash": "710a7db3dccbbe88d51b3954f124410d", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 79, "avg_line_length": 46.890160183066364, "alnum_prop": 0.5750817432043336, "repo_name": "citrix-openstack-build/nova", "id": "eea5886a470e87755751b894c4c77f3bd0e9efd3", ...
"""Some handy interfaces to the ADB :shell service. The :shell service is pretty straightforward, you send 'shell:command' and the device runs /bin/sh -c 'command'. The ADB daemon on the device sets up a PTY, similar to what ssh would do, to provide interactive terminal features. This makes things difficult if you're...
{ "content_hash": "954c5089237d7dddc80abc4a8d211d1c", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 98, "avg_line_length": 42.39923954372624, "alnum_prop": 0.7028069231459062, "repo_name": "amyxchen/openhtf", "id": "903c2120bed9222a4b792ec4e8743dd4e311e461", "size": "117...
if __name__ == '__main__': raise NotImplementedError("Setup has not been created yet.")
{ "content_hash": "6b31b431d5a9465c737b3a52a78a1f03", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 64, "avg_line_length": 46, "alnum_prop": 0.6413043478260869, "repo_name": "fatbeau/tribe", "id": "82d7ffc80e6d2f298728e2f7b53073c84a795b08", "size": "115", "binary": false...
""" [2016-05-23] Challenge #268 [Easy] Network and Cards: Part 1, The network https://www.reddit.com/r/dailyprogrammer/comments/4knivr/20160523_challenge_268_easy_network_and_cards/ #Description This week we are creating a game playable over network. This will be a 3-parter. The first part is to set up a connection b...
{ "content_hash": "c575d5aa1777a0129a86fcd79eb6d21c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 117, "avg_line_length": 46.707317073170735, "alnum_prop": 0.7671018276762402, "repo_name": "DayGitH/Python-Challenges", "id": "2f57aa3376ed4e529dc001e89aa0da1c64377be4", "s...
"""Generic JAX training loop for experiments.""" import functools import os from typing import (Any, Callable, Dict, Optional, Sequence, Tuple) from absl import logging from clu import metric_writers import flax from flax import jax_utils from flax import linen as nn from flax import struct from flax.training import ...
{ "content_hash": "e692abff96eb8cb81c8411aef7135803", "timestamp": "", "source": "github", "line_count": 743, "max_line_length": 80, "avg_line_length": 39.398384925975776, "alnum_prop": 0.6583541147132169, "repo_name": "google-research/meliad", "id": "6293890c7ea427066b3dc5fe48435726f12630b8", "size...
from climb.exceptions import UnknownCommand def command(function): function.command = True return function def completers(*compl): def wrapper(function): function.completers = compl return function return wrapper class Commands(object): def __init__(self, cli): self._c...
{ "content_hash": "43f39b6bf38e2c1b2868edd971201bef", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 81, "avg_line_length": 26.142857142857142, "alnum_prop": 0.5525956284153005, "repo_name": "m110/climb", "id": "6a17b32e8bdc24aad39624654fb5370495e8807a", "size": "1464", ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('buggy', '0004_bug_fulltext'), ] operations = [ migrations.RunSQL( """ CREATE INDEX bug_state_assigned_to_index ON buggy_bug (assigne...
{ "content_hash": "572fadecdf31300d1a053ed7e6d3bd02", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 109, "avg_line_length": 22.523809523809526, "alnum_prop": 0.5369978858350951, "repo_name": "fusionbox/buggy", "id": "4a16baec4d5caea2c0aad5fa922768d468550bdc", "size": "544...
from flask import Flask, url_for from flask.ext.admin import Admin, form from flask.ext.admin.contrib.sqla import ModelView import json from models import * import logging from flask.ext.admin.contrib import fileadmin from flask_wtf import Form from wtforms import StringField from jinja2 import Markup app = Flask(__n...
{ "content_hash": "139c74ab83fdd4e8e6f7be0c188a25c7", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 130, "avg_line_length": 39.06716417910448, "alnum_prop": 0.5444126074498568, "repo_name": "ebayohblr2014/eBay-Opportunity-Hack-Blr-2014", "id": "faae0d626dddaf2351c2a5660ee0...
from django.contrib.postgres.fields.jsonb import JsonAdapter from django.db.models import Lookup, Field @Field.register_lookup class DataLookup(Lookup): """ Lookup for values inside the data JSON of questionnaires. This is based on a text search inside the JSON of the questiongroup. It is therefore not ...
{ "content_hash": "df1aa177c51dcd03c4fe56859554dcf0", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 80, "avg_line_length": 38.853932584269664, "alnum_prop": 0.6093117408906883, "repo_name": "CDE-UNIBE/qcat", "id": "44215d7dccf2073d5a2bcf0ff2ea1f2ee3ff9372", "size": "3458"...
import sys from setuptools import setup, find_packages from cement.utils import version VERSION = version.get_version() LONG = """ Cement is an advanced CLI Application Framework for Python. Its goal is to introduce a standard, and feature-full platform for both simple and complex command line applications as well a...
{ "content_hash": "a655b5e855bd4b7756262495357a66e7", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 76, "avg_line_length": 26.901960784313726, "alnum_prop": 0.673469387755102, "repo_name": "rjdp/cement", "id": "d1318e7d1b13ec5e2dda1eebcff9d8f531134bb0", "size": "1373", ...
from __future__ import unicode_literals __version__ = "6.2.0"
{ "content_hash": "cfaa779524afebea890dd415ad63de24", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 31, "alnum_prop": 0.6612903225806451, "repo_name": "pombredanne/frappe", "id": "2a69af1984f0914bd7f2a49d978621d9300240b3", "size": "62", "binary": f...
from datetime import timedelta import sys from django.db import transaction, models, router, connection from django.utils import timezone from reversion.models import Revision, Version from reversion.management.commands.deleterevisions import Command as RevisionCommand class Command(RevisionCommand): help = "De...
{ "content_hash": "ed6e3d33fac554106fc974485e4d937b", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 109, "avg_line_length": 39.82236842105263, "alnum_prop": 0.5372542540888815, "repo_name": "kobotoolbox/kobocat", "id": "29b1267a4703d26f66c8723a2ed0423f9077a000", "size": ...
import threading import subprocess import datetime import traceback import shutil import psutil import sys import os import numpy as np from beaker.cache import CacheManager from beaker.util import parse_cache_config_options import logging import time import colorlog from tqdm import tqdm import re from operator imp...
{ "content_hash": "60b00bdbe1a1cd390090bd200011d6f0", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 126, "avg_line_length": 25.330049261083744, "alnum_prop": 0.587709062621548, "repo_name": "yotamfr/prot2vec", "id": "bd5f9973061721562b60e72ec9d4476308ec71e6", "size": "51...
"""\ =========================== Generic 3D Topology Viewer =========================== A 3D version of TopologyViewer plus hierarchy topology support, pygame based display of graph topologies. Rendering and physics laws can be customised for specific applications. Example Usage ------------- A simple console dri...
{ "content_hash": "bedb1863a63aee6024a9c606f7ac0f2a", "timestamp": "", "source": "github", "line_count": 1063, "max_line_length": 234, "avg_line_length": 44.636876763875826, "alnum_prop": 0.5652173913043478, "repo_name": "sparkslabs/kamaelia_", "id": "ccc98c51da020abd80cdd2c8d0124d02e9e0ab4d", "size...
from pip._vendor.requests.packages.urllib3.connectionpool import xrange # Solution to ProjectEuler problem 006 from ProjectEuler.net. # Calculates the difference between the square of the sum and the # the sum of the squares of the first 100 natural numbers. # Created By: Edward Eisenhart # Created On: Apr-08-2015 # C...
{ "content_hash": "ee0b28485bbd91292a1850a86e64b41e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 71, "avg_line_length": 37.05, "alnum_prop": 0.7678812415654521, "repo_name": "EdwardEisenhart/Project_Euler", "id": "e7087c6ea6c84bf4b31146e9e6fd86e220b7295d", "size": "741...
""" Summary ------- Tools for basic data manipulation. """ from __future__ import division import numpy as np from .utils import check_random_state def atleast_3d(x): x = np.asarray(x) if x.ndim >= 3: return x elif x.ndim == 2: return x[np.newaxis, ...] else: return x[np.new...
{ "content_hash": "ea3eac9b177ad577dccf9e7e0f11787c", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 89, "avg_line_length": 24.644549763033176, "alnum_prop": 0.5542307692307692, "repo_name": "cbrnr/scot", "id": "0fe568c3a6ac46ddddcdebbe3614055ef1a124c7", "size": "5320", ...
import instruction import parser import simulator def todec(n): return str(n).zfill(3) simulator.memory = [0 for i in range(99)] def main(): while not simulator.halt_flag: line = raw_input("instruction? ") label, operator, operand, labelref = parser.parseLine(line) instr = instruction.build(operator, operan...
{ "content_hash": "83e3ee08b37f65c53cacb9834252a1de", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 22.571428571428573, "alnum_prop": 0.6632911392405063, "repo_name": "whaleygeek/MyLittleComputer", "id": "d16eb69fc50abf1b8807a5debe7f30093ac31742", "...
""" Test that sockets, inputs, and outputs are functional in python. """ import os, unittest import opensim as osim test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)), 'tests') # Silence warning messages if mesh (.vtp) files cannot be found. osim.Model.setDebugLevel(0) # ...
{ "content_hash": "5a8cad58478370b67d3415da226be1c9", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 94, "avg_line_length": 37.014134275618375, "alnum_prop": 0.6051551312649165, "repo_name": "opensim-org/opensim-core", "id": "feccd8d45044098c1b529c1a98404946481a3df6", "si...
""" Canada-specific Form helpers """ from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.newforms.util import smart_unicode from django.utils.translation import gettext, ugettext import re phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-\...
{ "content_hash": "254a818751c4fdec09e0cabec09444cb", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 101, "avg_line_length": 33.73015873015873, "alnum_prop": 0.6035294117647059, "repo_name": "diofeher/django-nfa", "id": "b40dba833577bbf673466015aacf508455e0443d", "size": ...
from distutils.core import setup setup( name='heimdall', packages=['heimdall'], version='0.0.6', description='A library for taking website screenshots, whilst emulating various devices and resolutions.', author='Distilled R&D', author_email='tom.anthony@distilled.net', url='https://github.c...
{ "content_hash": "508bf7c5b846e901d57ab0f2575bc18b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 110, "avg_line_length": 32.1578947368421, "alnum_prop": 0.6595744680851063, "repo_name": "DistilledLtd/heimdall", "id": "cb07ebf81663389ef6f22a7a8f5f3a3e877ef10b", "size": ...
""" Support for the OpenWeatherMap (OWM) service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.openweathermap/ """ import logging from datetime import timedelta from homeassistant.const import CONF_API_KEY, TEMP_CELCIUS, TEMP_FAHRENHEIT from ho...
{ "content_hash": "510458736242ba179cd9ef584cfc6248", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 34.68452380952381, "alnum_prop": 0.5793718894800068, "repo_name": "aoakeson/home-assistant", "id": "c42519733bab81328420f5f9d800c4d57fdf6baf", "size...
import ingredients #import bestanden uit ingredients.py #whatarewegoingtoeat.py #def randomhoofdgerecht(): # jsonfile = "hoofdgerecht.json" ### # return random.choice(data) d = ingredients. ingredients #linkt an string uit my.data bestand #def main(): # random_hoofd = randomhoofdgerecht() #while True: print "menu...
{ "content_hash": "56c3f1d2b213d9339c869342ed59e6ee", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 65, "avg_line_length": 27.818181818181817, "alnum_prop": 0.6492374727668845, "repo_name": "ArtezGDA/text-IO", "id": "59cddf3e5c8c4547bb4288b227f8897d26c7448a", "size": "947...
import inspect import os import sys from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice currentDir = os.environ["LIBMOTS_TEST_DIR"] sys.path.insert(0, currentDir) import helpers calledScript = inspect.getfile(inspect.currentframe()) device = helpers.getDevice() helpers.createSharedElement(device, True)...
{ "content_hash": "640f3cb994645ecfb6e4b2206d463490", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 77, "avg_line_length": 26, "alnum_prop": 0.8129370629370629, "repo_name": "wlawski/libmots", "id": "a9c407ccea1f4b631255e8ba27f44cf89fc50eb2", "size": "1878", "binary": f...
""" Created by 捡龙眼 3/11/2016 """ from __future__ import unicode_literals, print_function, absolute_import import signal import tornado.ioloop import public.tcp_server import public.global_manager import public.simple_log import public.tcp_client import public.connect_data import config import root_logic.handl...
{ "content_hash": "93c62db8ba428a2680c9aaabe8988b51", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 29.0188679245283, "alnum_prop": 0.7249674902470741, "repo_name": "yanjianlong/server_cluster", "id": "ecf14ea662e41e0eed8ca35d97e4ca67fbd458bc", "siz...
import networkx as nx from collections import deque from itertools import chain, islice, combinations from ClusterUtility import ClusterUtility class KCliquePercolation(object): """This is a class for graph clustering based on k-clique percolation [Farkas2007]_. The procedure will find k-clique. If there is ...
{ "content_hash": "e80f0bf9ef86c03e9646b3fadbc1d6fe", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 117, "avg_line_length": 39.68181818181818, "alnum_prop": 0.5927835051546392, "repo_name": "studiawan/pygraphc", "id": "969947d6f6e186e2ceb1305616a3f0b8aac6b0da", "size": "...
from ._version import version as __version__
{ "content_hash": "52220eb4aa5d6294fbad6b795e2f884d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 44, "avg_line_length": 23, "alnum_prop": 0.717391304347826, "repo_name": "flit/cmdis", "id": "55fcb61e68fbf4535eed62ce379fcd83b3f93d63", "size": "671", "binary": false, ...
"""The testing directory contains a small set of imaging files to be used for doctests only. More thorough tests and example data will be stored in a nipy data packages that you can download separately. .. note: We use the ``nose`` testing framework for tests. Nose is a dependency for the tests, but should no...
{ "content_hash": "849bfa38977e2776f738c0bc94e7f0e6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 69, "avg_line_length": 29.666666666666668, "alnum_prop": 0.7273408239700374, "repo_name": "iglpdc/nipype", "id": "9a4848fb50d6e9538054b47a75b1282eb2656723", "size": "1449",...
import glob import os import shutil from unittest.mock import patch import pytest import settings settings_dir = 'fortest/server1' default_config = {'config': 'default'} dev_config = {'config': 'dev'} prod_config = {'config': 'prod'} site_config = {'config': 'site'} repo_dir = '/tmp/settings-repo' git_settings_subdi...
{ "content_hash": "2036fe7b95be7dfe344ce617b48eccaa", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 86, "avg_line_length": 28.317460317460316, "alnum_prop": 0.6303251121076233, "repo_name": "shon/converge", "id": "6a066019d3f380c14f861fc8649683fd87210ba2", "size": "3568"...
import datetime import hashlib import random import re from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.db import transaction from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ try: fro...
{ "content_hash": "04f5c1bc9bf79beb7077c8d02e5775b5", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 83, "avg_line_length": 40.2043795620438, "alnum_prop": 0.6216412490922295, "repo_name": "ildarsamit/django-registration", "id": "54d9e1086501da2b3ed86e342c2d52353d9c6153", ...
"""Test the dumpwallet RPC.""" import datetime import os import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, ) def read_dump(file_name, addrs, script_addrs, hd_master_addr_old): """ Read the given dump, co...
{ "content_hash": "b60639afe92fbee0ee3c3296ac837d67", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 162, "avg_line_length": 45.648648648648646, "alnum_prop": 0.5808170515097691, "repo_name": "qtumproject/qtum", "id": "0e173d8a6200b36757ca98f2c60c5f929bb4532c", "size": "1...
from keras.layers import Input, Activation, SpatialDropout2D from keras.layers.convolutional import Conv2D, UpSampling2D from keras.layers.normalization import BatchNormalization from keras.models import Model from keras.optimizers import Adam from keras.utils import plot_model def init_CNN_block(input_tensor, ...
{ "content_hash": "0798512988b30621a45284f9677866bf", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 78, "avg_line_length": 41.30379746835443, "alnum_prop": 0.5813668403309837, "repo_name": "nixingyang/Miscellaneous-Projects", "id": "a2a77e95ef6c29c722a59af668c322ac0d800db2"...
from sys import stdout import pprint import psycopg2 # Make a new Grouvie table to store all the plans CREATE_GROUVIE = """ CREATE TABLE GROUVIE( PHONE_NUMBER CHAR(11) NOT NULL, LEADER CHAR(11) NOT NULL, CREATION_DATETIME CHAR(19) NOT NULL, DATE ...
{ "content_hash": "f51476e5bff8d92662d58a53759ffaed", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 80, "avg_line_length": 32.82142857142857, "alnum_prop": 0.6203230936636812, "repo_name": "Team-JETT/Grouvie", "id": "f7eb8928913cb257844804293df7bd496201487c", "size": "11...
"""Tests for tf.contrib.layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import sys # TODO: #6568 Remove this hack that makes dlopen() not crash. if hasattr(sys, 'getdlopenflags') and hasattr(sys, 'setdlopenflags'): import ctypes ...
{ "content_hash": "24528159948b76616287b410b33b4176", "timestamp": "", "source": "github", "line_count": 3333, "max_line_length": 80, "avg_line_length": 41.80858085808581, "alnum_prop": 0.650106208915808, "repo_name": "elingg/tensorflow", "id": "d1b35e33c26df1a706613469355fc5825d10bb6d", "size": "14...
from neutron_lib.callbacks import events as local_events from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources as local_resources from oslo_log import log as logging import oslo_messaging from neutron.api.rpc.callbacks import events from neutron.api.rpc.handlers import resources_rpc fr...
{ "content_hash": "0a3d8fd10f757d4eec8d7e4c27cec7d8", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 79, "avg_line_length": 43.48663101604278, "alnum_prop": 0.6115346778160354, "repo_name": "noironetworks/neutron", "id": "0be8e2e3d9b8869afa4467c63fd455118b28725d", "size":...
import os, sys, random import logging as log from optparse import OptionParser import numpy as np import text.util, unsupervised.nmf, unsupervised.rankings, unsupervised.util # -------------------------------------------------------------- def main(): parser = OptionParser(usage="usage: %prog [options] corpus_file")...
{ "content_hash": "4660e1ffe2c0f2b74806e700d08140e0", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 177, "avg_line_length": 50.62244897959184, "alnum_prop": 0.6609554525297319, "repo_name": "akiratu/topic-stability", "id": "cb77d73b5473ba1916d13f4c909812a4c859eeaf", "size...
import logging import json import urllib.request import itertools import websocket import time import threading import subprocess import signal import tempfile import os import socket from umbra.behaviors import Behavior class BrowserPool: logger = logging.getLogger(__module__ + "." + __qualname__) BASE_PORT ...
{ "content_hash": "5321be8dca17b2ae7a498531505644e5", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 225, "avg_line_length": 43.663333333333334, "alnum_prop": 0.5943201771127568, "repo_name": "vonrosen/umbra", "id": "3176a970ce21b30b91820ef5054bcb6b459a88b9", "size": "131...
from wtforms import SubmitField from app.utils.form import model_form, BaseForm from .models import School class SchoolBase(BaseForm): """ Form for a comment """ field_order = ('*', 'submit') SchoolForm = model_form( School, base_class=SchoolBase) submit_add = SubmitField('Add School') SchoolForm.submit = submit_a...
{ "content_hash": "f1c4b41895808cb932f9f0a652251bad", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 47, "avg_line_length": 26.833333333333332, "alnum_prop": 0.7484472049689441, "repo_name": "codeforanchorage/collective-development", "id": "142f85b22dae45430746dfb70fd66d2903...
from collections import OrderedDict from .. import * from bfg9000.path import Path from bfg9000.shell import windows from bfg9000.safe_str import jbos, literal, shell_literal from bfg9000.shell.list import shell_list class TestSplit(TestCase): def test_single(self): self.assertEqual(windows.split('foo')...
{ "content_hash": "ebe8b74d022774ceb5dfca640c7312f5", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 79, "avg_line_length": 36.342629482071715, "alnum_prop": 0.5340934005700504, "repo_name": "jimporter/bfg9000", "id": "1fa8db6d6e95ccacc456c8229ddb57440c2d6f67", "size": "9...
""" unmature """ def initial_parse_given_csv(): import pandas as pd train = pd.read_csv('sampleSubmission.csv') id = train.Id.values assert len(id) == NUM_TEST dump(id, 'id') train = pd.read_csv('train.csv') xs = train.drop('Id', axis=1) xs = xs.drop('Cover_Type', axis=1).values ys...
{ "content_hash": "8dc20f3aee9d690f2634f787afe0f100", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 47, "avg_line_length": 25.2, "alnum_prop": 0.5873015873015873, "repo_name": "nishio/kagura", "id": "d59300c5a367822cf5e07ce64a7d8a98dd734060", "size": "630", "binary": fa...
import json import re BUG_PATTERN = '([Rr]elated|[Pp]artial|[Cc]loses)-[Bb]ug[:]?[\s]?[#]?([0-9]+)' BUG_RE = re.compile(BUG_PATTERN, re.MULTILINE) def debug(d): print(json.dumps(d, indent=4, sort_keys=True)) EVENTS = [] with open('bugsmash/events') as f: for line in f.readlines(): EVENTS.append(js...
{ "content_hash": "abb6e32216282bccf9d9938ddc45772a", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 79, "avg_line_length": 35.20338983050848, "alnum_prop": 0.5469427058257101, "repo_name": "dolph/gerrit-growler", "id": "adeae84dcda0219acbd54cc02189efde7ace57da", "size": ...
from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('bike', '0004_auto_20170129_2220'), ] operations = [ migrations.AlterField( model_name='bike', n...
{ "content_hash": "60d5b1238e84dfa801bde90a44949ade", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 24.541666666666668, "alnum_prop": 0.5891341256366723, "repo_name": "BridgeCityBicycleCoop/workstand", "id": "b3f25d7619468f69cd081c1937b7376ad5bf96d3",...
import sys, os, shlex, distutils.spawn def main(argv, environ, env_prefix, main_class): prefix = environ.get( env_prefix + 'PREFIX', os.path.abspath(os.path.dirname(os.path.dirname( os.path.realpath(__file__))))) lib = environ.get( env...
{ "content_hash": "ccc9a004ed623802d511db0763733b29", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 69, "avg_line_length": 34.32142857142857, "alnum_prop": 0.5156087408949012, "repo_name": "lisaglendenning/zookeeper-lite", "id": "8233cc9ef7cb18977f76a083332c225acd996fdf", ...
import time def retry_exc_handler(tries_remaining, exception, delay): """ Exception handler for the retry decorator, logs exceptions to the database :param tries_remaining: The number of tries remaining :param exception: The exception instance which was raised :param delay: We will sleep this many...
{ "content_hash": "8398b4cb38b100330be1818421810ec0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 115, "avg_line_length": 40.278688524590166, "alnum_prop": 0.6328856328856329, "repo_name": "dn0z/Steam-Headers-Downloader", "id": "f640179050a1da946531e5254ea247900659d57f", ...
from __future__ import print_function, unicode_literals import weblab.experiment.exc as ExperimentErrors import weblab.experiment.level as ExperimentApiLevel import weblab.core.coordinator.coordinator as Coordinator import json class Experiment(object): def __init__(self, *args, **kwargs): super(Experi...
{ "content_hash": "095bcc6e2a29c79a6449c66d78ba80da", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 124, "avg_line_length": 43.23300970873787, "alnum_prop": 0.660229059061307, "repo_name": "weblabdeusto/weblabdeusto", "id": "1e81a676c89b310ac84d3d2d12f23a85874c7e50", "si...
import os import sys import hashlib import re import redis import MySQLdb import chardet import ConfigParser import subprocess import shlex import binascii import xlrd #import datetime #from dateutil.parser import parse from PyQt4 import QtGui, QtCore from hashlib import sha256 from hmac import HMAC import time import ...
{ "content_hash": "4289eaa675bddc6cd9732223d8b7cbcf", "timestamp": "", "source": "github", "line_count": 2084, "max_line_length": 200, "avg_line_length": 46.29126679462572, "alnum_prop": 0.592385276404308, "repo_name": "joakimzhang/qa_study", "id": "e0943cdc542a0b8a04a5a70feb3e0c5053473b5a", "size":...
import os from core import perf_benchmark from core import platforms from page_sets.system_health import multi_tab_stories from telemetry import benchmark from telemetry import story from telemetry.timeline import chrome_trace_category_filter from telemetry.web_perf import timeline_based_measurement @benchmark.Info...
{ "content_hash": "3bc5357e038cc0e4631c260722762c4b", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 40.17307692307692, "alnum_prop": 0.7520344662517952, "repo_name": "nwjs/chromium.src", "id": "ede18393e7aef2ce896b695754798a2775f9e5c9", "size": "223...
""" Contains tensorflow models and functions """ import sys import tensorflow as tf_ class SilentTF: """ Class to supress deprecation warnings. """ def __init__(self): modules = [] if hasattr(tf_.compat, 'v1'): modules.append(tf_.compat.v1) self.modules = modules def ...
{ "content_hash": "df18b6055a80403021a76487bfec9b69", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 44.163636363636364, "alnum_prop": 0.7443392342527789, "repo_name": "analysiscenter/dataset", "id": "60b4dbdcc47598c13bfd7def2796a6f42cc8e582", "size...
""" WSGI config for kronikka project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
{ "content_hash": "aa52152a995b5891d3d0a818a38c9351", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 44.53125, "alnum_prop": 0.7936842105263158, "repo_name": "Hippu/pilttikronikka", "id": "850c693ab9ab01702b5bc0ea3d3c23a7e84096d0", "size": "1425", ...
""" The homematic rollershutter platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/rollershutter.homematic/ Important: For this platform to work the homematic component has to be properly configured. """ import logging from homeassistant.const im...
{ "content_hash": "fa287e2bcf7f85708108940b851c7917", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 32.89108910891089, "alnum_prop": 0.6243226971703792, "repo_name": "Julian/home-assistant", "id": "4a6b06f925c9bf713f0e73ac45bee2ca96835655", "size":...
""" Generate responsive, embeddable HTML/JS code from URL of online content """ try: from urlparse import urlparse, parse_qs except ImportError: from urllib.parse import urlparse, parse_qs class OnlineContent(object): """ Object to represent a single content on Internet which can be accessed through ...
{ "content_hash": "09e684a1caac98ca4177df63ce3a1be6", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 238, "avg_line_length": 36.26086956521739, "alnum_prop": 0.6103117505995204, "repo_name": "kmonsoor/embedX", "id": "4fc8244bc527a28d9ec9695580e4536a391d2950", "size": "922...
import click import subprocess import configparser import os import posixpath import json import io TB_SCRIPT = """ tell application "Tunnelblick" set connected_configs to name of every configuration whose state = "CONNECTED" return connected_configs end tell """ @click.command() @click.option( "--auth/--no-au...
{ "content_hash": "814d8145d208f82d98f8a1927c4f1d9c", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 102, "avg_line_length": 28.325301204819276, "alnum_prop": 0.6144193960017014, "repo_name": "alexrudy/dotfiles", "id": "8af4681a88a7d8c4ab6651369b528c968c6c2e58", "size": "...
''' Test Website :copyright: (c) 2014-2015 by Openlabs Technologies & Consulting (P) LTD :license: GPLv3, see LICENSE for more details ''' import json from trytond.tests.test_tryton import POOL, USER, DB_NAME, CONTEXT from trytond.transaction import Transaction from test_base import BaseTestCase from dec...
{ "content_hash": "dac430b42a0610106472c06780a72695", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 75, "avg_line_length": 29.007518796992482, "alnum_prop": 0.46578538102643857, "repo_name": "openlabs/nereid-webshop", "id": "7fac74934bdc351d9992aa4a261f27e7023ce3b6", "si...
import itertools import logging import unittest import urllib import environment import keyspace_util import utils from vtdb import dbexceptions from vtdb import vtgate_cursor from vtdb import vtgate_client shard_0_master = None shard_1_master = None lookup_master = None keyspace_env = None create_vt_user = '''cr...
{ "content_hash": "5adfc4ba92c0279616383ead4aef1105", "timestamp": "", "source": "github", "line_count": 1243, "max_line_length": 96, "avg_line_length": 33.30008045052293, "alnum_prop": 0.5542375338229609, "repo_name": "applift/vitess", "id": "058926be51622c69bd262474fb1b4206d20538d3", "size": "4201...
""" A simple echo server. Launch it with: $ ./server.py or: $ ./server.py xml '<?xml version="1.0" encoding="UTF-8" ?><methodResponse><params>\n<param><value><struct>\n<member><name>success</name><value><i4>1</i4></value></member>\n</struct></value></param>\n</params></methodResponse>\n\n\n' Test it with curl: curl h...
{ "content_hash": "af8da2d91a9d38c2e64c0c497a5faef0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 232, "avg_line_length": 28.129032258064516, "alnum_prop": 0.6009174311926605, "repo_name": "nimiq/echo-server", "id": "95dce575197538aae945b993e6473ef5272d6f33", "size": "1...
from mutornadomon.collectors.web import WebCollector # noqa
{ "content_hash": "be75c13dbca54ab8db5224beb0742c77", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 60, "avg_line_length": 61, "alnum_prop": 0.8360655737704918, "repo_name": "francoricci/sapspid", "id": "6443013840baf758ab1215dde050dc73741b9b18", "size": "61", "binary": ...
import getpass import base64 import urllib import urllib2 from datetime import datetime try: import json except ImportError: import simplejson as json def mstr(obj): if (obj == None): return "" return unicode(obj) def gittime(obj): if (obj == None): return None return datetime.strptime(obj[0:19], "%Y-%m-%dT...
{ "content_hash": "790c8aaed45a3435af7ca16e29fb50cd", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 94, "avg_line_length": 22.520833333333332, "alnum_prop": 0.6535615171137835, "repo_name": "Aloomaio/incubator-storm", "id": "c3e734e24a3b6be65a0fc31c1147f70d4159c37b", "siz...
from itertools import chain from typing import Any, Dict from ..compiler.helpers import ( INBOUND_EDGE_DIRECTION, OUTBOUND_EDGE_DIRECTION, FoldScopeLocation, Location, get_edge_direction_and_name, ) from ..compiler.metadata import QueryMetadataTable from ..schema.schema_info import QueryPlanningSch...
{ "content_hash": "9992f5f000ddc6114ca8ac291f6d6e62", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 100, "avg_line_length": 47.997252747252745, "alnum_prop": 0.7174746723141205, "repo_name": "kensho-technologies/graphql-compiler", "id": "c159e093a9d6cf6c977071a5d909417d4eb...
class2rel = { 'Attribution': ['attribution', 'attribution-e', 'attribution-n', 'attribution-negative'], 'Background' : ['background', 'background-e', 'circumstance', 'circumstance-e'], 'Cause' : ['cause', 'cause-result', 'result', 'result-e', 'consequence', 'consequence-n-e', 'consequence-n', 'consequence-s-e', 'c...
{ "content_hash": "1d2710f2ceecdbf7ec1c45c1217de813", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 423, "avg_line_length": 75.88235294117646, "alnum_prop": 0.6744186046511628, "repo_name": "arne-cl/rst_discourse_parser", "id": "829c19d037a0d793df1f877eae30177a98b30525", ...
import os import sys from telemetry import benchmark from telemetry import story from telemetry.core import util from telemetry import decorators from telemetry.page import page as page_module from telemetry.page import page_test from telemetry import record_wpr from telemetry.testing import options_for_unittests from...
{ "content_hash": "303b262fe9bc6f3793ead7d83fa6af22", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 80, "avg_line_length": 39.58974358974359, "alnum_prop": 0.6925734024179621, "repo_name": "SummerLW/Perf-Insight-Report", "id": "9760cb07e602259373cafe776470662bd2d97a38", ...
import os import sys from django.core.management import execute_from_command_line def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "%s.settings" % __package__) execute_from_command_line(sys.argv) if __name__ == "__main__": main()
{ "content_hash": "61b0383dbffe4a93ba02da830872bb2b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 60, "avg_line_length": 20.285714285714285, "alnum_prop": 0.6126760563380281, "repo_name": "novapost/django-generic-filters", "id": "b3cd09a497b5965d70e79c11e91b0abcb0e5675f",...
import sys import logging from sentry_sdk import utils from sentry_sdk.hub import Hub from sentry_sdk.utils import logger from sentry_sdk.client import _client_init_debug from logging import LogRecord class _HubBasedClientFilter(logging.Filter): def filter(self, record): # type: (LogRecord) -> bool ...
{ "content_hash": "06755f47684d1b6df80fbc9f084d2e81", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 84, "avg_line_length": 25.727272727272727, "alnum_prop": 0.651060070671378, "repo_name": "liszd/whyliam.workflows.youdao", "id": "fe8ae50cead3d8e1551427df36fc82393c8594f7", ...
import calendar import datetime import logging import re import socket from typing import Optional, Dict from urllib.parse import quote from uuid import uuid4 import requests from requests.exceptions import RequestException, HTTPError, SSLError from requests.exceptions import ConnectionError from requests.structures i...
{ "content_hash": "76a8376c1026000bc3f8252f0fd74d11", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 120, "avg_line_length": 39.36, "alnum_prop": 0.6317750677506775, "repo_name": "jaywink/social-federation", "id": "e341969204bb8dcc1bffe161ba4f67aab0b0b0a3", "size": "8856"...
""" Script used to create template config.py files for Glue """ from __future__ import absolute_import, division, print_function import os import sys from shutil import copyfile import glue from glue.external.six import input def get_clobber(): result = None result = input("\nDestination file exists. Overw...
{ "content_hash": "3c7540dfcf040402ca6a05546f61273d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 23.88, "alnum_prop": 0.6306532663316583, "repo_name": "saimn/glue", "id": "808d3cfa13d77c5cd931d7de8698a27a5ed1c935", "size": "1216", "binary": fal...
from os_client_config import cloud_config from os_client_config import config from os_client_config import exceptions from os_client_config.tests import base import fixtures class TestEnviron(base.TestCase): def setUp(self): super(TestEnviron, self).setUp() self.useFixture( fixtures....
{ "content_hash": "2352a4b987c54b443fde1020c3941b39", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 79, "avg_line_length": 44.752941176470586, "alnum_prop": 0.5901682439537329, "repo_name": "openstack/os-client-config", "id": "35ce2f2bf4a2b066a28b2dc4185d06d2193a4b51", "...
from django.conf import settings from django.contrib.auth.forms import AuthenticationForm from django.core.urlresolvers import reverse from django.db.models import Count from django.http import Http404, HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, render from django.views...
{ "content_hash": "f332139dd063797f9b340bb18a131af5", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 67, "avg_line_length": 29.31578947368421, "alnum_prop": 0.7459605026929982, "repo_name": "PrincessTeruko/TsunArt", "id": "b2b5ea845ea84b24a43d670472d05e7c9ca6d503", "size":...
import vtk def MakeScalars(dims, origin, spacing, scalars): # Implicit function used to compute scalars sphere = vtk.vtkSphere() sphere.SetRadius(3) sphere.SetCenter(5, 5, 5) scalars.SetNumberOfTuples(dims[0] * dims[1] * dims[2]) for k in range(0, dims[2]): z = origin[2] + spacing[2] *...
{ "content_hash": "3d78cfb2a16320eb2593eff47793b5f4", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 107, "avg_line_length": 28.66187050359712, "alnum_prop": 0.6352911646586346, "repo_name": "lorensen/VTKExamples", "id": "1b0c11acb083f5b8086714eba9e5973ce81d8355", "size":...
import io from django.test import TestCase from cms.models import Page from django.contrib.sites.models import Site from django.core.management import call_command, CommandError from email_user.tests.factories import EmailUserFactory from service_info_cms import utils class BaseMovePagesTest(TestCase): def se...
{ "content_hash": "715439b704e9d2aceb13e811acc28c02", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 97, "avg_line_length": 37.14492753623188, "alnum_prop": 0.6792820912992587, "repo_name": "theirc/ServiceInfo", "id": "a53c1bdd57bc559c5ce2b96235708965ff8817d1", "size": "25...
import mock from neutron_lib import constants from neutron_lib import exceptions as n_exc from oslo_db import exception as db_exc from neutron.api.rpc.handlers import dhcp_rpc from neutron.callbacks import resources from neutron.common import constants as n_const from neutron.common import exceptions from neutron.comm...
{ "content_hash": "6a9ad65ba6be9f623c9cea9072fd1f81", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 79, "avg_line_length": 45.75873015873016, "alnum_prop": 0.5364922991536006, "repo_name": "sebrandon1/neutron", "id": "c8f28e84550921949e04d8a92d757dc62ed1a4e4", "size": "1...
from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), url(r'^testit/', 'imageutil.tests.testapp.views.crop_images', name='testit'), url(r'^%s/(?P<path>.*)$' % settin...
{ "content_hash": "426321d2a02dc4b1bd1cdcd8cd36e1b1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 131, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6923076923076923, "repo_name": "gregplaysguitar/glamkit", "id": "a0366c83736468541aba0d02a2ce4a45eb1f05d8", "siz...
"""Gradients for operators defined in array_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from math import ceil from tensorflow.python.framework import constant_op from tensorflow.python.framework import ops from tensorflow.python.framework im...
{ "content_hash": "921c6b0008a5fcc3b6acdd9401fa10df", "timestamp": "", "source": "github", "line_count": 676, "max_line_length": 80, "avg_line_length": 33.25887573964497, "alnum_prop": 0.6696170439887915, "repo_name": "andrewcmyers/tensorflow", "id": "73a4b7db9f0fb8742e0445c43504ee8b49ad0c94", "size...
from oslo_db import exception as db_exc from oslo_log import log as logging from oslo_utils import uuidutils from tacker.common import exceptions import tacker.context from tacker.db import api as db_api from tacker.db.db_sqlalchemy import api from tacker.db.db_sqlalchemy import models from tacker.objects import base ...
{ "content_hash": "ce569fc4ea842d1faf0e743db12c3e87", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 79, "avg_line_length": 30.152838427947597, "alnum_prop": 0.6149167270094135, "repo_name": "stackforge/tacker", "id": "d5676a69c14ca011cc98c6ff0f541cabb456781c", "size": "7...
from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.re...
{ "content_hash": "f3bf0284a1d9e7824e58a4e3aeee0e45", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 282, "avg_line_length": 47.310483870967744, "alnum_prop": 0.6749339469871303, "repo_name": "Azure/azure-sdk-for-python", "id": "ec6cbe1e365fc50e977e97703d9c22398bc600e6", ...
"""Basic collect and runtest protocol implementations.""" import bdb import os import sys from typing import Callable from typing import cast from typing import Dict from typing import Generic from typing import List from typing import Optional from typing import Tuple from typing import Type from typing import TYPE_CH...
{ "content_hash": "5b123075fbfc11b04cb3780e03288006", "timestamp": "", "source": "github", "line_count": 542, "max_line_length": 87, "avg_line_length": 33.31734317343174, "alnum_prop": 0.6210543803300477, "repo_name": "markshao/pytest", "id": "584c3229d5f416c862a4eacbb434e53e6f334432", "size": "1805...
import unittest from spyne.test.protocol._test_dictdoc import TDictDocumentTest from spyne.protocol.yaml import YamlDocument from spyne import MethodContext from spyne.application import Application from spyne.decorator import srpc from spyne.service import ServiceBase from spyne.server import ServerBase from spyne....
{ "content_hash": "b8303a30744015828a1784ab212a8d7e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 83, "avg_line_length": 28.871794871794872, "alnum_prop": 0.6669626998223801, "repo_name": "deevarvar/myLab", "id": "399d943df5f7569a25a370155c2c76780a15caf2", "size": "1922...
from __future__ import absolute_import import subprocess from django.http import HttpResponse from django.utils.timezone import now as timezone_now from zerver.lib.test_helpers import ( most_recent_message, most_recent_usermessage, POSTRequestMock) from zerver.lib.test_classes import ( ZulipTestCase...
{ "content_hash": "a089508054cb324aa6c62be312de4f96", "timestamp": "", "source": "github", "line_count": 590, "max_line_length": 147, "avg_line_length": 42.383050847457625, "alnum_prop": 0.6220906982324242, "repo_name": "verma-varsha/zulip", "id": "83a48fca9fc64684cc2fbc3b7d3abdb133f84fa1", "size": ...
from tests.test_helper import * class TestCreditCard(unittest.TestCase): def test_create_adds_credit_card_to_existing_customer(self): customer = Customer.create().customer result = CreditCard.create({ "customer_id": customer.id, "number": "4111111111111111", "exp...
{ "content_hash": "e539d1b33d26982f0314876571c9956f", "timestamp": "", "source": "github", "line_count": 841, "max_line_length": 143, "avg_line_length": 40.36504161712247, "alnum_prop": 0.588770730845141, "repo_name": "eldarion/braintree_python", "id": "ebba18528a7542752f5d4766273452cab2d974f0", "si...
from twisted.internet import defer from twisted.trial.unittest import TestCase from scrapy.utils.test import get_crawler from tests.spiders import FollowAllSpider, ItemSpider, ErrorSpider from tests.mockserver import MockServer class TestCloseSpider(TestCase): def setUp(self): self.mockserver = MockServe...
{ "content_hash": "c6831f03473dbf28316b3ae084f85821", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 83, "avg_line_length": 39.903225806451616, "alnum_prop": 0.6709781729991916, "repo_name": "jorik041/scrapy", "id": "1700a861ea6f85baf33a0dde7d25a6b1e4496e1c", "size": "2474...
import re import subprocess from oslo.config import cfg import tempest.cli from tempest.openstack.common import log as logging CONF = cfg.CONF LOG = logging.getLogger(__name__) class SimpleReadOnlyGlanceClientTest(tempest.cli.ClientTestBase): """Basic, read-only tests for Glance CLI client. Checks retur...
{ "content_hash": "8db6e73ebd758233b3ceea5c43b3317b", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 34.861111111111114, "alnum_prop": 0.5920318725099601, "repo_name": "adkerr/tempest", "id": "a5a229c196eb170c72fd9f16adace78815ae5e18", "size": "3191"...
from __future__ import print_function ## batteries import os import sys import pytest ## 3rd party import numpy as np import pandas as pd ## package from SIPSim import Utils from SIPSim.Commands import OTU_PCR as OTU_PCR_CMD # data dir test_dir = os.path.join(os.path.dirname(__file__)) data_dir = os.path.join(test_dir...
{ "content_hash": "7c230e6229ddedb3fe3a1cc850502e94", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 21.681818181818183, "alnum_prop": 0.7044025157232704, "repo_name": "nick-youngblut/SIPSim", "id": "63801b217cea6b4a5526dcb118d298861feb85e9", "size":...
import sys class RedirectStdoutTo: def __init__(self, out_new): self.out_new = out_new def __enter__(self): self.out_old = sys.stdout sys.stdout = self.out_new def __exit__(self, *args): sys.stdout = self.out_old print('A') with open('out.log', mode='w', encoding='utf-8...
{ "content_hash": "9c1b74e0ffeac51bb8276aafc0c1e5b8", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 85, "avg_line_length": 19.35, "alnum_prop": 0.5788113695090439, "repo_name": "ctasims/Dive-Into-Python-3", "id": "84085f66ead6d806617daa969306c3c5291059b9", "size": "387", ...
from lib.samlib import samlib samlib = samlib() resp_login = samlib.login() if "Ogiltig login" in resp_login or resp_login == "": exit("Wrong username/password") else: print "Logged in successfully" samlib.menu()
{ "content_hash": "777c0a08e1016d17164e871b6dc1dbb7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 53, "avg_line_length": 21.8, "alnum_prop": 0.7201834862385321, "repo_name": "flawwan/Samarbeta-Helper", "id": "734b8bdc895a5e72917e29ce3fb93561d210c35c", "size": "242", "...
"""Tests for tensorflow.python.client.session.Session.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import threading import time import numpy as np import six from six.moves import xrange # pylint: disable=redefined-builtin from t...
{ "content_hash": "722480de0e6d1add1fa366e7b6b60594", "timestamp": "", "source": "github", "line_count": 1630, "max_line_length": 80, "avg_line_length": 40.26503067484663, "alnum_prop": 0.6225926377376889, "repo_name": "chenjun0210/tensorflow", "id": "13c2736609075a1a100440cfdae968d0a21f5d81", "size...
from setuptools import setup setup( name='gfm', version='0.0.3', description='Convert GitHub-Flavored Markdown to HTML', long_description=open('README.rst').read(), url='http://github.com/stewart/gfm/', license=open('LICENSE').read(), author='Andrew Stewart', author_email='andrew@stwrt....
{ "content_hash": "abf5f0f7ab8afdcfe9f1b6771e4b357c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 71, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6132478632478633, "repo_name": "stewart/gfm", "id": "82e556b4ffc309cd8a97499d60eb9313054320d0", "size": "936", ...
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) __version__ = None with open(path.join(here, 'cpc_api', '__version.py')) as __version: exec(__version.read()) assert __version__ is not None with open(path.join(here, 'README.md')) as readme: ...
{ "content_hash": "d07abf5c99aeefb13a7baf64ab642a9a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 70, "avg_line_length": 28.26530612244898, "alnum_prop": 0.6418772563176895, "repo_name": "regardscitoyens/cpc-api", "id": "37cf8b6371c68d20e082fbb0f49258f78c1be1fc", "size"...