text
stringlengths
4
1.02M
meta
dict
from __future__ import absolute_import from .datasets import ( load_reward_data, load_neuropixels_data, load_reaching_data, ) __all__ = [ 'load_reward_data', 'load_neuropixels_data', 'load_reaching_data', ]
{ "content_hash": "b74a889cac7fb9ca11942a556a389a7c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 38, "avg_line_length": 17.923076923076923, "alnum_prop": 0.6394849785407726, "repo_name": "codekansas/spykes", "id": "cf699428a2e0e034e1fad0f4a98cabf877220eee", "size": "23...
class Config(object): """Base config class.""" SQLALCHEMY_TRACK_MODIFICATIONS = True SECRET_KEY = 'www.jiar.vip|www.jiar.vip' class ProdConfig(Config): """Production config class.""" pass class DevConfig(Config): """Development config class.""" # Open the DEBUG DEBUG = True # MySQL...
{ "content_hash": "fd4a89aaa68092ae69c87b992a550fa1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 85, "avg_line_length": 27.866666666666667, "alnum_prop": 0.6674641148325359, "repo_name": "Jiar/Flask-Blog", "id": "586585ec903fc184c5eab705f6c7d28de5715a74", "size": "535"...
from test import cassette, sleep, get_client_credentials_session from test.resources.documents import * from test.resources.files import assert_basket_file, assert_weaving_file def test_should_list_files(): session = get_user_session() delete_all_documents() with cassette('fixtures/resources/files/list_f...
{ "content_hash": "9988421fc84883c7f86266446e828158", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 117, "avg_line_length": 33.07602339181287, "alnum_prop": 0.6614214992927864, "repo_name": "Mendeley/mendeley-python-sdk", "id": "95906efad1e4115a6df116e2dab617c31fe3e3f3", ...
from django.shortcuts import render from django.http import HttpResponse from django.template import loader from .models import TweetGroup from datetime import datetime, timedelta from django.utils import timezone import pandas as pd import scrape import json from django.db.models import Max def index(request): re...
{ "content_hash": "6c4f2654dd55edc12130654e466c0d55", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 210, "avg_line_length": 38.39393939393939, "alnum_prop": 0.6882399368587214, "repo_name": "mattcoley/oxbridge-sentiment", "id": "174c37322ff3d4e93bc1e5d1fc214650f441ce52", ...
from rich.console import Console from rich.theme import Theme custom_theme = Theme({"info": "blue", "warning": "magenta", "error": "red"}) console = Console(force_terminal=True, color_system="standard", width=180, theme=custom_theme)
{ "content_hash": "c81a47f6090766febf0be3211095a274", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 94, "avg_line_length": 47, "alnum_prop": 0.7319148936170212, "repo_name": "bolkedebruin/airflow", "id": "175fb7014ea832c226159b3be675ce2346678f55", "size": "1020", "binary...
from redis_shard.shard import RedisShardAPI from config import servers import time client = RedisShardAPI(servers) client.set('test', 1) print client.get('test') client.zadd('testset', 'first', 1) client.zadd('testset', 'second', 2) print client.zrange('testset', 0, -1) print client.zrank('testset', 'second') print cl...
{ "content_hash": "2e57df8a374908c83144a9ffb359e83a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 53, "avg_line_length": 27.457142857142856, "alnum_prop": 0.6722164412070759, "repo_name": "zhihu/redis-shard", "id": "7642ff6dd7617e54ca98ec321f9feb95f077a4c8", "size": "10...
import sys import os import xml.dom.minidom from collections import defaultdict from xml.sax.saxutils import escape as xml_escape, quoteattr try: from docopt import docopt from xmlbuilder import XMLBuilder except Exception, e: print e print 'Required modules: docopt, xmlbuilder' sys.exit(1) class ...
{ "content_hash": "7331ae33d00dbdd6fd5504ca01a62b59", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 78, "avg_line_length": 30.082758620689656, "alnum_prop": 0.5786336542870243, "repo_name": "FauxPasApp/fauxpas-converter", "id": "4274a91a57e4da4db92f1d771173b2db2bab74c9", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import logging from ray.function_manager import FunctionDescriptor import ray.signature # Default parameters for remote functions. DEFAULT_REMOTE_FUNCTION_CPUS = 1 DEFAULT_REMOTE_FUNCTION_NUM_RETU...
{ "content_hash": "db00bf50a26738b68e419f38f34557b9", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 79, "avg_line_length": 42.05161290322581, "alnum_prop": 0.5986498926050936, "repo_name": "atumanov/ray", "id": "44d2777a290000630f38741ae9e344e1b9a52b49", "size": "6518", ...
"""Contains the Display base class, which is a logical display in the mpf-mc.""" from typing import List, Union, Optional from math import floor from kivy.uix.floatlayout import FloatLayout from kivy.clock import Clock from kivy.uix.screenmanager import (ScreenManager, NoTransition, ...
{ "content_hash": "a47a9dd282fd1258f0958fb0f89ec6a6", "timestamp": "", "source": "github", "line_count": 704, "max_line_length": 119, "avg_line_length": 40.40340909090909, "alnum_prop": 0.5995992124876951, "repo_name": "missionpinball/mpf-mc", "id": "a59dbc510e7e0c24750a2047ceb12e83407b2a5b", "size"...
from .settings import * CLJS_LOADER['FIGWHEEL'] = False CLJS_LOADER['CLJS_BUILD'] = Keyword('min')
{ "content_hash": "cd452f5befa5532648fb78b4d0d972eb", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 25, "alnum_prop": 0.7, "repo_name": "jstaffans/django-cljs-loader", "id": "eab8f964b33a8dc89f415bac102239b0dc802d30", "size": "100", "binary": false...
from gevent import monkey; monkey.patch_all() from werkzeug.serving import run_with_reloader from gevent import wsgi from rowboat import ENV from rowboat.web import rowboat from rowboat.sql import init_db from yaml import load import os import copy import click import signal import logging import gevent import subpro...
{ "content_hash": "b6e346d3d3f01c63929c7eb83c05c7bf", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 103, "avg_line_length": 22.089655172413792, "alnum_prop": 0.621604745551046, "repo_name": "justdotJS/rowboat", "id": "eaa4e6a2799c7a6a37692311f3e6880fdd36211d", "size": "3...
import numpy as np import torch from torch import nn import torch.nn.functional as F from maskrcnn_benchmark.structures.bounding_box import BoxList # TODO check if want to return a single BoxList or a composite # object class MaskPostProcessor(nn.Module): """ From the results of the CNN, post process the mas...
{ "content_hash": "196dfe50b59bcee75466115a7ee7fd01", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 87, "avg_line_length": 31.759615384615383, "alnum_prop": 0.587344838026037, "repo_name": "mlperf/training_results_v0.7", "id": "fbe248973919db782a008e687f6067a23eef6f64", ...
from __future__ import unicode_literals from django.db import migrations from django.contrib.postgres.operations import UnaccentExtension class Migration(migrations.Migration): dependencies = [ ('users', '0003_auto_20170919_1335'), ] operations = [ UnaccentExtension() ]
{ "content_hash": "bedf60b8e344e2ca55981e45775f321c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 64, "avg_line_length": 20.533333333333335, "alnum_prop": 0.6948051948051948, "repo_name": "Angoreher/xcero", "id": "e6c9f81f252cc47ce800b7cab7f3064658e5285e", "size": "381"...
from urllib.request import Request, urlopen import xml.dom.minidom req = Request('https://64.103.26.61/api/contextaware/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone') req.add_header('Authorization', 'Basic bGVhcm5pbmc6bGVhcm5pbmc==') response = urlopen(req) responseString = response.read().decode("utf-8") dom =...
{ "content_hash": "7a428569552fb4d2f8bd38f5752a43bb", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 106, "avg_line_length": 41.6, "alnum_prop": 0.7860576923076923, "repo_name": "SivagnanamCiena/coding-skills-sample-code", "id": "7aa08ee22285e2609ea8078849abaa0ca54124a9", ...
class WorkerResult(object): RUNNING = 'RUNNING' SUCCESS = 'SUCCESS'
{ "content_hash": "aec5ac857cdd0e5a3bab0405f3df795f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 27, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6710526315789473, "repo_name": "sinistance/PokemonGo-Bot", "id": "f38ceb9704e7255638e8d67b02c443e3914453ba", "size...
import pandas as pd tips = pd.read_csv('tips.csv') tips['tip_pct'] = tips['tip'] / tips['total_bill'] grouped = tips.groupby(['sex', 'smoker']) grouped_pct = grouped['tip_pct'] print grouped_pct.agg('mean') # == print grouped_pct.mean() print grouped_pct.agg(['mean', 'std'])
{ "content_hash": "06242d2423336c07f7594c6968210c3a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 59, "avg_line_length": 25.454545454545453, "alnum_prop": 0.65, "repo_name": "m1key/data-science-sandbox", "id": "0b541bb8d0b64962580a49f5a07166adc995f01e", "size": "280", ...
"""Helpers for monkey-patching Python code.""" __all__ = [ 'MonkeyPatcher', 'patch', ] class MonkeyPatcher(object): """A set of monkey-patches that can be applied and removed all together. Use this to cover up attributes with new objects. Particularly useful for testing difficult code. "...
{ "content_hash": "91c62c86c82345541d4f6f77b86bb06b", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 78, "avg_line_length": 34.02105263157895, "alnum_prop": 0.6116955445544554, "repo_name": "xujun10110/pth-toolkit", "id": "ba0ac8fd8bfcde02ca6b09a9c27b30724c4f3e98", "size":...
from django.conf import settings from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import include, re_path from django.views.i18n import JavaScriptCatalog from django.views.static import serve from cms.test_utils.project.placeholderapp.views import ex...
{ "content_hash": "762a6fcd9479121cbfd59ad9c8a1fbd9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 84, "avg_line_length": 34.370370370370374, "alnum_prop": 0.6961206896551724, "repo_name": "datakortet/django-cms", "id": "1aeb44d2e96e2f5a1dd06b9ee055f5e8a810b742", "size":...
""" Tests of the new image services, both as a service layer, and as a WSGI layer """ import urlparse from lxml import etree import webob from nova.api.openstack.compute import images from nova.api.openstack.compute.views import images as images_view from nova.api.openstack import xmlutil from nova import exception ...
{ "content_hash": "d46f7448baa2505c2514d4604f933bf6", "timestamp": "", "source": "github", "line_count": 1694, "max_line_length": 79, "avg_line_length": 36.65761511216056, "alnum_prop": 0.437324873586911, "repo_name": "josephsuh/extra-specs", "id": "3b100f3f7cac320a60b39de0cbc07b177f8aac2c", "size":...
import numpy as np import pandas as p from sklearn import metrics from nn.activations import LogisticActivation from nn.layers import FullyConnectedLayer from nn.network import NN data = p.read_csv(r'./data/train.csv') train_set = np.asarray(data) cv_factor = 1.0 / 10 samples_len = 10000 #train_set.shape[0] train_l...
{ "content_hash": "35a5fdfdd709773897577a07228422d3", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 96, "avg_line_length": 28.833333333333332, "alnum_prop": 0.7283236994219653, "repo_name": "alnaav/shredNN", "id": "cbd3b7fb77ae1e7759f4761652ccfad9822d76d1", "size": "1211"...
import breakdancer from breakdancer import Condition, Effect, Action, Driver TESTKEY = 'testkey' ###################################################################### # Conditions ###################################################################### class ExistsCondition(Condition): def __call__(self, state):...
{ "content_hash": "b500e29d3c37199c6e5203d89d4563a3", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 91, "avg_line_length": 24.86936936936937, "alnum_prop": 0.5234558956710741, "repo_name": "zbase/memcached", "id": "bcaeac9caa3d63a4dcc876f1025a6b754471e797", "size": "6139...
''' Clean and trim raw Illumina read files ''' import os import sys import glob import csv import shutil import configparser import subprocess import pandas as pd from secapr.helpers import FullPaths def add_arguments(parser): parser.add_argument( '--input', required=True, action=FullPath...
{ "content_hash": "5fda9cca42724b9da13972c68f825347", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 387, "avg_line_length": 43.4343163538874, "alnum_prop": 0.6045923091167212, "repo_name": "AntonelliLab/seqcap_processor", "id": "2010471f244012fbd7ab3592fca5943e3ff6ca65", ...
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from rest_framework.response import Response from sentry import features from sentry.api.bases.organization import OrganizationEndpoint, OrganizationAdminPermission from sentry.api.exceptions import ResourceDoesNotExist fro...
{ "content_hash": "2688b0886df5c7dba810d9fff5266cef", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 91, "avg_line_length": 39.17857142857143, "alnum_prop": 0.7675478577939836, "repo_name": "beeftornado/sentry", "id": "bc1700e9f29122498ad6c895d3b69870ea3798d2", "size": "10...
import struct import data.libtctrout as libtctrout # Window # | # +-LayeredGameWindow # | # +-MessageWindow # | # +-ChoiceWindow # | # +-InputWindow # | | # | +-ConsoleWindow # | # +-NodeWindow # + # | # +-Inven...
{ "content_hash": "3d4c415812353f4090401501f75f4114", "timestamp": "", "source": "github", "line_count": 877, "max_line_length": 112, "avg_line_length": 31.511972633979475, "alnum_prop": 0.5356419163410044, "repo_name": "RedMike/pYendor", "id": "b1d7c0753e6a212cd1d72504ee0f3c3a0711b3f3", "size": "27...
""" Convert the ASCII download_file_types.asciipb proto into a binary resource. We generate a separate variant of the binary proto for each platform, each which contains only the values that platform needs. """ import os import re import sys # Import the binary proto generator. Walks up to the root of the source ...
{ "content_hash": "88a6dadff118d08854cffa51e3cb090b", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 80, "avg_line_length": 37.1151832460733, "alnum_prop": 0.6819015375934546, "repo_name": "google-ar/WebARonARCore", "id": "651ed98dad4eb62e0c576ad62aa1f958217cbaca", "size"...
from distutils.core import setup, Extension module1 = Extension('hello', sources = ['HelloWorld.c']) setup (name = 'PackageName', version = '1.0', description = 'This is a demo package', ext_modules = [module1])
{ "content_hash": "36bae1bf6d5af7e285df01b7efb1de84", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 28.333333333333332, "alnum_prop": 0.592156862745098, "repo_name": "sniemi/SamPy", "id": "38b285d3a71aa1817fdc82c77e1b32dc714974cf", "size": "255", "...
from django.http import HttpResponse try: from functools import wraps except ImportError: from django.utils.functional import wraps from feincms.module.page.models import Page def add_page_to_extra_context(view_func): """ Adds the best-match page to the extra_context keyword argument. Mainly used ...
{ "content_hash": "c4ce1a6d57925325d305b86198383e49", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 35.44444444444444, "alnum_prop": 0.6702194357366771, "repo_name": "pjdelport/feincms", "id": "8413d1c902c3aa4e863de07f80541914a8ff2383", "size": "159...
import sys from libcloud.compute.base import NodeAuthPassword from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver ECSDriver = get_driver(Provider.ALIYUN_ECS) region = "cn-hangzhou" your_access_key_id = "" your_access_key_secret = "" ecs = ECSDriver(your_access_key_id, your_...
{ "content_hash": "f398aa51d08bf73620233b0b0abd8677", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 25.19736842105263, "alnum_prop": 0.6422976501305483, "repo_name": "apache/libcloud", "id": "537cfdfdd7767b9e640bdf91b16baa58b9961220", "size": "2697"...
"""DBFData is used to provide standard interfaces to the dbfpy library.""" ## # Copyright 2013 Chad Spratt # 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.or...
{ "content_hash": "238d3b47acc440d6d0761e9ad43a5e96", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 79, "avg_line_length": 41.29251700680272, "alnum_prop": 0.5700164744645799, "repo_name": "chadspratt/AveryDB", "id": "e834a57aa908a4cb48829729bb375e537af99d48", "size": "6...
""" __graph_Signal.py___________________________________________________________ Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION ____________________________________________________________________________ """ import tkFont from graphEntity import * from GraphicalForm import * fro...
{ "content_hash": "872d777b32510b6593489c323fe20db4", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 200, "avg_line_length": 41.96774193548387, "alnum_prop": 0.5964642582628747, "repo_name": "levilucio/SyVOLT", "id": "eff5b710c612e619f4e6a773c84b4187637f1431", "size": "260...
import logging import sys from cliff.app import App from cliff.commandmanager import CommandManager from .config import Configurations VERSION = "0.3" class PreprintApp(App): log = logging.getLogger(__name__) confs = Configurations() def __init__(self): super(PreprintApp, self).__init__( ...
{ "content_hash": "8936a01517d0d21a2e9d985b045fd6da", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 25.32, "alnum_prop": 0.608214849921011, "repo_name": "jonathansick/preprint", "id": "85079c6cf71c9d76955eab41215f5a0329b1bfc9", "size": "1266", "bi...
from .MidiOutStream import MidiOutStream class MidiToText(MidiOutStream): """ This class renders a midi file as text. It is mostly used for debugging """ ############################# # channel events def channel_message(self, message_type, channel, data): "...
{ "content_hash": "a3001bb341c29d9f5b244ccc6cd58eb4", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 111, "avg_line_length": 24.1731843575419, "alnum_prop": 0.55095909406055, "repo_name": "nanotone/midihub", "id": "ec0a64c4db59f6f25ff1170c4c41024af51d4777", "size": "4357"...
def flushprint(*args, **kwargs): # type: ignore if "flush" not in kwargs: kwargs["flush"] = True __builtins__["oldprint"](*args, **kwargs) # type: ignore if "oldprint" not in __builtins__: # type: ignore __builtins__["oldprint"] = __builtins__["print"] # type: ignore __builtins__["print"] = f...
{ "content_hash": "13c2989dcb6ead8e2e1fea4dfa65e187", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 68, "avg_line_length": 34.6, "alnum_prop": 0.5982658959537572, "repo_name": "FinnStutzenstein/OpenSlides", "id": "d5f8e4b54dd190a9083876cade574e4b88b44c1f", "size": "392", ...
import os import unittest import numpy as np from tfsnippet.examples.utils import MLResults from tfsnippet.utils import TemporaryDirectory def head_of_file(path, n): with open(path, 'rb') as f: return f.read(n) class MLResultTestCase(unittest.TestCase): def test_imwrite(self): with Tempor...
{ "content_hash": "c5def583af5f38f8f670e94375ba24e5", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 73, "avg_line_length": 32.86486486486486, "alnum_prop": 0.5921052631578947, "repo_name": "korepwx/tfsnippet", "id": "ea5c897364b2fc0c754f6bda985b3a8473d1518a", "size": "121...
import sys # Return the trie built from patterns # in the form of a dictionary of dictionaries, # e.g. {0:{'A':1,'T':2},1:{'C':3}} # where the key of the external dictionary is # the node ID (integer), and the internal dictionary # contains all the trie edges outgoing from the corresponding # node, and the keys are th...
{ "content_hash": "9daf99f767c092d84b2cf0df65e10f9f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 61, "avg_line_length": 32.36363636363637, "alnum_prop": 0.6474719101123596, "repo_name": "xunilrj/sandbox", "id": "5764bed8110a53058ee8784f9588835e4e8a6144", "size": "726",...
"""Support for locks which integrates with other components.""" import voluptuous as vol from homeassistant.components.lock import ( PLATFORM_SCHEMA, STATE_JAMMED, STATE_LOCKING, STATE_UNLOCKING, LockEntity, ) from homeassistant.const import ( CONF_NAME, CONF_OPTIMISTIC, CONF_UNIQUE_ID,...
{ "content_hash": "a471ae166b36eda13d606c1b26125a74", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 86, "avg_line_length": 29.403973509933774, "alnum_prop": 0.6337837837837837, "repo_name": "home-assistant/home-assistant", "id": "8f73796c37c8e816dcc1d4d922b63b8f4d16aebf", ...
import re import itertools from Bio.Restriction import RanaConfig as RanaConf from Bio.Restriction.DNAUtils import complement """ Usage : PrintFormat allow to print the results from restriction analysis in 3 different format. List, column or map. the easiest way to use it is : >>> from Rana....
{ "content_hash": "628e93451411866223863b7dc8cee93d", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 84, "avg_line_length": 32.96277915632754, "alnum_prop": 0.4885576633544113, "repo_name": "dbmi-pitt/DIKB-Micropublication", "id": "5c98b5ca2217910845d7bf50fc66a162e30af296",...
"""TensorFlow API compatibility tests. This test ensures all changes to the public API of TensorFlow are intended. If this test fails, it means a change has been made to the public API. Backwards incompatible changes are not allowed. You can run the test with "--update_goldens" flag set to "True" to update goldens wh...
{ "content_hash": "d32763a76588b8c6b80b6cc1b70d2b80", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 80, "avg_line_length": 37.538243626062325, "alnum_prop": 0.6700626367821296, "repo_name": "seanli9jan/tensorflow", "id": "fb489ea80fbdad0612f5ae0af9d91fa0df534115", "size"...
""" Defines the Singleton metaclass available through :class:`objecttools.Singleton` """ __all__ = ('Singleton',) class Singleton(type): """A metaclass for defining singletons""" def __new__(mcs, name, bases, dict): """ Create a new :class:`Singleton` instance :param name: Name of th...
{ "content_hash": "aecbe2d9afbb5229db84cfc4ae01fad2", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 83, "avg_line_length": 30.01010101010101, "alnum_prop": 0.5382026253786604, "repo_name": "MitalAshok/objecttools", "id": "727ad3ab2932f64c937462269f3bef982c2d0c4f", "size":...
import ansible from ansible.callbacks import vv from ansible.errors import AnsibleError as ae from ansible.runner.return_data import ReturnData from ansible.utils import parse_kv, check_conditional import ansible.utils.template as template class ActionModule(object): ''' Create inventory groups based on variables...
{ "content_hash": "1be9613e6f21b0f9506f997550e32372", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 132, "avg_line_length": 38.956043956043956, "alnum_prop": 0.5858956276445698, "repo_name": "mith1979/ansible_automation", "id": "25c2073fa0fc3a7ec0629a70cb3ed377cf340b19", ...
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.conf.urls.i18n import is_language_prefix_patterns_used from django.http import HttpResponseRedirect from django.urls import get_script_prefix, is_valid_path from django.utils import translation from ...
{ "content_hash": "45ccf3f8bb49252ea83f1ae7007f34b7", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 98, "avg_line_length": 47.37096774193548, "alnum_prop": 0.658835546475996, "repo_name": "asser/django", "id": "c8cbd58685e8c89a3123be7166bf79c49465a01d", "size": "2937", ...
import json import logging import os from ..constants import IS_WINDOWS_PLATFORM DOCKER_CONFIG_FILENAME = os.path.join('.docker', 'config.json') LEGACY_DOCKER_CONFIG_FILENAME = '.dockercfg' log = logging.getLogger(__name__) def find_config_file(config_path=None): paths = list(filter(None, [ config_path...
{ "content_hash": "225d2cfa41f886ee175f0095c291ad27", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 26.12121212121212, "alnum_prop": 0.6305104408352669, "repo_name": "docker/docker-py", "id": "8e24959a5d2163c7ffc9f6ae3f5b467338bfe7e7", "size": "1724...
from __future__ import absolute_import import hashlib import os from pex.common import open_zip from pex.typing import TYPE_CHECKING, Generic if TYPE_CHECKING: from typing import IO, Callable, Iterable, Iterator, Optional, Protocol, Type, TypeVar class HintedDigest(Protocol): @property def b...
{ "content_hash": "466eed5631e44f394e25bd42f80b8169", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 98, "avg_line_length": 28.40392156862745, "alnum_prop": 0.5715863592434074, "repo_name": "pantsbuild/pex", "id": "b239b3124bfc066fce63ea32e22b34ee2cc9faf7", "size": "7375"...
import numpy as np import time import cv2 from threading import Thread #from picamera.array import PiRGBArray #from picamera import PiCamera import openface from sklearn.externals import joblib from livenessDetection import colbp, lpq import threading class DetectFace(Thread): """ Class constructor. Rece...
{ "content_hash": "a2566b84b54511d36a263d5e3be3ce90", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 122, "avg_line_length": 37.818897637795274, "alnum_prop": 0.493649802206954, "repo_name": "psilva-leo/AutonomousDoorman", "id": "b26fce4b41ba58e17c0a5d9341389b9ddc0133ff", ...
import os import logging from pymongo import MongoClient from tornado.httpserver import HTTPServer from tornado.web import Application from tornado.ioloop import IOLoop from tornado.options import options, parse_command_line from jinja2 import ChoiceLoader, FileSystemLoader import settings from lib.template import J...
{ "content_hash": "c1c184a55c300c03635c797bee784866", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 78, "avg_line_length": 32.72164948453608, "alnum_prop": 0.6219281663516069, "repo_name": "leonsim/me", "id": "f458136daa64c83dec12c210f6d29b57d19715ba", "size": "3213", "...
import argparse import os def contains_license_block(source_file): # This check is somewhat easier than in the engine because all sources need to # have the same license. py_license = """# Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that ...
{ "content_hash": "5822207a0a6eb80304fecc7a6668f75c", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 80, "avg_line_length": 24.07894736842105, "alnum_prop": 0.614207650273224, "repo_name": "flutter/engine", "id": "45607b7fb7f957706b5c322a6d8a3da2bb4517e5", "size": "1992", ...
'''Encodings support This is the only module from which functions obtaining encoding should be exported. Note: you should always care about errors= argument since it is not guaranteed that encoding returned by some function can encode/decode given string. All functions in this module must always return a valid enc...
{ "content_hash": "df7382feee5bd96e7a171a5964a6b6ed", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 84, "avg_line_length": 26.276422764227643, "alnum_prop": 0.729269801980198, "repo_name": "S0lll0s/powerline", "id": "76a51d814ce82a7261f9d22a783a062d645b28bc", "size": "32...
import itertools import re from eth_utils import ( remove_0x_prefix, to_dict, ) from .filesystem import ( is_under_path, ) from .string import ( normalize_class_name, ) def is_project_contract(contracts_source_dirs, contract_data): return any( is_under_path(source_dir, contract_data['sou...
{ "content_hash": "9500adcc684cf374ff0b7c1872c00f5b", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 95, "avg_line_length": 28.447257383966246, "alnum_prop": 0.6153960249184218, "repo_name": "pipermerriam/populus", "id": "b224206800b62c952283d171f474684916125ebe", "size":...
import pytest import libqtile.config from libqtile import layout from libqtile.confreader import Config from test.layouts.layout_utils import assert_dimensions, assert_focus_path, assert_focused class ZoomyConfig(Config): auto_fullscreen = True groups = [ libqtile.config.Group("a"), ] layouts...
{ "content_hash": "188b4ccaa9421c7f428dc0ac235266a7", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 90, "avg_line_length": 29.927272727272726, "alnum_prop": 0.6834750911300121, "repo_name": "qtile/qtile", "id": "287e9df6dd13abc92cbc10f45384325bc3ed7d89", "size": "2984", ...
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] class PointersT...
{ "content_hash": "1cba9b67a6706622801314f597a4a603", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 92, "avg_line_length": 33.151041666666664, "alnum_prop": 0.5525530243519245, "repo_name": "MalloyPower/parsing-python", "id": "86429c03c9d116561be633a315fe2864551f87c6", "...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.liuyanqu, name='liuyanqu'), ]
{ "content_hash": "6e14f52a210d2369d13ac9441d8ac8d7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 48, "avg_line_length": 18.428571428571427, "alnum_prop": 0.6356589147286822, "repo_name": "LoveKano/hs_django_blog", "id": "13d316d93c3864b1d6a037814a1af4f210e92119", "size"...
from redis import StrictRedis import json import requests from insight.reader import get_file_for_url from insight.engines import documents from insight.writer import get_thumb_from_cache, have_cache_for_kwargs, get_thumb_path_for_kwargs try: import settings except ImportError: pass REDIS_QUEUE_KEY = getattr...
{ "content_hash": "864278f2140b21b7c29a3801a548f64a", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 97, "avg_line_length": 35.44827586206897, "alnum_prop": 0.5744163424124513, "repo_name": "novapost/insight", "id": "d48e01d62dfe5f143d29df698fb3e575d2c10ae9", "size": "2080...
from __future__ import absolute_import from datetime import time import datetime import pickle import ProcessedTweet import Storage import pigeo from textblob.classifiers import NaiveBayesClassifier from textblob.sentiments import NaiveBayesAnalyzer from textblob import TextBlob import time from textblob import Blobbe...
{ "content_hash": "27d1a914207bf2cff2f4ad16650ab9e8", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 132, "avg_line_length": 40.0625, "alnum_prop": 0.6359854394175767, "repo_name": "juanc5ibanez/WhoLovesMe", "id": "9827819b95b6c96215bfa9029fbfa5f32941a476", "size": "3846",...
from rspecs.commons import DEFAULT_XMLNS from rspecs.commons_com import EMULAB_XMLNS, Sliver from rspecs.parser_base import ParserBase import core logger = core.log.getLogger("utility-rspec") class CRMv3RequestParser(ParserBase): def __init__(self, from_file=None, from_string=None): super(CRMv3RequestPar...
{ "content_hash": "b2ca8e81a41b1431ddd05552eac81354", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 40.34736842105263, "alnum_prop": 0.5570049569527785, "repo_name": "dana-i2cat/felix", "id": "00d5987d1f1694264526a77c5069df7f5f84e7c1", "size": "3833...
import datetime import random from django.conf import settings from django.contrib.auth.models import User, Group from django.contrib.sites.models import Site from django.core.mail import send_mail from django.db import models from django.template.loader import render_to_string from django.utils.hashcompat import sha_...
{ "content_hash": "b6a0f4ca9d688ee681248f116bc84c21", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 111, "avg_line_length": 40.20192307692308, "alnum_prop": 0.636689787132265, "repo_name": "joeatmatterport/django-invitation-simplified", "id": "298bd02d78cb41f90501d6917371c...
"""Abstracts querying Cassandra to manipulate timeseries.""" from __future__ import absolute_import from __future__ import print_function import logging import uuid import os from os import path as os_path import multiprocessing import cassandra from cassandra import murmur3 from cassandra import cluster as c_cluster...
{ "content_hash": "ad697185f31301e98d8d190fd8b3bd8a", "timestamp": "", "source": "github", "line_count": 885, "max_line_length": 99, "avg_line_length": 39.454237288135594, "alnum_prop": 0.6144857805653406, "repo_name": "natbraun/biggraphite", "id": "837cd7d53eb528355f20dd786ab162c98ff2fb35", "size":...
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$May 18, 2015 16:46:39 EDT$" from ._version import get_versions __version__ = get_versions()['version'] del get_versions
{ "content_hash": "0bf9ddd89c1d6f104f239c09256f1f9b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 27.285714285714285, "alnum_prop": 0.6701570680628273, "repo_name": "nanshe-org/splauncher", "id": "11435039ed5de234efaf098456a367671a4e7885", "size": ...
import uuid from cfgm_common import exceptions as vnc_exc from vnc_api import vnc_api import contrail_res_handler as res_handler import sgrule_res_handler as sgrule_handler class SecurityGroupMixin(object): def _security_group_vnc_to_neutron(self, sg_obj, contrail_extensio...
{ "content_hash": "192485ba9c586ef173bf048679e3c49f", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 80, "avg_line_length": 39.171779141104295, "alnum_prop": 0.5534847298355521, "repo_name": "tcpcloud/contrail-neutron-plugin", "id": "060f721edd0194d5e67c6ce8effcb4cebf2c9bbd...
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return [ "UPNP", "UPNPDevice" ] def get_doc_path(): return "doc_classes"
{ "content_hash": "d950911fb61849f01deab903cfabeb1b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 29, "avg_line_length": 14.428571428571429, "alnum_prop": 0.5742574257425742, "repo_name": "mcanders/godot", "id": "8724ff1a511c6c2f21b6e8685479bb2a81e5dc4c", "size": "202",...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding M2M table for field required_courses on 'Job' m2m_table_name = db.shorten_name(u'core_job_required_courses') db.cre...
{ "content_hash": "cfc5b65f30c07bfc936b0cb52e744066", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 209, "avg_line_length": 83.70238095238095, "alnum_prop": 0.550561797752809, "repo_name": "jdaigneau/geoq", "id": "577010d7c7048824bc2c3365ba56ffb4ef4999ac", "size": "14086...
from functional.common import test class QuotaTests(test.TestCase): """Functional tests for quota. """ # Test quota information for compute, network and volume. EXPECTED_FIELDS = ['instances', 'networks', 'volumes'] PROJECT_NAME = None @classmethod def setUpClass(cls): cls.PROJECT_NAM...
{ "content_hash": "a31f784b9e67cf85bc237b07dacc6843", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 38.3, "alnum_prop": 0.6475195822454308, "repo_name": "redhat-openstack/python-openstackclient", "id": "0bc93db283172a48a51d6c726ecabb315093ade5", "si...
import argparse import subprocess import os import time parser = argparse.ArgumentParser(description='A tool to produce a findbugs report for browsing') parser.add_argument('-c', '--classpath', nargs='*', type=str, help='Specify path(s) to .class files') parser.add_argument('-s', '--sourcepath', na...
{ "content_hash": "0079c275f16c8defea0c93ac1b745e0e", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 116, "avg_line_length": 38.67948717948718, "alnum_prop": 0.6794829300629764, "repo_name": "ContemplateLtd/findbugs-reporter", "id": "d409f868be5a697313269401f0eafe4d2018176f"...
"""Any function from n inputs to m outputs""" import logging from itertools import zip_longest import pypes.component log = logging.getLogger(__name__) def default_function(*args): "pass" return args class NMFunction(pypes.component.Component): """ mandatory input packet attributes: - data: f...
{ "content_hash": "e5ad550afa64a91fc381b8ffe7f98b08", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 75, "avg_line_length": 34.244897959183675, "alnum_prop": 0.4940405244338498, "repo_name": "Enucatl/pypes", "id": "34745d31e8528b90201cd45a66d04fa04c2adb86", "size": "3356",...
from __future__ import unicode_literals import jsl from .._compat import iteritems, iterkeys def _indent(line, spaces=4): return ' ' * spaces + line def _get_type_hint(field, class_to_helpers): hint = None if isinstance(field, jsl.BooleanField): hint = 'bool' elif isinstance(field, jsl.Str...
{ "content_hash": "1c555d271fb0931b16019bd307fbb274", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 94, "avg_line_length": 31.705263157894738, "alnum_prop": 0.6394422310756972, "repo_name": "aromanovich/flask-tuktuk", "id": "adcf58caaaa1dfceb9ebd61009fe437fb67c709a", "siz...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/medicine/crafted/shared_medpack_disease_willpower_a.iff" result.attribute_template_id = 7 result.stfName("medicine_name","medic_disease_willpower_a") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ...
{ "content_hash": "47eeb882310de3bba6673b5061ea6bcf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 92, "avg_line_length": 26.23076923076923, "alnum_prop": 0.718475073313783, "repo_name": "obi-two/Rebelion", "id": "8ecb1dd9910cda980a1a9938e6fcbcdb7a00444f", "size": "486",...
import time from pykka.actor import ThreadingActor from pykka.registry import ActorRegistry def time_it(func): start = time.time() func() print('%s took %.3fs' % (func.func_name, time.time() - start)) class SomeObject(object): baz = 'bar.baz' def func(self): pass class AnActor(Thread...
{ "content_hash": "7aa0d584253af25133e74f228b6a41bc", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 66, "avg_line_length": 21.109375, "alnum_prop": 0.6291635825314582, "repo_name": "PabloTunnon/pykka-deb", "id": "3f03c310c171625c7e4bce209389dbdd527f8d87", "size": "1351", ...
import warnings as _warnings _warnings.resetwarnings() _warnings.filterwarnings('error') from tdi import text template = text.from_string(""" Hello [[name]]! Look, hey, this is a text []template]. And here's a list: [item]* some stuff[/item][tdi=":item"] [/] Thanks for [[+listening]]. """.lstrip()) class Model(ob...
{ "content_hash": "a69b87cd1f2f29606271932175c2e1a2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 73, "avg_line_length": 22.03846153846154, "alnum_prop": 0.6387434554973822, "repo_name": "ndparker/tdi", "id": "1fb347af1470667942575d7beaa68a6ebdf6d451", "size": "595", ...
"""Layers using cuDNN.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf from tensorflow.compat.v1 import estimator as tf_estimator from tensorflow.contrib import cudnn_rnn as contrib_cudnn_rnn f...
{ "content_hash": "6e85473bba399306f609c16288cab0fd", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 34.41121495327103, "alnum_prop": 0.6613253666485606, "repo_name": "google-research/language", "id": "d348990fad6568114c92c1a4aa1114232547e067", "siz...
from __future__ import unicode_literals,print_function import six import subprocess import sys import re import h5py import time import numpy as np from vmc_postproc import load def vmc_exec(**kwargs): """ arguments: - nprocs (default 4)` - hosts (default localhost) - slurmqueue (default False) ...
{ "content_hash": "8a2464a52b6a9e3fcfcc925891700639", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 158, "avg_line_length": 35.98347107438016, "alnum_prop": 0.6093247588424437, "repo_name": "EPFL-LQM/gpvmc", "id": "c13acb219dec3778a0f4db0a5d1c9dd392fa154f", "size": "4372...
#!/usr/bin/env python """ This script is used to run tests, create a coverage report and output the statistics at the end of the tox run. To run this script just execute ``tox`` """ import re from fabric.api import local, warn from fabric.colors import green, red if __name__ == '__main__': local('flake8 --ignore...
{ "content_hash": "5b7c03a36c5e079bc62af84be13e5126", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 41.12, "alnum_prop": 0.646887159533074, "repo_name": "bitmazk/django-currency-history", "id": "4731ccc872b1c6ecdd458d44ab5484112b8448d5", "size": "10...
"""plane3.py Representation of a directed plane in 3D. License: http://www.apache.org/licenses/LICENSE-2.0""" from .vector3 import Vector3 class Plane3(object): def __init__(self, normal: Vector3, w: float) -> None: self.__normal = normal self.__w = w @property def normal(self) ->...
{ "content_hash": "06a82ec36dea926687c5ce5b3f292768", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 95, "avg_line_length": 27.790697674418606, "alnum_prop": 0.6092050209205021, "repo_name": "GarrettGutierrez1/FFG_Geo", "id": "83fecec6012394604e419fd8cc7ab0774c1bd158", "si...
import logging import apache_beam as beam from apache_beam import CombineFn from apache_beam import CombineGlobally from apache_beam import Create from apache_beam import Map class AverageFn(CombineFn): """ This is the same as the Mean PTransform, but it's used as an example to show the combiner interface ""...
{ "content_hash": "009c02713663d5b6244212bb12fcf885", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 28.56, "alnum_prop": 0.6967787114845938, "repo_name": "GoogleCloudPlatform/dataflow-cookbook", "id": "fe5fef264bea74ca9d831c56a32f0991b2301694", "siz...
import binascii import uuid from castellan.common.objects import symmetric_key as key import mock from oslo_concurrency import processutils from nova.tests.unit.volume.encryptors import test_cryptsetup from nova.volume.encryptors import luks class LuksEncryptorTestCase(test_cryptsetup.CryptsetupEncryptorTestCase): ...
{ "content_hash": "74a2c260f58e67750b6da99bb1dd54d6", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 79, "avg_line_length": 45.63274336283186, "alnum_prop": 0.5567730049452148, "repo_name": "vmturbo/nova", "id": "dea67176dc240e51edbf7b67f942440b55c242c4", "size": "10989",...
from eclcli.common import command from eclcli.common import exceptions from eclcli.common import utils from ..rcaclient.common.utils import objectify class ListVersion(command.Lister): def get_parser(self, prog_name): parser = super(ListVersion, self).get_parser(prog_name) return parser def ...
{ "content_hash": "00e2a0ad314fdda4d9fee7c2d20cbf78", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 80, "avg_line_length": 30.56896551724138, "alnum_prop": 0.5764241398759166, "repo_name": "anythingrandom/eclcli", "id": "6a36792e3118bbd728395934afc2fb88b528edb3", "size": ...
""" Resource references. """ # Enthought library imports. from enthought.traits.api import Any, HasTraits, Instance # Local imports. from resource_factory import ResourceFactory class ResourceReference(HasTraits): """ Abstract base class for resource references. Resource references are returned from calls...
{ "content_hash": "831d994169a1443fd7b90c74112d4290", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 29.1, "alnum_prop": 0.5316642120765832, "repo_name": "enthought/traitsgui", "id": "34f0f357f72e0a406be9fd706ef38f142a52e3e3", "size": "2679", "bina...
import httplib2 import json from six.moves import urllib from . import config class request: def __init__(self, host, port, network, username, password): self.host = host self.port = port self.network = network self.http = httplib2.Http() self.username = username ...
{ "content_hash": "e613f0f35ff3683da6c56e5ed21106ca", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 72, "avg_line_length": 28.383333333333333, "alnum_prop": 0.6100998238402818, "repo_name": "IsmaelRLG/simpbot", "id": "2ecae62033484c2493e73176cc8c8fa10b629b63", "size": "17...
from sppy.linalg.GeneralLinearOperator import GeneralLinearOperator from sppy.linalg.core import rsvd, norm, biCGSTAB
{ "content_hash": "b0d524f37d125b04d94e64afb007f8b2", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 68, "avg_line_length": 59, "alnum_prop": 0.864406779661017, "repo_name": "ICML14MoMCompare/MoMs-for-StochasticLanguages", "id": "6e731d6e2681aedfbde5b1d234eba52694bcade0", "...
from django.db import models class Skill(models.Model): name = models.CharField(max_length=64) description = models.TextField(blank=True) parent_id = models.IntegerField(default=-1) problem_list = models.TextField(blank=True) priority = models.IntegerField(default=0) @property def parsed_problem_list(s...
{ "content_hash": "5cd816877571408f04669caf221daaeb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 31, "alnum_prop": 0.7320099255583127, "repo_name": "ultmaster/eoj3", "id": "435d8f33117f36d0b0072b53b5919db38e698389", "size": "403", "binary": fal...
from django import forms from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django_comments.forms import CommentForm as CommentFormBase from bearded_comments.models import TComment from bearded_comments.models import TCommentNode from bearded_comments import settings ...
{ "content_hash": "f266587c0c4b5ac69c76e1b64e0d4c7e", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 108, "avg_line_length": 37.6875, "alnum_prop": 0.6907131011608624, "repo_name": "gooslap/django-bearded-comments", "id": "30ea59de2559fb64212d66fd801db5a4f625a179", "size":...
import OSIM.Simulation.Utils as u from OSIM.Modeling.Components.Charge import Charge from OSIM.Modeling.Components.NPN_Vertical_Bipolar_Intercompany_Model.VBIC_ParasitPNP.VBIC_ParasitTransportCurrent import ParasitTransportCurrent import numpy as np from numba import jit class QDBE(Charge): def __init__(self, nod...
{ "content_hash": "180714e3e250561196abd5d37a196c17", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 145, "avg_line_length": 35.16101694915254, "alnum_prop": 0.5994215473608099, "repo_name": "tmaiwald/OSIM", "id": "445b6ed4cd6754303b1ea18b4d46f6b508b54383", "size": "4149"...
""" # Relative Path Markdown Extension During the MkDocs build we rewrite URLs that link to local Markdown or media files. Using the following pages configuration we can look at how the output is changed. pages: - ['index.md'] - ['tutorial/install.md'] - ['tutorial/intro.md'] ## Markdown URLs When l...
{ "content_hash": "c3d6079a5c50e552e0afb8ad8e1f70ba", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 78, "avg_line_length": 33.515151515151516, "alnum_prop": 0.6313291139240507, "repo_name": "cazzerson/mkdocs", "id": "248ea7bf866cfb5fbc1551983cb518b7e23498ac", "size": "44...
"""Use multiprocess to perform COCO metric evaluation. """ # copybara:insert import multiprocessing from REDACTED.mask_rcnn import mask_rcnn_params from REDACTED.mask_rcnn import segm_utils # copybara:strip_begin from REDACTED.REDACTED.multiprocessing import REDACTEDprocess # copybara:strip_end # copybara:strip_begin...
{ "content_hash": "681e95e77f505e84636c093dd70b34d3", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 78, "avg_line_length": 35.819148936170215, "alnum_prop": 0.6721116721116721, "repo_name": "mlperf/training_results_v0.7", "id": "b4d8d03b60d64f6d92a14bd5d4169e3822ec1a39", ...
import argparse import subprocess import yaml import tempfile parser = argparse.ArgumentParser() parser.add_argument('--conf', type=str, default="", dest='configfile', required=True, help='Jenkins configuration file') parser.add_argument('--whitelist', type=str, default="", ...
{ "content_hash": "7b200ade58c57860d5d921055d683877", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 36.23076923076923, "alnum_prop": 0.6369426751592356, "repo_name": "lebauce/skydive", "id": "b2141836df7efe46f1a10e743d962e7beb0fef0b", "size": "961",...
import rospy import time import bson from rosbridge_library.internal.exceptions import InvalidArgumentException from rosbridge_library.internal.exceptions import MissingArgumentException #from rosbridge_library.internal.pngcompression import encode from rosbridge_library.capabilities.fragmentation import Fragmentation...
{ "content_hash": "932107e0874d28723bba22fd4a590930", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 217, "avg_line_length": 42.58702064896755, "alnum_prop": 0.609752718708873, "repo_name": "SNU-Sigma/rosbridge_suite", "id": "fadf587fbfdfdc64a5de06a20e8cdecf43b941dd", "si...
import logging from fuel_upgrade.actions import ActionManager from fuel_upgrade.engines.base import UpgradeEngine from fuel_upgrade.utils import get_required_size_for_actions logger = logging.getLogger(__name__) class BootstrapUpgrader(UpgradeEngine): """Bootstrap Upgrader. """ def __init__(self, *arg...
{ "content_hash": "f0ddbb6cb3bf12fd41ffc4cab88b546b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 26.166666666666668, "alnum_prop": 0.6596906278434941, "repo_name": "Axam/nsx-web", "id": "c32acb24b2571213b1848c814d9e7ebe8856486a", "size": "1734", ...
from django.forms import forms from django.utils.translation import ugettext as _ class SupervisionDocumentForm(forms.Form): document = forms.FileField( label=_('Upload a file'), )
{ "content_hash": "81ce43624fe6556894c4458d0bc7b06c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 50, "avg_line_length": 24.875, "alnum_prop": 0.7185929648241206, "repo_name": "puttarajubr/commcare-hq", "id": "f8d7c78888988e07760ff3ed344c318dd8d13f43", "size": "199", "...
""" Convert an SVG to an EPS file http://stackoverflow.com/questions/9793120/how-to-covert-svg-to-eps-in-ghostscript """ import optparse import os import re import tempfile if __name__ == "__main__": parser=optparse.OptionParser() parser.add_option("--remove","-r",help="Remove .ps file after conversion?",de...
{ "content_hash": "7511b54dbaaac3e712aa3e6b017e9438", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 114, "avg_line_length": 31.83529411764706, "alnum_prop": 0.6016260162601627, "repo_name": "tectronics/agpy", "id": "20291a283b5cc9b3a39647b1cced7297c8ede799", "size": "2728...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import compas from .bbox import * # noqa: F401 F403 if not compas.IPY: from .bbox_numpy import * # noqa: F401 F403 __all__ = [name for name in dir() if not name.startswith("_")]
{ "content_hash": "e989a1794245826e8aa7eadf68fa139c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 62, "avg_line_length": 22.923076923076923, "alnum_prop": 0.6845637583892618, "repo_name": "compas-dev/compas", "id": "57c9d4303daa08887c2b933e8b3d9e2d65036465", "size": "29...
import webapp2 from pages import author_list class AuthorPage(webapp2.RequestHandler): """The jlindber author home page of the GiR App Labs at AAMU app.""" def get(self): """HTTP GET handler for the tlarsen Users page.""" self.response.headers['Content-Type'] = 'text/plain' self.res...
{ "content_hash": "00a4dcaf01bcd5bc02bc8d862d3d8973", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 72, "avg_line_length": 24.176470588235293, "alnum_prop": 0.683698296836983, "repo_name": "GIR-at-AAMU/gir_app_labs_at_aamu", "id": "1a086612c1548ddc138ca2dee8f37a8e0a300b4e",...
from multiverse.msgsys import * from multiverse.server.plugins import * from multiverse.server.engine import * False=0 True=1 voicePlugin = VoicePlugin(); Engine.registerPlugin(voicePlugin);
{ "content_hash": "6852948d0fe6db0efad208595576aa6b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 39, "avg_line_length": 19.4, "alnum_prop": 0.7989690721649485, "repo_name": "longde123/MultiversePlatform", "id": "1df337507a8d5eacba222abb667f1c6b28c6625b", "size": "1412"...
from scrapy.item import Item, Field class KrakItem(Item): # define the fields for your item here like: # name = Field() # pass# company_name = Field() company_site_url = Field() short_description = Field() address = Field() phone = Field() phone_type = Field() gen_description = ...
{ "content_hash": "260a4e2fb4d695380cf06206e8af0290", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 48, "avg_line_length": 24.77777777777778, "alnum_prop": 0.6165919282511211, "repo_name": "0--key/lib", "id": "888a09b848fdd84015221d8d652297a6bccb8e05", "size": "563", "b...
"""Test listing users. """ import datetime import logging 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 LOG = logging.getLogger(__name__) class TestListEmptyProjects(tests_api.TestBase, ...
{ "content_hash": "e1d662e4aba8a730e8cfcbf2d16cf200", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 73, "avg_line_length": 31.847058823529412, "alnum_prop": 0.5411895086811969, "repo_name": "nttdata-osscloud/ceilometer", "id": "572cc99fd6e7e932337e492af794c0d4ce0d02f8", "...
from __future__ import print_function import argparse import email.mime.multipart import email.mime.text import logging import os.path import pickle import re import smtplib import subprocess import sys from datetime import datetime, timedelta from phabricator import Phabricator # Setting up a virtualenv to run this ...
{ "content_hash": "bbb0a5c7ec689a52926b4082f2ce521b", "timestamp": "", "source": "github", "line_count": 633, "max_line_length": 80, "avg_line_length": 37.720379146919434, "alnum_prop": 0.6041378732671608, "repo_name": "apple/swift-llvm", "id": "7bfbec8cfde9e5459274fc25dc3140438ef921e5", "size": "23...
from __future__ import annotations import sys from pathlib import Path import yaml from rich.console import Console if __name__ not in ("__main__", "__mp_main__"): raise SystemExit( "This file is intended to be executed as an executable program. You cannot use it as a module." f"To run this scrip...
{ "content_hash": "881bc1c920e0d5c5d2359baf02841a4c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 103, "avg_line_length": 34.75, "alnum_prop": 0.5367705835331734, "repo_name": "cfei18/incubator-airflow", "id": "803c3c3b9af9f2dc726007ffac6652420bcd66f8", "size": "3309", ...
from __future__ import absolute_import, division, print_function import mock import pytest import workflows.contrib.start_service def test_get_command_line_help(capsys): '''Running the start_service script with --help should display command line help and exit.''' with pytest.raises(SystemExit): workflows.cont...
{ "content_hash": "863f90272ec3ba10580e3511d9ca7854", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 115, "avg_line_length": 54.4375, "alnum_prop": 0.777841561423651, "repo_name": "xia2/workflows", "id": "2165925d37559a45fab5b711be60d07777f9e4d2", "size": "1742", "binary...
import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window and renderer ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.StereoCapableWindowOn() iren = vtk.vtkRenderWindowInteractor() ir...
{ "content_hash": "25723385f188fc8fe2bd383cfa404448", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 80, "avg_line_length": 37.292682926829265, "alnum_prop": 0.7874427730542839, "repo_name": "timkrentz/SunTracker", "id": "17513abc10282222053f2dc214f5925a48cefe48", "size": ...
"""add organization_users table Revision ID: be985ed5f992 Revises: Create Date: 2017-02-28 19:51:48.711414 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = 'be985ed5f992' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_t...
{ "content_hash": "b6a0be71cd24f8cf31a5c3fba38baa5e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 29.575757575757574, "alnum_prop": 0.5973360655737705, "repo_name": "olin-computing/assignment-dashboard", "id": "d4caff6c34539aa2f0b28d11691f596aa86df0...
import sys from pyraf import iraf def run_imstat(input): iraf.images() for image in input: iraf.imstat(image) if __name__ == "__main__": run_imstat(sys.argv[1:])
{ "content_hash": "114409444d35c3010e9059980e567c59", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 28, "avg_line_length": 18.4, "alnum_prop": 0.6086956521739131, "repo_name": "sniemi/SamPy", "id": "146d7b0ba315e3d1c592b6e03652859fc26ee4e5", "size": "207", "binary": fal...
__author__ = 'sim' class Edge: def __init__(self, parent, child): """ :param parent: Node object parent :param child: Node object child """ self.parent = parent self.child = child # assert self.parent != self.child, "Child not allowed to be its own parent."...
{ "content_hash": "5d3ba622563ec2e6a46e48f0f7c474a8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 85, "avg_line_length": 23.53846153846154, "alnum_prop": 0.5800653594771242, "repo_name": "rug-compling/hmm-reps", "id": "5f501f681c6c5305fff12aaf06a4ca79d7804d22", "size": ...
""" Test runner for the JSON Schema official test suite Tests comprehensive correctness of each draft's validator. See https://github.com/json-schema/JSON-Schema-Test-Suite for details. """ from decimal import Decimal import glob import json import io import itertools import os import re import subprocess try: ...
{ "content_hash": "62a55a50c137cacb578bd9023748b48d", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 78, "avg_line_length": 33.602409638554214, "alnum_prop": 0.6287797298912394, "repo_name": "neumerance/cloudloon2", "id": "e95dbbed371a926100f37362c0336da60f91144f", "size"...