text
stringlengths
4
1.02M
meta
dict
"""Tests for control_flow_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import numpy as np from tensorflow.core.framework import graph_pb2 from tensorflow.core.framework import node_def_pb2 from tensorflow.python.client impo...
{ "content_hash": "e4bc7fbf7d08e63472b8f1254a426171", "timestamp": "", "source": "github", "line_count": 971, "max_line_length": 81, "avg_line_length": 39.46549948506694, "alnum_prop": 0.617311656793925, "repo_name": "manipopopo/tensorflow", "id": "153548ae92cfecfe5c750746b1425abcf3747b1b", "size": ...
""" path.py - An object representing a path to a file or directory. Original author: Jason Orendorff <jason.orendorff\x40gmail\x2ecom> Contributors: Mikhail Gusarov <dottedmag@dottedmag.net> Example: from path import path d = path('/home/guido/bin') for f in d.files('*.py'): f.chmod(0755) This module require...
{ "content_hash": "20784d5e29dca65a915f522a207e3688", "timestamp": "", "source": "github", "line_count": 1017, "max_line_length": 97, "avg_line_length": 33.087512291052114, "alnum_prop": 0.5507578008915305, "repo_name": "koll00/Gui_SM", "id": "8d45e59978ee1889ef42fce6e03c8d018de665b9", "size": "3474...
from mrq.task import Task from mrq.context import connections, log import urllib2 class TestIo(Task): def run(self, params): log.info("I/O starting") ret = self._run(params) log.info("I/O finished") return ret def _run(self, params): if params["test"] == "mongodb-i...
{ "content_hash": "434ba515eb71966ba0e75cf80a63261a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 112, "avg_line_length": 25.462962962962962, "alnum_prop": 0.5781818181818181, "repo_name": "IAlwaysBeCoding/mrq", "id": "63d22f94581ecf10c1bae480b2d48878acd9b566", "size": ...
import mock import pytest import six from cmdtree import parser from cmdtree.exceptions import ArgumentParseError def mk_obj(property_dict): class TestObject(object): pass obj = TestObject() for key, value in six.iteritems(property_dict): setattr(obj, key, value) return obj @pytest....
{ "content_hash": "e86272d1f8e89a0b4084b367631b7c91", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 101, "avg_line_length": 31.401015228426395, "alnum_prop": 0.5460717749757517, "repo_name": "winkidney/cmdtree", "id": "83c499f8c16cda46c67caec67e7804d79177e0e3", "size": "...
''' Aggregate fiscal year end schedule for each company in the ernest_aq_forms index ** Note ** This runs prospectively using the --most-recent argument ''' import argparse from modules.compute_fye import COMPUTE_FYE from generic.logger import LOGGER if __name__ == "__main__": parser = argparse....
{ "content_hash": "408ad862631bc985f9e3e5fce7e4593c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 36.04, "alnum_prop": 0.632630410654828, "repo_name": "gophronesis/ernest", "id": "f41620c45a4f85224b79fd91c481593225b1f752", "size": "924", "binary...
"""Reads and then deletes the message from SQS queue""" from typing import Optional from airflow.exceptions import AirflowException from airflow.providers.amazon.aws.hooks.sqs import SQSHook from airflow.sensors.base import BaseSensorOperator class SQSSensor(BaseSensorOperator): """ Get messages from an SQS ...
{ "content_hash": "01081cba53698867f61763b3516f658a", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 100, "avg_line_length": 34.28735632183908, "alnum_prop": 0.612470667113644, "repo_name": "sekikn/incubator-airflow", "id": "dc6217b5bd0a347959a0e9783e8e6a053f159f18", "size...
from ctypes import CDLL, byref, CFUNCTYPE, POINTER, Structure, cast, addressof from ctypes import c_void_p, c_char_p, c_long, c_int, c_bool, py_object, string_at import threading SDKError = ('OK', 'ClusterDown', 'NoSuchKey', 'Timeout', 'LockFail', 'CleanBinlogFail', 'UserExists', 'PermissionDenied', 'Passw...
{ "content_hash": "fb62f8c73b80bb3ff216be9297e2d9ea", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 105, "avg_line_length": 38.36092715231788, "alnum_prop": 0.5507121277514027, "repo_name": "fxsjy/ins", "id": "2be7e9610bf7df901703e9af8f22d212865580cc", "size": "11604", ...
PARAM_FILE_PATH = "param.file.path" PLUGINS_DIR = "plugins.dir" EXTENSIONS_DIR = "extensions.dir" MB_IP = "mb.ip" MB_PORT = "mb.port" CARTRIDGE_KEY = "CARTRIDGE_KEY" APPLICATION_ID = "APPLICATION_ID" APPLICATION_PATH = "APPLICATION_PATH" SERVICE_GROUP = "SERIVCE_GROUP" SERVICE_NAME = "SERVICE_NAME" CLUSTER_ID = "CLUS...
{ "content_hash": "ebff24d9ea085244ac9e17d4d427fb59", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 69, "avg_line_length": 34.64957264957265, "alnum_prop": 0.7760236803157375, "repo_name": "dinithis/stratos", "id": "55106599300c0c8ddf85192f7385b86c77eb98f2", "size": "483...
from msrest.serialization import Model class StorageAccountUpdateParameters(Model): """The parameters to update on the account. :param tags: Resource tags :type tags: dict :param account_type: Gets or sets the account type. Note that StandardZRS and PremiumLRS accounts cannot be changed to other...
{ "content_hash": "e50bfab47e542057371c837a110092d4", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 84, "avg_line_length": 43.9375, "alnum_prop": 0.686344238975818, "repo_name": "lmazuel/autorest", "id": "c063ee8b044f6746de883b94a3d212f5fa824e64", "size": "1728", "binar...
import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure...
{ "content_hash": "2e0270bbef1eab9ca949a44141a36bfc", "timestamp": "", "source": "github", "line_count": 597, "max_line_length": 227, "avg_line_length": 47.08710217755444, "alnum_prop": 0.6563267048486358, "repo_name": "Azure/azure-sdk-for-python", "id": "54e7b3ab010ae28be19b56e091898ce2d287c527", "...
import sys import os # Make sure we're using the right python. Assume we're running out of the venv. INTERP = os.path.join(os.getcwd(), 'bin', 'python') if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) sys.path.append(os.getcwd()) import configparser import importlib config = configparser.Con...
{ "content_hash": "794febcb48d932d0a4d9d0db4b72ce35", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 79, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6202020202020202, "repo_name": "qdot/np-telegram-bot", "id": "9b1b615b59000769817f0719b26553960fb4b455", "size": ...
"""Support for OwnTracks.""" from collections import defaultdict import json import logging import re from aiohttp.web import json_response import voluptuous as vol from homeassistant import config_entries from homeassistant.components import mqtt from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.cor...
{ "content_hash": "f867e5c14e54b77761d8587c90aff463", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 79, "avg_line_length": 34.41048034934498, "alnum_prop": 0.6298223350253808, "repo_name": "HydrelioxGitHub/home-assistant", "id": "c0d3d152270a35848d740dfa9d9163367ce19779", ...
from ray.tune._structure_refactor import warn_structure_refactor from ray.air.integrations.comet import * # noqa: F401, F403 warn_structure_refactor(__name__, "ray.air.integrations.comet")
{ "content_hash": "306cb9becc7eabefa2c74a4e75c9fe77", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 64, "avg_line_length": 47.75, "alnum_prop": 0.774869109947644, "repo_name": "ray-project/ray", "id": "5ef4983186f73c1d987e7927482d7f4c8611266c", "size": "191", "binary": f...
import collections import inspect import os from ansible.plugins import action from six import StringIO from oslo_config import iniparser class OverrideConfigParser(iniparser.BaseParser): def __init__(self): self._cur_sections = collections.OrderedDict() self._sections = collections.OrderedDict...
{ "content_hash": "be91ac7dd580081879d339d795451877", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 75, "avg_line_length": 33.88405797101449, "alnum_prop": 0.5571000855431993, "repo_name": "gokulpch/OpenContrail-Kolla", "id": "27fcc532324cdffb4d956142add5402f9672dbe4", "...
from helper import unittest, PillowTestCase, hopper from PIL import Image from PIL import ImageFilter class TestImageFilter(PillowTestCase): def test_sanity(self): def filter(filter): im = hopper("L") out = im.filter(filter) self.assertEqual(out.mode, im.mode) ...
{ "content_hash": "eb55e8a231b640166f2bf5110327100e", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 78, "avg_line_length": 32.48421052631579, "alnum_prop": 0.568697342838626, "repo_name": "mollstam/UnrealPy", "id": "6a694b3ca64d5d674fb9a1a46d3aaf0ef06669b1", "size": "3086...
import argparse import time from pprint import pprint import pyeapi def rm_vlan_func(remove): if args.name in current_vlans: print 'VLAN', args.name, 'exists. Deleting now!' pynet_sw3.config(rm_vlan) else: print "VLAN", args.name, "does not exist" def add_vlan_func(name): if args.name in c...
{ "content_hash": "b5876084bd2bcbca0cc1a407cc70620b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 55, "avg_line_length": 24.4, "alnum_prop": 0.6491803278688525, "repo_name": "bonno800/pynet", "id": "def86b73586783bfab999ad76a699d5f80944495", "size": "1220", "binary": ...
import argparse import logging import sys from typing import Any from typing import Callable from typing import List from typing import Optional from typing import Sequence from typing import Tuple from typing import Type from typing import Union import a_sync from marathon import MarathonClient from marathon.models.t...
{ "content_hash": "5065763be710fc08ae43756b642785d3", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 88, "avg_line_length": 34.21632653061224, "alnum_prop": 0.6669450077537874, "repo_name": "Yelp/paasta", "id": "af3c05fd885d50f255cff2e7279aa4b179718654", "size": "8961", ...
from google.net.proto import ProtocolBuffer import array import _dummy_thread as thread __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit unusednames=printElemNumber,debug_strs no-special""" if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'): _extension_runtime = True _ExtendablePr...
{ "content_hash": "26a6450b3f8597f7c20b16f0255f130f", "timestamp": "", "source": "github", "line_count": 4803, "max_line_length": 241, "avg_line_length": 32.6456381428274, "alnum_prop": 0.640369394822605, "repo_name": "Suwmlee/XX-Net", "id": "1d0aaf2a2d4a5a963fee58e3f0a27b8927d4cea1", "size": "15740...
"""Tests module.""" from unittest import mock import pytest from httpx import AsyncClient from .application import app, container from .services import Service @pytest.fixture def client(event_loop): client = AsyncClient(app=app, base_url="http://test") yield client event_loop.run_until_complete(client...
{ "content_hash": "49dbd651fc60a4b749b03c95a531f2bc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 57, "avg_line_length": 23.535714285714285, "alnum_prop": 0.7101669195751138, "repo_name": "ets-labs/python-dependency-injector", "id": "bde075abe6376e1cae2b4628877e40e5c0fce3...
from itertools import chain from PyQt4.QtCore import * from PyQt4.QtGui import * from Orange.widgets import gui from Orange.widgets.widget import OWWidget from Orange.widgets.settings import Setting from Orange.widgets.utils.saveplot import save_plot from Orange.widgets.io import FileFormat DefDroppletBrush = QBrush...
{ "content_hash": "79cbcc4b7de1a703a4b05d8b01b5f19c", "timestamp": "", "source": "github", "line_count": 553, "max_line_length": 80, "avg_line_length": 34.15370705244123, "alnum_prop": 0.5769047492984593, "repo_name": "qPCR4vir/orange3", "id": "586f3ee8123cc8e081f518b660139b986d7e06b8", "size": "188...
__author__ = 'elsabakiu, neilthemathguy, dmorina' from rest_framework import status, viewsets from rest_framework.response import Response from crowdsourcing.serializers.project import * from rest_framework.decorators import detail_route, list_route from crowdsourcing.models import Module, Category, Project, Requeste...
{ "content_hash": "6e9e0bad1b11389360d5f231b9cb3f2d", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 126, "avg_line_length": 42.44642857142857, "alnum_prop": 0.6940120600196326, "repo_name": "ryosuzuki/crowdsource-platform", "id": "39e15bb3aa3946cb3e8f5fee484d9acf6e1c079d",...
from glad.loader import BaseLoader _EGL_LOADER = ''' int gladLoadEGL(void) { return gladLoadEGLLoader((GLADloadproc)eglGetProcAddress); } ''' _EGL_HEADER = ''' #ifndef __glad_egl_h_ #ifdef __egl_h_ #error EGL header already included, remove this include, glad already provides it #endif #define __glad_egl_h_ #de...
{ "content_hash": "16a4b6805ac887df2007b8d0a3642ed0", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 95, "avg_line_length": 18.30952380952381, "alnum_prop": 0.6521456436931079, "repo_name": "dbralir/glad", "id": "4c01c52bdb68710cc941703d79a0dc0994bb833b", "size": "1538", ...
from __future__ import unicode_literals from django.db import migrations import django.db.models.deletion import sentry.db.models.fields.onetoone class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production. We set this to True for operati...
{ "content_hash": "39f888d22df700c95b27a0f79f07479b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 149, "avg_line_length": 41.48717948717949, "alnum_prop": 0.6687268232385661, "repo_name": "beeftornado/sentry", "id": "5550472a7dc3af2b9615c7f9ce5ce73d021cd38a", "size": "1...
from unittest import TestCase from django.template import TemplateDoesNotExist try: from django.template.loaders.base import Loader as BaseLoader except ImportError: from django.template.loader import BaseLoader try: from django.template import Origin except ImportError: has_origin = False else: ...
{ "content_hash": "4d052c2164b22ff5b8ba8a8c2812161f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 95, "avg_line_length": 28.72222222222222, "alnum_prop": 0.663926499032882, "repo_name": "MichalMaM/ella", "id": "032debe4bbce1d27a898acdf5ee7bb9686fd12e8", "size": "2068", ...
__all__ = ['TreekvParser'] class Logger(object): def __init__(self): pass def write(self, message): print(message) class KeyValue(object): def __init__(self, key, value=None, lineinfo=None, logger=Logger()): self.key = key self.value = value self._list = [] ...
{ "content_hash": "20f7bf5c50e8b098f90aebba1574dc7d", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 169, "avg_line_length": 25.894736842105264, "alnum_prop": 0.5129768605378362, "repo_name": "mizuy/seqtool", "id": "153aa550812711a4079fd31b420eb26ceb2b75b1", "size": "6396...
""" MoinMoin - Create list of LikePages @copyright: 2004 Johannes Berg <johannes@sipsolutions.de> @license: GNU GPL, see COPYING for details. """ Dependencies = ['namespace'] from MoinMoin.action import LikePages def macro_LikePages(macro, text=u'(none)'): request = macro.request # we don't want...
{ "content_hash": "662cb3acb876d0edf02838283ec79d00", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 113, "avg_line_length": 33.06896551724138, "alnum_prop": 0.67570385818561, "repo_name": "RealTimeWeb/wikisite", "id": "cae6778ce335160b0cffb4c35b15c15c0baaa1a3", "size": "9...
""" This module houses the main classes you will interact with, :class:`.Cluster` and :class:`.Session`. """ from __future__ import absolute_import import atexit from collections import defaultdict from concurrent.futures import ThreadPoolExecutor import logging from random import random import socket import sys impor...
{ "content_hash": "4f9bde4170bda072bee4e468086ee116", "timestamp": "", "source": "github", "line_count": 3138, "max_line_length": 176, "avg_line_length": 40.13734862970045, "alnum_prop": 0.6021786250208414, "repo_name": "HackerEarth/cassandra-python-driver", "id": "c7b2be7b73f45e8249e803976577dba297c6...
''' Created on 27/08/2013 @author: luke ''' import unittest from linked_list import Node, LinkedList class TestNode(unittest.TestCase): """ A node represents a segment in the linked list. It has a data field: get and setable to represent the data it holds and a next field that references the next: get an...
{ "content_hash": "641e585d90c8e3448029b56bf17a5354", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 93, "avg_line_length": 30.674698795180724, "alnum_prop": 0.5761979575805185, "repo_name": "Drhealsgood/miniprojects", "id": "0749f96a39e3f5ae77bbb6f2744272f5f7bee824", "siz...
default_app_config = 'kutime.apps.KutimeConfig'
{ "content_hash": "b839a96c1e8ccbb65d383e82c58dec40", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 48, "alnum_prop": 0.7916666666666666, "repo_name": "littmus/kutime_web", "id": "d58fdfc6b64342e3b11c764d8a33cf135ca8841d", "size": "73", "binary": f...
import logging from itertools import chain from django.conf import settings from django.utils.encoding import force_text from django.utils.safestring import mark_safe from django.core.exceptions import ValidationError from .parsing import Parser from .errors import InlineValidationError, create_verbose_inline_error...
{ "content_hash": "a33603d6c7009a4c4c6a2a1e7dc3b4a6", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 74, "avg_line_length": 30.6231884057971, "alnum_prop": 0.5584477046852816, "repo_name": "acdha/django-inlines", "id": "c7fedfca809efe5b3c672a548523b2d5f89733e3", "size": "2...
from __future__ import unicode_literals from ...tokenizer import Tokenizer from ...symbols import ORTH, LEMMA, POS from ...lang.en import English def test_issue1250_cached_special_cases(): nlp = English() nlp.tokenizer.add_special_case(u'reimbur', [{ORTH: u'reimbur', LEMMA: u'reimburse', POS: u'VERB'}]) l...
{ "content_hash": "25803ccd86e1fb17308e84510fc61c58", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 103, "avg_line_length": 42.84615384615385, "alnum_prop": 0.6391382405745063, "repo_name": "recognai/spaCy", "id": "3b6e0bbf2e37534386b6dd8c60acab9a19e28826", "size": "557",...
""" Set of tools to deals with colors in python """ import hashlib class NotAValidComponentException(Exception): """ Exception raised when trying to get an invalid component """ pass class Color(object): """ Object to create, convert and manipulate color in python >>> c = Color(string=b'network'...
{ "content_hash": "571571c2adae86ca466332eee4719840", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 76, "avg_line_length": 35.67039106145251, "alnum_prop": 0.5357870007830854, "repo_name": "avcreation/pyPoppins", "id": "23185a75969439ad6e0eed39fcb3201a596707f3", "size": ...
import sys import os import time with open(sys.argv[2], "rt") as file: for line in file: os.system("./scrape"+sys.argv[1]+" "+line) time.sleep(1) #sleep between so you can quit and so it doesn't spam the site with requests. You can delete this line if you know the site won't mind, but beware you'll...
{ "content_hash": "564b857db3be09547d6cf2f5b0daf437", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 264, "avg_line_length": 51.25, "alnum_prop": 0.7024390243902439, "repo_name": "loadedice/Go-scrape", "id": "43ef753ef133683838746862d169700016b17703", "size": "434", "bina...
from aiohttp.test_utils import AioHTTPTestCase, BaseTestServer, unittest_run_loop from aiosparql.client import SPARQLClient from aiosparql.syntax import IRI __all__ = ["unittest_run_loop", "AioSPARQLTestCase", "TestSPARQLClient"] class TestSPARQLClient: def __init__(self, server, *, cookie_jar=None, loop=None, *...
{ "content_hash": "ae8595d5d7590e0570ed357f90c0f81d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 81, "avg_line_length": 32.59770114942529, "alnum_prop": 0.610719322990127, "repo_name": "tenforce/sparql-aiohttp", "id": "3722e70e7db993c8e5441b56d009ba21c200a811", "size":...
""" Example DAG demonstrating the usage of DateTimeBranchOperator with datetime as well as time objects as targets. """ import pendulum from airflow import DAG from airflow.operators.datetime import BranchDateTimeOperator from airflow.operators.empty import EmptyOperator dag1 = DAG( dag_id="example_branch_datetim...
{ "content_hash": "ee8f53ea3e12c8f764a327d7f6d99178", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 102, "avg_line_length": 33.78333333333333, "alnum_prop": 0.7143561914158856, "repo_name": "danielvdende/incubator-airflow", "id": "e707514c868a07f40ac35cfaabbde1a4b3492494", ...
"""Various algorithms for meshes that don't fit anywhere else.""" import itertools as it import numpy as np import ap.mesh.parsers as parsers def sorted_edges(element, argyris=True): """ Return the edges (as sorted (start, end) tuples) of a given element. Required Arguments ------------------ * e...
{ "content_hash": "7eaf07f843cc7e766e319254c4fae4aa", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 80, "avg_line_length": 35.310880829015545, "alnum_prop": 0.5540719002201027, "repo_name": "VT-ICAM/ArgyrisPack", "id": "86ae7ec1fdd6a600f0461b260d98d13263f6d722", "size": ...
"""Constants used in CSIT.""" class Constants(object): """Constants used in CSIT.""" # OpenVPP testing directory location at topology nodes REMOTE_FW_DIR = "/tmp/openvpp-testing" # shell scripts location RESOURCES_LIB_SH = "resources/libraries/bash" # vat templates location RESOURCES_TP...
{ "content_hash": "0d8db450a459f4a7e121d283f495d2cc", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 58, "avg_line_length": 25.771428571428572, "alnum_prop": 0.6807095343680709, "repo_name": "FDio/vpp", "id": "63428b0c4d4c4017cd41b7457123feb0c7721780", "size": "1498", "b...
from sqlalchemy.testing import assert_raises, assert_raises_message import datetime import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy import Integer, String, ForeignKey, MetaData, and_ from sqlalchemy.testing.schema import Table, Column from sqlalchemy.orm import mapper, relationship, relation, \ ...
{ "content_hash": "22909fd92f1ebb3ca4ac87fd343ba1b0", "timestamp": "", "source": "github", "line_count": 3988, "max_line_length": 83, "avg_line_length": 32.86935807422267, "alnum_prop": 0.4940915297940999, "repo_name": "sandan/sqlalchemy", "id": "00d41604ca234b1cd2c440bae34a7cf1b0abb463", "size": "1...
import os import unittest import json try: from cStringIO import StringIO except ImportError: from io import StringIO import numpy from molml.base import BaseFeature, SetMergeMixin, InputTypeMixin, _func_star from molml.base import EncodedFeature, FormMixin from .constants import METHANE_ELEMENTS, METHANE_CO...
{ "content_hash": "0493c2b23280d9d43155bdd04a7cd066", "timestamp": "", "source": "github", "line_count": 541, "max_line_length": 79, "avg_line_length": 31.168207024029574, "alnum_prop": 0.5419879017910094, "repo_name": "crcollins/molml", "id": "2573cbbee3166a4365c8369f15e876ead88e6d0f", "size": "168...
""" Code to test the deltmail.campaign module This test case sends the following mails: 1. "BulkMail : Greetings from Festember" to mojo@jojo.com and phineas@ferb.com Both email ids appear in the mail (like CC). 2. "TransactionMail : Greetings from Festember" to job@bob.com and pop@bob.com Two ...
{ "content_hash": "0e685f431b7768dc8c272a7647dc76c9", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 101, "avg_line_length": 36.514462809917354, "alnum_prop": 0.6001244836756634, "repo_name": "delta/mailer", "id": "597e91b2895636097ec13c5b44588b84cd0d326f", "size": "17673...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('aparcamientos', '0003_auto_20170522_1853'), ] operations = [ migrations.AlterField( model_name='aparcamiento', name='Num_Com...
{ "content_hash": "94f6954921cea7f8b6300bfa69c9137c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 21.555555555555557, "alnum_prop": 0.6030927835051546, "repo_name": "feer14agui/X-Serv-Practica-Aparcamientos", "id": "c825c3c820bc45c6a597c29062647d8a9...
import httplib import json import logging import logging.config import logging.handlers import optparse import os import re import sys import urllib import uuid # If ../glance/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... possib...
{ "content_hash": "423dc75e851e54d00bce9a1e3b3d16bf", "timestamp": "", "source": "github", "line_count": 784, "max_line_length": 79, "avg_line_length": 35.140306122448976, "alnum_prop": 0.559092558983666, "repo_name": "SUSE-Cloud/glance", "id": "c04262b645950067dab0ccb02ffdb2303cf068c2", "size": "28...
""" Routines to generate synthetic elections of "type 1". Called from syn.py. """ """ e is of type multi.Election synpar is an object of type syn.Syn_Parameters """ import copy import numpy as np import audit_orders import election_spec import outcomes import reported import syn import utils import write_csv """ R...
{ "content_hash": "366347afdd61b9b11d25be832cbc5069", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 89, "avg_line_length": 33.12222222222222, "alnum_prop": 0.5852398523985239, "repo_name": "ron-rivest/2017-bayes-audit", "id": "5914e74e8d13fa7bcd6f92a1b6dd7ea009fd7d9b", "...
from .fields import BitField, Field from nettest.exceptions import NettestError import struct class PacketMeta(type): def __new__(cls, name, bases, attrs): fields = attrs.get('fields') if fields is None: raise NettestError(_("packet class must have 'fields' field")) _fields = []...
{ "content_hash": "8bcc50d274e55d87d2d315c5aaa36b96", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 121, "avg_line_length": 34.52173913043478, "alnum_prop": 0.5090680100755668, "repo_name": "public0821/nettest", "id": "45656983befaf2efb662bff8a0f6da12eb280a68", "size": "...
from nchains import *
{ "content_hash": "cec27b49a479734e1401834b93a16ae2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 22, "alnum_prop": 0.7727272727272727, "repo_name": "plewis/phycas", "id": "193088dc9bbcb9f08273b7004e70fdd6415f9c2d", "size": "22", "binary": false,...
import settings def tag(bucket, doc): def wrapped(inner, **options): options[bucket] = 1 if 'name' in options: inner.__name__ = inner.name = options.pop('name') if 'doc' in options: inner.__doc__ = inner.doc = options.pop('doc') for i in options.items(): ...
{ "content_hash": "ce280d3adf44214ff3a1ab902d04bb84", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 72, "avg_line_length": 25.17543859649123, "alnum_prop": 0.5616724738675958, "repo_name": "justquick/django-native-tags", "id": "86b6ccfb565fedddaabf688b8a7de7d4151ba432", "...
from __future__ import absolute_import import argparse from . import benchmark def main(): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() benchmark.set_parser(subparsers.add_parser('benchmark')) args = parser.parse_args() args.func(args)
{ "content_hash": "3c01eb032b590c752347c8369f6b7a8f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 60, "avg_line_length": 19.266666666666666, "alnum_prop": 0.7058823529411765, "repo_name": "lukeyeager/pencroft", "id": "f3419c0c58fe2b72d25b553f3f4ca5e07a1ce04b", "size": "...
"""Support for Google Assistant Smart Home API.""" from asyncio import gather from collections.abc import Mapping from itertools import product import logging from homeassistant.util.decorator import Registry from homeassistant.core import callback from homeassistant.const import ( CLOUD_NEVER_EXPOSED_ENTITIES, C...
{ "content_hash": "102e34f45676553a776bff60b2f4a742", "timestamp": "", "source": "github", "line_count": 436, "max_line_length": 87, "avg_line_length": 29.672018348623855, "alnum_prop": 0.585761768570766, "repo_name": "molobrakos/home-assistant", "id": "ab2907cf661fa374cc29270497cd660141191100", "si...
import os import mock from oslo_config import cfg from oslo_policy import policy as oslo_policy from oslo_utils import uuidutils import six from six import moves import six.moves.urllib.parse as urlparse import webob from webob import exc import webtest from neutron.api import api_common from neutron.api import exten...
{ "content_hash": "cf7bf185908447d11e69138d37b2541a", "timestamp": "", "source": "github", "line_count": 1519, "max_line_length": 79, "avg_line_length": 41.46938775510204, "alnum_prop": 0.5532924815849631, "repo_name": "eonpatapon/neutron", "id": "eae4dd21b53f06730f72401f525cf5ead91c0e64", "size": "...
""" homeassistant.components.sensor.tellstick ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shows sensor values from tellstick sensors. Possible config keys: id of the sensor: Name the sensor with ID 135=Outside only_named: Only show the named sensors only_named=1 temperature_scale: The scale of the temperature value ...
{ "content_hash": "58e1e4b21fcda0b748a234c1529e4a1f", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 74, "avg_line_length": 29.158333333333335, "alnum_prop": 0.6576164618462418, "repo_name": "michaelarnauts/home-assistant", "id": "e93c6e4c97fe80332038910206d8ac333388d344", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0001_initial'), ] operations = [ migrations.AddField( model_name='taskitem', name='for_today', field=models.BooleanField(default=False), ...
{ "content_hash": "621e26191bebfb83581037393bb5c6b1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 20.625, "alnum_prop": 0.5666666666666667, "repo_name": "andreiavram/organizer", "id": "55f1f40fe83378ca382cdd2a4f82f9949dd152a9", "size": "379", "b...
import os import sys import math from chandelier import Chandelier, BROADCAST import function import generator import filter import random import common from time import sleep, time from color import Color DELAY = .02 device = "/dev/ttyAMA0" ch = Chandelier() ch.open(device) ch.off(BROADCAST) ch.send_entropy() rand...
{ "content_hash": "501e28b671e42d4ed54a752bdb215316", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 53, "avg_line_length": 18.96875, "alnum_prop": 0.7693574958813838, "repo_name": "mayhem/led-chandelier", "id": "9df83fd1ef7c60f6bc32e79778a0f8821ca7eb63", "size": "626", ...
from __future__ import annotations from typing import Any, Mapping, Optional, Sequence, Union from pydantic import BaseModel, Extra, Field, root_validator, validator from datadog_checks.base.utils.functions import identity from datadog_checks.base.utils.models import validation from . import defaults, validators ...
{ "content_hash": "0e2d2fea7a8608eb19229995923d4687", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 110, "avg_line_length": 31.006451612903227, "alnum_prop": 0.6978776529338327, "repo_name": "DataDog/integrations-core", "id": "e6b199569bc3e1a0cc7dc5889a7977f83fa45177", "...
import sys import six def safe_decode(text, incoming=None, errors='strict'): """Decodes incoming text/bytes string using `incoming` if they're not already unicode. :param incoming: Text's current encoding :param errors: Errors handling policy. See here for valid values http://docs.python....
{ "content_hash": "c3523d739d49d1bd437bc2dad09abec6", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 73, "avg_line_length": 36.1, "alnum_prop": 0.6478531855955678, "repo_name": "varunarya10/oslo.utils", "id": "14bd7175903884410d7cf1b188cefc252f106fa0", "size": "3517", "b...
import sys, os extensions = [] source_suffix = '.rst' master_doc = 'README' project = u'i19' copyright = u'2013, Johannes Steger <jss@coders.de>' release = version = '0.1' exclude_patterns = ['build'] pygments_style = 'sphinx' html_static_path = ['_static'] htmlhelp_basename = 'i19doc' html_sidebars = {'**': ['localtoc...
{ "content_hash": "8f8f382a91b2e8071037ead131155149", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 52, "avg_line_length": 27.416666666666668, "alnum_prop": 0.6747720364741642, "repo_name": "johaness/i19", "id": "3cb574c28dafcba040417b0fc4d0947b6d220899", "size": "329", ...
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customization for # the...
{ "content_hash": "9ad96788cbc20dbbc37741113a1dfde2", "timestamp": "", "source": "github", "line_count": 502, "max_line_length": 80, "avg_line_length": 38.07768924302789, "alnum_prop": 0.6127648443630657, "repo_name": "batermj/algorithm-challenger", "id": "03d36c9f600a66ae5722d4149ff6a56cfe72a19b", ...
import numpy as np import tensorflow as tf from agents import BasicAgent, capacities from agents.capacities import get_expected_rewards, build_batches class PolicyAgent(BasicAgent): """ Agent implementing Policy gradient using Monte-Carlo control """ def set_agent_props(self): self.policy_para...
{ "content_hash": "0c91ce84a89b3e76656cdca74e602394", "timestamp": "", "source": "github", "line_count": 955, "max_line_length": 179, "avg_line_length": 46.4, "alnum_prop": 0.5507311789131613, "repo_name": "morgangiraud/openai-rl", "id": "5168269a2de2f41e108e2396950d5d2ceb164674", "size": "44312", ...
from __future__ import absolute_import, division, print_function import pytest import pandas as pd from operator import (add, sub, mul, floordiv, mod, pow, truediv, eq, ne, lt, gt, le, ge, getitem) from functools import partial from datetime import datetime import datashape from datashape.predic...
{ "content_hash": "e009993276ac1a7412978545f952ea6d", "timestamp": "", "source": "github", "line_count": 842, "max_line_length": 83, "avg_line_length": 30.340855106888363, "alnum_prop": 0.5691079187380123, "repo_name": "cpcloud/blaze", "id": "81ac000c206bf113160b410770d79852650ddbfe", "size": "25547...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import unittest import json from mock import patch from app import create_app from app.database import db from app.profile.models import User class Auth0LoginTestCase(u...
{ "content_hash": "eb78a9a00fcb4a0263f6cdd087295252", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 94, "avg_line_length": 41.940520446096656, "alnum_prop": 0.49104768658039355, "repo_name": "subhankarb/dpr-api", "id": "2e6ad7ea13f44d47178c34648d6c72f38e5cda56", "size": ...
""" Cisco_IOS_XR_ipv4_arp_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR ipv4\-arp package configuration. This module contains definitions for the following management objects\: arp\: ARP configuraiton arpgmp\: arpgmp arp\-redundancy\: arp redundancy This YANG module augments the ...
{ "content_hash": "889135040374af9968c4c09ee72d76d8", "timestamp": "", "source": "github", "line_count": 902, "max_line_length": 341, "avg_line_length": 33.791574279379155, "alnum_prop": 0.4466535433070866, "repo_name": "abhikeshav/ydk-py", "id": "12ead048fff05bf96216fccfaf928f8dd5d1dab9", "size": "...
"""Read from and write to tar format archives. """ version = "0.9.0" __author__ = "Lars Gust\u00e4bel (lars@gustaebel.de)" __date__ = "$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $" __cvsid__ = "$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $" __credits__ = "Gustavo Niemeyer, Niels Gu...
{ "content_hash": "c8b135a9219a551b707565d3ed63861d", "timestamp": "", "source": "github", "line_count": 2512, "max_line_length": 103, "avg_line_length": 36.47691082802548, "alnum_prop": 0.5378806067881698, "repo_name": "thecodinghub/news-for-good", "id": "b78b1b1f4bb47364d0a3faaa54e89f35c03cdab3", ...
"""Cloud BigQuery Client for TensorFlow. This package allows TensorFlow to interface directly with Cloud BigQuery for high-speed data loading. @@BigQueryClient @@BigQueryReadSession @@BigQueryTestClient """ from tensorflow.python.util.all_util import remove_undocumented from tensorflow_io.python.ops.bigquery_datas...
{ "content_hash": "26e1259b432dd04a3de579e711b5de9d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 31.85, "alnum_prop": 0.8210361067503925, "repo_name": "tensorflow/io", "id": "7d524d7404b273901d93491def3da00929db2580", "size": "1326", "binary": ...
import pecan from kds.api import config as pecan_config from kds.api import hooks from kds.common import config as oslo_config CONF = oslo_config.CONF def get_pecan_config(): # Set up the pecan configuration filename = pecan_config.__file__.replace('.pyc', '.py') return pecan.configuration.conf_from_fil...
{ "content_hash": "b777d75a0d4e2d495ce7b43eadb699e0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 25.53191489361702, "alnum_prop": 0.6466666666666666, "repo_name": "jamielennox/openstack-kds", "id": "ca60c7e1b69dcfb8be64aceb5074c7fd7eb47869", "siz...
import numpy as np import theano import theano.tensor as T from neupy.utils import asfloat from neupy.core.properties import ProperFractionProperty, BoundedProperty from neupy.algorithms.utils import iter_parameters, count_parameters from .base import SingleStepConfigurable __all__ = ('LeakStepAdaptation',) class ...
{ "content_hash": "2c0b1eebda4aa82e313c3fbb3c133125", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 77, "avg_line_length": 31.52747252747253, "alnum_prop": 0.6350644823980481, "repo_name": "stczhc/neupy", "id": "088921bca9d3ef6a045cf874f1c4dfc52a5649ac", "size": "2869", ...
__author__ = 'Taio' import os import os.path import dns.query import dns.zone import logging from utils.noflib import Noflib run = Noflib() logger = logging.getLogger('get-dns') logging.basicConfig(filename='/var/log/get-dns/get-dns.log', level=logging.DEBUG, format='%(asctime)s - %(name)s - %(le...
{ "content_hash": "b5cd669a97dd963f1c53251d600ddeac", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 90, "avg_line_length": 25.025316455696203, "alnum_prop": 0.5832068791097622, "repo_name": "jiasir/get-dns", "id": "0ea32f2f0177e6ecd1744027dcd0fc176bbdec4b", "size": "1999"...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('editor', '0036_extension_runs_headless'), ] operations = [ migrations.AlterField( model_name='access', ...
{ "content_hash": "1481ef3586cbdc126347a997f9059597", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 168, "avg_line_length": 33.43478260869565, "alnum_prop": 0.64629388816645, "repo_name": "numbas/editor", "id": "d18b8f1c05da675767636bc460c8ac533954f64e", "size": "819", ...
import builtins as __builtins__ from brackets.translate import translate def eval(code, *args, **kwargs): code, debug, original = translate(code) try: return __builtins__.eval(code, *args, **kwargs) except Exception as e: exception_handler(e, debug, original) def exec(code, *args, **kwargs...
{ "content_hash": "085305b599ce9f52c8dcf5cf3a80aa5a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 58, "avg_line_length": 31.608695652173914, "alnum_prop": 0.6437414030261348, "repo_name": "pooya-eghbali/brackets", "id": "05cdcde1ee615044abe9ae3bb2e92108ba3e8550", "size"...
import argparse, os import torch from torch.autograd import Variable import numpy as np import time, math import scipy.io as sio import matplotlib.pyplot as plt parser = argparse.ArgumentParser(description="PyTorch SRResNet Demo") parser.add_argument("--cuda", action="store_true", help="use cuda?") parser.ad...
{ "content_hash": "40431944000c885dc6974363312e7922", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 95, "avg_line_length": 33.28235294117647, "alnum_prop": 0.6398020501944149, "repo_name": "twtygqyy/pytorch-SRResNet", "id": "ae24b903343328938b047dd567795d44832ef527", "siz...
import json from six.moves.urllib import parse as urllib from tempest.api_schema.response.compute.v2_1 import migrations as schema from tempest.common import service_client class MigrationsClientJSON(service_client.ServiceClient): def list_migrations(self, params=None): """Lists all migrations.""" ...
{ "content_hash": "15881c1a00e10d6d271f7f86f8e680d6", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 29.80952380952381, "alnum_prop": 0.6853035143769968, "repo_name": "neerja28/Tempest", "id": "f708a07a19bfd174edccad3e5899e516f21b7bfe", "size": "1235...
import simcity.__main__ as main import pytest @pytest.fixture(params=['cancel', 'check', 'create', 'delete', 'init', 'run', 'scrub', 'summary', 'submit']) def test_main_parser_init(request, argument_parser): main.fill_argument_parser(argument_parser) assert 'func' in argument_parser.pa...
{ "content_hash": "9455c13bd8cdf14d0b80af5f59507e62", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 77, "avg_line_length": 38.44444444444444, "alnum_prop": 0.6560693641618497, "repo_name": "NLeSC/sim-city-client", "id": "b88dc250779d5860aa95904833433c5b2e4ceb78", "size": "...
import flask internal = flask.Blueprint('internal', __name__, template_folder='templates') from mailu.internal.views import *
{ "content_hash": "e070c04c21b27803a1bcbb268339fe1e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 77, "avg_line_length": 18.571428571428573, "alnum_prop": 0.7384615384615385, "repo_name": "kaiyou/freeposte.io", "id": "560f4d970a1b8196e29409ebb8f78d6f4ebecaa5", "size": "1...
import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport i...
{ "content_hash": "f38b2bf5cc11d205e97d2a307cabef6a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 151, "avg_line_length": 43.174418604651166, "alnum_prop": 0.7142472394290331, "repo_name": "Azure/azure-sdk-for-python", "id": "4f8b3a672351f32a0733754f77a15f1e54b5aec1", "...
import subprocess from cactus.static.external import External class ClosureJSOptimizer(External): supported_extensions = ('js',) output_extension = 'js' def _run(self): subprocess.call([ 'closure-compiler', '--js', self.src, '--js_output_file', self.dst, ...
{ "content_hash": "c808a09e2b49e1aa4fe0cbfa5a4bf844", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 25.466666666666665, "alnum_prop": 0.5890052356020943, "repo_name": "gone/Cactus", "id": "98bdf88e187fd3c9fb256a6ed99915b5b363e077", "size": "396", ...
from kafka.tools.protocol.responses import BaseResponse class ListOffsetV0Response(BaseResponse): schema = [ {'name': 'responses', 'type': 'array', 'item_type': [ {'name': 'topic', 'type': 'string'}, {'name': 'partition_responses', 'type': 'array',...
{ "content_hash": "bb48b996c81d3896a755cbe4c1259788", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 32.05555555555556, "alnum_prop": 0.43847487001733104, "repo_name": "toddpalino/kafka-tools", "id": "2cee5e08fab4f3d8bf4c756459d2e8dc941c07da", "size"...
import os import datetime __basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DEBUG = False TESTING = False SQLALCHEMY_DATABASE_URI = 'sqlite://' SQLALCHEMY_TRACK_MODIFICATIONS = False FLATPAGES_MARKDOWN_EXTENSIONS = [] FLATPAGES_EXTENSION = '.html.md' SITE_NAME = 'zakwasy.zgodowie.org' DEFAUL...
{ "content_hash": "8ee7e6cd7e6937d17339eab4e27195c3", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 71, "avg_line_length": 22.511363636363637, "alnum_prop": 0.6733972741039879, "repo_name": "zgoda/zakwasy", "id": "0913fb6f0a20e90cdfef98d981f0ba0c1a0e0c8f", "size": "1981",...
from mpmath.libmp.libmpf import prec_to_dps from ...core import (Add, Function, Ge, Gt, I, Integer, Le, Lt, PrecisionExhausted) from ...logic import false, true ############################################################################### # ####################### FLOOR and CEILING FUNCTIONS #...
{ "content_hash": "7e2427f3d0264d5fb63dc7528dc56013", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 82, "avg_line_length": 28.253061224489795, "alnum_prop": 0.5057786766830396, "repo_name": "diofant/diofant", "id": "d85ba913fbf1c2b006d56cac728dc4500a9d1586", "size": "692...
"""Debugger basics""" import sys import os import types __all__ = ["BdbQuit","Bdb","Breakpoint"] BdbQuit = 'bdb.BdbQuit' # Exception to give up completely class Bdb: """Generic Python debugger base class. This class takes care of details of the trace facility; a derived class should i...
{ "content_hash": "b780cba3bd9c39585201b1335725e199", "timestamp": "", "source": "github", "line_count": 565, "max_line_length": 78, "avg_line_length": 33.13274336283186, "alnum_prop": 0.5369123931623931, "repo_name": "ai-ku/langvis", "id": "8f1367defff2647e9750eff996717df0f4e9e7b0", "size": "18720"...
""" The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters of an estimator. """ from __future__ import print_function # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # ...
{ "content_hash": "83d62e14bfe8c8fc4e79cf57fc570c3c", "timestamp": "", "source": "github", "line_count": 1053, "max_line_length": 87, "avg_line_length": 38.75403608736942, "alnum_prop": 0.6095373456185061, "repo_name": "mikebenfield/scikit-learn", "id": "2f432362e37e44a1edd4eb36a4ff0bbb8fc04b42", "s...
''' Linear Decoder for RGB images Author: Akhil P M Courtesy: UFLDL stanford, Siddharth Agarwal mail: akhilpm135@gmail.com ''' from settings import * import h5py class SparseAutoencoder(object): def __init__(self, input_size, hidden_size, lambdaa, rho, beta): """ initialize the parameters of the Autoencoder""" ...
{ "content_hash": "dd50b098d9d6cdcc9759a788b949b55a", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 98, "avg_line_length": 33.330882352941174, "alnum_prop": 0.6806750496360027, "repo_name": "akhilpm/Masters-Project", "id": "1dd3950c778c36e548bcaafc3a824001fecc8939", "siz...
import numpy as np import scipy as scipy import lxmls.classifiers.linear_classifier as lc import sys from lxmls.distributions.gaussian import * class MultinomialNaiveBayes(lc.LinearClassifier): def __init__(self, xtype="gaussian"): lc.LinearClassifier.__init__(self) self.trained = False s...
{ "content_hash": "161144449e1f9e140dda0045ad1f898e", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 132, "avg_line_length": 41.121212121212125, "alnum_prop": 0.5980103168754606, "repo_name": "LxMLS/lxmls-toolkit", "id": "1b44db3b002f4cf7f172ae3570d0ccbbe878ef9a", "size": ...
"""The Jersey Core libraries """ from jersey._version import copyright, license, version
{ "content_hash": "c14b530d0263bd810d9fd6c180927b93", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 55, "avg_line_length": 22.5, "alnum_prop": 0.7555555555555555, "repo_name": "olix0r/tx-jersey", "id": "4ad1da18502f790cc34ea5c37bbc3f07e1301957", "size": "90", "binary": f...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "03f5baab8f580bece79ee485f38d9e01", "timestamp": "", "source": "github", "line_count": 909, "max_line_length": 518, "avg_line_length": 42.50935093509351, "alnum_prop": 0.591754871768329, "repo_name": "napalm-automation/napalm-yang", "id": "981e263b09e9a20db03c5d27336fdc246e5d78c6", ...
from fcoclient.commands.base import Command class ProductOfferCmd(Command): @staticmethod def add_subparser(subparsers): parser = subparsers.add_parser("offer", help="Inspect product offers") subs = parser.add_subparsers() Command.create_get_parser(subs, "product offer") sub ...
{ "content_hash": "0b84975a8e7e7399a2c8a489c305e3d2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 78, "avg_line_length": 34.6, "alnum_prop": 0.6059730250481695, "repo_name": "xlab-si/fcoclient", "id": "45f54ef46be64b8e215ecde30384cbc812e62638", "size": "1619", "binary...
import py from prolog.interpreter import helper, term, error from prolog.builtin.register import expose_builtin # ___________________________________________________________________ # operators @expose_builtin("current_op", unwrap_spec=["obj", "obj", "obj"], handles_continuation=True) def impl_current...
{ "content_hash": "ed16e1f75a3c6f39f8b2bdd0a0793aa4", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 71, "avg_line_length": 37.59322033898305, "alnum_prop": 0.5446348061316502, "repo_name": "cosmoharrigan/pyrolog", "id": "56e690979f0ae1d0165e001871cc55f58c0efc98", "size": ...
__author__ = 'mworden' """ @package mi.dataset.parser.nutnr_b_particles @file mi/dataset/parser/nutnr_b_particles.py @author Mark Worden @brief Parser for the nutnr_b_particles dataset driver This file contains the particles that are applicable nutnr_b_dcl_conc, nutnr_b_dcl_full and nutnr_b. """ from mi.core.log imp...
{ "content_hash": "1848b6104322364f6a41257cc462d43d", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 107, "avg_line_length": 43.20205479452055, "alnum_prop": 0.6198176773682125, "repo_name": "JeffRoy/mi-dataset", "id": "a29aef8853725eff60892b5eda591ee83e836fa9", "size": "...
import logging import threading import serial import time logger = logging.getLogger(__name__) class DeviceManager(object): def __init__(self, devices): self.devices = devices self.last_tick = (0, 0) self.run_ticks = True self.skipped = 0 self.init() def init(self): ...
{ "content_hash": "5b5a919c35a2e0e76d350bcaf3818db9", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 93, "avg_line_length": 29.876543209876544, "alnum_prop": 0.5427685950413224, "repo_name": "zbanks/beetle", "id": "8dcdc41e7b7dd52ee9260c7e24036992492ed994", "size": "4840"...
import thread import time import random import sys import os participants = [ # Lista uczestników zarejestrowanych ] def input_thread(L): raw_input() L.append(None) def the_winer_is(): L = [] thread.start_new_thread(input_thread, (L,)) while 1: time.sleep(.005) o...
{ "content_hash": "08fb05c9538487a201a9f35b53d184d4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 82, "avg_line_length": 14.394736842105264, "alnum_prop": 0.5740402193784278, "repo_name": "PyStok/PyStok-1", "id": "dc669a45ee66b9775bada0106e1c53f3967a7864", "size": "573"...
prompt = '> ' def parse_arguments(arguments): if arguments['init:config']: print(arguments) if arguments['init:db']: from lightningwolf_smp.utils.creator import generate generate() print("Tables in Database created") if arguments['user:create']: import getpass ...
{ "content_hash": "f3b022b344acd2c3d22ba3bbd1992087", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 87, "avg_line_length": 34.701298701298704, "alnum_prop": 0.5669910179640718, "repo_name": "lightningwolf/lightningwolf-smp", "id": "ba98fe10ac486d86077e208c82ededf79a84d2bc",...
import unittest #from pyvision.analysis.stats import cibinom #from pyvision.analysis.Table import Table import pyvision as pv class ConfusionMatrix(pv.Table): def __init__(self, algorithm_name=None, test_name=None): pv.Table.__init__(self,default_value=0) self.algorithm_name = ...
{ "content_hash": "8ec1f3ca015d78ace0b25059f1915827", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 99, "avg_line_length": 33.72049689440994, "alnum_prop": 0.5675078283293424, "repo_name": "svohara/pyvision", "id": "93177cd0d37f7a47a4df13b7d52ef44dc99214c2", "size": "698...
"""Test the Store interface Many methods simply proxy to config/metadata/data store implementations, but there is some cross-coordination and there are some convenience methods implemented at this layer. """ import os import numpy as np import numpy.testing from pytest import fixture, raises from smif.data_layer impo...
{ "content_hash": "f16f75160ce849820ea6bf598af99ced", "timestamp": "", "source": "github", "line_count": 817, "max_line_length": 95, "avg_line_length": 42.6328029375765, "alnum_prop": 0.6062702764778501, "repo_name": "nismod/smif", "id": "f47f4daa07bb641c071034241b0bb34bfc97a9bf", "size": "34831", ...
import math import tensorflow as tf from random import shuffle import utils # Initialization parameters STD_DEV = 0.1 BIAS_BIAS = 0.1 # Network parameters INPUT_DIMENSION = 28 INPUT_SIZE = 784 # 28x28 OUTPUT_SIZE = 10 # 0-9 CONV_POOL_LAYERS = [(5, 32, 1, 2), (5, 64, 1, 2)] # filter_size, features, conv_stride, poo...
{ "content_hash": "434e900b498659392e2df1f9f279eed8", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 112, "avg_line_length": 33.878571428571426, "alnum_prop": 0.6540164452877926, "repo_name": "tonypeng/ml-playground", "id": "d733a9114a97d289e5d825bd8e00c7783f0f89d8", "siz...
mystr = 'xxxxxasher' myposition = mystr.find('asher') print("the position of 'asher' is in %s of %s" % (myposition, mystr)) print('*' * 20) if 'asher' in mystr: mykouer = mystr.replace('asher', 'kouer') print('mykouer is %s' % mykouer) else: print('asher is not in %s' % mystr) if mystr.find('aasher'): ...
{ "content_hash": "42e7dcf36c28bb7590b78f2e3ac2b596", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 69, "avg_line_length": 18.708333333333332, "alnum_prop": 0.6403118040089086, "repo_name": "lichengshuang/createvhost", "id": "82d358046120346f5fa0a857ef1cb4871c434893", "si...
import uuid import networkx as nx from solar import utils from .traversal import states from solar.interfaces.db import get_db db = get_db() def save_graph(graph): # maybe it is possible to store part of information in AsyncResult backend uid = graph.graph['uid'] db.create(uid, graph.graph, db.COLLEC...
{ "content_hash": "9dd6ba6af7a29c3604d53432765324e2", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 85, "avg_line_length": 26.020689655172415, "alnum_prop": 0.5860058309037901, "repo_name": "torgartor21/solar", "id": "f210b86bc6191992c60dede5a6e24be09dda6292", "size": "4...
from .stnet import *
{ "content_hash": "3c617b8718702c972a489dca42f72474", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 20, "avg_line_length": 21, "alnum_prop": 0.7142857142857143, "repo_name": "kuke/models", "id": "db952550a12b34853556fa42bba04c823bc7cbe4", "size": "21", "binary": false, ...
''' whooshalchemy flask extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds whoosh indexing capabilities to SQLAlchemy models for Flask applications. :copyright: (c) 2012 by Karl Gyllstrom :license: BSD (see LICENSE.txt) ''' from __future__ import absolute_import from flask import Flask from flas...
{ "content_hash": "246c33ca189e3dd1777ce4e77f8200e7", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 126, "avg_line_length": 34.97931034482759, "alnum_prop": 0.6332807570977917, "repo_name": "gyllstromk/Flask-WhooshAlchemy", "id": "95bb11d866e8928e31676ab1eb6194affb102d66",...
""" Load a CSV raster file to RasterAggregatedLayer object and related NumericRasterAggregateData. NOTE: Input CSV expected to be AGGREGATED. """ import os import csv import gzip import datetime from django.core.management.base import BaseCommand, CommandError from django.contrib.gis.geos import Point from django.utils...
{ "content_hash": "181ca0298b0c596c81fd94b25442f99f", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 213, "avg_line_length": 48.532544378698226, "alnum_prop": 0.4567178736893441, "repo_name": "monkut/deso", "id": "41ba413af48716b5d61e0bc7f52e65d21beddf16", "size": "8202",...
from django.conf.urls.defaults import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'payway_demo.views.home', name='home'), # url(r'^payway_demo/', include('payway_demo.fo...
{ "content_hash": "7f3309d27913389e03d7f9c94006cb65", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 38.47826086956522, "alnum_prop": 0.6621468926553672, "repo_name": "RANUX/django-payway", "id": "44821d972c8cfb737decf27198f4b3e9d3260697", "size": "8...
from __future__ import absolute_import, with_statement import errno import glob import os import re import shutil import signal import stat import subprocess import sys import time import tempfile import warnings from collections import namedtuple from datetime import datetime from distutils.version import LooseVersio...
{ "content_hash": "1ba651bf7f0cdfe08e531b80ba08431a", "timestamp": "", "source": "github", "line_count": 2080, "max_line_length": 251, "avg_line_length": 43.55336538461538, "alnum_prop": 0.5746045412899736, "repo_name": "tolbertam/ccm", "id": "ba065e5ce7516ce27dbffa9a89919b59f34ab901", "size": "9060...
import grpc from mocker.endpoints import grpc_endpoint_pb2 as mocker_dot_endpoints_dot_grpc__endpoint__pb2 class MockServiceStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.U...
{ "content_hash": "cd0889d6e4e520b3bd6ba2adbaabea0a", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 114, "avg_line_length": 44.59493670886076, "alnum_prop": 0.7470905478285552, "repo_name": "dcos/dcos", "id": "2c11558c779ca30cf102e85a7ed1890b10ef687e", "size": "3593", "...
import image, math, pyb, sensor, struct, time # Parameters ################################################################# uart_baudrate = 115200 MAV_system_id = 1 MAV_component_id = 0x54 MAX_DISTANCE_SENSOR_enable = True lens_mm = 2.8 # Standard Lens. lens_to_camera_mm = 22 # Standard Lens. sensor_w_mm = 3.984 #...
{ "content_hash": "67fb8b197475491513f39c53b28d751c", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 150, "avg_line_length": 38.48026315789474, "alnum_prop": 0.5566763549324671, "repo_name": "iabdalkader/openmv", "id": "236a0f663f0f085b41fd696047aeca312b182b76", "size": "...