text
stringlengths
4
1.02M
meta
dict
import argparse import os import sys import time from screenshots import Client, Screenshooter def env(name, default): return os.environ.get(name, default) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "-a", "--commands-after", dest="commands...
{ "content_hash": "aa1a7a55e631b36fb9d3cebcf7751bbd", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 92, "avg_line_length": 26.853503184713375, "alnum_prop": 0.5633301707779886, "repo_name": "qtile/qtile", "id": "205c9a783d7375985ae44b36c78d6df303a31a85", "size": "4239", ...
"""Tests for the WLED light platform.""" import aiohttp from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_HS_COLOR, ATTR_RGB_COLOR, ATTR_TRANSITION, ATTR_WHITE_VALUE, DOMAIN as LIGHT_DOMAIN, ) from homeassistant.components.wled.const import...
{ "content_hash": "4173d231fb156ec29f2cc97ba0db9522", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 86, "avg_line_length": 32.733333333333334, "alnum_prop": 0.6673977753407488, "repo_name": "leppa/home-assistant", "id": "037081608af422906169098efc02a50fc1639142", "size":...
import os import sys import traceback # Add the pulsar path thispath = os.path.dirname(os.path.realpath(__file__)) psrpath = os.path.join(os.path.dirname(thispath), "modules") sys.path.insert(0, psrpath) import pulsar as psr from pulsar.output import * from pulsar.testing import * from pulsar.system import * from ...
{ "content_hash": "2ca8ee79c2ce40aea2552f9e3bf6efb6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 87, "avg_line_length": 23.189873417721518, "alnum_prop": 0.550764192139738, "repo_name": "pulsar-chem/Pulsar-Core", "id": "6a796813af70de899f8474ed24b2458e67152db0", "size"...
from requestbuilder import Arg from euca2ools.commands.ec2 import EC2Request class AssociateDhcpOptions(EC2Request): DESCRIPTION = 'Associate a DHCP option set with a VPC' ARGS = [Arg('DhcpOptionsId', metavar='DHCPOPTS', help='''ID of the DHCP option set to associate, or "default" (required)'...
{ "content_hash": "b90da8e1cd4f83390fa31396951a31ff", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 41.125, "alnum_prop": 0.60790273556231, "repo_name": "vasiliykochergin/euca2ools", "id": "d981ad8499a2d73a0ff7d13be103d7b48cbcf519", "size": "2000", ...
import asyncio import curses import weakref from datetime import datetime import npyscreen from DictObject import DictObject from npyscreen import ActionFormV2WithMenus, wgwidget as widget from pytg.exceptions import NoResponse, IllegalResponseException from pytg.utils import coroutine from pygram import printed, che...
{ "content_hash": "aad9e86fdde1635b30abf5cae76820fd", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 116, "avg_line_length": 39.97119341563786, "alnum_prop": 0.5546175229074436, "repo_name": "RedXBeard/pygram", "id": "4d595583596fa3ea18083dee461273a5b3c51350", "size": "97...
from flask import Blueprint frontend = Blueprint('frontend', __name__) from . import views
{ "content_hash": "a83573be6286b5cc3bdedcf574368ae9", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 15.666666666666666, "alnum_prop": 0.723404255319149, "repo_name": "rblack42/rstRefactored", "id": "e269d7590a67b1f539388c7352d4ef5ff75ea98d", "size": ...
import multiprocessing import os import time import unittest import uuid from unittest import mock import pytest from mock import patch from airflow import settings from airflow.exceptions import AirflowException from airflow.executors.sequential_executor import SequentialExecutor from airflow.jobs.local_task_job imp...
{ "content_hash": "2a06bbb6b5b3d76d0ac68355fdeeb8c1", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 105, "avg_line_length": 37.36666666666667, "alnum_prop": 0.5825793296801325, "repo_name": "wooga/airflow", "id": "2d91efe32d92e7d21ca045fe197b0039c3db4a28", "size": "16483...
from ..oauth import OAuth2, register_oauth @register_oauth class Github(OAuth2): '''Github api https://developer.github.com/v3/ ''' auth_uri = 'https://github.com/login/oauth/authorize' token_uri = 'https://github.com/login/oauth/access_token'
{ "content_hash": "fa416e8bd5c9dee119898cca92be881d", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 24.272727272727273, "alnum_prop": 0.6779026217228464, "repo_name": "tazo90/lux", "id": "47cfe4a1b2d73128570364737735530021e41961", "size": "267", "...
""" Performs windowing of incoming stream and produces instances of fixed length for preprocessing and classification. The :class:`~pySPACE.missions.support.windower.SlidingWindower` class performs windowing for the online setting where no markers are available. The :class:`~pySPACE.missions.support.windower.MarkerWi...
{ "content_hash": "6b5f88c7efd0a8c5ac67a81814d3f73d", "timestamp": "", "source": "github", "line_count": 1167, "max_line_length": 128, "avg_line_length": 43.36846615252785, "alnum_prop": 0.5582383276362846, "repo_name": "pyspace/pyspace", "id": "e3f394815a705d02b75e6d21275f90ae06ab1a1d", "size": "50...
from django.test import TestCase from yacon.models.site import Site from yacon.tests.utils import create_test_site # ============================================================================ class ManagementCommandTests(TestCase): def setUp(self): create_test_site() def test_check_commands(self):...
{ "content_hash": "da203732dab5512882ad10988991af4f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 30.91304347826087, "alnum_prop": 0.5893108298171589, "repo_name": "cltrudeau/django-yacon", "id": "751f9e17ad4035a5eb2f2b3e2be44125575b21fa", "size":...
from flask import Flask,send_file from flask.ext.cors import CORS from qrcode import * import pexpect import json import re import os import pexpect import sys import reachable_ips import is_ssh app = Flask(__name__) cors = CORS(app) @app.route("/<info>/<ip>") @app.route("/<info>/<ip>/<eth>") @app.route("/<info>/<ip...
{ "content_hash": "a54e93e13fcf5ed96568b09d0d4755cb", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 107, "avg_line_length": 30.929515418502202, "alnum_prop": 0.584247258225324, "repo_name": "MuthuramanG/SpotLight", "id": "fc83d66421c5c49acca132cdcab9f32756531238", "size"...
import tqdm import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import utils.filesys as fs import utils.utils as ut import utils.tfw as tfw import utils.printer as pr import utils.datasets as ds """ A combination of modules that interacts with environment """ class Model: def __init__(self, ...
{ "content_hash": "19f1fa7e4395cf7e505d6b01f1f2cb54", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 87, "avg_line_length": 28.0625, "alnum_prop": 0.6176117868768203, "repo_name": "MehranMirkhan/ai_system", "id": "a58168979af6c28358f98a6a699ff08e6b815433", "size": "5838",...
"""Test the runtime.parser module.""" import unittest import runtime.lexer import runtime.env import runtime.flags from runtime.parser import * def token(value, kind): return lexer.TokenTuple(value=value, kind=kind) asgn_token = token("=", lexer.OPERATOR) asgnadd_token = token("+=", lexer.OPERATOR) asgnsub_toke...
{ "content_hash": "2d3cb37d7f89ac480b7299798f914eec", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 111, "avg_line_length": 35.60740740740741, "alnum_prop": 0.5252756396921157, "repo_name": "lnsp/tea", "id": "551e8bac6e2bb354f266a1d013ea38e6be1e6fff", "size": "19232", ...
from __future__ import unicode_literals from itertools import chain from django.apps import apps from django.conf import settings from django.contrib.admin.utils import ( NotRelationField, flatten, get_fields_from_path, ) from django.core import checks from django.core.exceptions import FieldDoesNotExist from dja...
{ "content_hash": "e30bfe392f15bd0024bb85501bbf1457", "timestamp": "", "source": "github", "line_count": 1015, "max_line_length": 117, "avg_line_length": 39.92512315270936, "alnum_prop": 0.5122396604481295, "repo_name": "himleyb85/django", "id": "48539fe9e5935da5a3c33adb563436e2d601a9ec", "size": "4...
""" This module contains the `ExpandoTextCtrl` which is a multi-line text control that will expand its height on the fly to be able to show all the lines of the content of the control. """ import wx import wx.lib.newevent # This event class and binder object can be used to catch # notifications that the ExpandoTextC...
{ "content_hash": "ed9ccabfedc0e9b3593fe9e3baa326a9", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 129, "avg_line_length": 38.64186046511628, "alnum_prop": 0.5652383245064998, "repo_name": "ifwe/wxpy", "id": "4c5b876eac82f0c20fe33ead4c6ac70f536132ce", "size": "8834", ...
from django.contrib import admin from . import models class GithubFeedAdmin(admin.ModelAdmin): list_display = ['username'] fields = ['username', 'token', 'api_key'] search_fields = ['username'] admin.site.register(models.GithubFeed, GithubFeedAdmin)
{ "content_hash": "02192a57d4ca4f41ba5485d310fee51e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 26.5, "alnum_prop": 0.720754716981132, "repo_name": "harveyr/django-aggregape", "id": "f4c825dcfa5051e82067a2926a65d881722e0c68", "size": "265", "b...
def preBuildPage(page, context, data): """ Called prior to building a page. :param page: The page about to be built :param context: The context for this page (you can modify this, but you must return it) :param data: The raw body for this page (you can modify this). :returns: Modified (or not) ...
{ "content_hash": "55deddb3f42fcf212d4fff799f3a2d8a", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 91, "avg_line_length": 18.990825688073393, "alnum_prop": 0.6314009661835749, "repo_name": "Knownly/Cactus", "id": "22561d01436b17a5cc71ee60dd87e8bf4682f2a8", "size": "2115...
from distutils.core import setup setup(name='gather-agent', version='0.4.1', description='Simple agent that gathers basic system statistics to RHQ Metrics', author='Michael Burman' author_email='miburman@redhat.com', url='http://github.com/burmanm/gather_agent', packages='gather_age...
{ "content_hash": "6895267e2d025b974b9f0cecc91fddaa", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 85, "avg_line_length": 33.2, "alnum_prop": 0.6746987951807228, "repo_name": "burmanm/gather_agent", "id": "b42926ae91e6023fa9b1ece1596bb1de434edc68", "size": "355", "bina...
import os import sys import glob import json import unittest sys.path.append(os.path.dirname(os.getcwd())) import tasks class TestInfoFiles(unittest.TestCase): """Test case for checking info files exist for each task and have a valid structure. """ @classmethod def setUpClass(self): self.t...
{ "content_hash": "7c13b5fc50f52d70858f44d1e003de40", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 129, "avg_line_length": 37.43396226415094, "alnum_prop": 0.6038306451612904, "repo_name": "voyagersearch/voyager-py", "id": "9be7a1ed9466052b8e230e4d4a490f23a3f62b75", "siz...
''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-05-07 Last_modify: 2016-05-07 ****************************************** ''' ''' Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one th...
{ "content_hash": "836c8d7297f427823cfc6b88c36ff461", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 23.076923076923077, "alnum_prop": 0.55, "repo_name": "zhlinh/leetcode", "id": "ecf397e9d0c99fcd87b579aecb9ccc2da380bfd1", "size": "946", "binary": ...
import pandas as pd from h2o.estimators.xgboost import * from tests import pyunit_utils import unittest import sys class TestXGBoostUnicode(unittest.TestCase): @unittest.skipIf(sys.version_info[0] < 3, "not tested on 2.7: csv.writer fails on 'ascii' codec can't encode character") #unrelated issue def test_xg...
{ "content_hash": "b55dd990701abb4f808aa05137c2cd93", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 141, "avg_line_length": 36.916666666666664, "alnum_prop": 0.6704288939051919, "repo_name": "h2oai/h2o-dev", "id": "404d36c05eeb2145dda43b65f4344c740317062d", "size": "886",...
""" Copyright 2017, Ben Langmead <langmea@cs.jhu.edu> Concrete subclass for HISAT2 aligner. """ import os import logging import sys from operator import itemgetter from subprocess import Popen from aligner import Aligner try: from Queue import Queue except ImportError: from queue import Queue # python 3.x ...
{ "content_hash": "1643610a9869799d6bdd255beb844b85", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 96, "avg_line_length": 38.75, "alnum_prop": 0.5563959955506118, "repo_name": "BenLangmead/qtip", "id": "6ee7d37ef90535c378ab93b7254cdbdcdd2f2249", "size": "4495", "binar...
""" Low-level parts of pyptlib that are only useful to clients. """ from pyptlib.config import Config class ClientConfig(Config): """ A client-side pyptlib configuration. :raises: :class:`pyptlib.config.EnvError` if environment was incomplete or corrupted. """ def __init__(self): Config._...
{ "content_hash": "fb22064c7780d7a9100b43222782e376", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 121, "avg_line_length": 32.768115942028984, "alnum_prop": 0.6218487394957983, "repo_name": "ch3n2k/pyptlib", "id": "33e34a61d0a4addad0d41e196c12730904d54bea", "size": "2304...
from typing import Dict, List, Optional, Union, Sequence import numpy as np import tensorflow as tf from typing_extensions import Literal from odin.backend.types_helpers import DataType, LabelType from tensorflow.python.data import Dataset # ===========================================================================...
{ "content_hash": "1ae5e53f6c6e104427e37b3128401d7f", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 77, "avg_line_length": 28.64848484848485, "alnum_prop": 0.5422043579437276, "repo_name": "imito/odin", "id": "555ba377d55e254ed84ba90e65c4faa9cefb8a2b", "size": "4727", ...
from bibliopixel.animation.matrix import Matrix from bibliopixel.util import log import numpy as np try: import cv2 except ImportError: log.error('Could not import cv2 library') import os grab = None if os.name == 'nt': try: from desktopmagic.screengrab_win32 import getRectAsImage, getScreenAsImag...
{ "content_hash": "6908d170b978131835a9f9b421b184e9", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 101, "avg_line_length": 30, "alnum_prop": 0.5159817351598174, "repo_name": "rec/BiblioPixelAnimations", "id": "084647c7d5ada8da68d593861321297f4e9280fb", "size": "4380", ...
""" Ball tracking example with OpenCV http://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/ """ import os import cv2 from collections import deque import numpy as np def main(): """Capture video and draw tracking box""" # define the lower and upper boundaries of the "color" (via range_detector.py...
{ "content_hash": "4fde9b72fcfcdfa1ea7d9f962cb34611", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 82, "avg_line_length": 34.32222222222222, "alnum_prop": 0.5642602784072516, "repo_name": "jhertzog/pi", "id": "dea3abdbe6d06e55f7a1fc477cc33864b873b85a", "size": "3089", ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class ListObjectTypes(Choreography): def __init__(self, temboo_session): """ Create...
{ "content_hash": "8663e9bd2a5d0b97c74da98646b661a2", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 254, "avg_line_length": 48.25581395348837, "alnum_prop": 0.7057831325301205, "repo_name": "jordanemedlock/psychtruths", "id": "b7d0ab8bec14b492c0f998a23364b4b471fdd945", "s...
from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import Group from models import UserPermissionList, GroupPermissionList class NonrelPermissionBackend(ModelBackend): """ Implements Django's permission system on Django-Nonrel """ supports_object_permissions = False...
{ "content_hash": "78c7e3bdd2ed6cf8d203341c5eeb0682", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 108, "avg_line_length": 39.51063829787234, "alnum_prop": 0.6322024771136241, "repo_name": "vongochung/buiquocviet", "id": "1cac6c5e71c6262f7cbd61ad945757903ae32fd4", "size"...
import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.template.defaultfilters import slugify APPROVED_FEED='A' DENIED_FEED='D' PENDING_FEED='P' DELETED_FEED='F' STATUS_CHOICES = ( (PENDING_FEED, 'Pending'), (DENIED_FEED, 'D...
{ "content_hash": "2cf64dbc6d87bd3f725728db6ba0f602", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 104, "avg_line_length": 29.657894736842106, "alnum_prop": 0.7391304347826086, "repo_name": "underlost/GamerNews", "id": "ab9a8821fc14acd1bd4074366255f6e9e78a4ddc", "size": ...
"""CMAC (Cipher-based Message Authentication Code) algorithm CMAC is a MAC defined in `NIST SP 800-38B`_ and in RFC4493_ (for AES only) and constructed using a block cipher. It was originally known as `OMAC1`_. The algorithm is sometimes named *X-CMAC* where *X* is the name of the cipher (e.g. AES-CMAC). This is an ...
{ "content_hash": "d8076f71a78f9a04dd08d6fa088254e8", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 88, "avg_line_length": 34.47575757575758, "alnum_prop": 0.5728223609035774, "repo_name": "Samuel789/MediPi", "id": "6c10390d35604d874ee9e1855aca3e554410f005", "size": "124...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import gettext_lazy as _ from djangocms_blog.admin import PostAdmin from .models import CustomUser, PostExtension @admin.register(CustomUser) class CustomUserAdmin(UserAdmin): model = CustomUser f...
{ "content_hash": "ce21299d08fd4267e0074cafb47ae801", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 112, "avg_line_length": 31.59016393442623, "alnum_prop": 0.5241307732226258, "repo_name": "nephila/djangocms-blog", "id": "ff284d561dcaa88520b7cef79eb46dbcc71319cb", "size"...
from sympy import srepr #Singleton related return values class SingletonOutput(): messages = { 'IMPROPER_TERM': 'Improper term in singleton', 'REDUCIBLE': "Singleton can be reduced", 'INVALID_SUM': "More than one term in singleton", 'INVALID_PRODUCT': "Invalid product in singleton",...
{ "content_hash": "31a4a706d652ad97434b60acf0a0ce4c", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 85, "avg_line_length": 39.89041095890411, "alnum_prop": 0.6559065934065934, "repo_name": "lemmalearning/sympy-form-analysis", "id": "f7e811eb029af43e29ff5dff39a04cdfaac90e81...
from Robinhood import Robinhood my_trader = Robinhood(username="USERNAME HERE", password="PASSWORD HERE") #get stock information about a stock # Note: for some stock names, more than one instrument # may be returned for a given stock symbol stock_instrument = my_trader.instruments("GEVO")[0] #You can stock info...
{ "content_hash": "3227fe182c577a999f4a0387c4804aa8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 32.55555555555556, "alnum_prop": 0.7559726962457338, "repo_name": "imbellish/Robinhood", "id": "0f0eede8d2bdf3895d458c8edd0bcab1c5d19169", "size": "5...
""" python _generate_pyx.py Generate Ufunc definition source files for scipy.special. Produces files '_ufuncs.c' and '_ufuncs_cxx.c' by first producing Cython. This will generate both calls to PyUFunc_FromFuncAndData and the required ufunc inner loops. The functions signatures are contained in 'functions.json', the ...
{ "content_hash": "c6bc312b560429e7ef2ce6f9c59f4249", "timestamp": "", "source": "github", "line_count": 1519, "max_line_length": 108, "avg_line_length": 34.45161290322581, "alnum_prop": 0.5436444240617595, "repo_name": "perimosocordiae/scipy", "id": "8e3e49dbabf5ca9f9612a1d239b60cc8a3ad5a73", "size...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_noble_old_zabrak_male_01.iff" result.attribute_template_id = 9 result.stfName("npc_name","zabrak_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "5fb7dc87e13ed849103b0d73b6b06676", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 24.076923076923077, "alnum_prop": 0.6964856230031949, "repo_name": "obi-two/Rebelion", "id": "0c1a492e74ba99fc2fa9bccc6416f750c25d015d", "size": "458...
import warnings as _warnings _warnings.resetwarnings() _warnings.filterwarnings('error') from tdi.integration import wtf_service as _wtf_service class Param(object): def multi(self, name): return [] param = Param() adapter = _wtf_service.RequestParameterAdapter(param) print adapter.getlist == param.multi...
{ "content_hash": "f157d0cad1259d833d043975a1e131d2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 55, "avg_line_length": 23.736842105263158, "alnum_prop": 0.7560975609756098, "repo_name": "ndparker/tdi", "id": "3af6f68d2adc736d173d43b830ea7a50ecae9106", "size": "473", ...
import json import os import unittest import PTN class ParseTest(unittest.TestCase): def test_parser(self): json_input = os.path.join(os.path.dirname(__file__), 'files/input.json') with open(json_input) as input_file: torrents = json.load(input_file) json_output = os.path.joi...
{ "content_hash": "f85288515337074670c4665344328ff8", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 82, "avg_line_length": 33.4, "alnum_prop": 0.561163387510693, "repo_name": "divijbindlish/parse-torrent-name", "id": "9db0507014fc7da0d9095de41fc7770f3245d2d0", "size": "12...
"""Bridges between the `asyncio` module and Tornado IOLoop. .. versionadded:: 3.2 This module integrates Tornado with the ``asyncio`` module introduced in Python 3.4 (and available `as a separate download <https://pypi.python.org/pypi/asyncio>`_ for Python 3.3). This makes it possible to combine the two libraries on...
{ "content_hash": "c8f5465fcd65309a2b683d602724f344", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 80, "avg_line_length": 35.689189189189186, "alnum_prop": 0.6269089991164962, "repo_name": "ajdavis/tornado", "id": "830ee1f3b1b68d97fc1871798f59740155e18403", "size": "792...
""" rest client ~~~~~~~~~~~~~~~~ RESTful api client. :copyright: 2012-18 by raptor.zh@gmail.com """ import sys PY3 = sys.version>"3" if PY3: from io import IOBase def isIOBase(obj): return isinstance(obj, IOBase) else: from cStringIO import InputType from StringIO import Stri...
{ "content_hash": "b0b30934305abb5247ae81ba95676c55", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 110, "avg_line_length": 36.98522167487685, "alnum_prop": 0.5610015982951518, "repo_name": "raptorz/pyfan", "id": "2b1f8b5778c354ed8f15a35c051dc27d263c55fb", "size": "7532"...
from xml.parsers.expat import ExpatError import xml.dom.minidom from vistrails.db import VistrailsDBException from vistrails.db.versions.v0_5_0 import version as my_version def parse_xml_file(filename): try: return xml.dom.minidom.parse(filename) except xml.parsers.expat.ExpatError, e: msg = '...
{ "content_hash": "550d64a86b2aa50e2c52961b1be6cb2e", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 75, "avg_line_length": 35.39344262295082, "alnum_prop": 0.6252894858730894, "repo_name": "Nikea/VisTrails", "id": "661d93790f5c5ed94663c4da88d09441f847aa7f", "size": "4039"...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitsendrpc")) import json import shutil import subprocess import tempfile import traceback from bitsendrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * def run_test(nodes): # Replace t...
{ "content_hash": "9b5c420b60ca4824478fb9c7dff3d04a", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 99, "avg_line_length": 28.794520547945204, "alnum_prop": 0.6294005708848716, "repo_name": "madzebra/BitSend", "id": "3a5d234bfa3237b87ad06c430dd2d1c046738303", "size": "242...
import unittest import os from mock import Mock, MagicMock from link.utils import load_json_file from link.common import APIObject TESTS_DIR = os.path.dirname(__file__) def tst_file_path(file_name): return '%s/%s' % (TESTS_DIR, file_name) def tst_config_path(config_name): return '%s/config/%s' % (TESTS_DIR, ...
{ "content_hash": "91c223ac97a389c38c65fb481f58cad1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 26.676470588235293, "alnum_prop": 0.6802646085997794, "repo_name": "uhjish/link", "id": "c92fd9904e5fb78f349c70afc7596e2aa5b8af27", "size": "907", ...
""" KFServing Python SDK for KFServing # noqa: E501 The version of the OpenAPI document: v0.1 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kfserving.configuration import Configuration class V1beta1TransformersConfig(object): """NOTE:...
{ "content_hash": "b7479c36af5364a6190313a39f29cc93", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 82, "avg_line_length": 28.296610169491526, "alnum_prop": 0.5693321353698713, "repo_name": "kubeflow/kfserving-lts", "id": "d816297a3d2952bbc5302a5fcf322605abc559d5", "size...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import argparse import sys import tempfile from tensorflow.examples.tutorials.mnist import input_data FLAGS = None ## # @brief generate variables by given shape # # @param shape:weig...
{ "content_hash": "b186f3a91f96d5035f66874655ffd36a", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 78, "avg_line_length": 31.529032258064515, "alnum_prop": 0.570902394106814, "repo_name": "viekie/tensorflow-tutorial", "id": "b3fb1f4b198b8117f248eabe074de90c52ae6149", "s...
from django.db import models from django_countries.fields import CountryField from django_countries.tests import custom_countries class Person(models.Model): name = models.CharField(max_length=50) country = CountryField() other_country = CountryField( blank=True, countries_flag_url="//flags.examp...
{ "content_hash": "0a1f9552f3cfc5376fdd6de743275a81", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 88, "avg_line_length": 31.617021276595743, "alnum_prop": 0.7166890982503364, "repo_name": "SmileyChris/django-countries", "id": "ca2dcabfaad0be3b058bdd98488d528d88fdd9bf", ...
class CommandTrait(object): def get_id(self): pass def set_hash(self): pass def get_hash(self): pass def set_arguments(self, arguments): pass def set_raw_arguments(self, arguments): pass def get_arguments(self): pass def get_argument(sel...
{ "content_hash": "6281acaca8a286139482a872bab9a2a5", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 64, "avg_line_length": 18.795321637426902, "alnum_prop": 0.6120099564405725, "repo_name": "whiteclover/redis-py", "id": "b1bd0f730d4e05ad0fd7b0b674bf34fbe65ac8a0", "size":...
""" The MIT License (MIT) Copyright (c) 2015-2016 Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
{ "content_hash": "eac1d493742ea6e9b00f942fe8c751b5", "timestamp": "", "source": "github", "line_count": 855, "max_line_length": 123, "avg_line_length": 32.02807017543859, "alnum_prop": 0.5878250073035349, "repo_name": "OthmanEmpire/project_othbot", "id": "03bbd1cb791d85cb052002127f6baedbffb36e52", ...
fname = input('Enter the file name: ') try: fhand = open(fname) except: print('File cannot be opened:', fname) exit() count = 0 for line in fhand: if line.startswith('Subject:') : count = count + 1 print('There were', count, 'subject lines in', fname)
{ "content_hash": "a56498656f41f0ded7a698b1d62f6d64", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 25.181818181818183, "alnum_prop": 0.6245487364620939, "repo_name": "mkhuthir/learnPython", "id": "1feac51ee31fe299ef9b4ea584418d3ab3ad384e", "size": ...
import numpy from pandas import DataFrame, Series def a_dot(): ''' Imagine a point system in which each country is awarded 4 points for each gold medal, 2 points for each silver medal, and one point for each bronze medal. Using the numpy.dot function, create a new dataframe called 'olympic_p...
{ "content_hash": "7daf8bde25e3ea1a8dcf3c8f4b60fa09", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 155, "avg_line_length": 44.701149425287355, "alnum_prop": 0.5626124967858062, "repo_name": "kinshuk4/MoocX", "id": "8b3281d9b8cca4c532f418c1a59c82462f06207e", "size": "3889...
from test_framework.test_framework import MincoinTestFramework from test_framework.util import assert_equal class ListSinceBlockTest (MincoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 4 def run_test (self): ''' ...
{ "content_hash": "bdfe3b1ab5b8fd02811b0456d5642c16", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 84, "avg_line_length": 31.506666666666668, "alnum_prop": 0.5780787134997885, "repo_name": "mincoin-project/mincoin", "id": "21c9be5fec9003b0d7cae99de84ec5425cd5ef12", "size...
class Tokenizer(object): """The root class for tokenizers. Args: return_set (boolean): A flag to indicate whether to return a set of tokens instead of a bag of tokens (defaults to False). Attributes: return_set (boolean): An att...
{ "content_hash": "96c880c48736a0f27202c8dda65bd0ac", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 114, "avg_line_length": 31.3, "alnum_prop": 0.5654952076677316, "repo_name": "kvpradap/conda-pysm-appveyor", "id": "36b96b780f548a8ff3aa04b02e5efa61961d181f", "size": "939"...
import sys import ctypes import weakref from multiprocessing import heap, RLock from multiprocessing.forking import assert_spawning, ForkingPickler __all__ = ['RawValue', 'RawArray', 'Value', 'Array', 'copy', 'synchronized'] # # # typecode_to_type = { 'c': ctypes.c_char, 'u': ctypes.c_wchar, ...
{ "content_hash": "a47cb302382f72aa7ab43cf92da09d6d", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 79, "avg_line_length": 27.042918454935624, "alnum_prop": 0.5768925567370259, "repo_name": "kleientertainment/ds_mod_tools", "id": "b6a8d7fa4256fcf4f6dffce30dbaf30d780e46e9",...
"""Writes a build_config file. The build_config file for a target is a json file containing information about how to build that target based on the target's dependencies. This includes things like: the javac classpath, the list of android resources dependencies, etc. It also includes the information needed to create t...
{ "content_hash": "81d61a8e8a2026378b9cb9f334139dc6", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 80, "avg_line_length": 40.538167938931295, "alnum_prop": 0.6805385556915544, "repo_name": "highweb-project/highweb-webcl-html5spec", "id": "baa535db6848fa78a9f283e847c6fb00f...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils import os.path schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../schemas/test-include-dau.xsd')) code = pyxb.binding.generate.GeneratePy...
{ "content_hash": "054ee530a43f97d2b5612faf25842ac6", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 110, "avg_line_length": 36.73809523809524, "alnum_prop": 0.6694750486066104, "repo_name": "balanced/PyXB", "id": "b4297186756484a08140ccff24f588080b47df5b", "size": "1567",...
__author__ = 'spencertank'
{ "content_hash": "f60d9d459d5db76be6c4d91ae6f84323", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 26, "avg_line_length": 27, "alnum_prop": 0.6296296296296297, "repo_name": "SEL-Columbia/commcare-hq", "id": "ae0e3b8b88ece0f7fd57ef6c59aa1396b7618360", "size": "27", "bina...
from __future__ import absolute_import from flask import Flask from werkzeug.serving import run_simple from .views import Graphics from flask_restful import Api from flask_discoverer import Discoverer from adsmutils import ADSFlask def create_app(**config): """ Create the application and return it to the user...
{ "content_hash": "21aed324b4a4c9319fad60f623b68633", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 25.225806451612904, "alnum_prop": 0.6790281329923273, "repo_name": "adsabs/graphics_service", "id": "61029a2a36d25fc105487991100f5fca2d7d5597", "size...
""" runprofileserver.py Starts a lightweight Web server with profiling enabled. Credits for kcachegrind support taken from lsprofcalltree.py go to: David Allouche Jp Calderone & Itamar Shtull-Trauring Johan Dahlin """ import sys from datetime import datetime from django.conf import settings from django.core....
{ "content_hash": "ab682f113cd00517fba2e66f8096e7f3", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 113, "avg_line_length": 41.90506329113924, "alnum_prop": 0.5416855459900317, "repo_name": "jpadilla/django-extensions", "id": "f08b81e13166f8d022f2c4c466035658cebbb330", "...
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import numerical_schemes """ Define simulation parameters """ dt = 0.1 # s time step dx = 0.5 # m spatial resolution # Domain x_w = - 15 x_e = 15 """ Initialize, dimensions, coordinates and variables """ ...
{ "content_hash": "8cde291d63ba29745e215d94c24b8317", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 30.4, "alnum_prop": 0.6453349282296651, "repo_name": "asura6/Fortran-Python-Advection-and-Diffusion-Models", "id": "2762a2a79a42eb91e7353d23df71dccd4db...
from prestans.http import STATUS from prestans.rest import RequestHandler import pytest import unittest class NoContentHandler(RequestHandler): def get(self): self.response.status = STATUS.NO_CONTENT def test_app(): from webtest import TestApp from prestans.rest import RequestRouter api =...
{ "content_hash": "39304233c3b2f6b074c264b6f6a64e7a", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 64, "avg_line_length": 23.823529411764707, "alnum_prop": 0.6518518518518519, "repo_name": "anomaly/prestans", "id": "7dfdbb5f7a5d306f3c9cba3afeb8840dab331553", "size": "810...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_ins...
{ "content_hash": "77f7dcfec46129fb2ee19c4327916af7", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 755, "avg_line_length": 38.714285714285715, "alnum_prop": 0.7049337160038267, "repo_name": "apache/bookkeeper", "id": "51fedc3c7aed8f1b7c56d66b2ea8e3ad7b34ce68", "size": "...
"""Generate a series of TensorFlow graphs that become tflite test cases. Usage: generate_examples <output directory> bazel run //tensorflow/lite/testing:generate_examples To more easily debug failures use (or override) the --save_graphdefs flag to place text proto graphdefs into the generated zip files. """ from _...
{ "content_hash": "65833289b44bb6110e3008350a384b1b", "timestamp": "", "source": "github", "line_count": 4981, "max_line_length": 80, "avg_line_length": 34.391688415980724, "alnum_prop": 0.5973205685765156, "repo_name": "ghchinoy/tensorflow", "id": "42bab6977253db120b3d479fa7876692730a23f8", "size":...
from django.test import TestCase from django.test.client import RequestFactory, Client from prescription.models import Pattern from prescription.views import CreatePatternView from user.models import HealthProfessional class TestCreatePattern(TestCase): def setUp(self): self.factory = RequestFactory() ...
{ "content_hash": "637b1c4cfdd5f6e9db13430c69dd5d07", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 30.30188679245283, "alnum_prop": 0.5990037359900373, "repo_name": "fga-gpp-mds/2017.2-Receituario-Medico", "id": "0f813fb84973c2aa233212613aae998ab35e0...
from flask import Flask from flask_digest import Stomach app = Flask(__name__) stomach = Stomach('realm') db = dict() @stomach.register def add_user(username, password): print(username, password) db[username] = password @stomach.access def get_user(username): return db.get(username, None) @app.route('/...
{ "content_hash": "d7b8d0d7ea69bd39ab2aca820616b8d3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 33, "avg_line_length": 17.583333333333332, "alnum_prop": 0.6848341232227488, "repo_name": "vctandrade/flask-digest", "id": "b0e8a3a1b94f63eef5a87d5ce56af4cdc2aab59f", "size...
import os import sys import shutil use_celery = '{{cookiecutter.use_celery}}' if use_celery == "no": base_path = os.getcwd() app_path = os.path.join( base_path, '{{cookiecutter.app_name}}', ) tasks_path = os.path.join(app_path, 'tasks') celery_app_path = os.path.join(app_path, 'ce...
{ "content_hash": "2cba0751cc07976bb87b2f702aaf2478", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 71, "avg_line_length": 24.848484848484848, "alnum_prop": 0.6036585365853658, "repo_name": "karec/cookiecutter-flask-restful", "id": "af2a9bbf593c8f79e84b326368c8afaca68252d1"...
import os.path from django.conf import settings from django.test import TransactionTestCase from panda.tests import utils class TestRelatedUpload(TransactionTestCase): fixtures = ['init_panda.json', 'test_users.json'] def setUp(self): settings.CELERY_ALWAYS_EAGER = True self.user = utils.ge...
{ "content_hash": "71a9a2131c5d138438921f5cde233931", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 30.125, "alnum_prop": 0.6939834024896265, "repo_name": "PalmBeachPost/panda", "id": "1c4ffbaa4b0db6bd96ff2920b25da91789dcf806", "size": "987", "bin...
from test_framework.mininode import * from test_framework.test_framework import FlurboTestFramework from test_framework.util import * from test_framework.blocktools import create_block, create_coinbase ''' SendHeadersTest -- test behavior of headers messages to announce blocks. Setup: - Two nodes, two p2p connectio...
{ "content_hash": "cd5ff3091b48b9ff8940468cffd30269", "timestamp": "", "source": "github", "line_count": 511, "max_line_length": 116, "avg_line_length": 42.336594911937375, "alnum_prop": 0.6041878524544698, "repo_name": "Flurbos/Flurbo", "id": "8943021d524cf87ef05a162c69671c54a0dc0716", "size": "218...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'remembermyseries.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^tvapp/', include('tvapp.urls')), url(r'^admin/', include(admin.site.ur...
{ "content_hash": "e14e12f900b04b4bfe1050339480dff5", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 32.8, "alnum_prop": 0.6432926829268293, "repo_name": "niksolaz/TvApp", "id": "85ef4a1674a7811e944080ae8c6573aa403d343d", "size": "328", "binary": f...
import core.implant import core.job import core.cred_parser import string import collections import time import uuid class DynWrapXShellcodeJob(core.job.Job): def create(self): self.fork32Bit = True self.errstat = 0 self.options.set("DLLUUID", uuid.uuid4().hex) self.options.set("MAN...
{ "content_hash": "56fd98ea804e78bfe47961c180ed9af5", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 147, "avg_line_length": 38.99390243902439, "alnum_prop": 0.6014073494917904, "repo_name": "zerosum0x0/koadic", "id": "d8af460ebd929f61d0f3bbd21b63a278b8f4a722", "size": "6...
import logging import unittest from nose.tools import eq_, raises from ryu.lib.packet.bgp import ( BGPFlowSpecTrafficRateCommunity, BGPFlowSpecTrafficActionCommunity, BGPFlowSpecRedirectCommunity, BGPFlowSpecTrafficMarkingCommunity, BGPFlowSpecVlanActionCommunity, BGPFlowSpecTPIDActionCommunit...
{ "content_hash": "39f23d0a7335a957e9d149a85468273b", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 80, "avg_line_length": 35.62051282051282, "alnum_prop": 0.5739994241289951, "repo_name": "fujita/ryu", "id": "6933a28b322b9637308498993e887b9c2ba75940", "size": "7560", ...
""" hyper/common/connection ~~~~~~~~~~~~~~~~~~~~~~~ Hyper's HTTP/1.1 and HTTP/2 abstraction layer. """ from .exceptions import TLSUpgrade, HTTPUpgrade from ..http11.connection import HTTP11Connection from ..http20.connection import HTTP20Connection from ..tls import H2_NPN_PROTOCOLS, H2C_PROTOCOL class HTTPConnection...
{ "content_hash": "765d0f014eb9a08906f628e45edcacb5", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 85, "avg_line_length": 40.79354838709678, "alnum_prop": 0.6030365332911592, "repo_name": "qqzwc/XX-Net", "id": "a49d3d50e94e4ae7ee3906ef1d5e3d0aec30b0bc", "size": "6347", ...
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab import scipy.ndimage as ni import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3') import rospy #import hrl_lib.mayavi2_util as mu im...
{ "content_hash": "665b85b579ee5f9ef4c261a4e474009e", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 664, "avg_line_length": 36.632, "alnum_prop": 0.6451190216204411, "repo_name": "tapomayukh/projects_in_python", "id": "2d7f9cdf33135d957e74e91a19d247c649d5660d", "size": "...
from google.appengine.api import users from google.appengine.ext import ndb class User(ndb.Model): email = ndb.StringProperty() @staticmethod def checkUser(): googleUser = users.get_current_user() if not googleUser: return False user = User.query(User.email == googleUser.email()).get() if user: ...
{ "content_hash": "087251472aeb06f97753714e970c8598", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 59, "avg_line_length": 17.725, "alnum_prop": 0.688293370944993, "repo_name": "racheliel/My-little-business", "id": "94108701b221e7bce1b10247a1124787076652b7", "size": "709"...
"""Tests for the DynamicPartition op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import constant_op from tensorfl...
{ "content_hash": "43f91d579663cdd7347f54b692717048", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 80, "avg_line_length": 42.2370820668693, "alnum_prop": 0.6389608520437536, "repo_name": "alshedivat/tensorflow", "id": "07da855a0174d7b217ac383758e358922b7e18e4", "size": ...
import acspytest__POA from Acspy.Servants.ContainerServices import ContainerServices from Acspy.Servants.ComponentLifecycle import ComponentLifecycle from Acspy.Servants.ACSComponent import ACSComponent from CORBA import TRUE, FALSE #*******************************************************************************...
{ "content_hash": "a92e2b0e315d10f3e8e8dbe07668d28e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 80, "avg_line_length": 40.59322033898305, "alnum_prop": 0.6200417536534447, "repo_name": "csrg-utfsm/acscb", "id": "2956456da2de05b0ab6807c66dbe72e5493cd2fc", "size": "2395...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class ListRecent(Choreography): def __init__(self, temboo_session): """ Create a ne...
{ "content_hash": "790a0a839a1a7b7c98df05b85508fddb", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 202, "avg_line_length": 42.151162790697676, "alnum_prop": 0.6772413793103448, "repo_name": "jordanemedlock/psychtruths", "id": "a88f5b00dde9bba13ad84aec34cf4a52b71e4789", "...
"""Tests for identity_function.""" from absl.testing import absltest from pydemos.mock_test import identity_function class IdentityFunctionTest(absltest.TestCase): def test_identity_function(self): self.assertEqual(1, identity_function.identity_function(1)) if __name__ == '__main__': absltest.main()
{ "content_hash": "ac3bb423fe20230f5b9353c72718f9d9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 24.153846153846153, "alnum_prop": 0.7420382165605095, "repo_name": "google-research/pydemos", "id": "5cf9cd47445ff8645749df703b9c594809ddd25f", "size...
"""Hardware interfaces for sound output""" # Authors: Dan McCloy <drmccloy@uw.edu> # Eric Larson <larsoner@uw.edu> # # License: BSD (3-clause) import numpy as np from scipy import fftpack import sys import os import pyglet _use_silent = (os.getenv('_EXPYFUN_SILENT', '') == 'true') _opts_dict = dict(linux2=(...
{ "content_hash": "f12b4d14b59803f5f352d5de2bc3d484", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 78, "avg_line_length": 31.291666666666668, "alnum_prop": 0.596537949400799, "repo_name": "lkishline/expyfun", "id": "50a22872fef9554d01c585591ce8c376e01b6dc0", "size": "45...
""" A network utils module to use vcloudapi """ import re import contextlib from oslo.config import cfg from oslo.vmware import api from oslo.vmware import vim import suds from nova import exception from nova import utils from nova.i18n import _, _LI, _LW from nova.openstack.common import jsonutils from nova.opensta...
{ "content_hash": "07741df89229aa2d09be1979ac6eab8f", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 83, "avg_line_length": 33.19614147909968, "alnum_prop": 0.5814606741573034, "repo_name": "Hybrid-Cloud/badam", "id": "775a30358b68d58bc6bdea1ebb30db39f15214a1", "size": "1...
from frozendict import frozendict def freeze(o): t = type(o) if t is dict: return frozendict({k: freeze(v) for k, v in o.items()}) if t is frozendict: return o if t is str or t is unicode: return o try: return tuple([freeze(i) for i in o]) except TypeError: ...
{ "content_hash": "da7fdb0c59dedf29c81bbbba07bdd9ef", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 63, "avg_line_length": 17.444444444444443, "alnum_prop": 0.554140127388535, "repo_name": "iot-factory/synapse", "id": "9e10d37aec4bb78496442347d5a2feb983cc886e", "size": "1...
import tensorflow as tf import numpy as np from neuralnet.highway import highway class single_cnn_highway(object): def __init__(self, sequence_length, num_classes, vocab_size, embedding_size, filter_sizes, num_filters, l2_reg_lambda = 0.0, label_smoothing = 0.0, dropout_keep_prob = 0.5): # Placeholders f...
{ "content_hash": "b3b0bec0dadd187f91ecdc5ae9ec70f7", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 177, "avg_line_length": 51.009803921568626, "alnum_prop": 0.5708245243128964, "repo_name": "windowsyuli/cross_domain", "id": "13839f856b62f11e213681e5db831b6fafea3f92", "s...
from __future__ import annotations import abc import inspect from typing import TYPE_CHECKING, Any, Mapping, TypeVar import numpy as np from astropy.io.registry import UnifiedReadWriteMethod from astropy.utils.decorators import classproperty from astropy.utils.metadata import MetaData from .connect import ( Cos...
{ "content_hash": "829957447cac7503037c0210d9efc8f4", "timestamp": "", "source": "github", "line_count": 610, "max_line_length": 88, "avg_line_length": 36.15573770491803, "alnum_prop": 0.5745635910224439, "repo_name": "pllim/astropy", "id": "6de217588c67b1124418f1fb4ff64605975389e1", "size": "22120"...
import _plotly_utils.basevalidators class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="familysrc", parent_name="scattergl.hoverlabel.font", **kwargs ): super(FamilysrcValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "4030a8ee09fd98da66a7c9ccddea1e0a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 34, "alnum_prop": 0.6029411764705882, "repo_name": "plotly/python-api", "id": "7bf4315987dc3f4723f006b407d4e41210adfdfd", "size": "476", "binary": ...
""" Support for Ruby extensions. A C/C++ compiler is required:: def options(opt): opt.load('compiler_c ruby') def configure(conf): conf.load('compiler_c ruby') conf.check_ruby_version((1,8,0)) conf.check_ruby_ext_devel() conf.check_ruby_module('libxml') def build(bld): bld( features = 'c cshlib rubye...
{ "content_hash": "765c198091b5689ae52ef0b85684c2eb", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 136, "avg_line_length": 30.204419889502763, "alnum_prop": 0.6873971099323212, "repo_name": "MarekIgnaszak/econ-project-templates", "id": "8d92a79a16179d3b62d957135b0d73c34e3...
import numpy as np from holoviews.core.spaces import DynamicMap from holoviews.element import Image, Curve, Scatter, Scatter3D from holoviews.streams import Stream from .test_plot import TestMPLPlot, mpl_renderer try: from matplotlib.ticker import FormatStrFormatter, FuncFormatter, PercentFormatter except: p...
{ "content_hash": "fdadbcee364c93f6ccfb20a8d00bff3a", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 109, "avg_line_length": 42.83410138248848, "alnum_prop": 0.635933297471759, "repo_name": "ioam/holoviews", "id": "de06cbc2a9fb9e93acd1abb5ce55f1b5d1c06ce7", "size": "9295"...
import logging import os from typing import Optional def setup() -> None: logging.basicConfig( format="%(asctime)s %(levelname)s: %(message)s", level=logging.DEBUG ) def memory_available() -> Optional[int]: """Available memory in MB. Only works on linux and returns None otherwise. """ ...
{ "content_hash": "d5360d98f5a6ec38d7af9bbfbdcbb18c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 22.571428571428573, "alnum_prop": 0.6392405063291139, "repo_name": "mapillary/OpenSfM", "id": "379a3a53be4f4294b97508a93bf439bd71c008e0", "size": "47...
from enum import Enum class ErrorCodes(Enum): """ """ # # NOTE: Testing to see if Enums as error codes is usable. # e0100 = 'Settings Error: ({0!s}).' e0110 = 'Settings Error: ({0!s}) is an invalid value. API Request Timeout must be a integer.' e0120 = 'Settings Error: ({0!s}) is an inval...
{ "content_hash": "a405de18a11117c74f3d45360abdee1f", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 117, "avg_line_length": 55.82857142857143, "alnum_prop": 0.6847492323439099, "repo_name": "percipient/threatconnect-python", "id": "1de6f25b4f8baa561f7d2bc835d89fae4ae90a3b"...
import os import subprocess import shlex from tempfile import NamedTemporaryFile import TimeoutThread def run_command(command, time_out): args = shlex.split(command) proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=os.setsid) with Timeo...
{ "content_hash": "553c6d67170dfdd8e3c2a49b1a6036de", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 27.607142857142858, "alnum_prop": 0.6610608020698577, "repo_name": "Wassasin/automatedreasoning", "id": "c2d2187809d8457d0df37cdef25c3aafeec07a6a", "...
"""Experimental support for defining XLA shardings.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as _np # Avoids becoming a part of public Tensorflow API. from tensorflow.compiler.tf2xla.python import xla as tf2xla from tensorflow.compi...
{ "content_hash": "6e003bd0d50272ac4366d7c39a42b61c", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 80, "avg_line_length": 35.13179916317991, "alnum_prop": 0.6904067170844995, "repo_name": "petewarden/tensorflow", "id": "0f1dcd89302dd32de9203e3b299aa191c1b53bdc", "size":...
"""Code for backpropagation using the tape utilities.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import operator import threading import six from tensorflow.python import pywrap_tensorflow from tensorflow.python.eager import conte...
{ "content_hash": "fe2bb0d2dd946e790557ea3dcd425eba", "timestamp": "", "source": "github", "line_count": 745, "max_line_length": 108, "avg_line_length": 34.60536912751678, "alnum_prop": 0.6677398083860208, "repo_name": "Xeralux/tensorflow", "id": "06e11f6ef9985e078b98c5f1e3d9d0edeef2df56", "size": "...
"""Tests for Backup code.""" import ddt import tempfile import uuid import mock from oslo_config import cfg from oslo_utils import importutils from oslo_utils import timeutils from cinder.backup import api from cinder.backup import manager from cinder import context from cinder import db from cinder import exception...
{ "content_hash": "f39c18c2306ea04be9d9373e1b924994", "timestamp": "", "source": "github", "line_count": 1150, "max_line_length": 79, "avg_line_length": 43.73478260869565, "alnum_prop": 0.5538522715975743, "repo_name": "Paul-Ezell/cinder-1", "id": "6de7d0130bff6f36a46e66ce1ac9620b0f8a11ad", "size": ...
import mock from oslo.config import cfg from webob import exc as web_exc import webtest from neutron.api import extensions from neutron.api.v2 import attributes from neutron.api.v2 import router from neutron import context from neutron.extensions import providernet as pnet from neutron.manager import NeutronManager fr...
{ "content_hash": "b8271a232535a736119fdc0281cf1d5e", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 77, "avg_line_length": 41.6241134751773, "alnum_prop": 0.6055546089623445, "repo_name": "vijayendrabvs/hap", "id": "d75cbfc2c81f525c36c1676c9114280df36fecd8", "size": "657...
from geosupport.error import GeosupportError from ..testcase import TestCase class TestError(TestCase): def test_error(self): e = GeosupportError("")
{ "content_hash": "6b64eaa628a8477ac06806c25d92eefb", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 44, "avg_line_length": 20.625, "alnum_prop": 0.7272727272727273, "repo_name": "ishiland/python-geosupport", "id": "638036322be66eb3712bdaf61aa069cf3ba6397c", "size": "165", ...
import sys import yaml import rethinkdb as r from rethinkdb.errors import RqlDriverError, RqlRuntimeError import requests import json import pprint from runbookdb import RunbookDB # Load Configuration # ------------------------------------------------------------------ if len(sys.argv) < 2: print("Hey, thats not...
{ "content_hash": "5ecbd704f82e861ed2ddfafb48e598ec", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 88, "avg_line_length": 27.0472972972973, "alnum_prop": 0.5903072695478391, "repo_name": "madflojo/cloudroutes-service", "id": "0f536f31a4a963949a0c1a418a4a7d22e5c9b95e", "...
""" Package for working with quasar spectra """ from spectrum import WavelengthFunction, SpectralFluxDensity, Spectrum, read_combined_spectrum from target import Target import wavelength from model import ContinuumModel from paths import Paths from continuum import MeanFluxContinuum, LinearFitContinuum
{ "content_hash": "431926df73e8c0b1358c7c1435bdc0a8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 94, "avg_line_length": 23.692307692307693, "alnum_prop": 0.8376623376623377, "repo_name": "dmargala/qusp", "id": "b520b7077594e3505c572adb3fce45b499d64aae", "size": "308", ...
import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from ivf.cv.image import trim, alpha class SubplotGrid: def __init__(self, num_rows, num_cols, fig=None): self._num_rows = num_rows self._num_cols = num_cols self._plot_id = 1 ...
{ "content_hash": "7b42e524d79fbe1b5e194921f036c628", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 102, "avg_line_length": 32.68571428571428, "alnum_prop": 0.5598776223776224, "repo_name": "tody411/ImageViewerFramework", "id": "b2482a4f3baaba281cec1e836d1e58007d50ed58", ...
from __future__ import unicode_literals import importlib import json import re import unittest from datetime import datetime from xml.dom import minidom from django.core import management, serializers from django.db import connection, transaction from django.test import ( SimpleTestCase, TestCase, TransactionTest...
{ "content_hash": "ee21e1a29a2c776f719f064444b2230e", "timestamp": "", "source": "github", "line_count": 819, "max_line_length": 172, "avg_line_length": 36.030525030525034, "alnum_prop": 0.5965298722423668, "repo_name": "hcsturix74/django", "id": "505e599f5e517f31b3d6739a30b331d0ae7206c0", "size": "...
from corehq.apps.users.models import CouchUser from dimagi.utils.logging import notify_exception from pact.utils import get_case_id from couchforms.signals import successful_form_received import traceback #placeholder for doing blocking vs. async via celery BLOCKING = True def process_dots_submission(sender, xform,...
{ "content_hash": "ead653cfd067d26dd807655191be7b3d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 134, "avg_line_length": 37.8, "alnum_prop": 0.6817838246409675, "repo_name": "qedsoftware/commcare-hq", "id": "19af09f4ae127392cb0229d190d9bb3dd0553541", "size": "1323", ...
from PySide import QtCore, QtGui from androguard.core import androconf from androguard.gui.helpers import display2classmethod, class2func, classmethod2display, method2func from androguard.gui.sourcewindow import SourceWindow class XrefDialog(QtGui.QDialog): '''Dialog holding our Xref listview. parent: Sour...
{ "content_hash": "620f00c7d6b1943a86fb9158174ee852", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 100, "avg_line_length": 37.57142857142857, "alnum_prop": 0.5918884664131813, "repo_name": "ApplauseAQI/androguard", "id": "3c6a3bccd9c9445dfe741663e170a263de91683f", "size...
from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server import util class TapiCommonDirectiveValue(Model): """NOTE: This class is auto generated by OpenAPI Generator (ht...
{ "content_hash": "474b8ccf49ed3df0fdc3de4771eb6a95", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 96, "avg_line_length": 25.636363636363637, "alnum_prop": 0.6312056737588653, "repo_name": "karthik-sethuraman/ONFOpenTransport", "id": "abef1a8bde0ff83221f770cdf53d2125e978c2...
import copy import logging import os import textwrap import urllib import uuid from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import itsdangerous import psycopg2.extras from profiles import configwrapper log = logging.getLogger(__name__) class PersonFactory(psycopg2.extras.Comp...
{ "content_hash": "af0a6a2c7b442342d09f7ba8ed4a79af", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 104, "avg_line_length": 27.145077720207254, "alnum_prop": 0.5300629891200611, "repo_name": "216software/Profiles", "id": "6b4f11a0760600d76fc887d0c786863fa702758c", "size"...