text
stringlengths
4
1.02M
meta
dict
import socket import struct import sys import os import time # see com.intellij.idea.SocketLock for the server side of this interface RUN_PATH = u'$RUN_PATH$' CONFIG_PATH = u'$CONFIG_PATH$' SYSTEM_PATH = u'$SYSTEM_PATH$' def print_usage(cmd): print(('Usage:\n' + ' {0} -h | -? | --help\n' + ...
{ "content_hash": "a8b40f66683bcf0a8314e29bd185fec0", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 85, "avg_line_length": 28.66346153846154, "alnum_prop": 0.5206306608520631, "repo_name": "semonte/intellij-community", "id": "0563b524fb54bfa20c2ae3d6480be3c2a015c4c2", "s...
import pytest from selenium.webdriver.wpewebkit.options import Options @pytest.fixture def options(): return Options() def test_set_binary_location(options): options.binary_location = "/foo/bar" assert options._binary_location == "/foo/bar" def test_get_binary_location(options): options._binary_l...
{ "content_hash": "1fb674eba16ddd80e6e3284d08a0f5e8", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 61, "avg_line_length": 23.61764705882353, "alnum_prop": 0.701120797011208, "repo_name": "valfirst/selenium", "id": "b43e01b8a3b5e4b550501874a0627453b6d702da", "size": "1591...
'''Definition of several collection types (list, dict, set,...)''' import types from JumpScale.core.pmtypes.base import BaseType, NO_DEFAULT class Dictionary(BaseType): '''Generic dictionary type''' NAME = 'dictionary' @staticmethod def check(value): '''Check whether provided value is a dict...
{ "content_hash": "2097cfd35e95082194ececa49d977ee9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 66, "avg_line_length": 24.046511627906977, "alnum_prop": 0.6150870406189555, "repo_name": "Jumpscale/jumpscale6_core", "id": "b96c923a48307cd09c17f9f7222e4e4b0ba02364", "si...
""" Monkey Patch httplib.HTTPResponse to buffer reads of headers. This can improve performance when making large numbers of small HTTP requests. This module also provides helper functions to make HTTP connections using BufferedHTTPResponse. .. warning:: If you use this, be sure that the libraries you are using d...
{ "content_hash": "ef864301f6c636ccfcd59f11c1026c4d", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 79, "avg_line_length": 38.08383233532934, "alnum_prop": 0.6305031446540881, "repo_name": "admiyo/keystone", "id": "db64175d1b425aaa2477e02d62f7c7b6d4818931", "size": "6950...
"""Warpper for testing """ # Coding: utf-8 # File name: test.py # Created: 2016-07-27 # Description: # v0.0: File created. from __future__ import division from __future__ import print_function from __future__ import absolute_import import embeddings import graph import util import numpy as np from matplotlib import ...
{ "content_hash": "5366b15e7dc578a296d3c640ea822301", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 86, "avg_line_length": 35.15573770491803, "alnum_prop": 0.5989741198414549, "repo_name": "gear/motifwalk", "id": "5936e5fee7fbb7bc5f1c552a8edfaad8a0b1c2c5", "size": "4289"...
class Diffusion_Embedding(object): def __init__(self, source_path, file_template, subjects, output_path, diff_time = 0, diff_alpha = 0.5, diff_ncomp = 10, subjects_subset = None, ...
{ "content_hash": "7b0e534fe213c4c449385aefd2d23afe", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 130, "avg_line_length": 36.295392953929536, "alnum_prop": 0.5748525349062943, "repo_name": "mfalkiewicz/diffusion_maps", "id": "acdb25ceaf3e83848a87166608b4666f14b2d115", ...
import _plotly_utils.basevalidators class TextpositionsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="textpositionsrc", parent_name="funnelarea", **kwargs ): super(TextpositionsrcValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "c60bd78c258ee9e0d944ee01b9524ab8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 33.46153846153846, "alnum_prop": 0.6229885057471264, "repo_name": "plotly/plotly.py", "id": "09e27c8241cbb57e0d8bc129a718aaae61b954ef", "size": "435"...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import io import sys from tabulator import Stream print('Parse csv format:') source = 'data/table.csv' with Stream(source, headers='row1') as stream: print(stream.h...
{ "content_hash": "a5268bc2b87f299e8593c6d0b57cf333", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 77, "avg_line_length": 25.138461538461538, "alnum_prop": 0.6612607099143207, "repo_name": "frictionlessdata/tabulator-py", "id": "21209f5b5386043fe8b4bb4fa84fa25ff2294497", ...
__author__ = 'ed adkins' import os import datetime import argparse import logging import sys from connect import Devicemanager from create_output_file import write_file, create_dir FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" logging.basicConfig(format=FORMAT, filename=".logs/lab_manager.log", leve...
{ "content_hash": "a08fecdf7186ec68fe1b4dccb8c0af54", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 97, "avg_line_length": 37.716981132075475, "alnum_prop": 0.6688344172086043, "repo_name": "ejmadkins/labRat", "id": "e80674ff4a224afca65b4d9a23cdc63d93f1e4d3", "size": "202...
import numpy as np from moviepy.decorators import audio_video_fx, convert_parameter_to_seconds def _mono_factor_getter(): return lambda t, duration: np.minimum(t / duration, 1) def _stereo_factor_getter(nchannels): def getter(t, duration): factor = np.minimum(t / duration, 1) return np.arra...
{ "content_hash": "6523eff70868d53ff30e41f344c365b2", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 24.977777777777778, "alnum_prop": 0.6352313167259787, "repo_name": "Zulko/moviepy", "id": "e62c6412ede7507b5ba6bcb47450cca15ff43514", "size": "1124",...
import __main__ __main__.pymol_argv = ['pymol','-qc'] #__main__.pymol_argv = ['pymol',''] import sys,time,os import pymol pymol.finish_launching() sys.path.append("/home/scratch/software/Pymol-script-repo-master") import my_elbow_angle_ab my_file = sys.argv[1] chain1 = sys.argv[2] chain2 = sys.argv[3] limit_h = sys.a...
{ "content_hash": "c136f65cb1e538235e69171c08aa9197", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 22.83783783783784, "alnum_prop": 0.6887573964497041, "repo_name": "demharters/git_scripts", "id": "8f58cd2b871a83cc681577ecd05483d36c8f29f3", "size":...
from enum import Enum from Utils import Status class ExtensionErrorCodeEnum(Enum): success = 1 ExtensionTempTerminalState = 4 error_parameter = 11 error_12 = 12 error_wrong_time = 13 error_same_taskid = 14 error_http_failure = 15 error_upload_status_blob = 16 error = 2 FailedRet...
{ "content_hash": "1c43693f6ad756858a9960137040f983", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 116, "avg_line_length": 40.86486486486486, "alnum_prop": 0.7493386243386243, "repo_name": "jasonzio/azure-linux-extensions", "id": "43cbfa750d744b605bc0f647cb5edc76ea2fcdaa",...
from twisted.internet import reactor, protocol from Config import Config class Server(protocol.Protocol): def connectionMade(self): print('Unity connected') self.transport.write(b"send from server") def dataReceived(self, data): print(data.decode("utf-8")) def connectionLost(sel...
{ "content_hash": "2cd6d9880586663f3a5f809c1cec723c", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 51, "avg_line_length": 21.933333333333334, "alnum_prop": 0.6595744680851063, "repo_name": "Dirilean/Road", "id": "85a52eaa7ead6dc0b71634182a81f5a0ac575b3f", "size": "706", ...
from __future__ import print_function import errno import gc import os import pprint import socket import sys import traceback import eventlet import eventlet.backdoor import greenlet from oslo.config import cfg from ceilometer.openstack.common._i18n import _LI from ceilometer.openstack.common import log as logging ...
{ "content_hash": "614a082d2b86d0c640d89387a782518c", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 77, "avg_line_length": 31.496124031007753, "alnum_prop": 0.6300762983017475, "repo_name": "m1093782566/openstack_org_ceilometer", "id": "bc544762b3ae57de059d16d572e2d40f1e4b...
import sqlite3 import os, sys # Import of my custom classes sys.path.append(os.path.abspath("./classes/")) from config_loader import * CONFIGURATION_FILE = "./config.xml" def get_configuration(): conf = ConfigLoader(CONFIGURATION_FILE) conf.loadFile() configuration = conf.getConfiguration() configur...
{ "content_hash": "e39cd7e55a35f838e9bb161cbdaf6dd1", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 113, "avg_line_length": 36.38095238095238, "alnum_prop": 0.737565445026178, "repo_name": "marekhakala/temperaturehub", "id": "23bc1ec81e59c6ee3417cb9c8b8f0870e0a5f598", "si...
import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredential...
{ "content_hash": "ade532aef1fee00af42370e8219725ac", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 91, "avg_line_length": 44.61827956989247, "alnum_prop": 0.6200747077961201, "repo_name": "googleapis/python-dialogflow", "id": "70eed03825651dcf3d7562859862e25e591f2a11", ...
import os from setuptools import setup, find_packages README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt') with open(requirements_path, "r") as f: REQUIREMENTS = [x.strip() for x in f.readlines()] setup( na...
{ "content_hash": "292358ab18fd4ad75b4641549a8638bf", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 35.48717948717949, "alnum_prop": 0.6322254335260116, "repo_name": "rafalp/django-hbs-makemessages", "id": "24b8bb55ba8de0df9e3afd7f620aaa8954bbe242", ...
"""Run a web flow for oauth2. """ import os import socket import webbrowser from oauth2client import client from oauth2client import tools from googlecloudsdk.core import log from googlecloudsdk.core import config try: # pylint:disable=g-import-not-at-top from urlparse import parse_qsl except ImportError: #...
{ "content_hash": "62f19b6d5f0a2874259e870a509e20d8", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 78, "avg_line_length": 31.063291139240505, "alnum_prop": 0.6666666666666666, "repo_name": "Plantain/sms-mailinglist", "id": "98a15ec5ed5695cca4cc40ccf0af649e98a62336", "si...
cfg = { "slaves": ["192.168.1.2#ma"], "source": "/home/bob/*" } cmd = "rsync -av {source} simple@{ip}::{module} --password-file=/etc/rsync.secrets" from pyinotify import WatchManager, Notifier, ProcessEvent from pyinotify import IN_DELETE, IN_CLOSE_WRITE import signal import threading import sys import subproc...
{ "content_hash": "f320b5c9c1a990ea62dc12e974af1261", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 108, "avg_line_length": 32.17777777777778, "alnum_prop": 0.6022099447513812, "repo_name": "nagexiucai/shityun", "id": "3a133f2687c3b2677d630f0add364233c3f0d3b9", "size": "1...
import datetime import unittest from base import BaseTestCase from project.server.models import User class TestCustomerBlueprint(BaseTestCase): def test_customer_route_requires_login(self): # Ensure logout route requres logged in user. response = self.client.get('/customer/items', follow_redirec...
{ "content_hash": "cada05a547ef1be805194809457fc38b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 33.03703703703704, "alnum_prop": 0.6423766816143498, "repo_name": "slobodz/TeamServices", "id": "66a992dc7fe66ab94f737269d3acbdb44ec2fc89", "size": "...
from __future__ import absolute_import # Avoid importing `importlib` from this package. import decimal import datetime from importlib import import_module import unicodedata from django.conf import settings from django.utils import dateformat, numberformat, datetime_safe from django.utils.encoding import force_str f...
{ "content_hash": "1ccbf7806daf8719540f6f7e1b846153", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 114, "avg_line_length": 36.03056768558952, "alnum_prop": 0.6381044721851896, "repo_name": "YYWen0o0/python-frame-django", "id": "521ab5c7634549dd568dddef5af8b52a613deac8", ...
import logging import pika import json import time import Queue LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' '-35s %(lineno) -5d: %(message)s') LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.ERROR) class AsyncConsumer(object): """This is an...
{ "content_hash": "16057f343dceff3c7beed867ad280f35", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 108, "avg_line_length": 38.208955223880594, "alnum_prop": 0.6359375, "repo_name": "kevenli/Flowy", "id": "b32e02129e7eb2d951d4ebf0d6d2195781371fe8", "size": "15360", "bi...
from __future__ import print_function import logging import numpy as np import tempfile import copy import gomill from gomill import common, boards, sgf, sgf_moves, gtp_states import utils import analyze_board """ Basic Player / Bot objects; Player should be gomill compatible envelope which actually generates ...
{ "content_hash": "d8f63825036d5f14df048b900fc58839", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 101, "avg_line_length": 34.65217391304348, "alnum_prop": 0.5781053952321205, "repo_name": "jmoudrik/deep-go-wrap", "id": "7d05948108d06b6bfea4a6c5f6aeb8054b9e031d", "size"...
""" =============================================================================== Compute a sparse inverse solution using the Gamma-Map empirical Bayesian method =============================================================================== See Wipf et al. "A unified Bayesian framework for MEG/EEG source imaging." ...
{ "content_hash": "e51a71abf0b838df3302651edaf937c5", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 79, "avg_line_length": 35.666666666666664, "alnum_prop": 0.6461342395921835, "repo_name": "agramfort/mne-python", "id": "4eb3208357bd783b0190dea7fab94496e34d3583", "size": ...
"""Support for a User resource in Skytap.""" from skytap.Environments import Environments from skytap.framework.ApiClient import ApiClient import skytap.framework.Utils as Utils from skytap.models.SkytapResource import SkytapResource class User(SkytapResource): """One Skytap User resource.""" def __init__(se...
{ "content_hash": "8a054cc364be3faf794cab1438e58f81", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 103, "avg_line_length": 38.867924528301884, "alnum_prop": 0.5820388349514564, "repo_name": "FulcrumIT/skytap", "id": "10e4a0f9210b2c6a6c29d1ce372015fa5d65eceb", "size": "20...
"""A thin wrapper around datastore query RPC calls. This provides wrappers around the internal only datastore_pb library and is designed to be the lowest-level API to be used by all Python datastore client libraries for executing queries. It provides a layer of protection so the actual RPC syntax can change without af...
{ "content_hash": "a66764a6f7441f89917933ae5df57c16", "timestamp": "", "source": "github", "line_count": 3384, "max_line_length": 80, "avg_line_length": 32.82239952718676, "alnum_prop": 0.653626959332319, "repo_name": "ychen820/microblog", "id": "a116e694a22d9ef68a2d1c02b5bcc39df0c83848", "size": "1...
""" Django settings for djangopoliticalmap project. Generated by 'django-admin startproject' using Django 1.10.4. 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/ """...
{ "content_hash": "3e96764e929f0e35c0dd2cf8d88efe78", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 91, "avg_line_length": 25.816176470588236, "alnum_prop": 0.6955283395044147, "repo_name": "20tab/django-political-map", "id": "a8870bbe6f54efd62733f5e50c190f8a9ed4e577", "...
def api_breadcrumbs(url, endpoint): url_parts = url.split("/") url_iterator = iter(url_parts) url_items = zip(url_iterator, url_iterator) if len(url_parts) % 2 == 0: #this is a request with id at the end. # We don't want it in parent bread crumbs parent_bread_crumbs = url_items[...
{ "content_hash": "4844e51449809142f22f675ed2d96496", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 32.785714285714285, "alnum_prop": 0.6209150326797386, "repo_name": "Aplopio/django_rip", "id": "e6daa342ef64fc9779ec02bbc21badb614d16c3a", "size": "9...
from .models import Project __all__ = ( 'Project', )
{ "content_hash": "dc2e86d707a4486d6849eb1a9820e333", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 27, "avg_line_length": 9.833333333333334, "alnum_prop": 0.559322033898305, "repo_name": "argaen/kickscraper", "id": "8cbfe53da6731733bc4709ff89f1ef73931212a8", "size": "59",...
application_config_schema = { 'type': 'object', 'properties': { 'application_command': {'type': 'string'}, 'local_input_files': { 'type': 'array', 'items': {'type': 'object'} }, 'local_result_files': { 'type': 'object', 'patternProp...
{ "content_hash": "7f8b0cb848e721e25c7622ac1dda0b17", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 83, "avg_line_length": 30.526315789473685, "alnum_prop": 0.47586206896551725, "repo_name": "curious-containers/cc-container-worker", "id": "da315936c02bc075e807c63c1bcc7c18ac...
"""Openstack logging handler. This module adds to logging functionality by adding the option to specify a context object when calling the various log methods. If the context object is not specified, default formatting is used. Additionally, an instance uuid may be passed as part of the log message, which is intended ...
{ "content_hash": "6c7b848c59151d648a23efa004c8044b", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 78, "avg_line_length": 35.26526717557252, "alnum_prop": 0.5853130580659126, "repo_name": "gspilio/nova", "id": "e40a803c5c010f9a2732f450128ad36d97cc0d41", "size": "19295",...
import numpy as np import os import pandas as pd import sys def abide_motion_wrapper(motion_thresh, age_l, age_u, n, n_perms=1000, overwrite=True): behav_data_f = 'DATA/Phenotypic_V1_0b_preprocessed1.csv' f_name = 'RESULTS/rsq_{:03.0f}pct_{:03.0f}subs_{:02.0f}to{:02.0f}.csv'.format(motion_thresh, n, a...
{ "content_hash": "bfeb725353a565f9fe0945b47d91b0f9", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 119, "avg_line_length": 37.244299674267104, "alnum_prop": 0.6320622704215497, "repo_name": "neurohackweek/kids_rsfMRI_motion", "id": "181865c9d52afb248fcc32d4e8cd0dc1fc0fbfa...
"""Dashboard reports.""" from league.dashboard.models import Game class Report(object): """A convenience class for generating AGA results reports.""" def __init__(self, season, episode): """Build a report.""" self.season = season self.episode = episode self.games = Game.get_b...
{ "content_hash": "9ded3fd623797c90d58319c2a7b2b447", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 30.933333333333334, "alnum_prop": 0.6422413793103449, "repo_name": "hwchen/league", "id": "017cfe54eb58d8a79dcf6992bff2fb2f337b9ab6", "size": "488", ...
from django.db import models from django.utils.translation import ugettext_lazy as _ from audit_log.models import AuthStampedModel class Master(AuthStampedModel): description = models.CharField(max_length=255, null=True, blank=True, verbose_name=_('description')) is_active = models.BooleanField(default=True,...
{ "content_hash": "53ca25ecf6d667ca6cea1710ac55c17b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 104, "avg_line_length": 39.285714285714285, "alnum_prop": 0.7381818181818182, "repo_name": "beren5000/ghosttown", "id": "ed81ece78da525e8643ae7a6160226bc69deaeb4", "size": ...
from datadog_checks.base.checks.windows.perf_counters.base import PerfCountersBaseCheckWithLegacySupport from .metrics import METRICS_CONFIG class ActiveDirectoryCheckV2(PerfCountersBaseCheckWithLegacySupport): __NAMESPACE__ = 'active_directory' def get_default_config(self): return {'metrics': METRI...
{ "content_hash": "d1c390cc2d38b36c13164ca28db0afc5", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 104, "avg_line_length": 33.1, "alnum_prop": 0.7915407854984894, "repo_name": "DataDog/integrations-core", "id": "cd2647b3164456b6d71fe392701b48fe7ac3f676", "size": "446", ...
""" SampleCIView - simple OpenGL based CoreImage view """ from Cocoa import * from Quartz import * import CGL from OpenGL.GL import * # XXX: this may or may not be a bug in the OpenGL bindings from OpenGL.GL.APPLE.transform_hint import * import objc # The default pixel format _pf = None class SampleCIView (NSOpen...
{ "content_hash": "3b2b73b330927d19dd65b9315ca91365", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 79, "avg_line_length": 31.078787878787878, "alnum_prop": 0.5916536661466458, "repo_name": "albertz/music-player", "id": "1f5acd7aca46d20d88d6ec2244a64e0e09f832f7", "size":...
""" test_networking_ovn ---------------------------------- Tests for `networking_ovn` module. """ from networking_ovn.ml2 import mech_driver from networking_ovn.tests import base class TestNetworking_ovn(base.TestCase): def test_init(self): # just create an instance of OVNMechDriver mech_driver...
{ "content_hash": "93061ad24ee196bf02631c9bb96da908", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 50, "avg_line_length": 21.0625, "alnum_prop": 0.6498516320474778, "repo_name": "russellb/networking-ovn", "id": "3e1e77f0d97bbb8c845a02dd0f32b2d585d44e3b", "size": "908", ...
import StringIO import math import unittest from webkitpy.common.host_mock import MockHost from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.layout_tests.port.driver import DriverOutput from webkitpy.layout_tests.port.test import TestDriver from webkitpy.layout_tests.port.test import TestPor...
{ "content_hash": "3843dee00d5c41d87e637345f5a322d2", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 165, "avg_line_length": 45.83136094674556, "alnum_prop": 0.612871990187851, "repo_name": "leighpauls/k2cro4", "id": "259fc7854cbe87e58748331d73a1304fcb73d8b6", "size": "17...
from dateutil.rrule import DAILY, MONTHLY, WEEKLY, YEARLY, HOURLY, MINUTELY, SECONDLY from django.db import models from django.utils.translation import ugettext_lazy as _ freqs = (("YEARLY", _("Yearly")), ("MONTHLY", _("Monthly")), ("WEEKLY", _("Weekly")), ("DAILY", _("Daily")), ("...
{ "content_hash": "6bcff43084d3cc10b015825bf78f1349", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 85, "avg_line_length": 33.42528735632184, "alnum_prop": 0.5450481430536451, "repo_name": "saxix/django-scheduler", "id": "7a8eb1e4e18192e90f15ad87ca5f4c846adab774", "size":...
import copy import importlib import logging import logging.handlers import os import re import sys import six from saml2 import root_logger, BINDING_URI, SAMLError from saml2 import BINDING_SOAP from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST from saml2 import BINDING_HTTP_ARTIFACT from s...
{ "content_hash": "7685e6b9936253b299bf3c60cc067187", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 80, "avg_line_length": 29.864462809917356, "alnum_prop": 0.5589993358423733, "repo_name": "cloudera/hue", "id": "9f394872858214f810ca3bd8d3e6528175271235", "size": "18091"...
"""This code example runs a report that an upgraded publisher would use to include statistics before the upgrade. To download the report run download_report.py.""" __author__ = ('Jeff Sham', 'Vincent Tsao') # Locate the client library. If module was installed via "setup.py" script, then # the following ...
{ "content_hash": "71ecc5aa2a8d81df251d5b7deb43b79d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 80, "avg_line_length": 33.509803921568626, "alnum_prop": 0.6512580456407255, "repo_name": "caioserra/apiAdwords", "id": "f992cb99aa6b4cc421c56e62ee152e3207555edb", "size": ...
""" Layout dimensions are used to give the minimum, maximum and preferred dimensions for containers and controls. """ from __future__ import unicode_literals from prompt_toolkit.utils import test_callable_args __all__ = [ 'Dimension', 'D', 'sum_layout_dimensions', 'max_layout_dimensions', 'to_dimen...
{ "content_hash": "429633f1f1adeadf72a0ebcdf1a11135", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 97, "avg_line_length": 32.85641025641026, "alnum_prop": 0.6166692679881379, "repo_name": "lmregus/Portfolio", "id": "d8e831588796a3cc81dfc1c5578e26e023dd3b03", "size": "64...
import os from celery import Celery from django.apps import apps, AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover app = Celer...
{ "content_hash": "e209fd82091446ecbb466578024d5022", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 96, "avg_line_length": 27.333333333333332, "alnum_prop": 0.688470066518847, "repo_name": "savioabuga/lipame", "id": "5b2272a17a11d1b80c0ad199ce68a8b7c74f2543", "size": "903...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.urls import reverse from reversion import revisions as reversion @reversion.register() class Type(models.Model): name = models.CharField(_('Name'), max_length=200, unique=True) def __str__(self): return ...
{ "content_hash": "2cf978f15ecd9bcb3b95795381e42e3f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 78, "avg_line_length": 28.526315789473685, "alnum_prop": 0.6531365313653137, "repo_name": "vIiRuS/Lagerregal", "id": "b0fd4919280bbd97191701c89fa775176ce18e1b", "size": "16...
from __future__ import unicode_literals from django.contrib import admin from django.template import RequestContext from django.http import QueryDict from cms.api import add_plugin, create_page from cms.utils.plugins import build_plugin_tree from cmsplugin_cascade.models import CascadeElement from cmsplugin_cascade.boo...
{ "content_hash": "f795074a4b149ee00f5428f534517604", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 139, "avg_line_length": 57.322916666666664, "alnum_prop": 0.678902416863529, "repo_name": "schacki/djangocms-cascade", "id": "3a818418cf71e5b765bc501b6a5bb17118d3869a", "si...
"""Tests for the Velbus config flow.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest import serial.tools.list_ports from velbusaio.exceptions import VelbusConnectionFailed from homeassistant import data_entry_flow from homeassistant.components import usb from homeassistant.components.velbus imp...
{ "content_hash": "bf8600b7cd87d08455052b25087cb1c3", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 88, "avg_line_length": 33.436708860759495, "alnum_prop": 0.6880560287715314, "repo_name": "GenericStudent/home-assistant", "id": "960eedcbd011b18989b113bbfc1f7c5fc7b3304a", ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/misc/shared_recording_rod_s01.iff" result.attribute_template_id = -1 result.stfName("item_n","recording_rod_s01") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "946ded42a66502dd40a162ae87b2f50d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 23.846153846153847, "alnum_prop": 0.6935483870967742, "repo_name": "obi-two/Rebelion", "id": "1011a2f61bf3f818c0d5fa902ff24bbd0294834f", "size": "455...
""" Option parser for all tests Needs to be a separate module to avoid circular imports """ import sys, optparse def option_parser(): """ Returns the option parser for tests. This parser needs to be able to handle all flags that may be passed to any test Due to the optparse desing we c...
{ "content_hash": "e9ae4039fb69a750770699ec39ccbf21", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 89, "avg_line_length": 32.25581395348837, "alnum_prop": 0.6411920211487623, "repo_name": "ctb/pygr", "id": "7d6779979c8a67be7b5d28accbaad23b74a05ca9", "size": "4161", "b...
from kivy.uix.screenmanager import Screen from gravur.wallet.transactionscrollview import TransactionScrollView # NOQA from gravur.wallet.invoicescrollview import InvoiceScrollView # NOQA from gravur.common.labelbox import LabelBox # NOQA from gravur.common.navbar import NavBar # NOQA from gravur.common.normalbutto...
{ "content_hash": "31091b2ef5b1d3e70a73050a0c4abe50", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 38.92307692307692, "alnum_prop": 0.8280632411067194, "repo_name": "F483/gravur", "id": "27a6e24b33e4ab9315184c9cb4adfd53654242db", "size": "621", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('taxbrain', '0066_auto_20150314_2135'), ] operations = [ migrations.RenameField( model_name='taxsaveinputs', old_name='casual...
{ "content_hash": "b3a6dea2253c1e4595fb46dcec1cc79f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 48, "avg_line_length": 27.973684210526315, "alnum_prop": 0.5465663217309501, "repo_name": "PeterDSteinberg/webapp-public", "id": "0a41c497811faf1df6c892f6be063b0c048e6b4b", ...
import os, sys import inspect import textwrap class PCSEFileReader(dict): """Reader for parameter files in the PCSE format. This class is a replacement for the `CABOFileReader`. The latter can be used for reading parameter files in the CABO format, however this format has rather severe limitations...
{ "content_hash": "8796ebc7d5cae41b5bf0c01d92328253", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 78, "avg_line_length": 38.973684210526315, "alnum_prop": 0.5932928201665542, "repo_name": "jajberni/pcse_web", "id": "6aecafe58f7dff3ee665744743221322bc52ccb8", "size": "4...
""" EC2api API Server """ import sys from oslo_config import cfg from oslo_log import log as logging from ec2api import config from ec2api import service CONF = cfg.CONF def main(): config.parse_args(sys.argv) logging.setup(CONF, 'ec2api') server = service.WSGIService('ec2api', max_url_len=16384) ...
{ "content_hash": "8037813692dc23b3f68c59660e4f8e91", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 61, "avg_line_length": 16.384615384615383, "alnum_prop": 0.6807511737089202, "repo_name": "hayderimran7/ec2-api", "id": "4ad067fbf8d5b53b9cefb0d6fe8582b0b73ae8f0", "size": ...
from extraction.runnables import Extractor, Filter class PlainTextExtractor(Extractor): # Extractors extending this extractor should: # return an ExtractorResult such that # xml_result is a node named 'file' with content 'plain_text.txt' # files is a dict with a key 'plain_text.txt' and a value which...
{ "content_hash": "fe02e8e47367fcff07254a3d95e7bfd8", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 108, "avg_line_length": 45.416666666666664, "alnum_prop": 0.7467889908256881, "repo_name": "SeerLabs/PDFMEF", "id": "2958be27a173b41c7ed8d9bda5833f05551fdf13", "size": "163...
import json from datetime import datetime, timedelta from unittest import mock from django.conf import settings from django.core import mail from django.core.management import call_command from django.test.testcases import TransactionTestCase from olympia import amo from olympia.abuse.models import AbuseReport from o...
{ "content_hash": "adf7aff03c784d9a94e624278c31a66b", "timestamp": "", "source": "github", "line_count": 1512, "max_line_length": 88, "avg_line_length": 40.70304232804233, "alnum_prop": 0.6124823294282047, "repo_name": "mozilla/addons-server", "id": "b3099c76c236f5c237a52b64335727769f2576b8", "size"...
from unittest import TestCase from . import settings from ec2stack.core import DB from ec2stack import create_app from .factories import UserFactory from .utils import FlaskTestCaseMixin class Ec2StackTestCase(TestCase): pass class Ec2StackAppTestCase(FlaskTestCaseMixin, Ec2StackTestCase): def _create_app...
{ "content_hash": "cced137c6f1dca91e2f80e7f13265375", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 64, "avg_line_length": 25.352941176470587, "alnum_prop": 0.6763341067285383, "repo_name": "apache/cloudstack-ec2stack", "id": "55758ace2742ebca544ed0bf0c1cb84d8c8ab253", "s...
"""Dependency Resolution The dependency resolution in pip is performed as follows: for top-level requirements: a. only one spec allowed per project, regardless of conflicts or not. otherwise a "double requirement" exception is raised b. they override sub-dependency requirements. for sub-dependencies ...
{ "content_hash": "e132701037fa490fc11663307a5dbe4f", "timestamp": "", "source": "github", "line_count": 473, "max_line_length": 84, "avg_line_length": 38.51797040169133, "alnum_prop": 0.617542126351611, "repo_name": "nataddrho/DigiCue-USB", "id": "665dba128a9776d3c2c58a1da9f48c1d11d5d60a", "size": ...
"""spatial index on links Revision ID: 4c2d727186 Revises: 8fc9e3cc0a Create Date: 2014-09-26 15:01:43.779140 """ # revision identifiers, used by Alembic. revision = '4c2d727186' down_revision = '8fc9e3cc0a' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic -...
{ "content_hash": "b3cd6f6eb45a5c80b86e763a32c2c4b1", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 93, "avg_line_length": 24.5, "alnum_prop": 0.6844583987441131, "repo_name": "rjw57/trafficdb", "id": "f23af721fefe7c367a2f6d4ada00fdd33d41c4d9", "size": "637", "binary": ...
import Adafruit_DHT sensor = Adafruit_DHT.DHT11 pin = 4 humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) if humidity is not None and temperature is not None: print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(temperature, humidity) else: print 'Failed to get reading. Try again!'
{ "content_hash": "3bba8fa44b3c877b8928e61a600ddfe7", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 74, "avg_line_length": 24.833333333333332, "alnum_prop": 0.7348993288590604, "repo_name": "valeriodelsarto/valecasa_bot", "id": "d293cd448fdda5d6f33ca5b01431a7aaa71b0e9d", ...
from steamweb.models import * from steamweb.database import db_session from steamweb.actions.actions_init import command_mapping resources = ['water', 'ore', 'quartz', 'energy'] def resolve_action(player_command, gameid, playerid): player = Player.query.filter(Player.id == playerid).first() game = Game.query...
{ "content_hash": "e2a70cc5c75f7da92b54811471a5c54b", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 81, "avg_line_length": 38.89473684210526, "alnum_prop": 0.706359945872801, "repo_name": "PiotrZakrzewski/steamweb", "id": "5d39f65b51e5d1554d2e278034d80d5e4b176a14", "size"...
from collections import namedtuple import logging import numpy as np from ray.rllib.policy.sample_batch import MultiAgentBatch, SampleBatch from ray.rllib.policy import Policy from ray.rllib.utils.annotations import DeveloperAPI from ray.rllib.offline.io_context import IOContext from ray.rllib.utils.numpy import conv...
{ "content_hash": "9dd6d60db89eeed7e568371c90098378", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 37.660377358490564, "alnum_prop": 0.6347695390781564, "repo_name": "richardliaw/ray", "id": "43aa2cc208a7c7d886738818513d9de9bfae8d7a", "size": "399...
from aiohttp import web import socketio sio = socketio.AsyncServer(async_mode='aiohttp') app = web.Application() sio.attach(app) async def index(request): with open('fiddle.html') as f: return web.Response(text=f.read(), content_type='text/html') @sio.event async def connect(sid, environ, auth): p...
{ "content_hash": "37130e515544864c2483d52e60792390", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 68, "avg_line_length": 19.806451612903224, "alnum_prop": 0.6530944625407166, "repo_name": "miguelgrinberg/python-socketio", "id": "dfde8e10c2f193d4b483815be4bf5601ef1d0bfb", ...
""" __graph_MT_post__PortRef.py___________________________________________________________ Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION _____________________________________________________________________________ """ import tkFont from graphEntity import * from GraphicalForm i...
{ "content_hash": "bf899bd4e004ec9c27e1d726f6952745", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 210, "avg_line_length": 41.476190476190474, "alnum_prop": 0.5755836203597398, "repo_name": "levilucio/SyVOLT", "id": "6023597b3b0366dbfec7e10bf71c9c8681531224", "size": "26...
import base64 from upcloud_api.api import API from upcloud_api.cloud_manager.firewall_mixin import FirewallManager from upcloud_api.cloud_manager.host_mixin import HostManager from upcloud_api.cloud_manager.ip_address_mixin import IPManager from upcloud_api.cloud_manager.network_mixin import NetworkManager from upclou...
{ "content_hash": "e147145fc349393afd0f640b06c4ea15", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 98, "avg_line_length": 30.36904761904762, "alnum_prop": 0.6589572716581733, "repo_name": "UpCloudLtd/upcloud-python-api", "id": "c525d0e96d713fdd9b0b322af3969012ab5be22e", ...
"""Tests for tensorflow.python.training.saver.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import math import os import random import shutil import tempfile import time import numpy as np import six from google.protobuf.any_pb2...
{ "content_hash": "4d61ff49e9472df24ed1891aac8e53ef", "timestamp": "", "source": "github", "line_count": 2570, "max_line_length": 80, "avg_line_length": 41.71867704280156, "alnum_prop": 0.6432188925263718, "repo_name": "dyoung418/tensorflow", "id": "744b17dd224297cbefedfe562ff106fe1200664f", "size":...
from django.apps import AppConfig from django_fsm import signals as fsm_signals class GeoIPConfig(AppConfig): name = 'waldur_geo_ip' def ready(self): from waldur_geo_ip.mixins import IPCoordinatesMixin from . import handlers for index, model in enumerate(IPCoordinatesMixin.get_all_mo...
{ "content_hash": "ff2fc746887b74f657883352c1edfacc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 32.68421052631579, "alnum_prop": 0.6022544283413849, "repo_name": "opennode/nodeconductor-assembly-waldur", "id": "2866565978e50a5aa5d26c2d33cd63880746...
"""Clustering Operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.factorization.python.ops import gen_clustering_ops # go/tf-wildcard-import # pylint: disable=wildcard-import from tensorflow.contrib.factorization.python.op...
{ "content_hash": "b2ba61c4138d177ecd12a1a34b4c1c2c", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 80, "avg_line_length": 45.88805970149254, "alnum_prop": 0.6608391608391608, "repo_name": "ville-k/tensorflow", "id": "2e9b5e22c73e02dce01fe6f62ad1de5fced88dd9", "size": "2...
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 'EmbedPlacePlugin' db.create_table(u'aldryn_locations_embedplaceplugin', ( (u'cmsplugin_ptr', self.gf('dj...
{ "content_hash": "b7f37232cc493016fb543df41d56975a", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 185, "avg_line_length": 81.6734693877551, "alnum_prop": 0.5834582708645677, "repo_name": "aldryn/aldryn-locations", "id": "9738f53cefedb75d126fa68415168d552e6391c2", "size...
import signal from django.test import TestCase from bulk_sms.utils import SignalManager class SignalManagerTest(TestCase): def setUp(self): self.manager = SignalManager() def _test_handler1(self): pass def _test_handler2(self): pass def test_push_pop(self): """ ...
{ "content_hash": "62c712c8f8a535b570ae9281fb887d91", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 82, "avg_line_length": 38.28358208955224, "alnum_prop": 0.6456140350877193, "repo_name": "SmartElect/SmartElect", "id": "21a9d4b8b7cbb0fec2e0c9de1fc144c18e734c75", "size": ...
from core import ContextDependent, Drawable class TextBlock(ContextDependent, Drawable): """ For drawing text """ def __init__(self, string): # initialize parent constructors for parent in self.__bases__: parent.__init__() self.contents = [] self.contents.append...
{ "content_hash": "b47ab8c6d8e743a91721b2e85c48f0a1", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 59, "avg_line_length": 21.653846153846153, "alnum_prop": 0.5612788632326821, "repo_name": "bengolder/sketcher", "id": "e8aa036b569b545c375ae7c4673d7d6f11bbdf11", "size": "5...
import os import sys import hashlib import unittest from time import sleep import system_test from system_test import TestCase, Qdrouterd, QdManager, Process from system_test import curl_available, TIMEOUT, skip_test_in_ci from subprocess import PIPE h2hyper_installed = True try: import h2.connection # noqa F401: ...
{ "content_hash": "6a8f114d08648744ea75df3031d383c0", "timestamp": "", "source": "github", "line_count": 860, "max_line_length": 126, "avg_line_length": 45.753488372093024, "alnum_prop": 0.5613245908305378, "repo_name": "mgoulish/qpid-dispatch", "id": "a588fa47df425d31fe3848604f25f0d3de38159e", "siz...
import argparse import argparse_parent_with_group parser = argparse.ArgumentParser( parents=[argparse_parent_with_group.parser], ) parser.add_argument('--local-arg', action="store_true", default=False) print(parser.parse_args())
{ "content_hash": "89e06980b9d55683e19d5e1d312afea1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 23, "alnum_prop": 0.6485507246376812, "repo_name": "jasonwee/asus-rt-n14uhp-mrtg", "id": "f44d6a899ad8833da38cb9e847bf405ad9d46cae", "size": "276", ...
from textx.metamodel import metamodel_from_file from textx.export import metamodel_export, model_export from textx.exceptions import TextXSyntaxError from pythonmodels import MLayoutGraph, MLayoutSubgraphs, MExpression, MTerm, MFactor import os import sys class Interpreter(): def __init__(self,): metamode...
{ "content_hash": "52d85de95ba112caf27096dfdf85117a", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 114, "avg_line_length": 42.306666666666665, "alnum_prop": 0.502363693665301, "repo_name": "renatav/GraphDrawing", "id": "67565b055ea7eba40522ec50d8d5c3dcbe639a0b", "size":...
from __future__ import unicode_literals from django.db import migrations, models import extras.models class Migration(migrations.Migration): dependencies = [ ('extras', '0006_add_imageattachments'), ] operations = [ migrations.AlterField( model_name='customfield', ...
{ "content_hash": "918cbafcd84701e39208008c5c977bf2", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 298, "avg_line_length": 45.325842696629216, "alnum_prop": 0.601883986117997, "repo_name": "snazy2000/netbox", "id": "c9a624510188026199887927911c76f4240cfc56", "size": "410...
import contextlib import cProfile import datetime import io import os import pstats import signal PYSPY_OUTPUT = os.environ.get("PYSPY_OUTPUT", "/files/pyspy/") @contextlib.contextmanager def pyspy(): """ This decorator provide deterministic profiling. It generate and save flame graph to file. It uses``pyspy...
{ "content_hash": "9ef5e88659db09f6399091b8ca3126e9", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 110, "avg_line_length": 26.9375, "alnum_prop": 0.6295436968290796, "repo_name": "apache/incubator-airflow", "id": "596f4f68330c928f015805b580ffda500a34b20d", "size": "3371"...
from .sub_resource import SubResource class ApplicationGatewayBackendHttpSettings(SubResource): """Backend address pool settings of an application gateway. :param id: Resource Identifier. :type id: str :param port: Port :type port: int :param protocol: Protocol. Possible values are: 'Http' an...
{ "content_hash": "9393c71ba09a502a9d20ad10d049bc1b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 90, "avg_line_length": 48.26315789473684, "alnum_prop": 0.6659396583060705, "repo_name": "lmazuel/azure-sdk-for-python", "id": "dbc04149c72111f1a61cee8a1a6804aeb9300119", "...
from setuptools import setup, find_packages setup( name='django-stats', version='0.1', description='An app for keeping stats about anything within your django project', author='Chris Drackett', author_email='chris@shelfworthy.com', url = "https://github.com/shelfworthy/django-stats", packa...
{ "content_hash": "4c757fdfd88052dadd9f432e0d8c1973", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 85, "avg_line_length": 30, "alnum_prop": 0.6212121212121212, "repo_name": "shelfworthy/django-stats", "id": "b3888eff611133624c301644a0b8c0dc456da68d", "size": "660", "bi...
from model.contact import Contact from random import randrange def test_modify_contact_name(app): old_contacts = app.contact.get_contact_list() index = randrange(len(old_contacts)) contact = Contact(firstname="Test") contact.id = old_contacts[index].id if app.contact.count() == 0: app.cont...
{ "content_hash": "04e470f4745aea90643b06bc6ef3bd93", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 102, "avg_line_length": 34.36842105263158, "alnum_prop": 0.7029096477794793, "repo_name": "volkodav1985/volkodavpython", "id": "758062a96aae4a9af961de768ccc77a5d98e588a", "...
from __future__ import annotations from typing import TYPE_CHECKING, Callable, Dict, Tuple, Any, cast import functools import numpy as np import math import types import warnings # trapezoid is a public function for scipy.integrate, # even though it's actually a NumPy function. from numpy import trapz as trapezoid fro...
{ "content_hash": "9f27f41d050bf85231f782a2d48fd8b2", "timestamp": "", "source": "github", "line_count": 1037, "max_line_length": 103, "avg_line_length": 32.79267116682739, "alnum_prop": 0.5758101511497971, "repo_name": "perimosocordiae/scipy", "id": "485356e6020c364a141394a78380aeeb13c7ff07", "size...
""" WSGI config for task_service project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
{ "content_hash": "cebd726b6eee16a3523a74c41bee3d19", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.0625, "alnum_prop": 0.770573566084788, "repo_name": "cognoma/task-service", "id": "7fcb12de4e2efdf341171f924206ce85d64019a8", "size": "401", "bi...
import os from django.db import models from tagging.models import Tag from graphite.events.compat import ModelTaggedItemManager if os.environ.get('READTHEDOCS'): TagField = lambda *args, **kwargs: None else: from tagging.fields import TagField class Event(models.Model): when = models.DateTimeField() ...
{ "content_hash": "ee54f0b2147b36c1b2fd797b911f7342", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 84, "avg_line_length": 27.864406779661017, "alnum_prop": 0.6058394160583942, "repo_name": "cosm0s/graphite-web", "id": "8f4fd905b05b22fe04b74a9b7b021a0a654e3b8b", "size": "...
"""Module containing base test results classes.""" import functools import sys import threading from lib.results import result_types # pylint: disable=import-error class ResultType: """Class enumerating test types. Wraps the results defined in //build/util/lib/results/. """ PASS = result_types.PASS SKI...
{ "content_hash": "fce22c8ad69571f5b51f89a6b4c324d9", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 80, "avg_line_length": 28.68840579710145, "alnum_prop": 0.6203586764334428, "repo_name": "nwjs/chromium.src", "id": "8a1610eb722c6ebf32cae9d93bded3f4d1d7414e", "size": "80...
from . import ObjectCreationParameters __author__ = 'Shamal Faily' class ClassAssociationParameters(ObjectCreationParameters.ObjectCreationParameters): def __init__(self,envName,headName,headDim,headNav,headType,headMultiplicity,headRole,tailRole,tailMultiplicity,tailType,tailNav,tailDim,tailName,rationale = ''): ...
{ "content_hash": "ad69f7ae320408721483f0f4e85f8e93", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 164, "avg_line_length": 43.916666666666664, "alnum_prop": 0.788741302972802, "repo_name": "nathanbjenx/cairis", "id": "846f84aee30fe7666230706763f5190b482cb285", "size": "2...
import logging import os import sys import time import numpy as np import tensorflow as tf import bigru_model import data_util tf.app.flags.DEFINE_float("learning_rate", 1., "Learning rate.") tf.app.flags.DEFINE_integer("size", 400, "Size of hidden layers.") tf.app.flags.DEFINE_integer("embsize", 200, "Size of embed...
{ "content_hash": "fc7f93e75488fef43c6659d5a7148a48", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 119, "avg_line_length": 42.034188034188034, "alnum_prop": 0.5917039446929646, "repo_name": "SebastienBoisard/Thunlp-Summarization", "id": "5ed1d55f5de06ee580fe13d70997f329cf...
"""OAuth 2.0 WSGI server middleware providing MyProxy certificates as access tokens """ __author__ = "R B Wilkinson" __date__ = "12/12/11" __copyright__ = "(C) 2011 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revisi...
{ "content_hash": "aeb476e21c3528e6513d7fa3af8f4fcf", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 83, "avg_line_length": 36.96, "alnum_prop": 0.6504329004329005, "repo_name": "cedadev/ndg_oauth", "id": "cfab1a57d1795e130cb929ddd40d3678a7af09d1", "size": "1848", "binar...
from rx import Observable from rx.internal import extensionmethod @extensionmethod(Observable, name="slice") def slice_(self, start=None, stop=None, step=1): """Slices the given observable. It is basically a wrapper around the operators skip(), skip_last(), take(), take_last() and filter(). This marble d...
{ "content_hash": "a3930c93a7f045edf358e81e89522fa8", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 75, "avg_line_length": 31.78723404255319, "alnum_prop": 0.6198125836680054, "repo_name": "Sprytile/Sprytile", "id": "1097031c9de10d98ecb1c5ad130403e09df9bf0d", "size": "298...
"""radius URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-base...
{ "content_hash": "6aefd5b95c4b0e4f560c8749868856c5", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 108, "avg_line_length": 45.829268292682926, "alnum_prop": 0.7232570516232039, "repo_name": "realworldtech/radius_restserver", "id": "38f1f7174140c7ff4fe50641b142f43787935294"...
FAILEDOPERATION = 'FailedOperation' # 设备固件升级任务已经完成。 FAILEDOPERATION_DEVICEFIRMWARETASKALREADDONE = 'FailedOperation.DeviceFirmwareTaskAlreadDone' # 设备正在升级中。 FAILEDOPERATION_DEVICEISUPDATING = 'FailedOperation.DeviceIsUpdating' # 设备已经运行其他ota升级任务。 FAILEDOPERATION_DEVICERUNNINGOTHEROTATASK = 'FailedOperation.DeviceRunn...
{ "content_hash": "5386f0d1876aa4936b41e29f49054804", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 93, "avg_line_length": 26.627906976744185, "alnum_prop": 0.8445414847161572, "repo_name": "tzpBingo/github-trending", "id": "4932c507866eabe0f987d4e711751e02f8d9014a", "siz...
import collections from neutron_lib import constants from neutron_lib.db import constants as db_consts from neutron_lib.services.qos import constants as qos_consts from oslo_log import log as logging from neutron.agent.linux import l3_tc_lib as tc_lib from neutron.api.rpc.callbacks.consumer import registry from neutr...
{ "content_hash": "8342ea35624ea62fde852fed5e59010c", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 77, "avg_line_length": 37.205298013245034, "alnum_prop": 0.6167675329298683, "repo_name": "noironetworks/neutron", "id": "8ab50b10333859275bce70a7a420d842348d864a", "size"...
from pipedream.dispatcher import Dispatcher from pipedream.exceptions import *
{ "content_hash": "7e680e4e297ee3a84ea2daab12e8e8d7", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 43, "avg_line_length": 39.5, "alnum_prop": 0.8607594936708861, "repo_name": "tgecho/pipedream", "id": "ab9b32598c80a69b459edd7f94ee40e374b3e9a4", "size": "79", "binary": f...
import cv2 import sys cascPath = sys.argv[1] faceCascade = cv2.CascadeClassifier(cascPath) cameraNum = 1 video_capture = cv2.VideoCapture(cameraNum) while True: # Capture frame-by-frame ret, frame = video_capture.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiS...
{ "content_hash": "0e9622ce3e57502b21cb160a5325c9b3", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 24.08108108108108, "alnum_prop": 0.6127946127946128, "repo_name": "ResearcherOne/RobotTakimiRepo", "id": "6334c854f73fb63392bcc6be873e6a2d50fb7789", ...
""" kombu.transport.virtual ======================= Virtual transport implementation. Emulates the AMQ API for non-AMQ transports. """ from __future__ import absolute_import import base64 import socket import warnings from itertools import count from time import sleep, time from Queue import Empty from kombu.exce...
{ "content_hash": "8ffad8b3250e99d7868fe3c35f034760", "timestamp": "", "source": "github", "line_count": 787, "max_line_length": 79, "avg_line_length": 32.95552731893265, "alnum_prop": 0.5783081431215299, "repo_name": "neumerance/deploy", "id": "6936b1ce738bb528cb2b561e92f5b83ca482f290", "size": "25...
from __future__ import print_function import httplib2 import os import argparse from OpenSSL import SSL from flask import Flask, jsonify from flask_restful import Resource, Api, reqparse from flask.ext.mysql import MySQL from apiclient import discovery import oauth2client from oauth2client import client from oauth2cl...
{ "content_hash": "bc9287721277452b890aa3f52dcf0a61", "timestamp": "", "source": "github", "line_count": 812, "max_line_length": 112, "avg_line_length": 34.48891625615764, "alnum_prop": 0.5145509730405284, "repo_name": "ktang012/CS180", "id": "a45b7f8b853e7af79903c0c651a506d840ab40b7", "size": "2800...
import matplotlib.pyplot as plt import json import argparse parser = argparse.ArgumentParser(description='Plot ev3dev datalogs.') parser.add_argument('infile', help='the input file to be logged') args = parser.parse_args() # Note, this code is a modified version from these pages: # # http://www.randalolson.com/2014/...
{ "content_hash": "d7529a1c074514f870c36b313b41016e", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 113, "avg_line_length": 36.13333333333333, "alnum_prop": 0.567650676506765, "repo_name": "rhempel/ev3dev-lang-python", "id": "c7a3725867b611fe460fae4a5262287db47fbf57", "si...
def main(request, response): encoding = request.GET['encoding'] tmpl = request.GET['tmpl'] sheet = tmpl % u'\\0000E5' return [("Content-Type", "text/css; charset=%s" % encoding)], sheet.encode(encoding)
{ "content_hash": "dfc7aea368afe153cc74bb9936b6085a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 88, "avg_line_length": 43.8, "alnum_prop": 0.6438356164383562, "repo_name": "youtube/cobalt", "id": "d7c9bce2786b44cbd3c4fa755ad60191032188d1", "size": "219", "binary": fa...
import abc class ServicePluginBase(object): """ defines base interface for any Advanced Service plugin """ __metaclass__ = abc.ABCMeta supported_extension_aliases = [] @abc.abstractmethod def get_plugin_type(self): """ returns one of predefine service types. see quantum/plugin...
{ "content_hash": "062a671b827b60de02d2ff765c2030dd", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 27.333333333333332, "alnum_prop": 0.6483739837398373, "repo_name": "aristanetworks/arista-ovs-quantum", "id": "dfa074d4ef2cbe0b857b893166763634ad7a416c...
import numpy as np import cv2 import logging import urllib.request import base64 from threading import Thread, Event logger = logging.getLogger('universe') class IPCamera: def __init__(self, url): self.stream = urllib.request.urlopen(url) self.b = bytearray() def read(self): max = 10...
{ "content_hash": "600c08c0f32edff03f662257980acf8c", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 91, "avg_line_length": 25.51798561151079, "alnum_prop": 0.5351000845785171, "repo_name": "bobbyluig/Eclipse", "id": "38621aabd687e7436a1c1c6db81d3b57821c0206", "size": "35...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0009_abstractnode_preprint_file'), ('osf', '0010_auto_20161025_1332'), ] operations = [ ]
{ "content_hash": "e3730d47d7b44f14a9dcadca116d7970", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 51, "avg_line_length": 18.928571428571427, "alnum_prop": 0.6339622641509434, "repo_name": "acshi/osf.io", "id": "b762d936a650ee668ecd6bba06044b375d40e2a2", "size": "335", ...
import collections import re from oslo_log import log as logging from tempest.lib.common.utils import data_utils from tempest import config from tempest.scenario import manager from tempest import test from tempest.lib import exceptions CONF = config.CONF LOG = logging.getLogger(__name__) Floating_IP_tuple = collec...
{ "content_hash": "28dcd3395b79616020014959f5096e33", "timestamp": "", "source": "github", "line_count": 535, "max_line_length": 97, "avg_line_length": 42.65607476635514, "alnum_prop": 0.5341133166820035, "repo_name": "cisco-openstack/tempest", "id": "b3d4910b4040590bece0fa7871371c3d6f78568f", "size...
from docutils import nodes from docutils.parsers.rst import Directive, directives CODE = ("""<iframe width="{width}" height="{height}" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/""" """{sid}"> </iframe>""") class SoundCloud(Directive): """ ...
{ "content_hash": "ab91ee59c77b1dd640cc357bd9e9c8b0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 79, "avg_line_length": 29.74468085106383, "alnum_prop": 0.5836909871244635, "repo_name": "servalproject/nikola", "id": "6bdd4d51749fbdd92245f087d99a4422cdbbb47a", "size": "...
from tempest.services.volume.json.admin import volume_quotas_client class VolumeQuotasV2Client(volume_quotas_client.BaseVolumeQuotasClientJSON): """ Client class to send CRUD Volume V2 API requests to a Cinder endpoint """ def __init__(self, auth_provider): super(VolumeQuotasV2Client, self)._...
{ "content_hash": "df2db543e6c469cdc0d5587c39f90c5f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 76, "avg_line_length": 31.333333333333332, "alnum_prop": 0.7127659574468085, "repo_name": "Lilywei123/tempest", "id": "64f4f338abd1d1426e2ac1cf59f05bd5dbdbc678", "size": "1...