text
stringlengths
4
1.02M
meta
dict
import __builtin__ import __future__ import functools import imp import inspect import json from pathlib import Path, PureWindowsPath, PurePath import optparse import os import os.path import subprocess import sys # When build files are executed, the functions in this file tagged with # @provide_for_build will be pro...
{ "content_hash": "0a3aedcfe3a7a7de3dc33e5f528a973c", "timestamp": "", "source": "github", "line_count": 749, "max_line_length": 99, "avg_line_length": 35.18825100133511, "alnum_prop": 0.6202382759144028, "repo_name": "artiya4u/buck", "id": "0c82e8c890e52eb6bcd9a78c9fd8e9f5ad13d982", "size": "26534"...
""" raven.utils.stacks ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import inspect import re import sys import warnings from raven.utils.serializer import transform from r...
{ "content_hash": "7e97ae3c7c5071d9efb82a2726314ce3", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 141, "avg_line_length": 33.20195439739414, "alnum_prop": 0.5897184342195625, "repo_name": "ronaldevers/raven-python", "id": "75a88d3927e28994c81168e81fc8af034495ab48", "si...
class CaptchaBackend(object): def setup(self, **kwargs): pass
{ "content_hash": "343feff299eb00685eff070a98bae4d3", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 30, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6351351351351351, "repo_name": "subeax/grab", "id": "0d9efb64eb0f6ac0d2265c3ff52e1b89a50e493f", "size": "74", "b...
from api.decorators import api_view, request_data_defaultdc from api.permissions import IsAnyDcTemplateAdmin from api.template.base.api_views import TemplateView __all__ = ('template_list', 'template_manage') @api_view(('GET',)) @request_data_defaultdc(permissions=(IsAnyDcTemplateAdmin,)) def template_list(request, ...
{ "content_hash": "6b77a78278d541835c73f7a0a20b5b31", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 120, "avg_line_length": 44.2, "alnum_prop": 0.6187782805429864, "repo_name": "erigones/esdc-ce", "id": "c11f8665602adc0c30c894dcda30a036bbb3a6eb", "size": "7956", "binar...
import sys import re from itertools import chain _PY3 = sys.version_info[0] > 2 if _PY3: basestring = unicode = str def is_string(v): return isinstance(v, basestring) def stringify(v): """ Return a string. If it's already a string, just return that. Otherwise, stringify it. Under Python 3, this...
{ "content_hash": "b707f88a0bdde7a05e3bc32978eb6772", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 76, "avg_line_length": 27.349397590361445, "alnum_prop": 0.608590308370044, "repo_name": "jonathaneunice/quoter", "id": "6626c738e153ab0469dab6279749568600d97266", "size":...
import requests from bs4 import BeautifulSoup import processor from datetime import datetime def parse( url ): r = requests.get( url ) if r.status_code == 404: return processor.create_dictionary('', url, r.status_code, [u''], [u''], u'', u'', u'', u'', [u''], [u'']) r.encoding = 'UTF-8' soup = BeautifulSoup( r...
{ "content_hash": "7e0499fb9ee802b5dfdce25767daaf50", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 142, "avg_line_length": 40.125, "alnum_prop": 0.6672897196261682, "repo_name": "HIIT/mediacollection", "id": "38ba0c9f5e3fa5b510b600ed2e81a8dfdb715c40", "size": "1630", "...
import hypergan as hg import pytest class TestParser: @pytest.fixture(autouse=True) def setup(self): self.parser = hg.parser.Parser() def parse(self, string): return self.parser.parse_string(string).to_list() def test_parses_simple_string(self): line = "conv2d" assert ...
{ "content_hash": "638a62f5d8e0b7037bb64b17506e8537", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 86, "avg_line_length": 35.25252525252525, "alnum_prop": 0.566189111747851, "repo_name": "255BITS/HyperGAN", "id": "eed4d60848221cdbd879d8b6edab29686fbd50ba", "size": "3490"...
"""Tests for tensorflow.ops.gradients.""" import warnings import tensorflow.python.platform import numpy as np from tensorflow.python.framework import ops from tensorflow.python.framework import test_util from tensorflow.python.framework import types # pylint: disable=unused-import from tensorflow.python.ops import ...
{ "content_hash": "1e8f59318a4693fc24d22b81720f3ab5", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 78, "avg_line_length": 37.27893175074184, "alnum_prop": 0.6180052535222479, "repo_name": "aksaxena80/test", "id": "96af01e1d83d12c616ba3c6731b4faf19834cc42", "size": "1256...
import os from setuptools import setup setup( name='stt-watson', version='1.0.3', packages=['utils', 'config', 'recording', 'watson_client', 'watson_client.websocket', 'stt_watson'], url='https://github.com/HomeHabbit/stt-watson', license='MIT', author='Arthur Halet', author_email='arthurh...
{ "content_hash": "7309f39530e70687c9b5e35f0778e5d2", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 109, "avg_line_length": 33.473684210526315, "alnum_prop": 0.5786163522012578, "repo_name": "HomeHabbit/stt-watson", "id": "8d7e970e7163a4fb4d94c49178fe74953aaa7040", "size"...
from rest_framework import serializers from .models import PublicCategories, PrivateCategories, FeedMapper, Feeds, UserSubscriptions, FeedStatus, UserSubscriptions #Default Serializers class FeedStatusSerializer(serializers.ModelSerializer): class Meta: model = FeedStatus class UserSubscriptionsSerializer...
{ "content_hash": "d8fe3e65107ebfd5f1f66c5630f73cfd", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 124, "avg_line_length": 32.592592592592595, "alnum_prop": 0.7284090909090909, "repo_name": "parthz/buku", "id": "eee2c35ea798ec551a4908724fa4571ac36c7ff1", "size": "1760", ...
import numpy as np epsilon = 0.000000001 def build_synapses(layers): """ Construct synapses to forward propagate between layers. These are matrices that will map from layer[n] to layer[n+1] :param layers: an array describing the size of each layer (number of nodes). The length of the array indic...
{ "content_hash": "a2356e08d577e1868628104ea7778036", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 119, "avg_line_length": 32.56872037914692, "alnum_prop": 0.6158323632130385, "repo_name": "kirkbroadhurst/simple_neural_network", "id": "b0c1c29d8eb321842df31ddca81c14aa7413...
""" Internal module for formatting output data in csv, html, and latex files. This module also applies to display formatting. """ from __future__ import print_function from distutils.version import LooseVersion # pylint: disable=W0141 from textwrap import dedent from pandas.core.dtypes.missing import isnull, notnull...
{ "content_hash": "25a9db107ba33fb45f8a86eb2b868f6f", "timestamp": "", "source": "github", "line_count": 2431, "max_line_length": 79, "avg_line_length": 35.59605100781572, "alnum_prop": 0.5138789377585689, "repo_name": "linebp/pandas", "id": "3deaec2dfbbc5bcf7760bc78b5cc6f9071c9cf09", "size": "86559...
import os from .version import _warn_if_setuptools_outdated from .utils import do from .discover import find_matching_entrypoint from . import get_version def version_keyword(dist, keyword, value): _warn_if_setuptools_outdated() if not value: return if value is True: value = {} if get...
{ "content_hash": "d1924db5fa1bf38c7f8b5c586663d7b2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 70, "avg_line_length": 25.307692307692307, "alnum_prop": 0.5724417426545086, "repo_name": "HolgerPeters/setuptools_scm", "id": "1b66a1d703ba6e9e98c640c7678576690ce990fa", "...
from __future__ import absolute_import from webfriend.rpc.reply import Reply from webfriend.rpc.base import Base from webfriend.rpc.browser import Browser from webfriend.rpc.console import Console from webfriend.rpc.dom import DOM, DOMElement from webfriend.rpc.emulation import Emulation from webfriend.rpc.event import...
{ "content_hash": "cc14336682df92a67b4de02cb5b71da8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 45, "avg_line_length": 40.8125, "alnum_prop": 0.8453292496171516, "repo_name": "ghetzel/webfriend", "id": "f121ed9af3a59d0c4f4f969b1c9a6853f102806c", "size": "668", "bina...
from __future__ import division, unicode_literals """ This module implements an XRD pattern calculator. """ from six.moves import filter from six.moves import map from six.moves import zip __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyu...
{ "content_hash": "4e6a2e653899a5e72f4f6ded21daa313", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 80, "avg_line_length": 38.39947780678851, "alnum_prop": 0.5617733052288026, "repo_name": "ctoher/pymatgen", "id": "62d5c6f6fe86880a4398b7bc383a179c6d8d850d", "size": "1472...
import pytest from rclpy.serialization import deserialize_message from rclpy.serialization import serialize_message from test_msgs.message_fixtures import get_test_msg from test_msgs.msg import Arrays from test_msgs.msg import BasicTypes from test_msgs.msg import BoundedSequences from test_msgs.msg import Builtins fr...
{ "content_hash": "89e6ae71c6ceae5638961d795aa97613", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 87, "avg_line_length": 38.23728813559322, "alnum_prop": 0.7406914893617021, "repo_name": "ros2/rclpy", "id": "f74215657f9662796c652bd155019ab043315fbc", "size": "2858", "...
print "Let's practice everything." print 'You\'d need to know \'about escapes with \\ that do newlines and tab' poem = """ \t The lovely world with logic so firmly planted cannot discern \n the nees of love nor comprehend passion from intuition and requires an explannation \n\t\twhere there is none. """ print "------...
{ "content_hash": "1b05c4ec147a90b7614e27833a1df67a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 25.805555555555557, "alnum_prop": 0.6727664155005382, "repo_name": "AisakaTiger/Learn-Python-The-Hard-Way", "id": "f022e90bfaf79bc69fd52c8c7b41dfeab826...
from azure.identity import DefaultAzureCredential from azure.mgmt.costmanagement import CostManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-costmanagement # USAGE python private_scheduled_actions_list_filter_by_view_id.py Before run the sample, please set the val...
{ "content_hash": "8d74f41db0cbd12c0f801370d35f7f02", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 182, "avg_line_length": 35.233333333333334, "alnum_prop": 0.7540208136234626, "repo_name": "Azure/azure-sdk-for-python", "id": "6814e9ba13ae2fb3ede07afad661e1d04ae36511", "...
import datetime import gevent import os import re import urllib2 import urlparse from gevent import monkey monkey.patch_all() from flask import Flask, render_template, send_from_directory, request, make_response from lxml.html import parse # initialization app = Flask(__name__) #app.config.update( # DEBUG=True, ...
{ "content_hash": "9c1229c63ba0e431370c7a056eb8df55", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 144, "avg_line_length": 41.388888888888886, "alnum_prop": 0.6273489932885906, "repo_name": "alphagov/service-domain-checker", "id": "432d98da63a16947601caeb9efab44e304ab7d2d...
""" Unit tests for gerrit.projects.project """ from copy import copy import mock from gerrit.error import ( UnhandledError, AlreadyExists, ) from gerrit.projects.project import Project from tests import GerritUnitTest class ProjectTestCase(GerritUnitTest): """ Unit tests for handling projects """ ...
{ "content_hash": "b4647c2d5041dfc228139ef8010bd00e", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 78, "avg_line_length": 33.16931216931217, "alnum_prop": 0.5849417769979263, "repo_name": "propyless/python-gerrit", "id": "80565e239c3ba0a69a9568e0c94c9945af07d614", "size...
from __future__ import absolute_import from setuptools import setup from setuptools import find_packages __version__ = '0.6.0' setup( author = 'Christian Heitman', author_email = 'barfframework@gmail.com', description = 'A multiplatform open source Binary Analysis and Reverse engineeri...
{ "content_hash": "0c55fc9346cde4436809bd34c844bf51", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 103, "avg_line_length": 35.40816326530612, "alnum_prop": 0.5579250720461095, "repo_name": "programa-stic/barf-project", "id": "f5fee02f1c460d168218dfc9c38bef28efc9ba08", "s...
import os import gym import numpy as np import tensorflow as tf from gym import spaces from collections import deque def sample(logits): noise = tf.random_uniform(tf.shape(logits)) return tf.argmax(logits - tf.log(-tf.log(noise)), 1) def cat_entropy(logits): """More computationally stable than softmax fol...
{ "content_hash": "e3323c342b46e3e0caaa9071db7bf350", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 83, "avg_line_length": 29.09, "alnum_prop": 0.6012375386730835, "repo_name": "8enmann/model-based-rl", "id": "cac9985282823c8310da530cd828637cf8588b2f", "size": "2909", ...
""" Usage: pywd --length=<len> [--numbers] [--letters] [--symbols] [-u | --uppercase] pywd -v | --version pywd -h | --help Examples: pywd --length=14 --numbers --symbols pywd --length=10 --symbols pywd --length=10 --letters --numbers Options: -h --help Show this screen. ...
{ "content_hash": "17a7b6d1c362ef538bf1244d5b5dddd4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 72, "avg_line_length": 32.48888888888889, "alnum_prop": 0.6320109439124487, "repo_name": "captainsafia/pywd", "id": "254d2da17bc7a70cc0198c8800421fb63bbb6d07", "size": "146...
"""EVARILOS Central Engine - Calculation of metrics for indoor localization performance benchmarking.""" __author__ = "Filip Lemic" __copyright__ = "Copyright 2015, EVARILOS Project" __version__ = "1.0.0" __maintainer__ = "Filip Lemic" __email__ = "lemic@tkn.tu-berlin.de" __status__ = "Development" import sys import...
{ "content_hash": "4d640368f47057dd6136cbe026780ed8", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 232, "avg_line_length": 50.86988847583643, "alnum_prop": 0.6460830166617948, "repo_name": "evarilos/ECE-EVARILOS", "id": "054cd3fff18aaf36b5aa9a6ecf7d6994311d57e0", "size"...
from __future__ import print_function import mxnet as mx import mxnext as X from mxnext.backbone.resnet_v1 import Builder bn_count = [10000] class TridentResNetV1Builder(Builder): def __init__(self): super().__init__() @staticmethod def bn_shared(data, name, normalizer, branch_ids=None, share_w...
{ "content_hash": "17ea40d371c2b8412e01239dc018974a", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 140, "avg_line_length": 46.746428571428574, "alnum_prop": 0.5619222247688899, "repo_name": "TuSimple/simpledet", "id": "2ea5f9e43fc203db5286e68f5220e7bab8b8ced5", "size": ...
from .cli import * # NOQA from .cli import __all__ # NOQA from .std import TqdmDeprecationWarning from warnings import warn warn("This function will be removed in tqdm==5.0.0\n" "Please use `tqdm.cli.*` instead of `tqdm._main.*`", TqdmDeprecationWarning, stacklevel=2)
{ "content_hash": "d847d0c0d2a9e517d61e10730ee0dbe1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 40.142857142857146, "alnum_prop": 0.708185053380783, "repo_name": "cjayb/mne-python", "id": "07b6730b1e95f85b56f2708d5ce399c730677470", "size": "281",...
"""A kernel that creates a new ASCII file with a given size and name. """ __author__ = "ExTASY project <ardita.shkurti@nottingham.ac.uk>" __copyright__ = "Copyright 2015, http://www.extasy-project.org/" __license__ = "MIT" from copy import deepcopy from radical.ensemblemd.exceptions import ArgumentError from ra...
{ "content_hash": "5087f5283018908e3b99f305ec4153e2", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 201, "avg_line_length": 36.16260162601626, "alnum_prop": 0.4244604316546763, "repo_name": "radical-cybertools/ExTASY", "id": "135083325d22d4879dce90b5f540b15c97cf4691", "s...
class InterpolationSettings: section_number: int = 1 interp_per_section: int = 2 interp_method: str = 'equidistant' same_arc_length_for_all_sections: bool = False sample_nodes_based_on_arc_length: bool = True def __init__(self, section_number, interp_per_section, interp_method, same_arc_length_...
{ "content_hash": "21564c3af0ad85f7e61a6f1b6cbb5a79", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 107, "avg_line_length": 49.5, "alnum_prop": 0.6868686868686869, "repo_name": "schreiberx/sweet", "id": "bc76644095846ff9dfe621babfc09a5b18d26ba5", "size": "693", "binary"...
from __future__ import annotations import itertools from collections import defaultdict from typing import Iterable, Mapping, Sequence, TypeVar from typing_extensions import Protocol from pants.backend.python.subsystems.setup import PythonSetup from pants.backend.python.target_types import InterpreterConstraintsFiel...
{ "content_hash": "7f785dd212ee538b3795fc19d5d88a42", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 98, "avg_line_length": 39.825581395348834, "alnum_prop": 0.7322627737226277, "repo_name": "pantsbuild/pants", "id": "dab39bb0816a76ea2f02bede78c5531a42c54610", "size": "355...
import sys import gevent.monkey gevent.monkey.patch_all() import logging import tempfile from pprint import pformat import coverage import fixtures import testtools from testtools import content, content_type from flexmock import flexmock, Mock from webtest import TestApp import contextlib from vnc_api.vnc_api import...
{ "content_hash": "79101fc334debccff9733f371bb555db", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 132, "avg_line_length": 40.45059288537549, "alnum_prop": 0.6078268516709009, "repo_name": "DreamLab/contrail-controller", "id": "94fafb097277a28017586d2ff9dc9ffc684bd9d6", ...
from dulwich.repo import Repo from dulwich.client import get_transport_and_path import sys def push(remote_url, repo_path='.'): """ Push to a remote repository :param remote_url: <str> url of remote repository :param repo_path: <str> path of local repository :return refs: <dict> dictionary of ref-...
{ "content_hash": "bc94472e6fab2b457c4c7a5d2eda2326", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 39.96551724137931, "alnum_prop": 0.5962036238136325, "repo_name": "mikofski/dulwichPorcelain", "id": "e23831c5c1e4e4aaba38057ace81941b540c3a57", "siz...
"""Test the bootstrapping.""" # pylint: disable=protected-access import asyncio import glob import os from unittest.mock import Mock, patch import pytest from homeassistant import bootstrap, core, runner import homeassistant.config as config_util from homeassistant.const import SIGNAL_BOOTSTRAP_INTEGRATIONS from home...
{ "content_hash": "2d01da772be751725f7c1f56a76ebbfa", "timestamp": "", "source": "github", "line_count": 797, "max_line_length": 86, "avg_line_length": 29.485570890840652, "alnum_prop": 0.5997446808510638, "repo_name": "w1ll1am23/home-assistant", "id": "e51f4d315eefcf7ae4decefb960f1c04c70e92fe", "si...
from flask import Flask, jsonify from flask_sqlalchemy import SQLAlchemy from flask_restless import APIManager import datetime import os from app import config app = Flask(__name__) # init config app.config.from_object(config) # init views from app import views #init database from app.database import db, restless ...
{ "content_hash": "ccddf0a09f466b771be725fb360f9f30", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 39, "avg_line_length": 17.074074074074073, "alnum_prop": 0.7505422993492408, "repo_name": "chengjf/database-interface-doc-management", "id": "a7d77dd5edc1d611d86e95e784b9f1e9...
"""Common functionality and utility functions for unit tests """ import os from ozelot import client from ozelot import config def get_test_db_client(): """Get client for test database Returns :mod:`ozelot.client.Client`: database client """ return client.Client(connection_string='sqlite://...
{ "content_hash": "b55fb93cefe263b956ff5e7d24c53e21", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 88, "avg_line_length": 23.34375, "alnum_prop": 0.6733601070950469, "repo_name": "trycs/ozelot", "id": "bc77d9df539c5d1e5337f038d058fdabacea032d", "size": "747", "binary":...
from __future__ import unicode_literals from past.builtins import basestring import os.path from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from httpwatcher.errors import MissingFolderError from tornado import gen from tornado.ioloop import PeriodicCallback from tornado.qu...
{ "content_hash": "a1c6924426da624bd71da8e612b1517e", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 105, "avg_line_length": 34.13978494623656, "alnum_prop": 0.6390551181102362, "repo_name": "thanethomson/httpwatcher", "id": "a4d4a727b943fdf3ce4d08c7e9838a44dddfef25", "siz...
import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('cp949') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): codec = codec class Increm...
{ "content_hash": "daf27e99cd643f64e7505359b5ead761", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 23.871794871794872, "alnum_prop": 0.6938775510204082, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "364fc7eaceea625e6aa530fdc6c3bff62c36f90e", ...
""" Django settings for learnwithpeople project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR...
{ "content_hash": "c28b314ee2a4b29694de928b5d4709db", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 133, "avg_line_length": 30.58009708737864, "alnum_prop": 0.6665608381617588, "repo_name": "p2pu/learning-circles", "id": "c3c9fdbf1a1d86dadeba11127cc624fbad0520a2", "size"...
import pytest from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from poliastro.bodies import Sun, Mercury, Venus, Earth, Moon, Mars from poliastro.bodies import Jupiter, Saturn, Uranus, Neptune, Pluto from poliastro.patched_conics import compute_soi def test_compute_soi(): ...
{ "content_hash": "8cd43505e9f00e76501e7961edb92b11", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 104, "avg_line_length": 29.186046511627907, "alnum_prop": 0.6199203187250996, "repo_name": "anhiga/poliastro", "id": "23438380aa8423570d6b300ec7bbd5d0f6a42910", "size": "12...
"""mmg rates now set to 1.65 pence per sms Revision ID: 0040_adjust_mmg_provider_rate Revises: 0039_fix_notifications Create Date: 2016-07-06 15:19:23.124212 """ # revision identifiers, used by Alembic. revision = "0040_adjust_mmg_provider_rate" down_revision = "0039_fix_notifications" import uuid from datetime imp...
{ "content_hash": "3a1f07daaf8494f4e22bdd123fb31e7b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 110, "avg_line_length": 26.23404255319149, "alnum_prop": 0.6009732360097324, "repo_name": "alphagov/notifications-api", "id": "195b6e2aa67f32eb622729aec34c462df04e1142", "s...
"""Custom yaml object types.""" from dataclasses import dataclass import yaml class NodeListClass(list): """Wrapper class to be able to add attributes on a list.""" class NodeStrClass(str): """Wrapper class to be able to add attributes on a string.""" @dataclass(frozen=True) class Input: """Input tha...
{ "content_hash": "36b05553213abcc23187a10824ba41a3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 22.625, "alnum_prop": 0.6703499079189686, "repo_name": "tboyce1/home-assistant", "id": "0e46820e0db12091a47d717dc8b47f2008eb083d", "size": "543", "...
""" Package-level global flags are defined here, the rest are defined where they're used. """ from gflags import * # This keeps pylint from barfing on the imports FLAGS = FLAGS DEFINE_string = DEFINE_string DEFINE_integer = DEFINE_integer DEFINE_bool = DEFINE_bool # __GLOBAL FLAGS ONLY__ # Define any app-specific f...
{ "content_hash": "a7a8fa0d4e27c7029a8cc309ae9e503f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 28.857142857142858, "alnum_prop": 0.7326732673267327, "repo_name": "anotherjesse/nova", "id": "35f432a77800ffe982e0196dcf19141b57a780dc", "size": "13...
import json import turtle from figures.simple_figures import Circle, Square, Rectangle, Pie, RegularPolygon def main(): try: input_data = load_input_data("figures_simple.json") figures = create_figures(input_data) draw_figures(figures) except Exception as e: print("Invalid inp...
{ "content_hash": "6142cee758e9775d5ecde438c436431b", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 81, "avg_line_length": 22.73076923076923, "alnum_prop": 0.61082910321489, "repo_name": "natla/softuni-python", "id": "ae788265887752df42b3c3961c54db3dfc920af0", "size": "11...
"""This module contains Google Dataproc Metastore operators.""" from datetime import datetime from time import sleep from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, Union from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault from google.api_core.retry import Retry, exponential_s...
{ "content_hash": "25d8ccf5e77dc0a87b01e9d6ed0c3535", "timestamp": "", "source": "github", "line_count": 1108, "max_line_length": 110, "avg_line_length": 44.70036101083033, "alnum_prop": 0.6470481343886286, "repo_name": "lyft/incubator-airflow", "id": "d0ca4a5f28672f055a3750b0f68868468f782d36", "siz...
from c7n_azure.provider import resources from c7n_azure.resources.arm import ArmResourceManager from c7n_azure.actions.base import AzureBaseAction from c7n.utils import type_schema @resources.register('hdinsight') class Hdinsight(ArmResourceManager): """HDInsight Resource :example: Finds all Hadoop HDIn...
{ "content_hash": "ff50f5ee1c6092e42c9d169c8256f707", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 99, "avg_line_length": 24.89, "alnum_prop": 0.5600642828445158, "repo_name": "Sutto/cloud-custodian", "id": "89252a884855de5d29babcfd32a9ba26b018559d", "size": "3071", "...
def solution(S): # write your code in Python 2.7 maximum = 0 S = S.replace('?','.').replace('!','.') sentences = S.split('.') # print(sentences) lengthOfWords = [] for sent in sentences: sent = sent.strip().split() lengthOfWords.append(len(sent)) return max(lengthOfWords)...
{ "content_hash": "6c5061cef478790bf73eddef64925a33", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 46, "avg_line_length": 28.307692307692307, "alnum_prop": 0.5896739130434783, "repo_name": "saisankargochhayat/algo_quest", "id": "9d1b5aa1aa03b74e64269d58acccef471a903c7f", ...
from typing import Dict, List, Iterable, Tuple, Any, Iterator import scipy.sparse as sparse import numpy as np import loompy import warnings with warnings.catch_warnings(): warnings.simplefilter("ignore") import h5py from .utils import compare_loom_spec_version class GlobalAttributeManager(object): def __init__(se...
{ "content_hash": "59b2cd6fb6103469f3d9587bf3a39978", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 104, "avg_line_length": 33.19491525423729, "alnum_prop": 0.6451365841205003, "repo_name": "linnarsson-lab/loompy", "id": "3d336ecde2b830c728d667b62b13907a90553b2d", "size"...
""" This module contains the main interface to the botocore package, the Session object. """ import copy import logging import os import platform from botocore import __version__ import botocore.config import botocore.credentials import botocore.client from botocore.exceptions import ConfigNotFound, ProfileNotFound f...
{ "content_hash": "0db7c4eaf48fb17fb487be6120e7d1ac", "timestamp": "", "source": "github", "line_count": 825, "max_line_length": 87, "avg_line_length": 41.89575757575758, "alnum_prop": 0.6193727577826641, "repo_name": "mnahm5/django-estore", "id": "6f91652ec5a4367e22b008e944d53535cd33c052", "size": ...
"""Manage class and methods for sessions.""" import logging import pandas import utils # Load logging configuration log = logging.getLogger(__name__) class Session: """Session class.""" def update_session_status(self, authorization: str, session_id: int, session_status: str): """Update a session sta...
{ "content_hash": "ecdd80bfdebcb47a3402107b2e2835f4", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 169, "avg_line_length": 48.75, "alnum_prop": 0.6797202797202797, "repo_name": "alexisrolland/data-quality", "id": "fb5670f11aa431378fa5a2731f31ca8cd4632799", "size": "2145"...
from .euler_flat_earth import EulerFlatEarth
{ "content_hash": "752d25eb434f0cc55b47ad01955b7346", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 44, "avg_line_length": 45, "alnum_prop": 0.8444444444444444, "repo_name": "AeroPython/PyFME", "id": "2f1951d20928452a0bfaacf59c129a3ead02d646", "size": "45", "binary": fal...
from common import * # nopep8 DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'onadata_test', 'USER': 'postgres', 'PASSWORD': '', 'HOST': '127.0.0.1', 'OPTIONS': { # note: this option obsolete starting with django 1...
{ "content_hash": "18ed368030345dacac73210723a40223", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 32.32692307692308, "alnum_prop": 0.6650803093396788, "repo_name": "jnordling/cabin", "id": "58e9630992b2626f5a3acb23e159594815ad9eea", "size": "1738"...
from .server import Server from .client import Client
{ "content_hash": "40ed6eded3bdc50185b7a66c4b970680", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 26.5, "alnum_prop": 0.8301886792452831, "repo_name": "baverman/jeque", "id": "e5cdf2872589877a5bbbaa5e4185f9563a114aa7", "size": "53", "binary": fal...
''' @author: shibkov ''' from actions import SlavePack
{ "content_hash": "4737e88397a2963e6f9ab764e2192dee", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 29, "avg_line_length": 11.2, "alnum_prop": 0.6964285714285714, "repo_name": "barsgroup/objectpack", "id": "0a12b27ce4474d3286b7a4d7215c0e9d0acdbcdf", "size": "70", "binary...
from typing import Any, Dict, List, Literal, NamedTuple, Optional, Sequence, Tuple, TypedDict, Union InitConfigType = Dict[str, Any] AgentConfigType = Dict[str, Any] InstanceType = Dict[str, Any] ProxySettings = TypedDict( 'ProxySettings', {'http': Optional[str], 'https': Optional[str], 'no': List[str]}, total=Fa...
{ "content_hash": "53da87a0cc66e0371df3325f505313ef", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 111, "avg_line_length": 35.06976744186046, "alnum_prop": 0.6352785145888594, "repo_name": "DataDog/integrations-core", "id": "ed97bc44c204f52d61c08da0f6ab463e401a3362", "si...
"""Configuration for editorial application.""" from django.apps import AppConfig from search import register_watson class EditorialAppConfig(AppConfig): """Configure editorial app.""" name = "editorial" def ready(self): """Add models to search. Add models to Activity Stream.""" ...
{ "content_hash": "a8e96ce71756ff993f1e3a3f043e3322", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 37, "alnum_prop": 0.5911196911196911, "repo_name": "ProjectFacet/facet", "id": "3e7d0639bc32736810f0025b73107161b5f93b4a", "size": "2590", "binary"...
from __future__ import absolute_import, print_function from django.db import IntegrityError, transaction from django.db.models.signals import post_save from sentry.models import Release, TagValue from sentry.tasks.clear_expired_resolutions import clear_expired_resolutions def ensure_release_exists(instance, created...
{ "content_hash": "7fa6dce358fe14d2add0830ee93e0463", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 76, "avg_line_length": 25.807692307692307, "alnum_prop": 0.6721311475409836, "repo_name": "zenefits/sentry", "id": "21112c080ead20f742b32f2cd1e503833eefb079", "size": "1342...
import json import sys from typing import Any, Dict, List, Tuple, Union from urllib.parse import unquote from moto.core.utils import path_url from moto.utilities.aws_headers import amz_crc32, amzn_request_id from moto.core.responses import BaseResponse, TYPE_RESPONSE from .models import lambda_backends, LambdaBackend ...
{ "content_hash": "d8aa31949b95104993ce6d222704d2c8", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 141, "avg_line_length": 41.19298245614035, "alnum_prop": 0.601022146507666, "repo_name": "spulec/moto", "id": "31b7298a7cb7db31b42ec4128fb71fccf959579a", "size": "23480", ...
import uppsell from . import resources uppsell.api.add_resource(resources.CustomerResource, r'customers$', r'customers/(?P<id>\d*)$') uppsell.api.add_resource(resources.CustomerAddressResource, r'customers/(?P<customer__id>\d*)/addresses$', r'customers/(?P<customer__id>\d*)/addresses/(?P<id>\d*)$') upp...
{ "content_hash": "d3f610c4aa8407eb480d780ee3472d18", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 37.955555555555556, "alnum_prop": 0.6381733021077284, "repo_name": "upptalk/uppsell", "id": "5798c74b8b5ad00d0f045918b9fcf99523e42662", "size": "1755...
__author__ = 'Alex Dzul' from pyql.geo.generics import GenericGeoPlace from pyql.interface import YQLConector __all__ = ('State', ) YQL_TABLE = "geo.states" class State(GenericGeoPlace): @staticmethod def get(**kwargs): """ Realiza una consulta a la base de datos de Yahoo utilizando YQL. ...
{ "content_hash": "a85dab4827e1ae0074f48699e442e277", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 80, "avg_line_length": 30.852941176470587, "alnum_prop": 0.6510962821734986, "repo_name": "alexdzul/pyql-weather", "id": "2356ff050bba8cec12f72dd68b137514af9a33da", "size":...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Find-DomainShare', 'Author': ['@harmj0y'], 'Description': ('Finds shares on machines in the domain. Part of PowerView.'), 'Background' : True, ...
{ "content_hash": "0919c675bedf0ba3b699b1330fb3eba4", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 128, "avg_line_length": 39.130434782608695, "alnum_prop": 0.45365079365079364, "repo_name": "PowerShellEmpire/Empire", "id": "b7eb7430bb04ecd40ca90099bbefd0f114040073", "s...
from datetime import datetime from difflib import SequenceMatcher from consts.account_permissions import AccountPermissions from consts.event_type import EventType from controllers.suggestions.suggestions_review_base_controller import \ SuggestionsReviewBaseController from database.event_query import EventListQuer...
{ "content_hash": "25554d4e635359f3cb7c3a3046774623", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 265, "avg_line_length": 42.9367816091954, "alnum_prop": 0.6328470084326061, "repo_name": "phil-lopreiato/the-blue-alliance", "id": "8cc7ad923f9a560898af27f84b03e49f5f676f46"...
import copy import operator import warnings import weakref from contextlib import suppress from functools import reduce import numpy as np from numpy import char as chararray from .column import (ASCIITNULL, FITS2NUMPY, ASCII2NUMPY, ASCII2STR, ColDefs, _AsciiColDefs, _FormatX, _FormatP, _VLF, _...
{ "content_hash": "191145ed624343e7c256e17c7cbefdad", "timestamp": "", "source": "github", "line_count": 1336, "max_line_length": 90, "avg_line_length": 39.5247005988024, "alnum_prop": 0.5557996401855885, "repo_name": "DougBurke/astropy", "id": "3e1bceb98aa9add0e71ede0488d47594df5e19ba", "size": "52...
"""hidden hosts management Revision ID: 4445080944ee Revises: 695dcbd29d4f Create Date: 2018-10-03 11:47:20.028686 """ # revision identifiers, used by Alembic. revision = "4445080944ee" down_revision = "695dcbd29d4f" from alembic import op import sqlalchemy as sa def upgrade(): # ### commands auto generated b...
{ "content_hash": "f09a72c2c30c89eb6fbded61ae2b7fec", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 67, "avg_line_length": 26.515151515151516, "alnum_prop": 0.6525714285714286, "repo_name": "ziirish/burp-ui", "id": "f8b4fddd369fed68ea399519307e0646f0ee58d1", "size": "875"...
import os import unittest from cloudfoundry_client.operations.push.validation.manifest import ManifestReader class TestManifestReader(unittest.TestCase): def test_empty_manifest_should_raise_exception(self): manifest_file = os.path.join(os.path.dirname(__file__), "..", "..", "..", "fixtures", "operations...
{ "content_hash": "3c9db0028961baf97a17b37c2c96825c", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 129, "avg_line_length": 49.733333333333334, "alnum_prop": 0.6456099195710456, "repo_name": "antechrestos/cf-python-client", "id": "25995c3a171c2b816c9fccf0ca69b4138ea17cf6",...
"""Tests for easydate""" import unittest from easydate import Datetime from datetime import date, datetime, timedelta base_date = Datetime(year=2014, month=1, day=1) class EasydateTestCase(unittest.TestCase): def setUp(self): self.datetime = base_date def tearDown(self): pass def test_...
{ "content_hash": "1f489ebfaa407da5e2b9920621dc7988", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 70, "avg_line_length": 28.127659574468087, "alnum_prop": 0.6391830559757943, "repo_name": "daftshady/easydate", "id": "94f53f704f9d9f6318be030f7db14946f53f9c9f", "size": "1...
from django import template from django.core.exceptions import ImproperlyConfigured register = template.Library() @register.simple_tag(takes_context=True) def frontpage_statusbox(context): if 'request' not in context: raise ImproperlyConfigured('Enable the request context processor!') request = contex...
{ "content_hash": "37db22a187415794b2e13aa686695cbe", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 31.846153846153847, "alnum_prop": 0.7705314009661836, "repo_name": "jokey2k/ShockGsite", "id": "6880c7b77dc83761c4be069fe98f1c88df139a7a", "size": "4...
import pytest import capnp import os this_dir = os.path.dirname(__file__) @pytest.fixture def capability(): return capnp.load(os.path.join(this_dir, 'test_capability.capnp')) class Server: def __init__(self, val=1): self.val = val def foo_context(self, context): extra = 0 if con...
{ "content_hash": "a4cdacdc0980d50ad812628e9b73a3b6", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 92, "avg_line_length": 26.258064516129032, "alnum_prop": 0.6491093366093366, "repo_name": "rcrowder/pycapnp", "id": "4f2c1113a6b156ad866b9f34d845eefd9fab3f82", "size": "65...
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 'Proposal' db.create_table('proposals_proposal', ( ('id', self.gf('django.db.models.fields.AutoFi...
{ "content_hash": "40750a137a6e970d865be68f96e7d890", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 228, "avg_line_length": 71.43795620437956, "alnum_prop": 0.5721875957903341, "repo_name": "EuroPython/djep", "id": "14ba60dd1ccad69b1f1e18e2213c891068b141f8", "size": "980...
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class EnumerateTests(TranspileTestCase): def test_enumerate(self): self.assertCodeExecution(""" lst=['a','b','c','d','e'] print(list(enumerate(lst))) lst=['a','b','c','d','e'] print(list(enumera...
{ "content_hash": "186db3f4676e4cfa28e34561acceb2f1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 80, "avg_line_length": 29.65714285714286, "alnum_prop": 0.47928709055876684, "repo_name": "pombredanne/voc", "id": "ba7d61a28489b512e4805f5c343ae1a895813409", "size": "2076...
import sys, os, glob, string, traceback, fnmatch, math, shutil, collections from PIL import Image, PngImagePlugin from .State import State from byond.DMIH import * import logging class DMILoadFlags: NoImages = 1 NoPostProcessing = 2 class DMI: MovementTag = '\t' def __init__(self, filename): ...
{ "content_hash": "18ebdb260fade7d40cc1ffbd31d6fad1", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 219, "avg_line_length": 40.68783068783069, "alnum_prop": 0.48185955786736023, "repo_name": "Boggart/ByondTools", "id": "2fd68007e1d2ccca44a39485d4e6cbd599afc1cc", "size": ...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.condenser_equipment_and_heat_exchangers import FluidCoolerSingleSpeed log = logging.getLogger(__name__) class TestFluidCoolerSingleSpeed(unittest.TestCase): def setUp(self)...
{ "content_hash": "c4b936b3661718b2a5e06316f8225c56", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 160, "avg_line_length": 49.03488372093023, "alnum_prop": 0.7061892340526441, "repo_name": "rbuffat/pyidf", "id": "f240a27b41108d7bb958b8be9383479f34d8e1f4", "size": "4217",...
from nova.policies import base BASE_POLICY_NAME = 'os_compute_api:os-server-password' server_password_policies = [ base.create_rule_default( BASE_POLICY_NAME, base.RULE_ADMIN_OR_OWNER, "Show and clear the encrypted administrative password of a server", [ { ...
{ "content_hash": "a15a9a953a7c2f176e4a9f773141f1d8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 23.96153846153846, "alnum_prop": 0.5313001605136437, "repo_name": "rajalokan/nova", "id": "d2e12a522c1102a94449914c773c62a36c760034", "size": "1262",...
from google.cloud import network_management_v1 def sample_rerun_connectivity_test(): # Create a client client = network_management_v1.ReachabilityServiceClient() # Initialize request argument(s) request = network_management_v1.RerunConnectivityTestRequest( name="name_value", ) # Make...
{ "content_hash": "e24b833f835af81392e668adc0f7fc58", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 85, "avg_line_length": 26.82608695652174, "alnum_prop": 0.7325769854132901, "repo_name": "googleapis/python-network-management", "id": "97d5a00d0b7873734ffa038884dc3cd649ea74...
import rospy from geometry_msgs.msg import Pose2D, Quaternion, Twist from std_msgs.msg import String from lg_msg_defs.msg import ApplicationState from rospy import ROSException from lg_sv import NearbyPanos import requests import json from interactivespaces_msgs.msg import GenericMessage # spacenav_node -> mux_twists...
{ "content_hash": "3a8918b1a0fff42c285ca79e9c88c208", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 93, "avg_line_length": 33.60879120879121, "alnum_prop": 0.5650667015432906, "repo_name": "EndPointCorp/lg_ros_nodes", "id": "25c8445c9dcb27f157be1a146352dd9fdddcb113", "si...
from Bio import SeqIO from Bio import pairwise2 from Bio.pairwise2 import format_alignment from collections import OrderedDict import os import yaml import pprint import math import matplotlib.pyplot as plt import numpy as np from datetime import datetime import requests class NewSeqToAlignment(): def __init__(self,...
{ "content_hash": "e145c38742f826b32b55048b2512adfc", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 164, "avg_line_length": 34.090090090090094, "alnum_prop": 0.6513389711064129, "repo_name": "protwis/protwis", "id": "b3955f533f918f0eac988869e50d682940e00453", "size": "11...
import json from werkzeug.wrappers import Response, Request as WRequest class JSONResponse(Response): def __init__(self, data, *args, **kwargs): kwargs['content_type'] = 'application/json' return super(JSONResponse, self).__init__(json.dumps(data), *args, **kwargs) class Request(WRequest): ...
{ "content_hash": "043ad9e99ce2cc8c59ce3f7236c5b3da", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 33.67741935483871, "alnum_prop": 0.6369731800766284, "repo_name": "dmonroy/spa", "id": "cec4935d4c469c0aea46826cd736e98066bcb2fe", "size": "1044", ...
from django.core.management.base import BaseCommand from django.contrib.gis.utils import LayerMapping from boundaries.models import Country, country_ibge_mapping class Command(BaseCommand): help = 'Import village layer' def add_arguments(self, parser): parser.add_argument('shapefile_path', nargs='+',...
{ "content_hash": "091c50bd0833753f387e06392b7bd403", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 120, "avg_line_length": 36.55, "alnum_prop": 0.6894664842681258, "repo_name": "hacklabr/geodjango-boundaries", "id": "f422d51f8410786343b20ab0b4cf7d5069d6d714", "size": "73...
import datetime try: import models except: from . import models CART_ID = 'CART-ID' class ItemAlreadyExists(Exception): pass class ItemDoesNotExist(Exception): pass class Cart: def __init__(self, request): cart_id = request.session.get(CART_ID) if cart_id: try: ...
{ "content_hash": "d50db234eadc18fe28e3d8a5a18e7d4b", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 77, "avg_line_length": 26.835051546391753, "alnum_prop": 0.52362658470995, "repo_name": "thodoris/djangoPharma", "id": "f59ae4fe73814276327ed4aa6fd233a076a0547e", "size": "...
"""Tests for adb.""" import cStringIO import struct import unittest import adb_commands import adb_protocol import common_stub BANNER = 'blazetest' LOCAL_ID = 1 REMOTE_ID = 2 class BaseAdbTest(unittest.TestCase): @classmethod def _ExpectWrite(cls, usb, command, arg0, arg1, data): usb.ExpectWrite(cls._Mak...
{ "content_hash": "7cfe103245e8e6f9c3460d913d40db10", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 78, "avg_line_length": 28.87292817679558, "alnum_prop": 0.6593953310371221, "repo_name": "8l/connectal", "id": "758b6ea1ebddc6fd5ee931aaaf38e6a3dbd79224", "size": "5822", ...
from __future__ import unicode_literals import subprocess import os class CommandWrapper(object): """ Parameters ---------- command : str Command (e.g. ls, mkdir or ffmpeg) exists_params : iterable, optional Parameters passed to command when checking its existence. This p...
{ "content_hash": "94fa64459025cb7f8d597de0392f6ad2", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 26.718446601941746, "alnum_prop": 0.5363372093023255, "repo_name": "tvd-dataset/tvd", "id": "acc1eea6769407d0ad8e2dfe1c8c9c0383792f2f", "size": "396...
import collections import mock from oslo_utils import timeutils from oslo_versionedobjects import fixture from nova import exception from nova.network import model as network_model from nova.notifications import base as notification_base from nova.notifications.objects import base as notification from nova import obj...
{ "content_hash": "09a51cc0dd4e1644ef14c529c8416136", "timestamp": "", "source": "github", "line_count": 500, "max_line_length": 79, "avg_line_length": 40.618, "alnum_prop": 0.6253385198680388, "repo_name": "rajalokan/nova", "id": "d0e815f5e83ec796701ce3493999c41678965a20", "size": "20906", "binar...
import json import keys def api_msg_render(headers, body, method, api_url): # # If rendering API message is enabled this takes a collection of variables and builds a dict containing API usage info. # input: # headers - dict of headers # body - dict for body; supports --form, -F, group, user_policy, video, or N...
{ "content_hash": "566857cf39f3706b72433c24b7ddd425", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 134, "avg_line_length": 27.74137931034483, "alnum_prop": 0.5997513983840895, "repo_name": "ReelDx/medvidio-webapp-demo", "id": "f4b6dfced4281b1549f2a95e4361a4eb0bda9786", ...
from django.contrib import admin from pos.models.shift import Shift from pos.models.stock import Category, Discount, FoodLog, Ingredient, Item, ItemIngredient, Order, OrderLine from pos.models.sumup import SumUpAPIKey, SumUpCard, SumUpOnline, SumUpTerminal, SumUpTransaction from pos.models.user import CreditUpdate, Us...
{ "content_hash": "4f02cc86a592d9d1a253e5ef9829edc8", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 108, "avg_line_length": 27.349397590361445, "alnum_prop": 0.7068281938325991, "repo_name": "nuxis/p0sX-server", "id": "416a56b1d46479066a7a621b3a5a838e755dee98", "size": "...
def average(array): pass # your code goes here if __name__ == '__main__': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)
{ "content_hash": "1633a4dd72891f63d7d32dd2f87387f5", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 41, "avg_line_length": 19.1, "alnum_prop": 0.5445026178010471, "repo_name": "jerodg/hackerrank-python", "id": "3f99c14eaff0c523c952a2c1418db293a137b01b", "size": "191", "...
""" ========================================= Tractography Clustering with QuickBundles ========================================= This example explains how we can use QuickBundles [Garyfallidis12]_ to simplify/cluster streamlines. First import the necessary modules. """ import numpy as np from nibabel import trackvi...
{ "content_hash": "6924f76cfd9edb1cb5c6a30a172d7460", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 125, "avg_line_length": 30.90506329113924, "alnum_prop": 0.6768380094204383, "repo_name": "matthieudumont/dipy", "id": "ce79b45d1bf108473a61dd37ddac0ed90083bf38", "size": ...
""" Unit tests for the MySQL implementation of spectrum libraries """ from os import path as os_path import uuid import unittest import fourgp_speclib from test_spectrum_library_sql import TestSpectrumLibrarySQL # These tests require a test MySQL database to be present db_host = "localhost" db_user = "fourgp_unittes...
{ "content_hash": "76617657c89183f5750ab9b8acddb9e3", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 103, "avg_line_length": 44.38582677165354, "alnum_prop": 0.5306013837147419, "repo_name": "dcf21/4most-4gp", "id": "6c40fc1d7c332b9e64511c5a5fc49af03ad2d33a", "size": "568...
""" ===================================== Time-frequency beamforming using DICS ===================================== Compute DICS source power in a grid of time-frequency windows and display results. The original reference is: Dalal et al. Five-dimensional neuroimaging: Localization of the time-frequency dynamics of...
{ "content_hash": "782204ddc3e4da94a1b3c319cd12514c", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 42.424, "alnum_prop": 0.6745238544220252, "repo_name": "wronk/mne-python", "id": "7d7191b421e53c9aa49542a72cc03659b0e426b3", "size": "5303", "bina...
from contextlib import contextmanager import io import os import shutil import stat def get_repo(path, search_parent_directories=True): repo = None try: import git repo = git.Repo( path, search_parent_directories=search_parent_directories ) except ImportError: ...
{ "content_hash": "3985c753f4ba72f22862bdc634f08aa3", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 77, "avg_line_length": 22.79047619047619, "alnum_prop": 0.6071876305892185, "repo_name": "ocefpaf/conda-smithy", "id": "6878850af8d492af81a923f356661cce9c6a08b9", "size": ...
import datetime, math from serenity_pypeline.logger import log from serenity_pypeline.db.influxdb_connector import InfluxDbConnector from serenity_pypeline.filters.filter import Filter class CfFinisherException(Exception): pass class CfFinisher(Filter): KEY_FOR_DATA = 'data_to_insert' KEY_NAME = 'measu...
{ "content_hash": "a6a18a358aea4a374e880a5607670643", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 30.098360655737704, "alnum_prop": 0.605119825708061, "repo_name": "Bplotka/serenity-pypeline", "id": "462a43a718b5a96b7cff848d13ca163ffc51105d", "siz...
__all__ = ["HeapSnapshotTaker"] from devtools_event_listener import DevToolsEventListener from status import * from base.log import VLOG # Take the heap snapshot. class HeapSnapshotTaker(DevToolsEventListener): def __init__(self, client): self.client = client self.client.AddListener(self) self.snapshot...
{ "content_hash": "e3395a89230df8c5670cf181c8b1be94", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 98, "avg_line_length": 36.07142857142857, "alnum_prop": 0.6623762376237624, "repo_name": "PeterWangIntel/crosswalk-webdriver-python", "id": "8dc3ce96b9084d85969eac71f993917d8...
import unittest from pyramid import testing class ViewTests(unittest.TestCase): def setUp(self): self.config = testing.setUp() def tearDown(self): testing.tearDown() def test_my_view(self): from .views import my_view request = testing.DummyRequest() info = my_vie...
{ "content_hash": "1a84e2559c716c2ec035491f16825933", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 53, "avg_line_length": 22.647058823529413, "alnum_prop": 0.6415584415584416, "repo_name": "birkbeckOLH/annotran", "id": "5726f826e86512093903f4dc63e86e3bbf76ddaf", "size": ...
from django.core.paginator import Paginator from django.http import Http404 from django.shortcuts import get_object_or_404, render from wagtail.admin.forms.choosers import EmailLinkChooserForm, ExternalLinkChooserForm from wagtail.admin.forms.search import SearchForm from wagtail.admin.modal_workflow import render_mod...
{ "content_hash": "37a92f8ab4f2bfdee6bd220944b5dc43", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 110, "avg_line_length": 37.75390625, "alnum_prop": 0.6405587170201759, "repo_name": "nealtodd/wagtail", "id": "a0f299d4c6333ee84572e5b7c6c0325f3b5699d5", "size": "9665", ...
"""Mimic pyquick exercise -- optional extra exercise. Google's Python Class Read in the file specified on the command line. Do a simple split() on whitespace to obtain all the words in the file. Rather than read the file line by line, it's easier to read it into one giant string and split it once. Build a "mimic" dic...
{ "content_hash": "c634bf9ec2d4eebbf3257566862bfaa4", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 77, "avg_line_length": 28.10843373493976, "alnum_prop": 0.7003857693956279, "repo_name": "brebory/google-python-exercises", "id": "26103eb5bc8ca52ce176dd5a18ca7a0972b1299f", ...
import os basedir = os.path.abspath(os.path.dirname(__file__)) class BaseConfig(object): """Base configuration.""" SECRET_KEY = 'afds7fn7aw4ytnachfw84' DEBUG = False BCRYPT_LOG_ROUNDS = 13 WTF_CSRF_ENABLED = True DEBUG_TB_ENABLED = False DEBUG_TB_INTERCEPT_REDIRECTS = False SQLALCHEMY_...
{ "content_hash": "8760f44998a6a5eaaea58740b69b8706", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 62, "avg_line_length": 26.790697674418606, "alnum_prop": 0.6657986111111112, "repo_name": "runozo/palinsesto-fire", "id": "70007e77739bc645b179ed01f0c9d41933f32b47", "size"...
import sys, time sys.path.append('../../') from parsing.filing import filing from parsing.form_parser import form_parser, ParserMissingError from fec_alerts.utils.form_mappers import * from write_csv_to_db import CSV_dumper from fec_import_logging import fec_logger from hstore_helpers import dict_to_hstore from db...
{ "content_hash": "3a2b741f578c10cbd1240b3d3cc102bc", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 184, "avg_line_length": 32.44329896907217, "alnum_prop": 0.6266285351128058, "repo_name": "sunlightlabs/read_FEC", "id": "09d8dc18c5a322b49a31d57766d08e183bbd564a", "size"...
import argparse import torch import torch.distributed as dist import torch.multiprocessing as mp from fairscale.optim.oss import OSS from fairscale.nn.data_parallel import ShardedDataParallel as ShardedDDP import torchvision from torchvision import datasets, transforms import time from torch.nn.parallel import Distribu...
{ "content_hash": "4f7619cf193d716b12190ea093734df7", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 118, "avg_line_length": 37.25342465753425, "alnum_prop": 0.6223570509284795, "repo_name": "microsoft/onnxruntime", "id": "e1a7dd591ec36bd035e460da6aa19a14cc187ebc", "size"...
from EXOSIMS.Prototypes.PlanetPopulation import PlanetPopulation from EXOSIMS.PlanetPopulation.EarthTwinHabZone1 import EarthTwinHabZone1 import numpy as np import astropy.units as u class EarthTwinHabZone2(EarthTwinHabZone1): """ Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth) On eccentric h...
{ "content_hash": "d68340b3e6eb3f7cc96521648b0f8c60", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 82, "avg_line_length": 35.870588235294115, "alnum_prop": 0.5716628402755002, "repo_name": "dsavransky/EXOSIMS", "id": "2e200d5d63fdea4877d94799eac0f48b6074b6c0", "size": "3...
""" The VMware API VM utility module to build SOAP object specs. """ import collections import copy import functools from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from oslo_vmware import exceptions as vexc from oslo_vmware.objects import d...
{ "content_hash": "73240943c64031364f96102b02c03734", "timestamp": "", "source": "github", "line_count": 1518, "max_line_length": 79, "avg_line_length": 38.7266139657444, "alnum_prop": 0.6235222072907275, "repo_name": "isyippee/nova", "id": "b61fac4a090e3f0494495465a29e13df501f1748", "size": "59538"...
from weboob.core import WebNip import sys DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" class Connector(object): ''' Connector is a tool that connects to common websites like bank website, phone operator website... and that grabs personal data from there. Credentials are required to make this operation. ...
{ "content_hash": "1935a6060586b52767cba07bcb0454a0", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 91, "avg_line_length": 34.38235294117647, "alnum_prop": 0.5286569717707442, "repo_name": "rlustin/kresus", "id": "a24483842fd7911791b028f89f7660799b9db68b", "size": "2338",...
import unittest import numpy as np from tick.array_test.build.array_test import test_sum_double_pointer, \ test_sum_ArrayDouble, test_sum_SArray_shared_ptr, test_sum_VArray_shared_ptr """ ref_size = 10000 ref_n_loops = 10000 start = time.process_time() ref_result = test_sum_double_pointer(ref_size, ref_n_loops) en...
{ "content_hash": "d0af7f3b721c8ab0ffaa816a52fbcb06", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 80, "avg_line_length": 33.80357142857143, "alnum_prop": 0.6265187533016376, "repo_name": "X-DataInitiative/tick", "id": "2985ba707eb072fc2182dd2abdd183c9deb93239", "size": ...
"""All URLs for the extension.""" from django.conf.urls import url from .views import ( IndexPage, AllWebResourcesPage, AddWebResourcePage, SingleWebResourcePage, RemoveWebResourcePage, ReorderWebResourcesAjax, UpdateWebResourceAjax, AllWebResourcesAPI, SingleWebResourceAPI ) url...
{ "content_hash": "51e1034a8cf228987ba30a405912b1d2", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 60, "avg_line_length": 27.649350649350648, "alnum_prop": 0.5232503522780648, "repo_name": "ExCiteS/geokey-webresources", "id": "fa3260de46d7d2c9a83696707a599927a82913ff", "...