text
stringlengths
4
1.02M
meta
dict
from selenium import webdriver from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.user import UserHelper class Application: def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firefox() elif browser == "chrome":...
{ "content_hash": "8c277ec533fad660553b721aed0e8dfa", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 65, "avg_line_length": 26.428571428571427, "alnum_prop": 0.5837837837837838, "repo_name": "maximatorrus/automated_testing_python", "id": "31ad218fa93d3bdad88dc8962a1d4687bc3a...
u""" Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. This file is part of Toolium. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unles...
{ "content_hash": "eccaeba459f227f10595498e3530322e", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 91, "avg_line_length": 36.52173913043478, "alnum_prop": 0.7339285714285714, "repo_name": "Telefonica/toolium-examples", "id": "c31d27c9db7710282c84ac2c0c2f8868dc97b132", "s...
import unittest from pants.util.filtering import create_filter, create_filters, wrap_filters class FilteringTest(unittest.TestCase): def _divides_by(self, divisor_str): return lambda n: n % int(divisor_str) == 0 def test_create_filter(self): divides_by_2 = create_filter("2", self._divides_by...
{ "content_hash": "dc041103de511add800ef6908d8fdc81", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 81, "avg_line_length": 39.77049180327869, "alnum_prop": 0.6314921681780709, "repo_name": "tdyas/pants", "id": "d55c9933f533158f8c957f7c47081872f8cac28a", "size": "2558", ...
from stanza.nlp.data import * from stanza.nlp.corenlp import *
{ "content_hash": "8ce28d44cf5caf92fb2d7f4446f7d160", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 32, "avg_line_length": 31, "alnum_prop": 0.7903225806451613, "repo_name": "arunchaganty/presidential-debates", "id": "5f7ebca9cf525cdbc1f657e684fc6a8b94e195b7", "size": "62"...
""" Contains keras models and functions. """ from .keras_model import KerasModel
{ "content_hash": "4a5402c67e617ecfdb8f36aacd461ba8", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 44, "avg_line_length": 40.5, "alnum_prop": 0.7530864197530864, "repo_name": "analysiscenter/dataset", "id": "27ac26aad7a753d2e90a419f1b66e6792dbecbe3", "size": "81", "bina...
import httplib #import eventlet #httplib = eventlet.import_patched('httplib') from .http import http_backend class https_backend(http_backend): def get_connection(self): return httplib.HTTPSConnection(self.host, self.port)
{ "content_hash": "e2ddbfe436bcc75ff71d3ed2abc574ad", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 21.727272727272727, "alnum_prop": 0.7489539748953975, "repo_name": "geodelic/arke", "id": "f41ea2447c1591819d33d1afd446b0f58e0cb224", "size": "840", ...
"""Support for RFXtrx switches.""" import logging import voluptuous as vol from homeassistant.components import rfxtrx from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA from homeassistant.components.rfxtrx import ( CONF_AUTOMATIC_ADD, CONF_FIRE_EVENT, DEFAULT_SIGNAL_REPETITIONS, CONF_S...
{ "content_hash": "ce5438a62274820919c6dd23c7040e3d", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 33.725806451612904, "alnum_prop": 0.6934481109516978, "repo_name": "nugget/home-assistant", "id": "141cf2c2c1a6172341708c27d8ec05fdeeecaa84", "size":...
from .util.config import config import sqlalchemy from sqlalchemy.orm import sessionmaker # Create database uri = '{driver}{user}:{password}@{path}'.format(**config.storage._asdict()) db = sqlalchemy.create_engine(uri, echo = False) Session = sessionmaker() Session.configure(bind = db) from .models import Base Base.m...
{ "content_hash": "9379d9149133b6b9de7a3f9994686418", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 75, "avg_line_length": 20.966666666666665, "alnum_prop": 0.7424483306836248, "repo_name": "tmacro/hitman_agent", "id": "7b3dd20841542d2478d1d7240377d4f87f50b7bf", "size": "...
from itertools import groupby from pychron.processing.analyses.analysis_group import InterpretedAgeGroup def set_subgrouping_error(tag, selected, items): ss = [] for s in selected: if s.subgroup: s.subgroup['error_kind'] = tag ss.append(s.subgroup['name']) if ss: ...
{ "content_hash": "2f1921921325a98a053b66faa02831fe", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 106, "avg_line_length": 27.272727272727273, "alnum_prop": 0.5233333333333333, "repo_name": "UManPychron/pychron", "id": "c3d2ea2b4ea56bb58f114b6dfdf20c7fc9db50bb", "size": ...
from debile.master.arches import get_preferred_affinity, get_source_arches class FnordArch(object): def __init__(self, name): self.name = name def __repr__(self): return "<Fnord: %s>" % (self.name) valid_arches = [ FnordArch("amd64"), FnordArch("sparc"), FnordArch("ppc64"), ...
{ "content_hash": "054fea5b7550aa3495e2a9ee5acceeca", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 78, "avg_line_length": 25.671296296296298, "alnum_prop": 0.5945897204688909, "repo_name": "opencollab/debile", "id": "668044c7a37138aede34f9cdee40d5d586c4c909", "size": "5...
"""Utilities and helper functions.""" import contextlib import datetime import errno import functools import hashlib import inspect import itertools import os import paramiko import pyclbr import random import re import shlex import shutil import signal import socket import struct import sys import tempfile import tim...
{ "content_hash": "1452e4a676c9e13660fa7022eb6cf8c0", "timestamp": "", "source": "github", "line_count": 1145, "max_line_length": 79, "avg_line_length": 32.60524017467249, "alnum_prop": 0.5822730560094287, "repo_name": "citrix-openstack-build/cinder", "id": "1d5e89c5c9017a79cd37170fbc7ce38c5c1ca272", ...
import re if (__name__ == "__main__"): # Assemble the script which embeds the Markdeep page into the preview blog PreviewBlogPage = open("PreviewBlogPage.htm", "rb").read().decode("utf-8") HeadMatch = re.search("<head(.*?)>(.*?)</head>", PreviewBlogPage, re.DOTALL) HeadAttributes = HeadMatch.group(1) FullDoc...
{ "content_hash": "d232f6cda9c293740fe59866ae7cc451", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 97, "avg_line_length": 51.18181818181818, "alnum_prop": 0.6660746003552398, "repo_name": "MTASZTAKI/ApertusVR", "id": "ac0b394f1767df4dbe5d335b522e7f79ebfc0d4a", "size": "2...
import os from django_node.base_service import BaseService class TimeoutService(BaseService): path_to_source = os.path.join(os.path.dirname(__file__), 'services', 'timeout.js') timeout = 1.0 class ErrorService(BaseService): path_to_source = os.path.join(os.path.dirname(__file__), 'services', 'error.js')
{ "content_hash": "c490b9fae2445ea43db3141c6241a226", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 86, "avg_line_length": 29.09090909090909, "alnum_prop": 0.709375, "repo_name": "markfinger/django-node", "id": "ebde682f03019dcf08efa6a821ccaf272ef927ed", "size": "320", ...
"""Tests for the views of the ``django-metrics-dashboard`` app.""" from django.test import TestCase from django.test.client import RequestFactory from django_libs.tests.factories import UserFactory from django_libs.tests.mixins import ViewTestMixin from metrics_dashboard.tests.mixins import WidgetTestCaseMixin from m...
{ "content_hash": "5b540f97eef53a15a964d9b738f0fff6", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 37.8421052631579, "alnum_prop": 0.6731571627260083, "repo_name": "bitmazk/django-metrics-dashboard", "id": "234c0191a42f5402d02bd03ef08a731993e2d655", ...
import unicodecsv from cStringIO import StringIO from ckan.plugins.toolkit import BaseController, render, c, get_action, response class InventoryController(BaseController): def index(self): context = {'user': c.user} c.entries = get_action('inventory_entry_organization_summary')(context, {}) ...
{ "content_hash": "a8a9b9428b90adf7c427c785ab0eb5db", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 120, "avg_line_length": 34.791666666666664, "alnum_prop": 0.6574850299401198, "repo_name": "govro/ckanext-inventory", "id": "5ea32714a0db7a9853ce97c7cd509cd61eb27c08", "siz...
"""A client interface for TensorFlow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import functools import re import threading import warnings import numpy as np import wrapt from tensorflow.core.protobuf import config_pb2 from te...
{ "content_hash": "01d6d0cf63b8e015d49c7c944fbb4722", "timestamp": "", "source": "github", "line_count": 1785, "max_line_length": 94, "avg_line_length": 38.69075630252101, "alnum_prop": 0.6566178706398506, "repo_name": "sarvex/tensorflow", "id": "910428fb3c485db67a4e9ede6ced0cf688ecd6cd", "size": "6...
import copy import warnings from collections import OrderedDict from django.utils import six class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the...
{ "content_hash": "295789566f5a2f079e346e330935a902", "timestamp": "", "source": "github", "line_count": 533, "max_line_length": 107, "avg_line_length": 29.587242026266416, "alnum_prop": 0.5484464172479391, "repo_name": "denisenkom/django", "id": "f4f694f399fd588e1826e718cbd33bb2fd4a5562", "size": "...
from abc import ABC, abstractmethod import dateutil.parser from enum import Enum from metadata_comparison.lib.operation_ids import JsonObject, operation_id_to_api_version, \ PAPI_V1_API_VERSION, PAPI_V2_ALPHA1_API_VERSION, PAPI_V2_BETA_API_VERSION import re from typing import AnyStr, Dict, Iterator, Union class D...
{ "content_hash": "62453fc71e8894b5efdb137232aa6c5a", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 122, "avg_line_length": 39.826989619377166, "alnum_prop": 0.635968722849696, "repo_name": "broadinstitute/cromwell", "id": "bda34c1aa4c923d302b75d2477a9976700273e55", "siz...
""" use objgraph to plot the reference paths for types found in dill.types """ #XXX: useful if could read .pkl file and generate the graph... ? import dill as pickle #pickle.debug.trace(True) #import pickle # get all objects for testing from dill import load_types load_types(pickleable=True,unpickleable=True) from di...
{ "content_hash": "f1c46e1bc4bbddbd913dbca1b2f481a5", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 71, "avg_line_length": 27.151515151515152, "alnum_prop": 0.6082589285714286, "repo_name": "DiegoCorrea/ouvidoMusical", "id": "d62c4cad9f497efaf6cfd422644a5a05841c6b3a", "si...
from django.core.management.base import BaseCommand, CommandError from ship_data.models import MultibeamRawFileMetadata import json import datetime import os # This file is part of https://github.com/cpina/science-cruise-data-management # # This project was programmed in a hurry without any prior Django experience, # ...
{ "content_hash": "490f9396374fb753f97e870ee6c19526", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 107, "avg_line_length": 45.945945945945944, "alnum_prop": 0.7252941176470589, "repo_name": "cpina/science-cruise-data-management", "id": "321228616d50f9547b02c9c1921e3d557eff...
import unittest import numpy as np from op_test import OpTest import paddle.fluid.core as core import paddle.fluid as fluid import paddle paddle.enable_static() def bilinear_interp_np( input, out_h, out_w, out_size=None, actual_shape=None, align_corners=True, align_mode=0, data_layout...
{ "content_hash": "9879f6933d043a1b6b3bd84a45610789", "timestamp": "", "source": "github", "line_count": 568, "max_line_length": 80, "avg_line_length": 30.408450704225352, "alnum_prop": 0.541975451597962, "repo_name": "PaddlePaddle/Paddle", "id": "b281d30a2221f2f07aad061df939620fb2659425", "size": "...
from CRABClient.UserUtilities import config, getUsernameFromSiteDB config = config() config.General.requestName = 'TSTARSELECT_NAME' config.General.workArea = 'work_area' config.General.transferOutputs = True config.General.transferLogs = True config.JobType.pluginName = 'Analysis' config.JobType.psetName = './run_pr...
{ "content_hash": "cb086bd178911eb5ef7cf254055824c7", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 66, "avg_line_length": 27.2, "alnum_prop": 0.7720588235294118, "repo_name": "enochnotsocool/TstarAnalysis", "id": "9e97909b5579f3fc0134199882c30228af078642", "size": "680",...
"""The test case itsself, and associated stuff""" import string class BaseTest: def __init__(self): self.res = -1 self.reason = None def parse_config(self, config): self.files = [] for line in config.readlines(): line = string.strip(line) self.file...
{ "content_hash": "2ac3a4137d3e92ecc1b72e2223461907", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 87, "avg_line_length": 27.157894736842106, "alnum_prop": 0.458656330749354, "repo_name": "wilebeast/FireFox-OS", "id": "984eef0e2d941e3e2abb2baf2be0e9b67e08254b", "size": "...
import os from flask import current_app def make_relative(curr_path: str, href: str) -> str: """ Given a current path and a href, return an equivalent relative path. :param curr_path: :param href: :return: """ curr_list = curr_path.lstrip('/').split('/') href_list = href.lstrip('/')....
{ "content_hash": "5649e2ff59567eefa7b662850810755f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 72, "avg_line_length": 26.70689655172414, "alnum_prop": 0.5584247901872176, "repo_name": "tokyo-jesus/tamactiluya", "id": "42b22e03855cadd5d0acf84bcf80f0be8bda13a4", "size"...
import random from oslo_db import exception as db_exc from oslo_log import log as logging import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc from sqlalchemy.orm import joinedload from neutron.callbacks import events from neutron.callbacks import registry from neutron.callbacks import re...
{ "content_hash": "154189b96d96cd55c4ca71f0955a071a", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 79, "avg_line_length": 46.861189801699716, "alnum_prop": 0.5686736791198163, "repo_name": "Stavitsky/neutron", "id": "6dd4e7807ef0868a22bb1dd62ee3105e74ea0ed5", "size": "1...
from nova.policies import base BASE_POLICY_NAME = 'os_compute_api:os-extended-server-attributes' extended_server_attributes_policies = [ base.create_rule_default( BASE_POLICY_NAME, base.RULE_ADMIN_API, """Return extended attributes for server. This rule will control the visibility for a...
{ "content_hash": "e0520c3de50057a7c8c1095461947372", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 70, "avg_line_length": 29.263157894736842, "alnum_prop": 0.6097122302158273, "repo_name": "rajalokan/nova", "id": "ce1fcdd58a38c8f10edca2f085cf88ba19b661d8", "size": "1751"...
from django.db import migrations class Migration(migrations.Migration): dependencies = [("cms", "0005_product_page_header")] operations = [migrations.RemoveField(model_name="bootcamprunpage", name="content")]
{ "content_hash": "09c23f1aab66fb332120afe087bbc68f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 87, "avg_line_length": 27.625, "alnum_prop": 0.7375565610859729, "repo_name": "mitodl/bootcamp-ecommerce", "id": "483f184e9fa54d29ab7a8469466de76995129663", "size": "271", ...
from redbot.message import headers class x_cache(headers.HttpHeader): canonical_name = "X-Cache" description = """\ The `X-Cache` header is used by some caches to indicate whether or not the response was served from cache; if it contains `HIT`, it was.""" list_header = True deprecated = False vali...
{ "content_hash": "cbb9202727a79b4d25fa730b8c6df46d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 99, "avg_line_length": 31, "alnum_prop": 0.7016129032258065, "repo_name": "mnot/redbot", "id": "c756253804b5f953c11a7926881edc90513f4e10", "size": "372", "binary": false,...
from django.core.mail.message import EmailMultiAlternatives from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.context import RequestContext, Context from django.template.loader import get_template from django.utils import simplejson from django.views.decorators.cs...
{ "content_hash": "2eb69759a27c0da6ebe4ebe4bb9acb91", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 104, "avg_line_length": 38.728813559322035, "alnum_prop": 0.6122538293216631, "repo_name": "vosi/django-sitecontacts", "id": "1431aa930f544193efe3117c15d7ef74be4ca790", "si...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2016 Alex Forencich 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...
{ "content_hash": "bfffcd0577775d54ff6b309a3967279d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 37.11904761904762, "alnum_prop": 0.7408595253367544, "repo_name": "Diti24/python-ivi", "id": "c1b8151a3ec18f00a496a69a03138ee9bea69bb3", "size": "155...
import time import game import instances import palette import registry from entities import entity from entities.creatures import player from statuses import hastestatus class TwitchChatManager(entity.Entity): special_viewers = [] def __init__(self): super().__init__(' ') self.hidden = Tru...
{ "content_hash": "eca08351fb6487a47772453eacbb8a2c", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 160, "avg_line_length": 41.2972972972973, "alnum_prop": 0.48276614310645727, "repo_name": "JoshuaSkelly/lunch-break-rl", "id": "ef49018a54b21a5b06d0e69a64e788b92e4ecddc", ...
"""Tests for tensorflow.ops.control_flow_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math import time import unittest import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflo...
{ "content_hash": "38a9d699f5900718a7cac51c949b77a9", "timestamp": "", "source": "github", "line_count": 3457, "max_line_length": 112, "avg_line_length": 35.87648249927683, "alnum_prop": 0.6082241483571861, "repo_name": "AnishShah/tensorflow", "id": "374faad7a7f989ab80492320cee0bbc89c78465b", "size"...
import collections import jinja2 import json import os import urllib import webapp2 import league_website JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) def MakeDivisionJson(division): def MakeTea...
{ "content_hash": "7ea9d5b7ba114ff0a699c8e411a9e84f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 78, "avg_line_length": 29.376623376623378, "alnum_prop": 0.6865605658709107, "repo_name": "fortuna/corporate-soccer-league", "id": "04018e3e843b15ed6723480e6cc7781a8b46ce3d",...
import collectd from pysphere import VIServer RUN = 0 METRIC_TYPES = { 'datastorecapacity': ('z_dscapacity', 'current'), 'datastorefreespace': ('z_dsfreespace', 'current'), 'datastoreusagepercent': ('z_dsusage_pct', 'current'), 'zonedatacenterscount': ('z_datacenters_count', 'current'), 'zoneclust...
{ "content_hash": "5ba8be154b363999843d09e25330f340", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 324, "avg_line_length": 53.795505617977526, "alnum_prop": 0.6046618488658674, "repo_name": "llambiel/collectd-vcenter", "id": "f53cf3042f5f7d12c03247dcd555ff4544da8c5f", "...
import json import time from bson import json_util from tests import base from girder import events from girder.constants import AccessType from girder.exceptions import ValidationException from girder.models.user import User from girder.models.token import Token from girder_jobs.constants import JobStatus, REST_CREA...
{ "content_hash": "297f8a55c5282b26d7da682d5bf4da06", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 99, "avg_line_length": 42.04054054054054, "alnum_prop": 0.6127852780456445, "repo_name": "Kitware/girder", "id": "853dbf0104fd039216219cc602ee956392bafbe8", "size": "24912...
""" =================================== The :mod:`array_split.tests` Module =================================== Module for running all :mod:`array_split` unit-tests, including :mod:`unittest` test-cases and :mod:`doctest` tests for module doc-strings and sphinx (RST) documentation. Execute as:: python -m array_spl...
{ "content_hash": "b85d483d6ee5616f1dbd60c236a0790b", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 90, "avg_line_length": 28.848275862068967, "alnum_prop": 0.5646665072914177, "repo_name": "array-split/array_split", "id": "db8c8202ac93ff0c14b820f734baea578f6e5382", "siz...
class ConfigmanException(Exception): pass class ConfigFileMissingError(IOError, ConfigmanException): pass class ConfigFileOptionNameMissingError(ConfigmanException): pass class NotAnOptionError(ConfigmanException): pass class OptionError(ConfigmanException): pass class CannotConvertError(C...
{ "content_hash": "6940b8dc5556ac2fe4c7980bf6887397", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 15.863636363636363, "alnum_prop": 0.7936962750716332, "repo_name": "peterbe/configman", "id": "f7f6be4a73d0d4303360c24d28b5ebeff728367f", "size": "20...
import six import numbers import logging import numpy as np from sklearn.metrics import log_loss from sklearn.utils import check_consistent_length, check_array from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelBinarizer import mxnet as mx from mxnet.metric import EvalMetric...
{ "content_hash": "0fbf260be0584a22634ba96ab1ea5be6", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 96, "avg_line_length": 29.808333333333334, "alnum_prop": 0.5835896002236511, "repo_name": "joshloyal/Nettie", "id": "2ff3580a9bff9139a670356e08a17d2a5a1021fb", "size": "71...
from django.shortcuts import render, get_object_or_404 from .models import Book def index(request): recommended_books = Book.objects.all()[:5] context = {'recommended_books': recommended_books} return render(request, 'index.html', context) def detail(request, book_id): book = get_object_or_404(Book,...
{ "content_hash": "c2785f8cc346450bae78bd214e9e6d30", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 172, "avg_line_length": 37.16, "alnum_prop": 0.6620021528525296, "repo_name": "tonyshenyy/equal-read-interface", "id": "8320ccc5d909e25a2e01b837876f4cae565d30d0", "size": "...
import argparse import copy import logging import numpy as np # noqa from caffe2.proto import caffe2_pb2, caffe2_legacy_pb2 from caffe.proto import caffe_pb2 from caffe2.python import core, utils, workspace from google.protobuf import text_format logging.basicConfig() log = logging.getLogger("caffe_translator") log....
{ "content_hash": "33cecd7763bfff0d8e853ed702217b66", "timestamp": "", "source": "github", "line_count": 726, "max_line_length": 97, "avg_line_length": 37.37603305785124, "alnum_prop": 0.6325409987101529, "repo_name": "bwasti/caffe2", "id": "7c7dd916ca48310789335b861cdb9776f3d6463f", "size": "27228"...
import numpy as np from traits.api import (HasTraits, Instance, Float, Enum, Int, Property, cached_property, Any) from traitsui.api import View, HSplit, ToolBar, Action, Item, VGroup from pyface.api import ImageResource from enable.api import ComponentEditor from chaco.api import (create_line_p...
{ "content_hash": "14ff581c1e56a514389080bb9a1dd106", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 79, "avg_line_length": 37.1566265060241, "alnum_prop": 0.5768482490272373, "repo_name": "bburan/cochlear", "id": "dbed6267ba5f5f0f128fc93b3b4e09fbabbc289d", "size": "6168"...
import webbrowser from xierpa3.components import Theme, Page, Text from xierpa3.builders.htmlbuilder import HtmlBuilder class HelloWorld(Theme): u"""The **HelloWorld** site class implements a basic "Hello, world!", showing the smallest possible web page""" TITLE = u'The standard "Hello, world!" page.' # U...
{ "content_hash": "6f70535a6e94b85475c27ed944e2d6b0", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 101, "avg_line_length": 53.98, "alnum_prop": 0.6721007780659504, "repo_name": "petrvanblokland/Xierpa3", "id": "5c0f74e2b4ef91ffddd9299c7a05962e896577ed", "size": "3422", ...
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.utils.six.moves.urllib.parse import urljoin from djblets.siteconfig.models import SiteConfiguration from reviewboard.site.urlresolvers import local_site_reverse def get_server_url(local_site_name=None, local_site=None, ...
{ "content_hash": "a39aab5b0b9ef0cf7843e1bcdd502c28", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 78, "avg_line_length": 37.5, "alnum_prop": 0.6918518518518518, "repo_name": "beol/reviewboard", "id": "29c4fd89d2fb998b766f4e8408113c26a90fbddd", "size": "1350", "binary"...
try: import json as _json except ImportError: import sys sys.path.append('simplejson-2.3.3') import simplejson as _json import requests as _requests import urlparse as _urlparse import random as _random import base64 as _base64 from ConfigParser import ConfigParser as _ConfigParser import os as _os _C...
{ "content_hash": "eaf1cac22ea37d58849ecf1670fe4332", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 105, "avg_line_length": 41.00558659217877, "alnum_prop": 0.5543596730245232, "repo_name": "kbaseIncubator/onerepotest", "id": "e14fcbc65792bf79fd70c84345dbcb8ae4ff358f", "...
from nose.tools import assert_true, assert_equal import pickle as pkl import sys import os import numpy as np from sklearn.model_selection import train_test_split sys.path.insert(1, os.path.abspath('..')) from lopq.model import LOPQModel, eigenvalue_allocation, accumulate_covariance_estimators, compute_rotations_from...
{ "content_hash": "491c634187c89846c1cf99fb66b2ee9e", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 126, "avg_line_length": 31.027397260273972, "alnum_prop": 0.6528697571743929, "repo_name": "yahoo/lopq", "id": "96832d0b6312e11226c4ae7633b2f7fc97d3b3ed", "size": "9212", ...
"""Abstraction layer to resize images using PIL, ImageMagick, or a public resizing proxy if neither is available. """ from __future__ import (division, absolute_import, print_function, unicode_literals) import urllib import subprocess import os import re from tempfile import NamedTemporaryFile ...
{ "content_hash": "9403f127328a512f1f0cae2457824952", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 78, "avg_line_length": 29.74590163934426, "alnum_prop": 0.6025075778451364, "repo_name": "parapente/beets", "id": "1b6a5903e095e21420dc5e96bd1f10fcd7706941", "size": "7929...
"""TensorArray: a dynamically sized array of Tensors. @@TensorArray """ # Mixture of pep8 and non-pep8 names, so disable pylint bad-name # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib from tensorflow.python.e...
{ "content_hash": "8f395caae46cf6d64d1d3d109671a0ba", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 80, "avg_line_length": 38.855711422845694, "alnum_prop": 0.6492856774459745, "repo_name": "bowang/tensorflow", "id": "08325ba7710d5f7007f5c55934f15ab5a4015536", "size": "2...
import serial #serial library import sys #used to read argument from shell ser = serial.Serial('/dev/ttyMCC', 115200) # open serial port stringa = sys.argv[1] + ':' + sys.argv[2] + ':' + sys.argv[3] ser.write(stringa.encode()) # write a string if (sys.argv[1] == "i" and (sys.argv[3] == "a" or sys.argv[3] == "d"))...
{ "content_hash": "44f9cac9fc70446e1e9b9ae753f6290b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 43.77777777777778, "alnum_prop": 0.6192893401015228, "repo_name": "ghesio/SGWEB", "id": "28532d01af589406629b18151c63813eb1b103c1", "size": "611", "...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 30, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "6ebad01d50b27302148ea3d94ae55826", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 165, "avg_line_length": 37.857142857142854, "alnum_prop": 0.7056603773584905, "repo_name": "antoinecarme/pyaf", "id": "5c0a567a9fcc65efdc8eeb97280969f0633baa46", "size": "26...
"""Provide the RedditorListingMixin class.""" from ....const import urljoin from ..generator import ListingGenerator from .base import BaseListingMixin from .gilded import GildedListingMixin class RedditorListingMixin(BaseListingMixin, GildedListingMixin): """Adds additional methods pertaining to Redditor instanc...
{ "content_hash": "0da07178682d213017e4ca7a5568bf35", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 38.98540145985402, "alnum_prop": 0.6382699868938401, "repo_name": "nmtake/praw", "id": "0be84041a4ae0eba705f072c8e83b841d40e277c", "size": "5341", ...
import sys, os sys.path.append("../..") # import facerec modules from feature import Fisherfaces, SpatialHistogram, Identity from distance import EuclideanDistance, ChiSquareDistance from classifier import NearestNeighbor from model import PredictableModel from validation import KFoldCrossValidation from visual import ...
{ "content_hash": "6fe2b4c481cc158a591bef9202ed29b4", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 126, "avg_line_length": 39.431372549019606, "alnum_prop": 0.6496767777225261, "repo_name": "revan/facerecserver", "id": "f465148fc5decce4edd9d7d98e82fba711cdb806", "size":...
if __name__ == '__build__': raise Exception import string __version__ = string.split('$Revision: 1.1.1.1 $')[1] __date__ = string.join(string.split('$Date: 2007/02/15 19:25:21 $')[1:3], ' ') __author__ = 'Tarn Weisner Burton <twburton@users.sourceforge.net>' # # Ported to PyOpenGL 2.0 by Tarn Weisner Burton 10May200...
{ "content_hash": "0589aceafa641c26cfcc9ae6403c1fdf", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 119, "avg_line_length": 39.796407185628745, "alnum_prop": 0.6953054468853446, "repo_name": "lhl/vrdev", "id": "2f6c62952ddf8f32f798ba2a89e6e2c9b47c4a23", "size": "6722", ...
import json import logging import os import re class GPServiceAccount(): """Holds authentication details for connecting to the Globalization Pipeline (GP) service instance. The service supports Globalization Pipeline Authentication and Identity and Access Management (IAM) authentication ...
{ "content_hash": "36801fef1c318f0fa0c2e2878582cada", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 137, "avg_line_length": 45.44015444015444, "alnum_prop": 0.5861160676353131, "repo_name": "IBM-Bluemix/gp-python-client", "id": "321a1abda5b824e118e38a3a7e5a513efe6d50c8", ...
import sys from os.path import abspath, dirname, join, normpath BASE = dirname(abspath(__file__)) SRC = normpath(join(BASE, '..', '..', '..', '..', 'src')) # must generate data next to testdoc.html to get relative sources correct INPUT = join(BASE, 'libdoc.txt') OUTPUT = join(BASE, 'libdoc.js') sys.path.insert(0, SRC...
{ "content_hash": "d20bd12bdfcdc2b2db679a5d73c391aa", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 29.7, "alnum_prop": 0.7289562289562289, "repo_name": "fingeronthebutton/RIDE", "id": "7c35d053059d1ac5a9b11219d2d00bd5ee8a67b2", "size": "617", "bi...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hypothesis.strategies as st from caffe2.python import core, workspace from caffe2.proto import caffe2_pb2 from hypothesis import given import caffe2.python.hypoth...
{ "content_hash": "ea4ed2bb21c6a4bc5230d18f647ae867", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 80, "avg_line_length": 29.341836734693878, "alnum_prop": 0.5348635019996523, "repo_name": "davinwang/caffe2", "id": "4673574f4a63c21231d8b6757963fe67f83f7aaa", "size": "64...
from marshmallow import fields, Schema class ExplorePermalinkPostSchema(Schema): formData = fields.Dict( required=True, allow_none=False, description="Chart form data", ) urlParams = fields.List( fields.Tuple( ( fields.String(required=True, allow...
{ "content_hash": "a5f97fd54ecc2000108de8d8512c9be7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 83, "avg_line_length": 29.043478260869566, "alnum_prop": 0.5733532934131736, "repo_name": "airbnb/caravel", "id": "e1f9d069b853f4d7a7c2fecb04cb3a4b0bcdb69b", "size": "1453"...
import base64 try: import cPickle as pickle except ImportError: import pickle from datetime import date, datetime, timedelta from django.core.mail import send_mail from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.conf import settings from django...
{ "content_hash": "bcaaec320b37fed38479b135ec315525", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 79, "avg_line_length": 33.458149779735685, "alnum_prop": 0.6422646477946017, "repo_name": "django-stars/dash2011", "id": "f013d8254862b6c32ac729d86b4df1c5dd6b6604", "size"...
import os import logging import datetime import math import re from six.moves.urllib.request import urlopen from six.moves.urllib.parse import urlencode import aniso8601 from flask import Flask, json, render_template from flask_ask import Ask, request, session, question, statement ENDPOINT = "https://tidesandcurrent...
{ "content_hash": "bc86291ca89807c666130c83eb89a4d3", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 94, "avg_line_length": 32.946308724832214, "alnum_prop": 0.6561417804033408, "repo_name": "johnwheeler/flask-ask", "id": "6c54fdaf701a4bddb0829b7949b9fb184b503b06", "size"...
"""Switch implementation for Wireless Sensor Tags (wirelesstag.net).""" from __future__ import annotations from typing import Any import voluptuous as vol from homeassistant.components.switch import ( PLATFORM_SCHEMA, SwitchEntity, SwitchEntityDescription, ) from homeassistant.const import CONF_MONITORED...
{ "content_hash": "d4b8f937f4703cc9df32dbdcbb97e2bb", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 71, "avg_line_length": 29.009345794392523, "alnum_prop": 0.6630154639175257, "repo_name": "w1ll1am23/home-assistant", "id": "9829cffd2b585063bb27f817e41a59c474653359", "si...
import datetime from collections import OrderedDict from litmos.litmos import LitmosType from litmos.api import API from litmos.course_module import CourseModule class Course(LitmosType): SCHEMA = OrderedDict([ ('Id', ''), ('Name', ''), ('Description', ''), ('Code', ''), (...
{ "content_hash": "9d6f1cae800015063d0fdf2f968e3781", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 96, "avg_line_length": 26.346153846153847, "alnum_prop": 0.5255474452554745, "repo_name": "charliequinn/python-litmos-api", "id": "b0f7369fd72a71cb9e050a3ada5a9b82fd69a176", ...
import rpc import objects from oslo_service import service from oslo_config import cfg from oslo_log import log as logging CONF = cfg.CONF LOG = logging.getLogger(__name__) class Service(service.Service): def __init__(self, manager, rpc_api): super(Service, self).__init__() LOG.info('init servic...
{ "content_hash": "88e244add89bbf2723ca3d32dc9f1473", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 88, "avg_line_length": 25.62264150943396, "alnum_prop": 0.5773195876288659, "repo_name": "fabrickit/fabkit", "id": "456816d8618d58f716fa6dca4b1340c8270d6749", "size": "1375...
import os import re import string import requests import numpy as np import collections import random import pickle import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.framework import ops ops.reset_default_graph() # Start a session sess = tf.Session() # Set RNN Parameters min_word_freq = 5...
{ "content_hash": "f2f9ed91bc4113668904d85fdadf68c5", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 114, "avg_line_length": 39.96715328467153, "alnum_prop": 0.6194868048580038, "repo_name": "benjaminoh1/tensorflowcookbook", "id": "62ef2cd901a1ba11d4edb0e59899c0227ac0fddf",...
""" Schema file for retrieving all the contents of the `editor` models. """ import graphene from django.conf import settings from graphene_django.debug import DjangoDebug from graphene_django.types import DjangoObjectType from gollahalli_cms.editor.models import ContentModel, EducationModel, ProjectsModel, TutorialsMo...
{ "content_hash": "79f9873ca644e8f4ab7bbe9d46a5b78b", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 133, "avg_line_length": 24.2434554973822, "alnum_prop": 0.5704567541302236, "repo_name": "akshaybabloo/gollahalli-com", "id": "4fa4380ef75af9ddbbe26e19d891227b588cae7a", "...
import httplib2 from oslo_serialization import jsonutils as json from oslotest import mockpatch from tempest.services.compute.json import networks_client from tempest.tests import base from tempest.tests import fake_auth_provider class TestNetworksClient(base.TestCase): FAKE_NETWORK = { "bridge": None,...
{ "content_hash": "70eab821831cafcc2d608dd8edb48a33", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 75, "avg_line_length": 31.74468085106383, "alnum_prop": 0.6055630026809652, "repo_name": "pczerkas/tempest", "id": "cbeaefc4104fe067474ee3400f1fe7795931a685", "size": "3615...
import logging from .ga import ga_event from collections import defaultdict, OrderedDict from flask import render_template, request, redirect, abort, flash, jsonify from flask_security import current_user, login_required from sqlalchemy import desc from pmg import app, db from pmg.api.client import load_from_api from...
{ "content_hash": "5e0d0ccc6d590cb141bd5f46ff121d72", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 86, "avg_line_length": 32.0046511627907, "alnum_prop": 0.6593518383955821, "repo_name": "Code4SA/pmg-cms-2", "id": "e2fe7bb3f62ecb7ebbe20f4b62a52b3bc116e9ce", "size": "688...
import pytest import torch import torch.nn.functional as F from torch.utils.data import DataLoader import pytorch_lightning as pl import tests.helpers.pipelines as tpipes import tests.helpers.utils as tutils from pytorch_lightning import Trainer from pytorch_lightning.callbacks import EarlyStopping from pytorch_lightn...
{ "content_hash": "ce902ba978d3070ddb193f45c4ef4047", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 114, "avg_line_length": 31.22826086956522, "alnum_prop": 0.6555864949530108, "repo_name": "williamFalcon/pytorch-lightning", "id": "efaf761cb711611f697d933d38d0e357d8ff3a18"...
try: from http.client import BadStatusLine except ImportError: from httplib import BadStatusLine import pytest from selenium.common.exceptions import ( NoSuchElementException, NoSuchFrameException, TimeoutException, WebDriverException) from selenium.webdriver.common.by import By from selenium....
{ "content_hash": "a8aaeb097533ced3c33bf5f7ce83450c", "timestamp": "", "source": "github", "line_count": 374, "max_line_length": 112, "avg_line_length": 47.3048128342246, "alnum_prop": 0.6647637350214787, "repo_name": "TikhomirovSergey/selenium", "id": "51153c196d79c7dad92c5c35244074262d82f2fa", "si...
"""Markdown renderers""" from django.utils.deconstruct import deconstructible import markdown @deconstructible class BaseRenderer(markdown.Markdown): # TODO test renderer and extensions def __init__(self, *args, **kwargs): """Default markdown renderer It's required that you add one renderer...
{ "content_hash": "8f7230f8532e26a5f11c25d6e7a9b631", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 72, "avg_line_length": 26.666666666666668, "alnum_prop": 0.64375, "repo_name": "AmatanHead/collective-blog", "id": "30f54d97f44f98022a04c210d29e061b297900ce", "size": "800"...
""" This script is used to read KRTD cameras files and a PLY file and produce a homography file. It fits a plane to the landmarks in the PLY and then extracts the sequence of homographies induced by that plane (assuming no radial distortion). """ from optparse import OptionParser import numpy as np import numpy.linal...
{ "content_hash": "847f6b7fd53ce3bce2901ea7d86a0585", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 25.142857142857142, "alnum_prop": 0.6322314049586777, "repo_name": "linus-sherrill/maptk", "id": "f0261293294d294d632d9a77026186c99cafb3c2", "size": ...
"""Django views implementing the XBlock workbench. This code is in the Workbench layer. """ import logging import mimetypes from xblock.core import XBlock, XBlockAside from xblock.django.request import django_to_webob_request, webob_to_django_response from xblock.exceptions import NoSuchUsage from xblock.plugin i...
{ "content_hash": "98cf88463bc54fc447b51eb51602d0ab", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 99, "avg_line_length": 31.322033898305083, "alnum_prop": 0.6731601731601732, "repo_name": "stvstnfrd/xblock-sdk", "id": "57c9907338c3a9e68c1604667f8c5c194d20c4d2", "size":...
from __future__ import unicode_literals from django.db import models, migrations import django_resized.forms class Migration(migrations.Migration): dependencies = [ ('deal', '0019_auto_20141023_0309'), ] operations = [ migrations.AlterField( model_name='deal', na...
{ "content_hash": "003b48c63885589c91a6056f7e352445", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 108, "avg_line_length": 24.31578947368421, "alnum_prop": 0.6298701298701299, "repo_name": "raytung/Slice", "id": "4e3e661cd191d08b99491675353ed40805c6a856", "size": "486", ...
import configparser import os import shutil import click from ..util import (get_config_path, get_db_path, initialize_message, successful_update_message, DB_NAME) from .. import errors def list_config(): config_path = get_config_path() if not os.path.isfile(config_path): initializ...
{ "content_hash": "21ed012a11d9c66faa983d8a0927acc1", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 74, "avg_line_length": 26.775510204081634, "alnum_prop": 0.6310975609756098, "repo_name": "dguo/churn", "id": "3cb92dee2bfbbb9d122d39992d8276d0a98c85e5", "size": "1312", ...
from __future__ import print_function from BinPy import * # <codecell> # Usage of IC 7404: ic = IC_7404() print(ic.__doc__) # <codecell> # The Pin configuration is: inp = {1: 1, 3: 0, 5: 0, 7: 0, 9: 0, 11: 0, 13: 1, 14: 1} # Pin initinalization # Powering up the IC - using -- ic.setIC({14: 1, 7: 0}) ic.setIC(...
{ "content_hash": "c658a8dce749a38a5687a8fabca548f9", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 71, "avg_line_length": 15.18918918918919, "alnum_prop": 0.6574733096085409, "repo_name": "rajathkumarmp/BinPy", "id": "9749b23d1bf0a66daf33cefb0c9e925cc15cc31d", "size": "1...
from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.sumo.tests import TestCase from kitsune.sumo.urlresolvers import reverse from kitsune.wiki.tests import TranslatedRevisionFactory class LocalizationDashTests(TestCase): """Tests for the Localization Dashboard. The L10n Dash shares a l...
{ "content_hash": "6978d3275959b847b3ac1978b419d545", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 97, "avg_line_length": 38.91891891891892, "alnum_prop": 0.6784722222222223, "repo_name": "mythmon/kitsune", "id": "e61774597b81737c07fb1d139a06f9b91f0c7e33", "size": "1440"...
"""Tests NODE_NETWORK_LIMITED. Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED correctly and that it responds to getdata requests for blocks correctly: - send a block within 288 + 2 of the tip - disconnect peers who request blocks older than that.""" from test_framework.messages impor...
{ "content_hash": "6bfb9560ff6b3e118e3eb40c10020678", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 121, "avg_line_length": 41.26548672566372, "alnum_prop": 0.6626635213381943, "repo_name": "merelcoin/merelcoin", "id": "ef9c71dc02d105d8ec71c6c19662d55cee29a9db", "size": ...
from collections import OrderedDict import json import contoml from prettytoml.errors import TOMLError, DuplicateKeysError, DuplicateTablesError, InvalidTOMLFileError def test_loading_toml_without_trailing_newline(): toml_text = '[main]\nname = "azmy"' toml = contoml.loads(toml_text) assert toml['main'][...
{ "content_hash": "9a6b2eb504a0c650f315d1cfc9952993", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 103, "avg_line_length": 21.68421052631579, "alnum_prop": 0.603502080443828, "repo_name": "Jumpscale/python-consistent-toml", "id": "f23d8b348fea8df72476f1e89302edcc20f0a261"...
import pickle, base64 import subprocess, csv import optparse, tempfile, re, traceback from datetime import date from time import localtime, strftime, sleep, time from threading import Thread from Queue import Queue import urllib # for passing strings across gpssh import shutil # for copying import pg ...
{ "content_hash": "165ae321548178702495003c9db4c90d", "timestamp": "", "source": "github", "line_count": 893, "max_line_length": 149, "avg_line_length": 39.370660694288915, "alnum_prop": 0.4981227601114967, "repo_name": "cwelton/incubator-hawq", "id": "73c5637e1a66f0f92876b9b9457ca9e9f3f15fbb", "siz...
"""Tests for the Netgear config flow.""" from unittest.mock import Mock, patch from pynetgear import DEFAULT_USER import pytest from homeassistant import data_entry_flow from homeassistant.components import ssdp from homeassistant.components.netgear.const import ( CONF_CONSIDER_HOME, DOMAIN, MODELS_PORT_5...
{ "content_hash": "91ea72e8f803e31057c2f55dbd0c1439", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 82, "avg_line_length": 33.74772036474164, "alnum_prop": 0.6364045753399982, "repo_name": "rohitranjan1991/home-assistant", "id": "33c634e250a8ffb094fb570a5d4ad50d4efb48b0", ...
from __future__ import absolute_import, division, print_function from collections import OrderedDict from ..defs import (task_name_sep, task_state_to_int, task_int_to_state) from ...util import option_list from ...io import findfile from .base import (BaseTask, task_classes) from desiutil.log import get_logger i...
{ "content_hash": "98f59b5f33e3eeb6db5bdf75c460866c", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 142, "avg_line_length": 33.37435897435898, "alnum_prop": 0.5534726490473264, "repo_name": "desihub/desispec", "id": "ceea560a7ab0e79f8eeb56ac70023f7d806371e5", "size": "65...
""" Created on Thu Aug 6 18:21:36 2015 @author: wirkert """ import numpy as np class Msi(): """ a multi spectral image stack consisting of: image: a rows x columns x nrWavelengths dimensional array properties: additional, application dependent properties """ def __init__(self, image=None...
{ "content_hash": "74af5647ea4d823757130c5cbdb04eda", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 82, "avg_line_length": 36.23622047244095, "alnum_prop": 0.5884398087787919, "repo_name": "fmilano/mitk", "id": "5638d44ad7ce8e8e8bfb04c396cd4c83372fb041", "size": "4626", ...
from __future__ import print_function import unittest import mock import autosklearn.util.smac from autosklearn.util import Backend class SMACTest(unittest.TestCase): @mock.patch.object(Backend, 'write_txt_file') def test_write_instance_file(self, MockedBackend): # Holdout backend = MockedBa...
{ "content_hash": "8cdc72faf8b8425138ccdd2cc8e45850", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 80, "avg_line_length": 40.015151515151516, "alnum_prop": 0.5297235895494131, "repo_name": "hmendozap/auto-sklearn", "id": "258e225866132c67993e70e68d237c11e57f5d14", "size"...
from setuptools import setup setup( name='cisco_pass', packages=['cisco_pass'], version='0.1', description='Generate Cisco password strings. Decrypt type7. Devices: IOS, NXOS, ACE, CatOS', author='Roger Caldwell', author_email='roger@monkey.net', url='https://github.com/rcaldwel/cisco_pas...
{ "content_hash": "9a56caea5e17b99cddeeb83c1ea1d373", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 99, "avg_line_length": 33, "alnum_prop": 0.6666666666666666, "repo_name": "rcaldwel/cisco_pass", "id": "b16fd0b126c9eafcfe3ed602d8b7e78ddb7d28c1", "size": "530", "binary"...
from sqlalchemy import Column from sqlalchemy import MetaData from sqlalchemy import Table from sqlalchemy import Text BASE_TABLE_NAME = 'instance_extra' NEW_COLUMN_NAME = 'vcpu_model' def upgrade(migrate_engine): meta = MetaData() meta.bind = migrate_engine for prefix in ('', 'shadow_'): table...
{ "content_hash": "4ce62379ab70ce4a81a7c371bc180ac6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 68, "avg_line_length": 28.482758620689655, "alnum_prop": 0.6634382566585957, "repo_name": "affo/nova", "id": "223e4593346cfcc9e57ea8e1464e6eff96093560", "size": "1400", "...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pants.base.exceptions import TaskError from pants.base.workunit import WorkUnitLabel from pants.util.dirutil import safe_mkdir from pants.contrib.go.t...
{ "content_hash": "ebb5895baab3c11934c2885b4161dfec", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 114, "avg_line_length": 47.63, "alnum_prop": 0.6632374553852614, "repo_name": "pombredanne/pants", "id": "3072d5fe98f945721ec9f7ac8932bb2cec37ac10", "size": "4910", "bin...
"""The tg2app package"""
{ "content_hash": "81d0ca9d122ca4580b55c02d3af2dc73", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.64, "repo_name": "ralphbean/moksha", "id": "b9eb912a4a7e340735ac85ea573915544e491685", "size": "49", "binary": false, "copies"...
from __future__ import absolute_import from __future__ import print_function import six from . import defs def _populate_options(opts): assert isinstance(opts, dict) opts = dict((k.upper(), v) for k,v in opts.iteritems() if isinstance(k, six.string_types)) newopts = defs.DEFAULT_OPTIONS....
{ "content_hash": "11cdb211d1e01437f4718d06ce6376d0", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 71, "avg_line_length": 26.86842105263158, "alnum_prop": 0.5768854064642507, "repo_name": "colossalbit/cssypy", "id": "f1d136ca4ed939a76b8c6412019162e606623766", "size": "10...
from django import forms from .models import ( Compound, CompoundSummary, CompoundProperty, CompoundTarget ) from django.forms.models import BaseInlineFormSet from mps.forms import BootstrapForm from django.forms.models import inlineformset_factory class CompoundForm(BootstrapForm): """Form for Co...
{ "content_hash": "5fea6eca78a1b4168fcbdfc34be24146", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 99, "avg_line_length": 36.38053097345133, "alnum_prop": 0.614205789345658, "repo_name": "UPDDI/mps-database-server", "id": "c4b4f531b388f5d62d47ba3e68a9bea0b8238da0", "siz...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General configurat...
{ "content_hash": "ce04942b5c48b6ab248c351aa8fdd90e", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 31.882096069868997, "alnum_prop": 0.700041090261608, "repo_name": "dcwatson/drill", "id": "3f2a787e990df34e93a6b5741b004acdfd917bc7", "size": "7717"...
''' Created by auto_sdk on 2015.04.21 ''' from aliyun.api.base import RestApi class Rds20140815CreateReadOnlyDBInstanceRequest(RestApi): def __init__(self,domain='rds.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.ClientToken = None self.DBInstanceClass = None self.DBInstanceDescript...
{ "content_hash": "aa2eae7799b32343f6690e01af13a681", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 63, "avg_line_length": 30.217391304347824, "alnum_prop": 0.7251798561151079, "repo_name": "wanghe4096/website", "id": "6df4f730e49ea6190c2f7d2062096e68f84c768b", "size": "6...
from functools import wraps from pulsar.api import ImproperlyConfigured from pulsar.apps import wsgi from lux.models import Schema from lux.openapi import OperationInfo from lux.utils.data import compact_dict class route(wsgi.route): """Extend pulsar wsgi route decorator for openapi information It adds the...
{ "content_hash": "55bc68cb26cd0b7b44dcc795a8284c25", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 33.464285714285715, "alnum_prop": 0.5789754535752402, "repo_name": "quantmind/lux", "id": "5441b6ebc417861611c981e8f7b6d6c60111ec6a", "size": "1874",...
"""pyversioncheck - Module to help with checking versions""" import types import rfc822 import urllib import sys # Verbose options VERBOSE_SILENT=0 # Single-line reports per package VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated VERBOSE_EACHFILE=2 # Report on each...
{ "content_hash": "113f80ee3dc312a093ce9e89f95404fe", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 84, "avg_line_length": 42.33673469387755, "alnum_prop": 0.6218365871294288, "repo_name": "hwu25/AppPkg", "id": "1a9d10e3ab41e042737eb0f7d979cab13905b82d", "size": "4149", ...
import unittest import uuid from swiftclient import client from swift.common.storage_policy import POLICIES from swift.common.manager import Manager from swift.common.direct_client import direct_delete_account, \ direct_get_object, direct_head_container, ClientException from test.probe.common import kill_servers,...
{ "content_hash": "b8f434470b7b858b87f735668d5bbecc", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 38.81481481481482, "alnum_prop": 0.5623409669211196, "repo_name": "kalrey/swift", "id": "028157029a6354023e8c7f1414d8e90dccb25b1a", "size": "3711", ...
from ...errors.saklientexception import SaklientException from ..client import Client from .resource import Resource from .icon import Icon from .iface import Iface from .serverplan import ServerPlan from .serverinstance import ServerInstance from .isoimage import IsoImage from ..enums.eserverinstancestatus import ESer...
{ "content_hash": "b49203e5699008be79143fce2b502a8b", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 171, "avg_line_length": 32.967806841046276, "alnum_prop": 0.57113213304852, "repo_name": "hnakamur/saklient.python", "id": "ec6230e988f44e2b54bd2eb65b18c39346ab66d6", "siz...
""" tinycss ------- A CSS parser, and nothing else. :copyright: (c) 2012 by Simon Sapin. :license: BSD, see LICENSE for more details. """ import sys from .version import VERSION __version__ = VERSION from .css21 import CSS21Parser from .page3 import CSSPage3Parser PARSER_MODULES = { 'page...
{ "content_hash": "25e71cfb0c2296d0941ab770da04ecd1", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 24.209302325581394, "alnum_prop": 0.6493756003842459, "repo_name": "jbhamilton/Which-CSS", "id": "9eca2b1b4648687759ddde847349b13eb4c9d0da", "size": ...
"""Integration tests for TensorBoard. These tests start up a full-fledged TensorBoard server. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import base64 import gzip import json import numbers import os import shutil import threading import zlib fro...
{ "content_hash": "bed1f521fb31a77b933b074e00c1aeef", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 97, "avg_line_length": 38.68162393162393, "alnum_prop": 0.6244821300336961, "repo_name": "juharris/tensorflow", "id": "0132085f5d0892e71a9e2fc36965cea567e26e93", "size": "...
from django.contrib.auth.models import User from django.db import models from tastypie.utils import now, aware_datetime class Note(models.Model): author = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE) title = models.CharField(max_length=100) slug =...
{ "content_hash": "69667462706d347bf07516d3591e96bf", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 59, "avg_line_length": 30.225806451612904, "alnum_prop": 0.6467449306296692, "repo_name": "Perkville/django-tastypie", "id": "4db7cc6466024b69e1eb9c24add6017ed91c0f1a", "si...
class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def enter(self): pass class Centralcorridor(Scene): def enter(self): pass class LaserWeaponArmory(Scene): def enter(self): pass class TheBridge(Scene)...
{ "content_hash": "18ad5855221fb83b4f575c98a306ef5a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 34, "avg_line_length": 11.813559322033898, "alnum_prop": 0.6743185078909613, "repo_name": "anbet/99-Prolog-Problems", "id": "f0820fbbcd811d31239d08e5e235fca6d65787b9", "siz...
"""Python binding of I2C wrapper of LetMeCreate library.""" import ctypes _LIB = ctypes.CDLL('libletmecreate_core.so') def init(): """Initialise I2C bus on both mikrobus. The current I2C bus is set to MIKROBUS_1. The timeout is disabled for both busses. Note: If an error occurs during the initiali...
{ "content_hash": "f93c14190b0a592947bfebbf8098e97b", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 80, "avg_line_length": 27.291666666666668, "alnum_prop": 0.6564885496183206, "repo_name": "francois-berder/PyLetMeCreate", "id": "bf8e6a1c4bf3c7819932288a98228360f91dbe10", ...
import os from django.conf import settings def configure_settings(): """ Configures settings for manage.py and for run_tests.py. """ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') if not settings.configured: # Determine the database settings depending on if a test_db var is ...
{ "content_hash": "84581ef5896534a8ce022e9e7fe7591b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 96, "avg_line_length": 31.4, "alnum_prop": 0.4956572090330052, "repo_name": "ambitioninc/django-entity", "id": "c8d73ae431aed988910a53d646a4bc6036fd06f9", "size": "1727", ...
from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('osf', '0006_merge'), ] operations = [ migrations.AddField( model_name='abstractnode', ...
{ "content_hash": "8724ffba1be0772d5d81139e88fac098", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 154, "avg_line_length": 33.48717948717949, "alnum_prop": 0.599540581929556, "repo_name": "mluo613/osf.io", "id": "792f2261dbac9480f6fb1feca91d6ea82898a764", "size": "1376",...