text
stringlengths
4
1.02M
meta
dict
from collections import deque import time class Node(object): """Represents a node.""" def __init__(self, name): self.name = name self._visited = 0 self.discovery_time = None self.finishing_time = None def neighbors(self, adjacency_list): return adjacency_list[self...
{ "content_hash": "9c01a27552435a2bc89af3cb8285ed57", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 62, "avg_line_length": 23.68831168831169, "alnum_prop": 0.5570175438596491, "repo_name": "AbhiAgarwal/prep", "id": "cc5330fc10faae7c3d5efb9a0f5af9880a6d9d14", "size": "1824...
import datetime import os import numpy as np import pandas as pd from decouple import config from WindAdapter.enums import Header from WindAdapter.enums import OutputFormat DATA_DICT_PATH = config('DATA_DICT_PATH', default='data_dict.csv') DATA_DICT_PATH_TYPE_ABS = config('DATA_DICT_PATH_TYPE_ABS', default=False, ca...
{ "content_hash": "b3eaa614daaa15f7f2cad7f8d62fcf12", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 137, "avg_line_length": 36.94047619047619, "alnum_prop": 0.6142442797292942, "repo_name": "RoxanneYang/TestCase", "id": "579658ba5bd0436d73b2e1e942ad546a44336374", "size": ...
import os import tempfile from robotide.lib.robot.errors import DataError from robotide.lib.robot.output import LOGGER from robotide.lib.robot.utils import abspath, find_file, get_error_details, NormalizedDict from .variables import Variables class VariableScopes(object): def __init__(self, settings): ...
{ "content_hash": "c3ddd298e8beb4fc44f8304e393f34da", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 90, "avg_line_length": 32.81327800829875, "alnum_prop": 0.5464087000505817, "repo_name": "robotframework/RIDE", "id": "d44f8fe0723ac9daa5ee49f270cd82bf362ce5bc", "size": "...
""" This package contains persistent stores """
{ "content_hash": "4e43bb26626f19d75de90ee3ae816454", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 16, "alnum_prop": 0.7291666666666666, "repo_name": "tcpcloud/openvstorage", "id": "42fccd9e2ab4af81517e022a3835e770ac340b56", "size": "629", "binary...
from django.conf.urls.defaults import url, patterns from django.contrib.auth.views import login, logout from forms import AuthenticationForm from nose.tools import eq_ urlpatterns = patterns('person.views', url(r'^signin/$', login, {'authentication_form': AuthenticationForm}, name='login'), url(r'^si...
{ "content_hash": "cd9efcbcdbe93003bb664f7122b5300c", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 39.54761904761905, "alnum_prop": 0.6104756170981337, "repo_name": "mozilla/FlightDeck", "id": "f6e7b8c3a825ddd789e1409f192e4cf78d033cf2", "size": "16...
"""Real Time Plotting of planning and control""" import math import sys import threading import gflags import matplotlib.pyplot as plt import numpy as np import rospy import common.proto_utils as proto_utils from item import Item from modules.localization.proto.localization_pb2 import LocalizationEstimate from modul...
{ "content_hash": "4d6504a7c815aa8ffca7a4c8dbfbf48e", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 81, "avg_line_length": 32.516, "alnum_prop": 0.540533891007504, "repo_name": "fy2462/apollo", "id": "3ab6846cdb50de2db6f0e75f85778a4be8d213ec", "size": "8912", "binary":...
from celery import Celery from .. import celery_config celery = Celery(__name__, config_source=celery_config)
{ "content_hash": "ce878f125ab420a9bd0a201cf3e050e9", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 54, "avg_line_length": 22.4, "alnum_prop": 0.75, "repo_name": "steinitzu/aptfinder", "id": "a91509d66ac7d5d6362fb23d5f6f7841c4ee76c5", "size": "112", "binary": false, "c...
"""Downloads SVGs into a specified directory.""" from __future__ import print_function import optparse import os import urllib PARENT_DIR = os.path.dirname(os.path.realpath(__file__)) def download_files(input_file, output_dir, prefix, keep_common_prefix): with open(input_file, 'r') as f: lines = f.readlines...
{ "content_hash": "1cb67d0fa6b3b9cc2eda4a857ae5bd9e", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 81, "avg_line_length": 31.06451612903226, "alnum_prop": 0.6438213914849429, "repo_name": "google/skia", "id": "88c6a7fcbf53a59f0514ab9c0a11c8d57ddb92ac", "size": "2115", ...
import sys, socket, time import asyncoro def client_recv(conn, coro=None): conn = asyncoro.AsyncSocket(conn) while True: line = yield conn.recv_msg() if not line: break print(line.decode()) if __name__ == '__main__': asyncoro.logger.setLevel(asyncoro.Logger.DEBUG) #...
{ "content_hash": "0b250cbca3552bf7f2d6175e5b87a2df", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 26.170212765957448, "alnum_prop": 0.5609756097560976, "repo_name": "pgiri/asyncoro", "id": "52d5e9faab6f589f4c54fa6a51b1af4f70db6f8c", "size": "1449"...
""" Constants specific to the SQL storage portion of the ORM. """ from django.utils.regex_helper import _lazy_re_compile # Size of each "chunk" for get_iterator calls. # Larger values are slightly faster at the expense of more storage space. GET_ITERATOR_CHUNK_SIZE = 100 # Namedtuples for sql.* internal use. # How ...
{ "content_hash": "91fabda20616e2d4c314dbf0afa71b4e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 73, "avg_line_length": 23.77777777777778, "alnum_prop": 0.6744548286604362, "repo_name": "georgemarshall/django", "id": "1ff44252c56220d659faaf82e83e5c35b97842b8", "size": ...
'''Test module to thest the xmllib module. Sjoerd Mullender ''' testdoc = """\ <?xml version="1.0" encoding="UTF-8" standalone='yes' ?> <!-- comments aren't allowed before the <?xml?> tag, but they are allowed before the <!DOCTYPE> tag --> <?processing instructions are allowed in the same places as comments ?>...
{ "content_hash": "c4365616938213edfd52cdd0460f10a7", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 71, "avg_line_length": 27.0625, "alnum_prop": 0.6297151655119323, "repo_name": "DecipherOne/Troglodyte", "id": "68b883a0e50f31403353b35220bdf3493dd7b13b", "size": "1299", ...
""" Digital Water - your micro water simulator. By Tom Viner Explanation and see running: https://www.youtube.com/watch?v=OBTUjoc46Pk """ import microbit # define some constants DISPLAY_WIDTH = 5 DISPLAY_HEIGHT = 5 MIN_BRIGHTNESS = 0 MEDIUM_BRIGHTNESS = 4 MAX_BRIGHTNESS = 9 # this is how the accelerometer values ...
{ "content_hash": "177c6a94e1c55f75e189c1868277dbdd", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 32.91596638655462, "alnum_prop": 0.6520296145008936, "repo_name": "tomviner/micro-bit-examples", "id": "75a6879bc820e5aed210b6ce5cca01f82d7b8c2c", "...
from __future__ import absolute_import import os from celery import Celery from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dunning_cruncher.settings') app = Celery('dunning_cruncher', broker='amqp://', backend='amqp://', include=['dunning_cru...
{ "content_hash": "de165988f9c510afc993b7e5a342f963", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 76, "avg_line_length": 22.5, "alnum_prop": 0.674074074074074, "repo_name": "MattBlack85/dunning-cruncher", "id": "3bd40a246978a5f14d84a32e861fe741dfa1b3e0", "size": "540", ...
import requests import sys username = sys.argv[1] password = sys.argv[2] query = 'John' expected_entities_count = 3 if len(sys.argv) > 3: query = sys.argv[3] expected_entities_count = int(sys.argv[4]) status_response = requests.get('http://localhost:21000/api/atlas/admin/status') status = status_response.con...
{ "content_hash": "5af260c21d92136b5ffc6151b0a74f94", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 29.606060606060606, "alnum_prop": 0.6519959058341863, "repo_name": "GoogleCloudDataproc/initialization-actions", "id": "40499fe1bec3e840b4c3af082d0db5a...
"""UEs Handerler.""" from empower.datatypes.etheraddress import EtherAddress from empower.restserver.apihandlers import EmpowerAPIHandlerAdminUsers from empower.main import RUNTIME import empower.logger LOG = empower.logger.get_logger() class UEHandler(EmpowerAPIHandlerAdminUsers): """UE handler. Used to view U...
{ "content_hash": "5ec891b4b3eee31e02dd4a60306f3b5e", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 70, "avg_line_length": 29.72340425531915, "alnum_prop": 0.5755189692197566, "repo_name": "LokiNetworks/empower-runtime", "id": "64cdfc57834aa6dab9ef0725b202c1fda34b51c6", "...
''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License");...
{ "content_hash": "84f1f3a8940ceb0220f4ad2f82f44a1b", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 140, "avg_line_length": 38.386138613861384, "alnum_prop": 0.7363941191643023, "repo_name": "davidbz/trafficserver", "id": "25254ec49ab67ee77d3263d74039f1ca1fc2b674", "size...
from distutils.core import setup setup(name='pygmi', version='0.2', description='Python wmii interaction library', author='Kris Maglione', author_email='maglione.k@gmail.com', url='http://wmii.suckless.org', packages=['pygmi'], license='MIT', )
{ "content_hash": "8e6ccb19f235d399b1d88468dba28d43", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 52, "avg_line_length": 24.5, "alnum_prop": 0.6156462585034014, "repo_name": "bwhmather/wmii", "id": "556d6b60484c53f203ed383167264d6042e4a4ca", "size": "317", "binary": f...
import hmac import random from base64 import b64encode, b64decode from ..util import hash, bytes, XOR from ..sasl import Mechanism, register_mechanism from ..exceptions import SASLCancelled def parse_challenge(challenge): """ """ items = {} for key, value in [item.split(b'=', 1) for item in challenge...
{ "content_hash": "7982f3d5bac4309f0d9e13909a14eeb8", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 78, "avg_line_length": 28.222857142857144, "alnum_prop": 0.5241951812107715, "repo_name": "nicfit/vexmpp", "id": "991c4ce5c3b62331973c3431601fe41a2210922a", "size": "4939"...
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive import fix_spec import sys from thrift.transport import TTransport all_structs = [] class PropValueUnion(object): """ Attributes: ...
{ "content_hash": "93adc0304efcf9f65ddf219aeaa1c0dc", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 199, "avg_line_length": 41.80877192982456, "alnum_prop": 0.5328353824849985, "repo_name": "jcamachor/hive", "id": "e8c169c01fcb48339ecff8065758e3213f18eceb", "size": "2397...
"""Training helper that checkpoints models and creates session.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import time import numpy as np from tensorflow.python.client import session from tensorflow.python.framework import errors fr...
{ "content_hash": "47004efac5bc277c206310a1fc6f2719", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 80, "avg_line_length": 38.4178674351585, "alnum_prop": 0.6708423974195484, "repo_name": "EvenStrangest/tensorflow", "id": "d34e86e896029f81a4e68afc76a2552e82508e50", "size...
import os from unittest import TestCase class CommandLineTest(TestCase): def test_command_line(self): """Ensures command line interface does not contain typos.""" exit_status = os.system('dacsspace --help') assert exit_status == 0
{ "content_hash": "66ba40db01ed5c94396ac182b111c42f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 68, "avg_line_length": 26.2, "alnum_prop": 0.6793893129770993, "repo_name": "RockefellerArchiveCenter/DACSspace", "id": "4c563583256bb550789539def362640fdbfeb6fd", "size": ...
from django.contrib import admin from ..models import FormQuestion, Page from .page_admin import PageAdmin from .question_admin import FormQuestionAdmin admin.site.register(Page, PageAdmin) admin.site.register(FormQuestion, FormQuestionAdmin)
{ "content_hash": "1d7c994b184895fc3a9a86e733178cda", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 52, "avg_line_length": 30.625, "alnum_prop": 0.8326530612244898, "repo_name": "SexualHealthInnovations/django-wizard-builder", "id": "9d7464ef1df437e65010f808668ea7b8d0d45947"...
"""Tests for `tf.data.experimental.copy_to_device()`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized from tensorflow.core.protobuf import config_pb2 from tensorflow.python.data.experimental.ops import prefetching_o...
{ "content_hash": "e9b67ebff7397b8fdd1102c9b2d23ac3", "timestamp": "", "source": "github", "line_count": 573, "max_line_length": 79, "avg_line_length": 38.767888307155324, "alnum_prop": 0.6903754389123976, "repo_name": "renyi533/tensorflow", "id": "b325474daabbb9a65e9e515f7c6fcedc90c5c783", "size": ...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('distutils', parent_package, top_path) config.add_subpackage('command') config.add_subpackage('fcompiler') config.add_subpackage('tests') config.add_data_files('site.cfg...
{ "content_hash": "acb4c16c34987c261f2e29054327fb4e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 65, "avg_line_length": 38.714285714285715, "alnum_prop": 0.7047970479704797, "repo_name": "abalkin/numpy", "id": "88cd1a16083beb8269bff52a73af9481b0bc5ab7", "size": "565", ...
import tests.periodicities.period_test as per per.buildModel((15 , 'H' , 400));
{ "content_hash": "3a1d4197e230a98853d1ec9482a49682", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 20.5, "alnum_prop": 0.7073170731707317, "repo_name": "antoinecarme/pyaf", "id": "04c65a022eae726f758fa4fae3658682dfc9378a", "size": "82", "binary": ...
""" This module defines built-in evaluation functions for regression applications """ from __future__ import absolute_import, division, print_function import numpy as np import pandas as pd from niftynet.evaluation.base_evaluations import BaseEvaluation class BaseRegressionEvaluation(BaseEvaluation): """ Inte...
{ "content_hash": "0194a3fa206b530d9d3ca790b30c473a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 77, "avg_line_length": 31.163265306122447, "alnum_prop": 0.6339227242960053, "repo_name": "NifTK/NiftyNet", "id": "a236e09e624e4c31b85a3d57b47209c43a8575bf", "size": "1551"...
import paddle import paddle.fluid as fluid import numpy as np import unittest from op_test import OpTest def test_static_layer( place, input_np, label_np, reduction='mean', weight_np=None ): prog = paddle.static.Program() startup_prog = paddle.static.Program() with paddle.static.program_guard(prog, st...
{ "content_hash": "a618c3b5e97195f0759ba2454be8640f", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 80, "avg_line_length": 34.56273764258555, "alnum_prop": 0.5614961496149615, "repo_name": "luotao1/Paddle", "id": "c77196c1d0d94ef1ad8ecd4e4b414b30997a89d3", "size": "9701"...
from __future__ import print_function, absolute_import, division import sys import numpy from numba import config, unittest_support as unittest from numba.npyufunc.ufuncbuilder import UFuncBuilder, GUFuncBuilder from numba import vectorize, guvectorize from numba.npyufunc import PyUFunc_One from numba.tests import s...
{ "content_hash": "378e20252d4ab890bed47ba79fc0f688", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 79, "avg_line_length": 32.38157894736842, "alnum_prop": 0.568772856562373, "repo_name": "pitrou/numba", "id": "4749ff103ef8ed7ef5f20addb7fcce7215df5317", "size": "9844", ...
import fileinput import subprocess import os import urllib2 import json def transmit(matrix): req = urllib2.Request('http://localhost:8000/print') req.add_header('Content-Type', 'application/json') return urllib2.urlopen(req, json.dumps(matrix)) for line in fileinput.input(): for char in line.rstrip(...
{ "content_hash": "c66011ca51ff41c5897169bb3fe366b6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 27.708333333333332, "alnum_prop": 0.5729323308270676, "repo_name": "anuragpeshne/LEcho", "id": "1b583413cb7f867b738f57b8ad135ae5df859008", "size": "6...
""" @name: Modules/House/Family/insteon/insteon_button.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2019-2020 by D. Brian Kimmel @note: Created on Aug 18, 2019 @license: MIT License @summary: We get these . """ __updated__ = '2020-02-18' # Import system type stuff ...
{ "content_hash": "6a5f85e14880fe3d9a9edc0ea6b1a602", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 115, "avg_line_length": 20.571428571428573, "alnum_prop": 0.5952380952380952, "repo_name": "DBrianKimmel/PyHouse", "id": "bf6a92f2c90db86c22d391d2bb2140df4922523b", "size":...
import sys for line in sys.stdin: sys.stdout.write(line)
{ "content_hash": "a3864b1ec1e685788c5a5f0d6561a1d0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 26, "avg_line_length": 12.6, "alnum_prop": 0.6984126984126984, "repo_name": "jvanbrug/alanaldavista", "id": "f13dd00a0dcf2cb4e9f43692a80fa42556b00641", "size": "85", "bina...
_base_ = '../cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.py' model = dict( backbone=dict( dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), stage_with_dcn=(False, True, True, True)))
{ "content_hash": "8d31e2a21e2d0a48beb515dd82ebb136", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 72, "avg_line_length": 44.2, "alnum_prop": 0.6425339366515838, "repo_name": "open-mmlab/mmdetection", "id": "3b3683af235f46df36d8793e52c2b9c52e0defeb", "size": "221", "bin...
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ from pyclaw.geotools import topotools from pyclaw.data import Data #-------------------------- def setplot(plotdata)...
{ "content_hash": "22eeace244d97efd23782b3a3d426238", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 76, "avg_line_length": 32.751173708920184, "alnum_prop": 0.6092316513761468, "repo_name": "clawpack/clawpack-4.x", "id": "3b82894ad275c32529ec6add99d1450248ea0e9b", "size"...
""" Example Script for the Python Geographic Visualizer (GeoVis) https://github.com/karimbahgat/geovis """ #importing geovis from temporary location TEMP_GEOVIS_FOLDER = r"C:\Users\BIGKIMO\Documents\GitHub\geovis" import sys sys.path.append(TEMP_GEOVIS_FOLDER) import geovis ############ #SETUP ############ #set rende...
{ "content_hash": "223ea86c0fa5b50f5820252c8ba65e01", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 256, "avg_line_length": 35.951219512195124, "alnum_prop": 0.737449118046133, "repo_name": "karimbahgat/GeoVis", "id": "6e1114882e179cd6e287d044869c9d5c28d221a4", "size": "1...
import abc import json import math from collections.abc import Mapping, Sequence import pprint import numpy as np import hail as hl from hail import genetics from hail.expr.nat import NatBase, NatLiteral from .type_parsing import type_grammar, type_node_visitor from hail.genetics.reference_genome import reference_gen...
{ "content_hash": "528d13da62def9d20661bbedb75f4310", "timestamp": "", "source": "github", "line_count": 1863, "max_line_length": 145, "avg_line_length": 27.208803005904453, "alnum_prop": 0.5616689682383113, "repo_name": "danking/hail", "id": "7ea46b6de366897c200fda0eda6772349b7d5bdb", "size": "5069...
"""This script helps to generate code coverage report. It uses Clang Source-based Code Coverage - https://clang.llvm.org/docs/SourceBasedCodeCoverage.html In order to generate code coverage report, you need to first add "use_clang_coverage=true" and "is_component_build=false" GN flags to args.gn file in you...
{ "content_hash": "ccba0c04b6e581f09a9e41a45c681bef", "timestamp": "", "source": "github", "line_count": 1160, "max_line_length": 107, "avg_line_length": 36.88620689655173, "alnum_prop": 0.6840936711227447, "repo_name": "chromium/chromium", "id": "826496ac40806a6252908c384f65b3a4c7b7de35", "size": "...
""" This module exists only for schema compatibility for existing databases. As soon as Axiom supports removing types from a store, this module can be deleted. """ from axiom.item import Item from axiom import attributes class HyperbolaPublicPage(Item): """ Needed for schema compatibility only. """ in...
{ "content_hash": "2c35815f15a0fb3564f62bf600241a45", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 27.307692307692307, "alnum_prop": 0.7492957746478873, "repo_name": "twisted/hyperbola", "id": "59df026c0d94e9e87467002fa087b05e91bdf882", "size": "35...
import motionSensor import soundPlayer import logging import sys import getopt import glob import random import ConfigParser import datetime import time # ============================================================================== # Globals # -------------------------------------------------------------------------...
{ "content_hash": "cafc061fedec55b6de2faf88a7e47076", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 86, "avg_line_length": 33.03791469194313, "alnum_prop": 0.5696456749390332, "repo_name": "sizlo/RPiFun", "id": "3b5047c8b30a1aa6bca3b142b0c199c7496f55bc", "size": "7190", ...
__author__ = 'kjoseph' import itertools, codecs, sys from multiprocessing import Pool from casostwitter.general_utils import tab_stringify_newline from casostwitter.Tweet import Tweet from collections import defaultdict, Counter import ujson as json from datetime import datetime top_dir = "/usr3/kjoseph/final_minerva...
{ "content_hash": "21cc1130253a6f5889fd61d3e6002b5e", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 106, "avg_line_length": 30, "alnum_prop": 0.5941176470588235, "repo_name": "kennyjoseph/minerva_relig_paper", "id": "cbfa3cc51a1fc014dca7e4931d0778d049d3ace4", "size": "204...
'''Functional tests using WebTest.''' import httplib as http import unittest import re import mock from nose.tools import * # noqa (PEP8 asserts) from framework.mongo.utils import to_mongo_key from framework.auth import exceptions as auth_exc from framework.auth.core import Auth from tests.base import OsfTestCase, ...
{ "content_hash": "0a55407dbc0c7cbcfbf69f10bcf0bb22", "timestamp": "", "source": "github", "line_count": 1385, "max_line_length": 111, "avg_line_length": 38.15595667870036, "alnum_prop": 0.6100556333497332, "repo_name": "lamdnhan/osf.io", "id": "13c48a404482da808446ff683a51e5bbf4c74063", "size": "52...
""" Common code for isolate starters :author: Thomas Calmant :license: Apache Software License 2.0 :version: 1.1.0 .. Copyright 2014 isandlaTech 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 t...
{ "content_hash": "8544b24e7b2faa3716007b1ad33377f7", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 80, "avg_line_length": 28.637795275590552, "alnum_prop": 0.5643387407203739, "repo_name": "isandlaTech/cohorte-devtools", "id": "17b94a4bf3b20e139856e4d8f351aaaa469dc01b", ...
import json from datetime import datetime from trove.common import cfg from trove.common import exception from trove.common import utils from trove.common.exception import ModelNotFoundError from trove.datastore import models as dstore_models from trove.db import get_db_api from trove.db import models as dbmodels from...
{ "content_hash": "1880a9c3074b1171a90bd4a4b44c3a11", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 89, "avg_line_length": 36.34712643678161, "alnum_prop": 0.5764973752450825, "repo_name": "daizhengy/RDS", "id": "e79d33ca8baf5b2c14fb1e3b04aece6b19721735", "size": "16436"...
from my_lib.imagelib import expand2square from PIL import Image im = Image.open('data/src/astronaut_rect.bmp') # ![](data/src/astronaut_rect.bmp) im_new = expand2square(im, (0, 0, 0)) im_new.save('data/dst/astronaut_expand_square.jpg', quality=95) # ![](data/dst/astronaut_expand_square.jpg) im_new = expand2square...
{ "content_hash": "bba120bac6708b98896a99b53f0aac7a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 25.357142857142858, "alnum_prop": 0.7014084507042253, "repo_name": "nkmk/python-snippets", "id": "c297a2fba54477aac1b739050e8ffd981e1f51c8", "size": ...
import json import urllib import urllib2 import sys import datetime from b_bot import BBot from rand_str import RandomString #cmrCollectionsByPage = "https://cmr.earthdata.nasa.gov/search/collections.umm-json?%s=%s&page_size=%s&pretty=true" cmrCollections = "https://cmr.%searthdata.nasa.gov/search/collections?%s=%s&p...
{ "content_hash": "40c4d4836439e9e2212c83bbda1f600d", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 191, "avg_line_length": 36.33673469387755, "alnum_prop": 0.5397360292052794, "repo_name": "jceaser/gcmd_bot", "id": "0f6b7a647545fa43f4976772fee225fd7bd51ca9", "size": "356...
import os from setuptools import setup, find_packages from federation import __version__ description = 'Python library to abstract social web federation protocols like ActivityPub and Diaspora.' def get_long_description(): return open(os.path.join(os.path.dirname(__file__), "docs", "introduction.rst")).read()...
{ "content_hash": "b14b8114656a92aa79143e1455ef42d2", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 105, "avg_line_length": 32.03125, "alnum_prop": 0.6107317073170732, "repo_name": "jaywink/social-federation", "id": "7635666f07cf2f596e5d2cdcce56dfef70e5ad55", "size": "207...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentPortlet', fields=[ ('id', models.AutoField(verbose_name='ID', se...
{ "content_hash": "42c4db7c4db55bf33db1b52efef27a56", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 114, "avg_line_length": 38.67796610169491, "alnum_prop": 0.5297984224364592, "repo_name": "diefenbach/lfc-portlets", "id": "42e8c64f5ce0cfd9efec46ea8992340a3e636364", "size...
import sys from wmr import common from itertools import imap for pair in imap(common.parse_input, sys.stdin): mapper(*pair)
{ "content_hash": "4fbc159dc5d08073cc569b40b23b208f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 48, "avg_line_length": 21.5, "alnum_prop": 0.7596899224806202, "repo_name": "benjamin-guillet/wmr-backend", "id": "f065614ade6e5ff8f05cbf0f5ea2f7b0b3838d41", "size": "711", ...
from __future__ import print_function from yambopy import * from qepy import * from schedulerpy import * from functools import partial import multiprocessing import argparse import sys prefix = "bn" yambo = "yambo" p2y = 'p2y' pw = 'pw.x' layer_separations = [10,15,20,25,30,35,40] scf_kpoints = [ 9, 9,1] nscf_kpoints...
{ "content_hash": "f2da3d98ac769a1a446e352da4f87e64", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 117, "avg_line_length": 34.5188679245283, "alnum_prop": 0.6197048373872642, "repo_name": "palful/yambopy", "id": "76c84ea3b9ab90945cbb0ca4c0f4496ce2ed03fd", "size": "7445"...
"""Test simple functions (i.e. no pointers involved)""" from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import time start = time.time() window = None def drawText( value, x,y, windowHeight, windowWidth, step = 18 ): """Draw the given text at given 2D position in window """ glMa...
{ "content_hash": "c2f91bd33642e1519f0ee8608e76e66b", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 81, "avg_line_length": 28.81896551724138, "alnum_prop": 0.6212982351181573, "repo_name": "frederica07/Dragon_Programming_Process", "id": "bfb81a82ca1eddb294cbef476702ff998a5...
from functools import lru_cache from django import template from django.conf import settings from django.forms.formsets import BaseFormSet from django.template.loader import get_template from crispy_forms.helper import FormHelper from crispy_forms.utils import TEMPLATE_PACK, get_template_pack register = template.Lib...
{ "content_hash": "c9f059388fa9735606aee312eb8f36dc", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 116, "avg_line_length": 38.1764705882353, "alnum_prop": 0.612673343605547, "repo_name": "maraujop/django-crispy-forms", "id": "e5060232f6b8f9ad4348f8f47d008247bd842c37", "...
from mezzanine import template from mezzanine.generic.fields import RatingField from mezzanine.generic.forms import RatingForm register = template.Library() @register.inclusion_tag("generic/includes/rating.html", takes_context=True) def rating_for(context, obj): """ Provides a generic context variable name ...
{ "content_hash": "8b689a6b307dc9fbf48b7a75073d5009", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 34.5, "alnum_prop": 0.6877470355731226, "repo_name": "guibernardino/mezzanine", "id": "ad10d578322d48cb85205df50cd1b192874bca6b", "size": "760", "b...
""" Pytest fixtures """ import os import pytest import icomoon class FixturesSettingsTestMixin(object): """ A mixin containing settings about application. This is almost about useful paths which may be used in tests. Attributes: application_path (str): Absolute path to the application direct...
{ "content_hash": "f74b96709d5880adc4b5a1f0b75a95bc", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 27.934065934065934, "alnum_prop": 0.5869394177812746, "repo_name": "sveetch/django-icomoon", "id": "f54bcec184eedb8db3d9d5e6d3fecd4856839255", "size"...
from __future__ import unicode_literals from django.db import migrations import utilities.fields class Migration(migrations.Migration): dependencies = [ ('dcim', '0031_regions'), ] operations = [ migrations.AlterField( model_name='device', name='name', ...
{ "content_hash": "8b028ea8816a3c57102228d272d52482", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 104, "avg_line_length": 22.736842105263158, "alnum_prop": 0.6203703703703703, "repo_name": "Alphalink/netbox", "id": "e11e75bab3a154eef29f446745c879189c5918aa", "size": "50...
"""This module exposes utility functions and classes for working with pandas objects.""" # third-party libraries import pandas __author__ = 'Amanda Birmingham' __maintainer__ = "Amanda Birmingham" __email__ = "abirmingham@ucsd.edu" __status__ = "prototype" def add_series_to_dataframe(dataframe, series, header): ...
{ "content_hash": "a1e2a7280ad9b88519613ede1541e315", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 102, "avg_line_length": 38.05, "alnum_prop": 0.7069645203679369, "repo_name": "ucsd-ccbb/jupyter-genomics", "id": "bfe6d0825a1bc0d963c2256cdf7f86f7d2a063cb", "size": "761",...
import pytest from pathlib import Path from dstools.pipeline import DAG from dstools.pipeline.tasks import PythonCallable from dstools.pipeline.products import File class MyException(Exception): pass def fn(product, a): Path(str(product)).write_text('things') def fn_w_exception(product): raise MyExcep...
{ "content_hash": "6dc5d3d14a6d5996e04eba720aae9f66", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 61, "avg_line_length": 23.84313725490196, "alnum_prop": 0.6241776315789473, "repo_name": "edublancas/python-ds-tools", "id": "f3fa2cfa43986a918493a102fd4c1ed14490cee2", "si...
""" Defines a representation of a graph in Graphviz"s dot language """ #------------------------------------------------------------------------------ # Imports: #------------------------------------------------------------------------------ import uuid from enthought.traits.ui.api \ import View, Group, VGroup,...
{ "content_hash": "b576ec401202cf0a3882be0d715c3c6f", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 79, "avg_line_length": 34.658307210031346, "alnum_prop": 0.5349131693198264, "repo_name": "rwl/godot", "id": "cf9ae73fecbe5a1db601024278183660d0e8b67a", "size": "12330", ...
import unittest from unittest import skip class InitializationTests(unittest.TestCase): def test_import_ingestion(self): """ Check import 'ingestion' as a whole package """ try: import ingestion except ImportError: self.fail("Was not able to import i...
{ "content_hash": "3b7e6ba515a03bed63bd24f50697f237", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 57, "avg_line_length": 23.7, "alnum_prop": 0.5886075949367089, "repo_name": "georgetown-analytics/housing-risk", "id": "4b57a2bc09f3cdf5d6ec2478b99b6cb84226caa6", "size": "...
from collections.abc import Iterable from numbers import Real, Integral from warnings import warn import numpy as np import openmc.checkvalue as cv from openmc.stats import Tabular, Univariate, Discrete, Mixture, \ Uniform, Legendre from .function import INTERPOLATION_SCHEME from .angle_energy import AngleEnergy ...
{ "content_hash": "7309991aed09f77e7943b948ae1a7dec", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 88, "avg_line_length": 35.93260869565217, "alnum_prop": 0.537237582430879, "repo_name": "wbinventor/openmc", "id": "b760f2e2fdae8e8bf0d27c9d140c80ea8c4bc397", "size": "165...
from OpenstackConnection import * from TestConnection import * from Exceptions import *
{ "content_hash": "fdc0c8f416662240e7b4a6a5d045bf6c", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 29.333333333333332, "alnum_prop": 0.8295454545454546, "repo_name": "LAL/openstack-lease-it", "id": "be8b218f5d11c77428b0b78535c96aa841ba9c75", "size":...
import configuration import logging from google.appengine.api import users, memcache from google.appengine.ext import db, ereporter from google.appengine.ext.webapp.util import run_wsgi_app, login_required from tornado.wsgi import WSGIApplication from utils import BaseRequestHandler, SessionRequestHandler, send_mail_o...
{ "content_hash": "79cd323a50e704f24942d801fc82fdc3", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 126, "avg_line_length": 35.02212389380531, "alnum_prop": 0.5677826910928616, "repo_name": "yesudeep/old-milsalumni", "id": "921b872bedf9fb4730d48ab4970ce2b40534dcf6", "siz...
import sys from passslot import __version__ from setuptools import setup # To install the passslot-python-sdk library, open a Terminal shell, then run this # file by typing: # # python setup.py install # # You need to have the setuptools module installed. Try reading the setuptools # documentation: http://pypi.python....
{ "content_hash": "696dd553eab1ce4fbc6e673830f87088", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 82, "avg_line_length": 32.86274509803921, "alnum_prop": 0.6390214797136038, "repo_name": "passslot/passslot-python-sdk", "id": "d0ceaf3070adf4ae0ab4331f979234cb9d54cab9", "...
import unittest import pathlib import json from mycroft.dialog import MustacheDialogRenderer class DialogTest(unittest.TestCase): def setUp(self): self.stache = MustacheDialogRenderer() self.topdir = pathlib.Path(__file__).parent def test_general_dialog(self): """ Test the loading an...
{ "content_hash": "fb4fb4eec199109d035027189670a875", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 40.49180327868852, "alnum_prop": 0.5323886639676113, "repo_name": "linuxipho/mycroft-core", "id": "3cd9ab5f7d58277d7795550892f9d32ff9b76964", "size":...
import unittest import google import mock from google.cloud.bigtable import Client from google.cloud.bigtable.instance import Instance from mock import PropertyMock from airflow import AirflowException from airflow.providers.google.cloud.hooks.bigtable import BigtableHook from tests.providers.google.cloud.utils.base_...
{ "content_hash": "5b4a8091752d8824bc887e1714bba711", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 100, "avg_line_length": 50.54988399071926, "alnum_prop": 0.6936246385459219, "repo_name": "mtagle/airflow", "id": "dc0ba6e7c72eeaec5d15e2f7268ecd6488602303", "size": "2257...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "csinfo.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is real...
{ "content_hash": "e74d3d4937cd36200f732dfd7c453ac8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.23809523809524, "alnum_prop": 0.6202046035805626, "repo_name": "hcrudolph/ciphersuite.info", "id": "8b20de284874c40831b6223951ca0d01137f301c", "si...
import json from collections import abc def load_profiles(strings): """Load profiles from a list of strings Parameters ---------- strings : [str] A list of strings that are file names or json, and represent either a single profile or a list of profiles. Returns ------- pr...
{ "content_hash": "451f4a96e15cf3cc9ed47e6615497627", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 77, "avg_line_length": 25.838709677419356, "alnum_prop": 0.5580524344569289, "repo_name": "yackj/GameAnalysis", "id": "889c5cf246c6950b96dc330514101be8f4565358", "size": "8...
import pkg_resources import argparse import logging import textwrap import os import sys import megdc __header__ = textwrap.dedent(""" Megam System megdc-%s Full documentation can be found at: http://docs.megam.io """ % megdc.__version__) def log_flags(args, logger=None): logger = logger or LOG logg...
{ "content_hash": "1759b7654d636a00630270695535f1dd", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 23.86868686868687, "alnum_prop": 0.5670757511637748, "repo_name": "vijaykanthm28/megdc.py", "id": "bfee43f4f6757cfaf534c81c0f19b95d0d9d96c8", "size":...
"""This pipeline is intended to make the classification of MRSI relative quantification modality features.""" from __future__ import division import os import numpy as np from sklearn.externals import joblib from sklearn.preprocessing import label_binarize from sklearn.ensemble import RandomForestClassifier from pro...
{ "content_hash": "4fd54fb9989cba1f22933fd06bea18c8", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 90, "avg_line_length": 40.313559322033896, "alnum_prop": 0.669539625814589, "repo_name": "I2Cvb/mp-mri-prostate", "id": "06d084377bda165379ff1db05b459ba6787d6ca2", "size":...
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless import warnings from django import forms from django.core.exceptions import FieldError from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import Validati...
{ "content_hash": "2015f137442ce3149d18180124edc4d5", "timestamp": "", "source": "github", "line_count": 1879, "max_line_length": 219, "avg_line_length": 41.68653539116551, "alnum_prop": 0.6016290262865606, "repo_name": "yceruto/django", "id": "bf7b3d296aa1ff1f10e9070016938791aab6995f", "size": "783...
import tornado.web from .handlers.ping import PingHandler from .handlers.run import RunHandler def get_application(**settings): return tornado.web.Application([ (r"/ping", PingHandler), (r"/api/v1/run", RunHandler), ], **settings)
{ "content_hash": "a7fae2876e9d895ef1985e488d8aba3f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 23.454545454545453, "alnum_prop": 0.6782945736434108, "repo_name": "asimihsan/vocalsalad", "id": "d782b0f2acb1ad40843a1d277b0847695213e87f", "size": ...
"""Create hybrid foil coefficient dataset from Sheldahl and Jacobs data.""" from __future__ import division, print_function import numpy as np import pandas as pd from scipy.stats import linregress # Default CACTUS 0021 data has zero for all moment coeffs zero_cms = True # Whether or not to calculate lift slopes cal...
{ "content_hash": "15fc18110a9910600d92c493d8b5180b", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 92, "avg_line_length": 35.26712328767123, "alnum_prop": 0.6407069333851233, "repo_name": "UNH-CORE/RM2-CACTUS", "id": "76a0ad9a6d792c16b86d251049c7131cf557690e", "size": "...
from django.core.exceptions import ObjectDoesNotExist from djblets.util.decorators import augment_method_from from djblets.webapi.decorators import (webapi_login_required, webapi_response_errors, webapi_request_fields) from djblets.webapi.err...
{ "content_hash": "6e6490fde56e06310c26126b2ee4b1cd", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 79, "avg_line_length": 38.626506024096386, "alnum_prop": 0.5828134747348721, "repo_name": "reviewboard/reviewboard", "id": "4c9097a471f41629ebdd9369e6ad8ee686f930c6", "siz...
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 model 'ReportingPeriod' db.create_table(u'pa_reportingperiod', ( (u'id', self.gf('django.db.models.fields.AutoF...
{ "content_hash": "3ae4115014b416cbb49d12bea5ef0f72", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 187, "avg_line_length": 57.91244239631337, "alnum_prop": 0.5756345985517626, "repo_name": "Mathew/psychoanalysis", "id": "696b8d5235b1a8395663cfa5a23fbb4d6a44abda", "size"...
import bs4 import config import re import requests import sqlite3 from datetime import datetime from uuid import UUID, uuid4 PATH = "chat.sqlite" class Show(object): def __init__(self, show_str): self.show_str = show_str.strip() self.date = datetime.strptime(self.show_str.split()[0], '%d.%m.%Y'...
{ "content_hash": "345c77f634a4814d5f821888e8e92e5c", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 77, "avg_line_length": 27.328767123287673, "alnum_prop": 0.5453634085213033, "repo_name": "suspectpart/alfachat", "id": "f321fb36a3d1bb1936e508bbf5affa5ddd2eb986", "size":...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "d8020e077061305d8e05e9e7964d059f", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 219, "avg_line_length": 28.068292682926828, "alnum_prop": 0.6958637469586375, "repo_name": "mahabs/nitro", "id": "4b79104da37498b8b3a326ff8c89df6d7f52dbfa", "size": "6368"...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.contrib.auth import get_user_model from helpdesk.settings import DEFAULT_USER_SETTINGS def pickle_settings(data): """Pickling as defined at migration's creation ti...
{ "content_hash": "d97625949ec6abf67190fda7bef3225b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 195, "avg_line_length": 56.157303370786515, "alnum_prop": 0.5916366546618648, "repo_name": "harrisonfeng/django-helpdesk", "id": "8b0514b283e76ed117259ba00cb8275744291bb5", ...
from django.contrib import messages from django.conf import settings from django.core.urlresolvers import reverse, NoReverseMatch from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from django.template ...
{ "content_hash": "a8acad6ca1fcb800c8f00f64d7b3ab40", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 81, "avg_line_length": 41.376543209876544, "alnum_prop": 0.48023273161271074, "repo_name": "designcc/django-cccheckout", "id": "50e04f9ef995a4cba05420af14e4c3bc28e1ccbd", ...
""" Automatic file """ from app.logic.commandrepo.controllers import CommandController
{ "content_hash": "5d8f748ec7588ad61c6c6f5b2086bfb0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 63, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7954545454545454, "repo_name": "imvu/bluesteel", "id": "71e6d2c73c9d0e497eaa69bdcb5f9ce220c3cfe6", "size": "88", ...
"""Pickle related utilities. Perhaps this should be called 'can'.""" __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
{ "content_hash": "0913ad883ddd8215695768d2bc407fd0", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 86, "avg_line_length": 28.039772727272727, "alnum_prop": 0.5252279635258359, "repo_name": "marcoantoniooliveira/labweb", "id": "04ac8827f519a1acaab0fbe2e5a0253157811c1c", ...
from django.db import models # import django.contrib.auth.models as auth from django.contrib.auth.models import User # from django.conf import settings class UserProfile(models.Model): user = models.OneToOneField(User) def __str__(self): return self.user.get_username() class Task(models.Model): id = models.Auto...
{ "content_hash": "2a7eb0a7a12ef9ae8a27d733749f27e8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 72, "avg_line_length": 31.074074074074073, "alnum_prop": 0.7508939213349225, "repo_name": "jailuthra/taskzilla", "id": "1e6028b97409f179a0fde2231acf66e7f0034041", "size": "...
'''Tests for youtube playlist''' from unittest.mock import patch from chineurs import youtube_playlist @patch('chineurs.youtube_playlist.requests', autospec=True) def test_insert_videos(requests): '''Make HTTP calls to the youtube API''' requests.post.return_value = 5 assert youtube_playlist.insert_vide...
{ "content_hash": "f576fb72388dffc57fb49cac95e8d486", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 75, "avg_line_length": 25.517241379310345, "alnum_prop": 0.4560810810810811, "repo_name": "jroitgrund/chineurs", "id": "d12dbc629f95e89a7e2ddc5df92d4ada17d0bdb7", "size": "...
import os import pathlib import sys if len(sys.argv) < 3: sys.exit('usage: replacer.py <pattern> <replacement>') source_root = pathlib.Path(os.environ['MESON_DIST_ROOT']) modfile = source_root / 'prog.c' contents = modfile.read_text() contents = contents.replace(sys.argv[1], sys.argv[2]) modfile.write_text(cont...
{ "content_hash": "f12436165b0944a7e64aefd24e1f7306", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 23.285714285714285, "alnum_prop": 0.7177914110429447, "repo_name": "mesonbuild/meson", "id": "96ccdcc8bf2c308b38f86271815c340b01229705", "size": "350...
import logging import pkg_resources import six from novaclient import exceptions from novaclient import utils logger = logging.getLogger(__name__) _discovered_plugins = {} def discover_auth_systems(): """Discover the available auth-systems. This won't take into account the old style auth-systems. "...
{ "content_hash": "ff401d2ab6a3a7db81666ff003b92bff", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 78, "avg_line_length": 30.519685039370078, "alnum_prop": 0.6439628482972136, "repo_name": "neumerance/deploy", "id": "843489788435b195e5a1762d2455452ee07c475f", "size": "4...
from console import Console class GUI: class Managers: class Console: def show(self, screen): Console.Output.clear() screen.draw(self) def show_dialog(self, screen): screen.draw(self) class Dialogs: class OptionsBox: ...
{ "content_hash": "1e02867abbb8b067a11c2faef233d3a5", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 32.583333333333336, "alnum_prop": 0.4840153452685422, "repo_name": "FetzenRndy/Creative", "id": "396e13b9bfeb3c6845f1c82aca2d58a6695aac6e", "size": "...
"""Translation string lookup helpers.""" import logging from typing import Any, Dict, Iterable, Optional from homeassistant import config_entries from homeassistant.loader import async_get_integration, bind_hass from homeassistant.util.json import load_json from .typing import HomeAssistantType _LOGGER = logging.getL...
{ "content_hash": "3dfc9b3f2cee158d67a95bd9a8e326ae", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 78, "avg_line_length": 35.23489932885906, "alnum_prop": 0.6582857142857143, "repo_name": "auduny/home-assistant", "id": "4f655e692f74dcd2c7374c94449ff72f013d15dd", "size":...
from plotly.graph_objs import Layout
{ "content_hash": "459d286594a9a2ae79d248917c1e05f1", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.8378378378378378, "repo_name": "plotly/python-api", "id": "058b60b807ddad489df88882a1a46dcf430ce19a", "size": "37", "binary": fa...
from itertools import islice import time from django.conf import settings from django.db import connection from django.template.loader import render_to_string class Frelic(object): """docstring for Frelic""" def __init__(self): self.start_time = time.time() self.template_num = 0 self....
{ "content_hash": "29916d47791b0b3e2e310af11486b8fa", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 77, "avg_line_length": 33.67741935483871, "alnum_prop": 0.6101532567049809, "repo_name": "glasslion/django-frelic", "id": "211b47a286f686e9da6c2d0e6fd74c37f199ee16", "size"...
""" Django settings for homeinventory project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ imp...
{ "content_hash": "f786fbbfa2c78eaeb01a8bbf07724ece", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 91, "avg_line_length": 25.124031007751938, "alnum_prop": 0.6862079605060166, "repo_name": "Drabant/homeinventory", "id": "fa849c6a4e57498afd012eb1b2f30f2ab30ef8fa", "size"...
import sys import os import re import sendmail import config out = sys.argv[1] err = sys.argv[2] hostname = sys.argv[3] if not os.path.exists(out) or not os.path.exists(err): sendmail.send(config.DEVS, "Failed to read results from '%s'" % hostname, "Failed to read files: '%s'...
{ "content_hash": "ae23376f1b78fece1127a7c565baa4c9", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 82, "avg_line_length": 27.375, "alnum_prop": 0.5388127853881278, "repo_name": "dstaple/z3test", "id": "9e99629766c4c00c6105a3ca8a8472906343fb0b", "size": "1058", "binary"...
import socket import threading import time from org.apache.flink.api.common.functions import FlatMapFunction, ReduceFunction from org.apache.flink.api.java.functions import KeySelector from org.apache.flink.streaming.api.windowing.time.Time import milliseconds from org.apache.flink.streaming.util.serialization import S...
{ "content_hash": "723b195c62d1e20686eb54a408d443f3", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 103, "avg_line_length": 28.280898876404493, "alnum_prop": 0.6249503377036154, "repo_name": "zohar-mizrahi/flink", "id": "aa322ce4675915036587149d1daf2c3ef0be595b", "size": ...
import contextlib import functools import mock from django.http import HttpRequest from nose import SkipTest from nose.tools import assert_equal, assert_not_equal from framework.auth import Auth from website.archiver import ARCHIVER_SUCCESS from website.archiver import listeners as archiver_listeners def requires_mo...
{ "content_hash": "f6cf9015201664f9046827349db34e6f", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 95, "avg_line_length": 36.651162790697676, "alnum_prop": 0.6592639593908629, "repo_name": "njantrania/osf.io", "id": "fdc02f49a56410d97a35dc1ee4546dc20be41a6c", "size": "4...
import unittest import six if six.PY2: from mock import Mock else: from unittest.mock import Mock from application.caches.cache_manager import CacheManager class TestCacheManager(unittest.TestCase): def setUp(self): self.cache_manager = CacheManager() def tearDown(self): pass def test_addElementSingleCac...
{ "content_hash": "d70f51c7a6b70801ec61ffc3e7be3c50", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 68, "avg_line_length": 23.148936170212767, "alnum_prop": 0.7196691176470589, "repo_name": "andrew749/andrew749.github.io", "id": "795d03aa8476acdf3b6bec1ac7ca8f934e295aae", ...
"""The Tornado web server and tools.""" from __future__ import absolute_import, division, print_function, with_statement # version is a human-readable version number. # version_info is a four-tuple for programmatic comparison. The first # three numbers are the components of the version number. The fourth # is zero ...
{ "content_hash": "e9e8277c91d932df32c5f09e3a5b94aa", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 40.53846153846154, "alnum_prop": 0.7533206831119544, "repo_name": "alkaitz/starloot", "id": "c188a1b5feb7de2e0d16b50e2aafe1eca62b2e1c", "size": "1124...
def test_password(con): """Called by GitHub Actions with auth method password. We just need to check that we can get a connection. """ pass
{ "content_hash": "5565079bc66e9a5e75e3bc20f6d1d516", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 58, "avg_line_length": 31.2, "alnum_prop": 0.6730769230769231, "repo_name": "tlocke/pg8000", "id": "ada7edb007b7032b31582de84784d369575c9c37", "size": "156", "binary": fal...
from setuptools import setup version = '1.0.0' required = open('requirements.txt').read().split('\n') setup( name='thunder-regression', version=version, description='algorithms for mass univariate regression', author='jwittenbach', author_email='the.freeman.lab@gmail.com', url='https://github...
{ "content_hash": "203b4fa75d9fd7555987e676e03b7ce8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 82, "avg_line_length": 28.944444444444443, "alnum_prop": 0.6967370441458733, "repo_name": "thunder-project/thunder-regression", "id": "59fad9222b6a5a37ab6669c4619079cb2f84543...
import os from flexmock import flexmock from orator.migrations import Migrator from orator.commands.migrations import MigrateCommand from orator import DatabaseManager from .. import OratorCommandTestCase class MigrateCommandTestCase(OratorCommandTestCase): def test_basic_migrations_call_migrator_with_proper_argu...
{ "content_hash": "f95c86edb8aaba07a7cd37a134f30a17", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 82, "avg_line_length": 42.320388349514566, "alnum_prop": 0.6526726313374627, "repo_name": "sdispater/orator", "id": "4a69058a88f75df817b98e562b420da2f6596354", "size": "43...
import setuptools if __name__ == "__main__": setuptools.setup()
{ "content_hash": "57756fd6809f17aaf1cf8b2a7402fbd5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 26, "avg_line_length": 17.25, "alnum_prop": 0.5942028985507246, "repo_name": "Featuretools/featuretools", "id": "dbe9716a3302dfe8faa31a7daa63502e0d3d9907", "size": "91", "...
from django.urls import reverse from accounts.factories import UserFactory from functional_tests.base import FunctionalTest class UsersTest(FunctionalTest): def test_unauthenticated_can_login(self): self.user = UserFactory.create(username='ugo') self.password = self.user.password self.use...
{ "content_hash": "5e55a57f354b135e6a7802601eef8532", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 92, "avg_line_length": 46.293103448275865, "alnum_prop": 0.6454376163873371, "repo_name": "asyler/betleague", "id": "8f30906b19df16ecf10b9eb8630cd78e17ca8252", "size": "268...
"""solar URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
{ "content_hash": "b23e2816ff5bcfc594a2b707b5deb4fb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 37.916666666666664, "alnum_prop": 0.6835164835164835, "repo_name": "mageelen/Forest", "id": "15ab8ae6409b7373574d036d85c8f90def4a4f2f", "size": "910"...
import argparse import datetime import dateutil.parser import httplib import json import random arg_parser = argparse.ArgumentParser(description='Generate URL for load testing') arg_parser.add_argument('--number-of-urls', required=True, dest='n', type=int, metavar='n', help='Number of url to generate') arg_parser.add...
{ "content_hash": "ac48bdb128b9b95f753d0bbf6762d38c", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 174, "avg_line_length": 40.811764705882354, "alnum_prop": 0.6434130873450562, "repo_name": "atlasapi/atlas-deer", "id": "13970788c9a5882bb1e24569bec0d2d6b84d23fc", "size": ...
__version__ = '0.0.19' DEFAULT_PORT = 5672 AMQP_EXCHANGE = "amqppy" AMQP_BROKER = "amqp://localhost:{}//".format(DEFAULT_PORT) from .utils import create_url, parse_url from .consumer import Worker from .publisher import Topic, Rpc import logging try: # not available in python 2.6 from logging im...
{ "content_hash": "6e9a87297be1ebbeb641e2377675f266", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 132, "avg_line_length": 27.698795180722893, "alnum_prop": 0.6763810352327099, "repo_name": "marceljanerfont/amqppy", "id": "a477f5538e317b4c1a326d840e484327b8e37abe", "size...