text
stringlengths
4
1.02M
meta
dict
import sys from tqdm import tqdm from csv import DictWriter import argparse from datetime import date, datetime from django.core.management.base import BaseCommand from catalog.elastic_models import NACPDeclaration class Command(BaseCommand): help = "Export submission report as CSV" def add_arguments(self, p...
{ "content_hash": "b2bffc721fb5dd6afc15f34e4c36d671", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 88, "avg_line_length": 31.62686567164179, "alnum_prop": 0.465785747994337, "repo_name": "dchaplinsky/declarations.com.ua", "id": "e3d881d65095d603c29b5928418989ff5056c1ae", ...
import unittest from slack_sdk.oauth.installation_store import Installation, FileInstallationStore from slack_sdk.oauth.installation_store.internals import _from_iso_format_to_datetime class TestFile(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_iso_format(...
{ "content_hash": "c9db41d682548fb7d36c48c12fdc534a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 85, "avg_line_length": 27.9375, "alnum_prop": 0.7136465324384788, "repo_name": "slackapi/python-slackclient", "id": "5d0f3d4356e5ec3c473cac9852cc5d0b4d4f0c3f", "size": "447...
""" A container file """ from NetCatKS.NetCAT.api.implementers.twisted.services import * from NetCatKS.NetCAT.api.implementers.twisted.protocols import * from NetCatKS.NetCAT.api.implementers.twisted.factories import * from NetCatKS.NetCAT.api.implementers.twisted.resources import * __author__ = 'dimd'
{ "content_hash": "8c1a0e5275f367feb61d066992656424", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 64, "avg_line_length": 25.666666666666668, "alnum_prop": 0.788961038961039, "repo_name": "dimddev/NetCatKS", "id": "9a852e55ff94d7080f15546804df72ca9cb6cb9e", "size": "308"...
"""Tests for Model subclassing.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import six from tensorflow.python import keras from tensorflow.python.data.ops import dataset_ops from tensorflow.python.eager import context f...
{ "content_hash": "8848f3d2c8052b5691754824a810aecd", "timestamp": "", "source": "github", "line_count": 1118, "max_line_length": 80, "avg_line_length": 35.22450805008945, "alnum_prop": 0.6322338183387928, "repo_name": "AnishShah/tensorflow", "id": "3a1b00041fb01b93258f284b9c871b1da19d7278", "size":...
""" The pyro wire protocol message. Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ import hashlib import hmac import struct import logging import sys import zlib from Pyro4 import errors, constants from Pyro4.configuration import config __all__ = ["Message", "secure_compare"] ...
{ "content_hash": "80b25ce9af4d47a5083e9a084cdd7f68", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 139, "avg_line_length": 44.15139442231076, "alnum_prop": 0.6297599711243458, "repo_name": "irmen/Pyro4", "id": "c33f09345c858cab3121a3fad70c6f9205721901", "size": "11082",...
from django import forms from django.utils.translation import ugettext_lazy as _ # from fobi.contrib.plugins.form_elements.security.honeypot.settings import ( # HONEYPOT_VALUE # ) __title__ = 'fobi.contrib.plugins.form_elements.security.honeypot.fields' __author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'...
{ "content_hash": "50d5518c91d4804027f946ca86333fc2", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 30.275862068965516, "alnum_prop": 0.6526195899772209, "repo_name": "mansonul/events", "id": "339199d51aa7fac55d141db28cd2cfb56c0e71e1", "size": "878"...
""" SLA (Service-level agreement) is set of details for determining compliance with contracted values such as maximum error rate or minimum response time. """ from rally.common.i18n import _ from rally.common import streaming_algorithms from rally import consts from rally.task import sla @sla.configure(name="outlier...
{ "content_hash": "1e68c0e029e62871912f461b08995e3d", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 38.276923076923076, "alnum_prop": 0.6093247588424437, "repo_name": "shdowofdeath/rally", "id": "92e8cb8003ea242f43d91499b535f38ea65c2719", "size": "3...
import os import json import logging import urllib3 import ca_certs_locater from upwork.oauth import OAuth from upwork.http import raise_http_error from upwork.utils import decimal_default from upwork.exceptions import IncorrectJsonResponseError __all__ = ["Client"] logger = logging.getLogger('python-upwork') if...
{ "content_hash": "532e859709f5008e538f49c909ae76be", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 80, "avg_line_length": 34.0328947368421, "alnum_prop": 0.5026097042335202, "repo_name": "kipanshi/python-upwork", "id": "c6f6e30eb3a949a9a7cb2e86dc67ab33d9799d4c", "size":...
"""Django settings for performance_db_frontend project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ ""...
{ "content_hash": "5eac777cb414329f170ebf7c9dc1c7eb", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 71, "avg_line_length": 29.01063829787234, "alnum_prop": 0.6963696369636964, "repo_name": "sidrakesh93/grpc-tools", "id": "dcbc7fae946890462d8e07b7aecee36462202bb0", "size":...
from ..Qt import QtCore, QtGui from ..python2_3 import asUnicode from .Parameter import Parameter, registerParameterType from .ParameterItem import ParameterItem from ..widgets.SpinBox import SpinBox from ..widgets.ColorButton import ColorButton from ..colormap import ColorMap #from ..widgets.GradientWidget import Grad...
{ "content_hash": "42539443b0c747e4854c28ba98ca7fb3", "timestamp": "", "source": "github", "line_count": 682, "max_line_length": 106, "avg_line_length": 37.68768328445748, "alnum_prop": 0.5816052600863713, "repo_name": "pmaunz/pyqtgraph", "id": "d137410d68b9dace80ce338e49398dcd0c60880e", "size": "25...
from base64 import b64encode from optparse import make_option import json import urllib import urllib2 import argparse import time import os import subprocess def make_request(url, params, auth=None, data=None, contentType=None): """ Prepares a request from a url, params, and optionally authentication. """...
{ "content_hash": "061545675eca6f4d4e889f3c75b8a383", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 115, "avg_line_length": 29.54385964912281, "alnum_prop": 0.6036223277909739, "repo_name": "state-hiu/cybergis-scripts", "id": "ce4f435b95d8e2d6db62b5e74546444595d6d2f5", "...
import dbus import dbusmock import bluefang import subprocess import pytest adapter_name = 'hci0' system_name = 'my-device' address = '11:22:33:44:55:66' alias = 'My Device' class ClientDBusTestCase(dbusmock.DBusTestCase): @classmethod def setUpClass(klass): klass.start_system_bus() klass.db...
{ "content_hash": "677a8a8b64d5478ecd86e305ed3dcd7b", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 150, "avg_line_length": 33.04255319148936, "alnum_prop": 0.6160120197467268, "repo_name": "tmcneal/bluefang", "id": "a0aa15f6ecb6623da55c7db41bf8660f74fb4287", "size": "46...
import os import sys import argparse from django.core.management import execute_from_command_line os.environ["DJANGO_SETTINGS_MODULE"] = "wagtailaltgenerator.tests.demosite.settings" def runtests(): args, rest = argparse.ArgumentParser().parse_known_args() argv = [sys.argv[0], "test"] + rest execute_fr...
{ "content_hash": "4963ab9b54be73b54605d08e4e145848", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 84, "avg_line_length": 21.444444444444443, "alnum_prop": 0.7020725388601037, "repo_name": "marteinn/wagtail-alt-generator", "id": "278a80ccd00bbd613ccf59ba3cee2f3d964b2eb4", ...
import mock from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr from nova.cmd import baseproxy from nova import config from nova.console import websocketproxy from nova import test from nova import version @mock.patch.object(config, 'parse_args', new=lambda *args, **kwargs: Non...
{ "content_hash": "f0ffa6076e857d8702613d8ef0b933b5", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 46.84375, "alnum_prop": 0.6604402935290193, "repo_name": "cyx1231st/nova", "id": "8c89f8257ec053e033b3eec112712923e09749d8", "size": "3572", "binar...
"""Sample that implements a text client for the Google Assistant Service.""" import os import logging import json import click import google.auth.transport.grpc import google.auth.transport.requests import google.oauth2.credentials from google.assistant.embedded.v1alpha2 import ( embedded_assistant_pb2, embe...
{ "content_hash": "70e03825cb8b2728b34ca22368c5fb31", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 79, "avg_line_length": 40.144444444444446, "alnum_prop": 0.6046221976197066, "repo_name": "javier-ruiz-b/docker-rasppi-images", "id": "c1ef4a3f76f8bec35d5c94a9b9a70f08b57fad...
""" ============= Frangi filter ============= The Frangi and hybrid Hessian filters can be used to detect continuous edges, such as vessels, wrinkles, and rivers. """ from skimage.data import camera from skimage.filters import frangi, hessian import matplotlib.pyplot as plt image = camera() fig, ax = plt.subplots(...
{ "content_hash": "8b0f934e33f54fc1ae52eac06e9ce5c6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 72, "avg_line_length": 21.870967741935484, "alnum_prop": 0.6946902654867256, "repo_name": "paalge/scikit-image", "id": "8c41ce91e4d5d066de72cfa969c06f5edc40fd92", "size": "...
import csv import datetime import zipfile from collections import defaultdict from datetime import timedelta from io import StringIO from celery import shared_task from dateutil import relativedelta from django.conf import settings from django.contrib.auth.models import User from django.core.files.storage import get_s...
{ "content_hash": "58ef54da310d70e018b416b355d3ac7e", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 78, "avg_line_length": 34.226890756302524, "alnum_prop": 0.6076602013258041, "repo_name": "kobotoolbox/kobocat", "id": "e12275fdd5479b18ae5a0a84ff5035d9556ce5e2", "size": ...
import sys, getopt, argparse from seldon.microservice import Microservices if __name__ == "__main__": import logging logger = logging.getLogger() logging.basicConfig(format='%(asctime)s : %(levelname)s : %(name)s : %(message)s', level=logging.DEBUG) logger.setLevel(logging.INFO) parser = argparse...
{ "content_hash": "1a35908bae35463fd27f94bb6b49946f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 107, "avg_line_length": 38.083333333333336, "alnum_prop": 0.6936542669584245, "repo_name": "SeldonIO/seldon-server", "id": "d8020ce740e40babbce36c4291810192a9869911", "size...
from neutron_lib.api import extensions from neutron_lib import constants as consts from neutron_lib.plugins import constants as plugin_constants from neutron_lib.plugins import directory from oslo_log import log as logging import oslo_messaging LOG = logging.getLogger(__name__) class MeteringRpcCallbacks(object): ...
{ "content_hash": "7c922284897ebb370c2de1d307336db6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 34.044444444444444, "alnum_prop": 0.5966057441253264, "repo_name": "huntxu/neutron", "id": "07a2477ea0d5030c15c601726d313f5cfc11eff7", "size": "2139"...
from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from moocng.categories.models import Category def category(request, categories): cat_list = [] for cat in categories.split('/'): cat_list.append(get_object_or_404(Category, slug=cat)) # ...
{ "content_hash": "3c2e97b8e13e0f54f96f96284e49262e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 66, "avg_line_length": 34.23809523809524, "alnum_prop": 0.6815020862308763, "repo_name": "GeographicaGS/moocng", "id": "5476564d1bad6830e2309a343e864409548f2306", "size": "...
"""Calculate the molecular weight given a molecular formula Parse the formula using parglare. This example is based on the example from PLY compared with pyparsing and ANTLR by Andrew Dalke http://www.dalkescientific.com/writings/diary/archive/2007/11/03/antlr_java.html """ from parglare import Grammar, Parser gramma...
{ "content_hash": "8de720c9dc2b763412e3e43fada4401c", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 25.25, "alnum_prop": 0.6336633663366337, "repo_name": "igordejanovic/parglare", "id": "9805b4667bbeecd1ea84edfca827759c5c8b239b", "size": "1313", "...
"""Control tasks execution order""" import fnmatch from collections import deque from collections import OrderedDict import re import six from .exceptions import InvalidTask, InvalidCommand, InvalidDodoFile from .cmdparse import TaskParse, CmdOption from .task import Task, DelayedLoaded from .loader import generate_ta...
{ "content_hash": "338d0b051e374245c5a2052028221858", "timestamp": "", "source": "github", "line_count": 650, "max_line_length": 81, "avg_line_length": 38.04461538461538, "alnum_prop": 0.5649642120587165, "repo_name": "gh0std4ncer/doit", "id": "eb4d35f2bcfd3d754b634e745613073926ab9bc3", "size": "247...
from __future__ import division from collections import defaultdict import datetime import re import sys import time timestamp_pattern = r'(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})' message_pattern = r'(?P<message>.*)' log_re = re.compile(r'^%s: \w+: %s\s*$' % (timestamp_pattern, message_pattern)) task...
{ "content_hash": "10cd98ad264a03afd4a88877163caa91", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 79, "avg_line_length": 28.420454545454547, "alnum_prop": 0.5737704918032787, "repo_name": "WillChilds-Klein/mistress-mapreduce", "id": "d588ff184c56319f9db9b429036dae23502788...
"""Statistical Language Processing tools. (Chapter 22) We define Unigram and Ngram text models, use them to generate random text, and show the Viterbi algorithm for segmentatioon of letters into words. Then we show a very simple Information Retrieval system, and an example working on a tiny sample of Unix manual pages...
{ "content_hash": "d74f008bb96f3d2ee26e7f59d6af4eb8", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 96, "avg_line_length": 35.804627249357324, "alnum_prop": 0.6097070649052269, "repo_name": "sofmonk/aima-python", "id": "991c764d9ca11ff97d125d6772df21802002d4f2", "size": ...
def describe_duration(battle_data): if 'duration' in battle_data: if battle_data['battle_still_ongoing']: return "{0:03d}+".format(battle_data['duration']) else: return "{0:03d}".format(battle_data['duration']) else: return "???" def describe_defender(battle_dat...
{ "content_hash": "3d454aa87b4a600030c875cace3a17f8", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 111, "avg_line_length": 34.707317073170735, "alnum_prop": 0.5888966971187631, "repo_name": "LeagueOfAutomatedNations/LeagueBot", "id": "b91db3b1086120e5b0deacf9fee194858f1f89...
import inspect import unittest from unittest import mock from unittest.mock import MagicMock, Mock, call import pytest from google.api_core.exceptions import AlreadyExists, NotFound from google.api_core.retry import Retry from airflow import AirflowException from airflow.models import DAG, DagBag from airflow.provide...
{ "content_hash": "2badcd8ca4d9b650bf5d5ab2822deb37", "timestamp": "", "source": "github", "line_count": 1772, "max_line_length": 110, "avg_line_length": 39.49379232505643, "alnum_prop": 0.6222082505751397, "repo_name": "mistercrunch/airflow", "id": "34e63537f0c555202e3fe2b16771bc1f94526998", "size"...
import collections import copy import uuid from keystoneauth1.fixture import V2Token from keystoneauth1 import loading as ks_loading import mock from mox3 import mox from neutronclient.common import exceptions from neutronclient.v2_0 import client from oslo_config import cfg from oslo_config import fixture as config_f...
{ "content_hash": "c61b0de9f1a94a13816cdbe1d6a8f323", "timestamp": "", "source": "github", "line_count": 4200, "max_line_length": 79, "avg_line_length": 46.86571428571428, "alnum_prop": 0.5426649596618505, "repo_name": "HybridF5/nova", "id": "8c835ec68e5dd81b6a196a2fac1eade9c6bdaac1", "size": "19747...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ApiException from...
{ "content_hash": "fd70333159e04730fcafab5c3c4fb810", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 18.525, "alnum_prop": 0.6612685560053981, "repo_name": "kinow-io/kinow-python-sdk", "id": "a1aa456ca3fde67edfce9fa8c76ac2aea3dc6892", "size": "758", ...
import Tkinter from PIL import ImageTk, Image import DrawMain # This class creates window that allows the user to choose a wallpaper pattern class ChooseWallpaper: def __init__(self, meta): self.root = Tkinter.Toplevel() self.meta = meta self.cv = Tkinter.Canvas(self.root, width=521, heigh...
{ "content_hash": "4ad8494d23a71f98a828acb853d339dd", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 94, "avg_line_length": 47.357142857142854, "alnum_prop": 0.6376319758672699, "repo_name": "mntalateyya/Shapes_Studio", "id": "441e550c9cba7b741a1e581ad44dea8829dcb581", "si...
""" .. module: cloudaux.gcp.gce.network :platform: Unix :copyright: (c) 2016 by Google Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Tom Melendez (@supertom) <supertom@google.com> """ from cloudaux.gcp.utils import gce_list, gce_list_aggregated from cloudaux.gc...
{ "content_hash": "0703cb8278dbd59669262f08f147ea67", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 28.045454545454547, "alnum_prop": 0.6256077795786061, "repo_name": "Netflix-Skunkworks/cloudaux", "id": "5efd290ddba0c4b7438f86c46b359c6d3ec3b45a", "...
import os import unittest import csv import numpy from __main__ import vtk, qt, ctk, slicer from slicer.ScriptedLoadableModule import * # # NeedleGuideTemplate # class NeedleGuideTemplate(ScriptedLoadableModule): """Uses ScriptedLoadableModule base class, available at: https://github.com/Slicer/Slicer/blob/master...
{ "content_hash": "23cbf6b175c6b5bd37b532536de1994f", "timestamp": "", "source": "github", "line_count": 616, "max_line_length": 139, "avg_line_length": 37.1948051948052, "alnum_prop": 0.708711592178771, "repo_name": "ProstateBRP/NeedleGuideTemplate", "id": "2d75de040380d046e8b874b3cfb18dac819f3918", ...
from project.utils import auth from flask import Blueprint, request, redirect, Response, abort from project import db, session from project.models import User, Group from datetime import datetime, date import json import jsonpickle import project.constants as constants from werkzeug.exceptions import NotFound bathing ...
{ "content_hash": "f8a3f249cc4417a276ad6112565bb704", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 88, "avg_line_length": 33.41836734693877, "alnum_prop": 0.6109923664122138, "repo_name": "lingxz/dinnercore", "id": "605b48e213dec1ac62c7cbc79956cfc49663e6cc", "size": "327...
import os import binascii import time import random from threading import Event from traceback import print_exc from ACEStream.Core.simpledefs import * from ACEStream.Core.DirectDownload.Storage import Storage from ACEStream.Core.DirectDownload.Downloader import Downloader from ACEStream.Core.DirectDownload.VODTranspor...
{ "content_hash": "6f08691e0a371e06b73d228144021d8f", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 173, "avg_line_length": 42.026162790697676, "alnum_prop": 0.5737704918032787, "repo_name": "alesnav/p2ptv-pi", "id": "bd29020f818aed69a7d1ff942b161e5a1f5cf005", "size": "1...
from __future__ import absolute_import from envisage.ui.workbench.workbench_action_set import *
{ "content_hash": "6c9239384634cb8ab053e733d6d5f9ba", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 56, "avg_line_length": 48, "alnum_prop": 0.8020833333333334, "repo_name": "enthought/etsproxy", "id": "8c938f334afc0d20e46019f04f6ab4ca87d5cae2", "size": "111", "binary": ...
from django.contrib.auth.hashers import check_password from django.contrib.auth.models import User from testbase.unit import UnitTestCase class TestCreateAdminUser(UnitTestCase): def setUp(self): super().setUp() name = self.randStr() self.createSuperUser(userName=name) self.user = ...
{ "content_hash": "9c7c2a42f66aa909e62265a3e5a73adc", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 54, "avg_line_length": 28.833333333333332, "alnum_prop": 0.7129094412331407, "repo_name": "tctimmeh/django-testing-base", "id": "f29cde1b41f27249e06ffa64cc33c2e55d7db7e5", ...
"""The tests for the counter component.""" # pylint: disable=protected-access import asyncio import logging from homeassistant.components.counter import ( CONF_ICON, CONF_INITIAL, CONF_NAME, CONF_RESTORE, CONF_STEP, DOMAIN, ) from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_ICON from ho...
{ "content_hash": "76ab9d06256ac78c00b3c36cb37fde15", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 87, "avg_line_length": 26.770089285714285, "alnum_prop": 0.6059367964646043, "repo_name": "leppa/home-assistant", "id": "35512129aedccf6c047f0d480322270b6e8f12ef", "size":...
from __future__ import absolute_import #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012, Dongsheng Cai # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must reta...
{ "content_hash": "6e740aa62b5c6d4f2c377eeee261c49d", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 95, "avg_line_length": 37.279310344827586, "alnum_prop": 0.6081768569050041, "repo_name": "jaydg/python-wns", "id": "d4a21a9426bb4140a6b8dc52c221ddf860e7691a", "size": "10...
"""The tests for the group cover platform.""" from datetime import timedelta import pytest from homeassistant.components.cover import ( ATTR_CURRENT_POSITION, ATTR_CURRENT_TILT_POSITION, ATTR_POSITION, ATTR_TILT_POSITION, DOMAIN, ) from homeassistant.components.group.cover import DEFAULT_NAME from...
{ "content_hash": "4b37d95cc9333ece9d80b4d9da93f115", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 88, "avg_line_length": 35.77946768060836, "alnum_prop": 0.6815090329436769, "repo_name": "soldag/home-assistant", "id": "2ffe02570c9fa1f7a96ed7cd0ac545f40c5ad2ba", "size":...
__version__ = '2.3.0' from sys import version_info def detect(aBuf): if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or (version_info >= (3, 0) and not isinstance(aBuf, bytes))): raise ValueError('Expected a bytes object, not a unicode object') from . import universaldetector ...
{ "content_hash": "95322e695c162efaea5d240694a9f466", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 73, "avg_line_length": 28.6, "alnum_prop": 0.6386946386946387, "repo_name": "Ritsyy/fjord", "id": "f1f4235a8784ab8ed58b6d2e8c3fcfc2a7117676", "size": "1295", "binary": fa...
from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import open from future.utils import text_type from pants.backend.graph_info.subsystems.cloc_binary import ClocBinary from pants.base.workunit import WorkUnitLabel from pants.engine.fs import FilesContent, Path...
{ "content_hash": "4c11edf0378f7b65a3832bcf21631515", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 112, "avg_line_length": 35.98924731182796, "alnum_prop": 0.6847923513594264, "repo_name": "twitter/pants", "id": "e1903d9dfd5ae7327ea8a2b1dc8dda4e53a2c36d", "size": "3494",...
"""Common test objects.""" import copy import json from hatasmota.const import ( CONF_MAC, CONF_OFFLINE, CONF_ONLINE, CONF_PREFIX, PREFIX_CMND, PREFIX_TELE, ) from hatasmota.utils import ( config_get_state_offline, config_get_state_online, get_topic_tele_state, get_topic_tele_wi...
{ "content_hash": "12778654518d007eb28b3dff7a09e2b6", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 89, "avg_line_length": 32.66891891891892, "alnum_prop": 0.637693898655636, "repo_name": "tboyce021/home-assistant", "id": "04346f915c44acc9d8f837131f94c341ba032357", "size...
import logging logger = logging.getLogger(__name__) from bottle import request request_logger = logging.getLogger('request.params') def logplugin(callback): def wrapper(*args, **kwargs): request_logger.info(request.params) request.remote_addr = request.environ.get("X_FORWARDED_FOR", request.remo...
{ "content_hash": "400abee50c35e185fcb8626dd06b88d6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 89, "avg_line_length": 24.72222222222222, "alnum_prop": 0.6831460674157304, "repo_name": "mengzhuo/zaquming_web", "id": "901c4cd1cc0141f25b31f3cfca6f300c629997e9", "size": ...
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
{ "content_hash": "27fb65f0c88eac6e7951cfdbaed5f1f3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 208, "avg_line_length": 37.411764705882355, "alnum_prop": 0.7421383647798742, "repo_name": "Kiesum/tfrs-1", "id": "4a9782379bd70c60d6cb5af4ec4006cb485e1669", "size": "1272"...
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic) context = AppContext(title = "jade") grammar = Grammar("jade", context=context) noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on") rules = MappingRule( name = "jade", mapping = { "heading [<n>]": T...
{ "content_hash": "ae3e67d5a8c442ad248cef89a62c85c7", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 94, "avg_line_length": 29.926829268292682, "alnum_prop": 0.5753871230643847, "repo_name": "simianhacker/code-by-voice", "id": "56d2d5a48a77192256135edecc3e18dc6b39d401", "s...
import argparse import os import json from chrome_telemetry_build import android_browser_types from core import path_util from core import bot_platforms _VALID_SWARMING_DIMENSIONS = { 'gpu', 'device_ids', 'os', 'pool', 'perf_tests', 'perf_tests_with_args', 'cpu', 'device_os', 'device_status', 'device_type', '...
{ "content_hash": "81680606314f0d4375eb5c2ef856d5b4", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 80, "avg_line_length": 40.08108108108108, "alnum_prop": 0.6574511126095752, "repo_name": "scheib/chromium", "id": "780019cb0354c0c0a48b990123a06c1a369b1723", "size": "9061...
"""Provides target dimension object.""" from __future__ import absolute_import from warnings import warn from ..errors import ClientError from ..entity import Entity, SubEntity from .targetvalue import TargetValue class TargetDimension(SubEntity): """TargetDimension object. Used for most current targeting settin...
{ "content_hash": "716d3dd42d979c68b6bcec1939d28dc9", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 89, "avg_line_length": 41.214285714285715, "alnum_prop": 0.5457105719237435, "repo_name": "MediaMath/t1-python", "id": "6da7cccacf9064b9c987d76af9c7b40d7f31d4a3", "size": ...
import os import tempfile from django import forms from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.http import HttpResponse from django.template import Template, Context from django.contrib.auth.models import User from django.contrib.formtools.wiz...
{ "content_hash": "3bca2c2765ed56298364958c91c5e9a8", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 84, "avg_line_length": 33.411764705882355, "alnum_prop": 0.732981220657277, "repo_name": "ericholscher/django", "id": "c89f51e179cb041ebe084683fbfaee85c657bb00", "size": "1...
import os import numpy as np from singa import device from singa import tensor from singa import sonnx from singa import autograd import onnx import sys sys.path.append(os.path.dirname(__file__) + '/..') from utils import download_model, check_exist_or_download import logging logging.basicConfig(level=logging.INFO, ...
{ "content_hash": "94c64874a6c742da862a9d932cc067ab", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 154, "avg_line_length": 29.894736842105264, "alnum_prop": 0.6584507042253521, "repo_name": "apache/incubator-singa", "id": "b6b02ed9ee394f846ebf83d5f8f439078afe7150", "size...
import json import struct import re import base64 import httplib import sys ERR_SLEEP = 15 MAX_NONCE = 1000000L settings = {} class AnoncoinRPC: OBJID = 1 def __init__(self, host, port, username, password): authpair = "%s:%s" % (username, password) self.authhdr = "Basic %s" % (base64.b64encode(authpair)) se...
{ "content_hash": "04a4015f7f492687460789bc3a1e3bd6", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 72, "avg_line_length": 25.508333333333333, "alnum_prop": 0.6524011760862464, "repo_name": "GroundRod/anoncoin", "id": "71efd49fbe7e142d2eb9b483f484979335d64abf", "size": "...
"""Test the config manager.""" import asyncio from datetime import timedelta import logging from unittest.mock import AsyncMock, Mock, patch import pytest from homeassistant import config_entries, data_entry_flow, loader from homeassistant.components.hassio import HassioServiceInfo from homeassistant.const import EVE...
{ "content_hash": "47a03dfe6ccb72a576c6d99aac038ae6", "timestamp": "", "source": "github", "line_count": 3014, "max_line_length": 108, "avg_line_length": 35.6413404114134, "alnum_prop": 0.6476173631345242, "repo_name": "rohitranjan1991/home-assistant", "id": "b62e9bffbce40512622f9a468368d998c27d0099",...
from enum import Enum import yaml import os import datetime import glob import time import threading from abc import ABC, abstractmethod import json import requests import traceback from nameko.rpc import rpc from nameko.timer import timer from nameko.events import EventDispatcher, event_handler from nameko.dependency...
{ "content_hash": "c8de8127eb693ef7e22a4f8677507af7", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 95, "avg_line_length": 23.67543859649123, "alnum_prop": 0.5542793627269359, "repo_name": "mcclown/AutoReef", "id": "ebb348374c8a85096a1de708c1f456543aa58ae6", "size": "809...
import inspect import sys import os import tempfile from io import StringIO from unittest import mock import numpy as np from numpy.testing import ( assert_, assert_equal, assert_raises, assert_raises_regex) from numpy.core.overrides import ( _get_implementing_args, array_function_dispatch, verify_matching...
{ "content_hash": "3331d5dd7ca5f0f6318fce9de1d8345b", "timestamp": "", "source": "github", "line_count": 585, "max_line_length": 79, "avg_line_length": 34.51794871794872, "alnum_prop": 0.5820829000148566, "repo_name": "jakirkham/numpy", "id": "36970dbc02ed413353f63bf65a4d089cff81ffed", "size": "2019...
from setuptools import setup description = """ Full featured redis cluster cache backend for Django """ setup( name = "django-redis-cluster", url = "https://github.com/glumu/django-redis-cluster", author = "Glen", author_email = "glumu@126.com", version = "1.0.0", packages = [ "django_...
{ "content_hash": "25652bf17103c81292382a0191fe7feb", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 58, "avg_line_length": 30.152173913043477, "alnum_prop": 0.5652487382840663, "repo_name": "glumu/django-redis-cluster", "id": "c9d55495bdd0021d5fe867d73fc81492723668ca", "s...
"""linebot.models.things module.""" from abc import ABCMeta from future.utils import with_metaclass from .base import Base class Things(with_metaclass(ABCMeta, Base)): """Abstract Base Class of Things.""" def __init__(self, device_id=None, **kwargs): """__init__ method. :param str device...
{ "content_hash": "70623a430e877dffcf961a0eb2e597df", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 87, "avg_line_length": 30.644444444444446, "alnum_prop": 0.6241237611795988, "repo_name": "line/line-bot-sdk-python", "id": "cd23ad4aac62a386d93e35ffd09f6dd9e2d333fb", "si...
""" test_aioh2 ---------------------------------- Tests for `aioh2` module. """ import random import unittest import uuid import asyncio from h2.events import DataReceived from h2.events import PingAcknowledged from h2.events import RemoteSettingsChanged from h2.events import ResponseReceived from h2.events import Se...
{ "content_hash": "12adff4f167d35176f367a23e3e3c233", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 78, "avg_line_length": 35.210682492581604, "alnum_prop": 0.6176470588235294, "repo_name": "decentfox/aioh2", "id": "7c32349a6a91ea196018a8b2da7a686e2b75eb79", "size": "118...
from __future__ import absolute_import, print_function, division import utool as ut import ubelt as ub import six def extract_feature_from_patch(patch): import pyhesaff import numpy as np import vtool_ibeis as vt patch = vt.rectify_to_uint8(patch) patch = vt.rectify_to_square(patch) patch_list...
{ "content_hash": "9a5986f6965028a79ef97bbc46244989", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 122, "avg_line_length": 35.63297872340426, "alnum_prop": 0.5950141812210777, "repo_name": "Erotemic/vtool", "id": "e521bcd7cf117e1990895fa06696d95ed3380a33", "size": "1342...
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="layout.selection", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "960b90b12feeacdfcc606b4ad0e799cc", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 85, "avg_line_length": 35.44, "alnum_prop": 0.5079006772009029, "repo_name": "plotly/plotly.py", "id": "7017d95469e079031b0bb1fdb9f51bef8fe9b98a", "size": "886", "binary"...
from .base import Pool from .. import event from ..engine.base import Engine class PoolEvents(event.Events): """Available events for :class:`_pool.Pool`. The methods here define the name of an event as well as the names of members that are passed to listener functions. e.g.:: from sqlal...
{ "content_hash": "ad91f13cacaf8891f4812740511516d8", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 79, "avg_line_length": 36.15867158671587, "alnum_prop": 0.6601694050413307, "repo_name": "monetate/sqlalchemy", "id": "7c2cae7c5eb0fe1f275cb83433ada71e45ec0bff", "size": "...
import qrcode from pyqrcode import QRCode import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.error, urllib.parse import http.cookiejar import requests import xml.dom.minidom import json import time import ssl import re import sys import os import subprocess import random import multiprocess...
{ "content_hash": "d001729dc73f79c0456c0ca6afd98d7e", "timestamp": "", "source": "github", "line_count": 1253, "max_line_length": 291, "avg_line_length": 36.95450917797287, "alnum_prop": 0.4869341741534209, "repo_name": "Hoverhuang-er/CBotTester", "id": "a85eab98a6ced9a83747e928280491f70e99969d", "s...
import unittest from jamenson.runtime.picklep import picklep #global functions from dis import dis from pprint import pprint from tokenize import tokenize class TestPicklep(unittest.TestCase): def check_pickleable(self, op): self.failUnless(picklep(op), '%s is not pickleable' % (op,)) def check_no...
{ "content_hash": "0a835f28a19a682e2c8a9ea4b36c580c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 68, "avg_line_length": 22.37837837837838, "alnum_prop": 0.5452898550724637, "repo_name": "matthagy/Jamenson", "id": "b1133cd0e1832713047b5cea924d7add26079ad5", "size": "165...
"""Test configurations for nose This module contains nose plugin hooks that configures Beam tests which includes ValidatesRunner test and E2E integration test. TODO(BEAM-3713): Remove this module once nose is removed. """ from nose.plugins import Plugin class BeamTestPlugin(Plugin): """A nose plugin for Beam tes...
{ "content_hash": "232810ab8add4f0549c519926644b886", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 35.9375, "alnum_prop": 0.662608695652174, "repo_name": "axbaretto/beam", "id": "d916a7cd9b7764f0da0627687acd2f4b98fdbf50", "size": "1935", "binary"...
""" flaskext.uploads ================ This module provides upload support for Flask. The basic pattern is to set up an `UploadSet` object and upload your files to it. :copyright: 2010 Matthew "LeafStorm" Frazier :license: MIT/X11, see LICENSE for details """ import sys PY3 = sys.version_info[0] == 3 if PY3: s...
{ "content_hash": "483d6591bc7a5bf0ca775d382fc9bc4d", "timestamp": "", "source": "github", "line_count": 502, "max_line_length": 79, "avg_line_length": 37.24900398406375, "alnum_prop": 0.634311995293866, "repo_name": "171121130/SWI", "id": "a10b72ce3f6ba7cef0b48d49b0d07836e701f299", "size": "18723",...
from PySide import QtCore, QtGui class Ui_Settings(object): def setupUi(self, Settings): Settings.setObjectName("Settings") Settings.resize(382, 286) self.verticalLayout = QtGui.QVBoxLayout(Settings) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtGui....
{ "content_hash": "dd819ba1f7fe48ee4a6aec8940fd74fb", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 165, "avg_line_length": 57.45454545454545, "alnum_prop": 0.7072784810126582, "repo_name": "gil9red/fake-painter", "id": "8fc1479dd6c2fbe3278b7be8cbd9b46a36bccdab", "size": ...
import webob from jacket.api.compute import openstack as openstack_api from jacket.compute import test from jacket.tests.compute.unit.api.openstack import fakes class MapperTest(test.NoDBTestCase): def test_resource_project_prefix(self): class Controller(object): def index(self, req): ...
{ "content_hash": "1e7c62acaa9d45774e022b6fc936bd90", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 61, "avg_line_length": 33.87096774193548, "alnum_prop": 0.6085714285714285, "repo_name": "HybridF5/jacket", "id": "3f82a6b69637f67997e6dc5b7e38b97bcaded0ac", "size": "1686"...
from __future__ import absolute_import, division, print_function import contextlib import warnings import numpy as np import pandas as pd import pytest from xarray import (Dataset, Variable, SerializationWarning, coding, conventions, open_dataset) from xarray.backends.common import WritableCFData...
{ "content_hash": "915ac0d190acf7664fb12a52a1c98067", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 79, "avg_line_length": 41.42181818181818, "alnum_prop": 0.556491967342639, "repo_name": "jcmgray/xarray", "id": "62ff8d7ee1a1753d855b0d29d00b60636653e9af", "size": "11415"...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from textwrap import dedent from typing import TYPE_CHECKING, Optional, Sequence import simplesqlite from simplesqlite import SimpleSQLite from tabledata import TableData from typepy import String from .._common import ResultLogger try: im...
{ "content_hash": "5eba6c419fe513c1c3f7daa52fc7324d", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 94, "avg_line_length": 32.325, "alnum_prop": 0.5743748388759989, "repo_name": "thombashi/sqlitebiter", "id": "35b89da528b820e471051e27a4fd5e4cc1a529f9", "size": "3879", ...
import tornado.web from traffic_cloud_utils.pm import default_config_dict from baseHandler import BaseHandler class DefaultConfigHandler(BaseHandler): """ @api {get} /defaultConfig/ Default Configuration @apiName Default Configuration @apiVersion 0.1.0 @apiGroup Configuration @apiDescription C...
{ "content_hash": "dfb97726474b5effebcb0576542e504b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 313, "avg_line_length": 61.142857142857146, "alnum_prop": 0.7745327102803738, "repo_name": "santosfamilyfoundation/SantosCloud", "id": "6e4ff4cc6723b584b6b01fb716557fc0c217cf...
import sys from typing import Any, List, Sequence, Tuple, Union, TYPE_CHECKING from numpy import dtype from ._shape import _ShapeLike if sys.version_info >= (3, 8): from typing import Protocol, TypedDict HAVE_PROTOCOL = True else: try: from typing_extensions import Protocol, TypedDict except I...
{ "content_hash": "d60ea633e1670a3e69b7e1b446b9fb97", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 110, "avg_line_length": 30.567901234567902, "alnum_prop": 0.6680129240710824, "repo_name": "grlee77/numpy", "id": "1953bd5fcfcc668243f655631b5b00810f8740e0", "size": "2476"...
import copy import functools import uuid import six from glance.common import exception import glance.openstack.common.log as logging from glance.openstack.common import timeutils LOG = logging.getLogger(__name__) DATA = { 'images': {}, 'members': {}, 'metadef_namespace_resource_types': [], 'metade...
{ "content_hash": "f060173492ba227dd104aaa390e3f33f", "timestamp": "", "source": "github", "line_count": 1747, "max_line_length": 79, "avg_line_length": 31.942186605609617, "alnum_prop": 0.5829077289751448, "repo_name": "redhat-openstack/glance", "id": "daa12485670bcd7ef05d7ebc464d206ce3224ca1", "si...
import re import json import requests from functools import update_wrapper from django import forms from django.conf import settings from django.views.generic import View from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from djan...
{ "content_hash": "316ea7c3b17b1d5b2d47c51d8ccdbc7b", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 79, "avg_line_length": 35.99472759226713, "alnum_prop": 0.4937258922904155, "repo_name": "getsentry/sentry-hipchat-ac", "id": "f37189c2542fdb614c0e87fcb05e9a27a9ec7146", "...
""" The setup and build script for the pyrant library. """ import os from setuptools import setup, find_packages from _version import version readme = open(os.path.join(os.path.dirname(__file__), 'README')).read() setup( name = "pyrant", version = version, url = 'http://code.google.com/p/pyrant/', l...
{ "content_hash": "f4c41156c3d4a1d750845b8a1cbd3b65", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 30.56756756756757, "alnum_prop": 0.6463306808134395, "repo_name": "neithere/pyrant", "id": "27c00cf4f28c79bca4f9a7d40039b7a691e18702", "size": "1772"...
"""A wrapper around requests that records all requests made with it. Supports get, put, post, delete and request all calls return an instance of HarvesterResponse """ from __future__ import absolute_import import json import time import logging import functools from datetime import datetime import six import ...
{ "content_hash": "ffea7d1c1ba6f621a96caf285d68f504", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 109, "avg_line_length": 29.923076923076923, "alnum_prop": 0.6847394250993223, "repo_name": "ostwald/scrapi", "id": "e6b7d91c1d5f6fd6ca427d86385d2e37063b2a18", "size": "427...
from collections import OrderedDict from typing import Dict, Type from .base import KeywordPlanIdeaServiceTransport from .grpc import KeywordPlanIdeaServiceGrpcTransport # Compile a registry of transports. _transport_registry = ( OrderedDict() ) # type: Dict[str, Type[KeywordPlanIdeaServiceTransport]] _transport...
{ "content_hash": "51eb42e79a2641c653df7bf78698a3a9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 29.5625, "alnum_prop": 0.7970401691331924, "repo_name": "googleads/google-ads-python", "id": "7bd34e5abf62a49e481ba7bfce111261393c3cac", "size": "107...
from __future__ import division import ConfigParser import time import numpy as np import geovidcorpus import lda.lda as lda import util exp_id = time.time() eta_list = [0.1] alpha_list = [0.001] num_topics_list = [20] niter = 30 burn = 20 lag = 0 cv_folds = 5 def main(): config = ConfigParser.RawConfigParser...
{ "content_hash": "848d8c5e8b40770a371f7312b99e09e2", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 151, "avg_line_length": 45.6, "alnum_prop": 0.5350877192982456, "repo_name": "c4fcm/WhatWeWatch-Analysis", "id": "37cd7ce349d04e2f2765c3bbe41bad7d19371f3e", "size": "3192",...
from .resource import Resource class NetworkSecurityGroup(Resource): """NetworkSecurityGroup resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource Identifier. :type id: str :ivar name: Resource name. :vartype name: str :...
{ "content_hash": "ae00569f56f2593c74bbf96ede6a99cf", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 203, "avg_line_length": 43.35616438356164, "alnum_prop": 0.6527646129541864, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "7213d08bb536b47fcb746ad03fc783642ae573a7",...
from openprocurement.tender.core.utils import optendersresource from openprocurement.tender.openeu.views.award_document import TenderAwardDocumentResource as TenderEUAwardDocumentResource @optendersresource(name='esco.EU:Tender Award Documents', collection_path='/tenders/{tender_id}/awards/{award_i...
{ "content_hash": "e80fc18fec67c8a67c53d8a94812873f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 123, "avg_line_length": 60.45454545454545, "alnum_prop": 0.7263157894736842, "repo_name": "Scandie/openprocurement.tender.esco", "id": "2e37ae001bda3e6284f2f73bc1f1b468fd44e7...
from __future__ import absolute_import import os from chaco.plot_label import PlotLabel from enable.component_editor import ComponentEditor as EnableComponentEditor from traits.api import Property, Event, cached_property, Any from traitsui.api import View, UItem from pychron.core.helpers.iterfuncs import groupby_gro...
{ "content_hash": "d449e107c9c040a05f3bbdf386064d55", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 81, "avg_line_length": 29.8, "alnum_prop": 0.5813113061435209, "repo_name": "UManPychron/pychron", "id": "a380c43cfc877abf07a2ed58f00773bdc772da11", "size": "4674", "bin...
import findLibs from imagedb import imagedb from imagedb import jobColumns, flickrColumns from paths import imageBase from flickrInterface import flickrObject from facebookInterface import facebookObject from tumblrInterface import tumblrObject from twitterInterface import twitterObject import web from web import form...
{ "content_hash": "28fcff47281da7c1d67222934ebb8e70", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 112, "avg_line_length": 30.373056994818654, "alnum_prop": 0.6784373933810987, "repo_name": "bhautikj/imageCatapult", "id": "314c683407a1b21c0041cd4707d650b2cec5cf09", "siz...
from django import forms from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Reset, Layout, Div from .models import User class UserForm(forms.ModelForm): class Meta: # Set this form ...
{ "content_hash": "e47e90afcd4a292ef9e00553b3a85424", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 87, "avg_line_length": 33.15151515151515, "alnum_prop": 0.6078610603290676, "repo_name": "diegoduncan21/subastas", "id": "aab49be05d9df685b4c5c6b7b816fd1fad95143b", "size":...
import psutil import qtutil from .temporal_filter import * from .util import custom_qt_items as cqt from .util.plugin import PluginDefault from .util.plugin import WidgetDefault from .util.custom_qt_items import MyProgressDialog class Widget(QWidget, WidgetDefault): class Labels(WidgetDefault.Labels): pa...
{ "content_hash": "4ff0ef3f77f42fa8e9019e8154fa9897", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 120, "avg_line_length": 40.97520661157025, "alnum_prop": 0.6202097620008068, "repo_name": "Frikster/Mesoscale-Brain-Explorer", "id": "26c9f8e2ccd994c5d26dd58a8e1f89a15ff630d...
"""users/forms.py: User forms.""" from flask_wtf import FlaskForm from wtforms import Form, BooleanField, StringField from wtforms.validators import DataRequired, Length class UserForm(FlaskForm): matricula = StringField(u'Matrícula', validators=[Length(min=3, max=10), DataRequired()]) #email = StringField('C...
{ "content_hash": "b98a477b865fd00a8348bed774278b5b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 93, "avg_line_length": 43.1, "alnum_prop": 0.7470997679814385, "repo_name": "marcanuy/notificamesta", "id": "83f22c4ac428bdfa19a9db3115355692b5bae2b5", "size": "478", "bi...
import numpy as np from numba import cuda from numba.cuda.kernels.transpose import transpose from numba.cuda.testing import unittest from numba.tests.ddt import ddt, data, unpack from numba.cuda.testing import skip_on_cudasim @skip_on_cudasim('Device Array API unsupported in the simulator') @ddt class Test(unittest.Te...
{ "content_hash": "e67fc07c460523db1d83b524790c08d9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 67, "avg_line_length": 31.392857142857142, "alnum_prop": 0.6473265073947668, "repo_name": "pombredanne/numba", "id": "66fd8e38dde2ea535b69c051ceba198f2c5bb341", "size": "87...
import logging from ufs_tools.python_app_utils.base import AppBase from iconizer.utils import start_script_app_iconized AppBase().add_default_module_path() __author__ = 'weijia' log = logging.getLogger(__name__) if __name__ == '__main__': # logging.basicConfig(level=logging.DEBUG) start_script_app_iconiz...
{ "content_hash": "bcabcefdd97a0b1df684502de02acaec", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 21.9375, "alnum_prop": 0.717948717948718, "repo_name": "weijia/iconizer", "id": "de2e514d5319743b5bce5be76a2043b246ba79e2", "size": "351", "binary"...
"""Support for AVM FRITZ!SmartHome thermostate devices.""" from __future__ import annotations from typing import Any from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( ATTR_HVAC_MODE, HVAC_MODE_HEAT, HVAC_MODE_OFF, PRESET_COMFORT, PRESET...
{ "content_hash": "86434c34b0c14addbf817c6aa97416a4", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 85, "avg_line_length": 33.119617224880386, "alnum_prop": 0.6421554464027738, "repo_name": "sander76/home-assistant", "id": "4baa1b3b81afc669371f1e041a31942d87be72b4", "siz...
try: from unittest import mock except ImportError: # pragma: NO PY3 COVER import mock import pytest from google.cloud.ndb import context as context_module from google.cloud.ndb import _eventloop from google.cloud.ndb import exceptions from google.cloud.ndb import _remote from google.cloud.ndb import tasklets...
{ "content_hash": "6d9501c3f185c57f92e3dc34fd91d60e", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 81, "avg_line_length": 31.040431266846362, "alnum_prop": 0.6222646752344564, "repo_name": "googleapis/python-ndb", "id": "ce00f7f1c842b2794ac7be19d93608abae8a4ca7", "size"...
from datetime import datetime, timedelta from images.images import FAVICON, PIXEL import uuid from flask import Flask, make_response, request, redirect app = Flask(__name__) app.permanent_session_lifetime = timedelta(days=365) def add_headers(response): """ Adds custom user agent and query string headers, a...
{ "content_hash": "2ea14d53f96342131ce3b364f5c389af", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 77, "avg_line_length": 29.48, "alnum_prop": 0.633921302578019, "repo_name": "DirectEmployers/MyJobs-pixel", "id": "d7cabee2b35e675cc0f5143846da5b41e7ebb463", "size": "3685...
import fnmatch import importlib import inspect import json import os import pdb import re import sys import unittest import traceback from datetime import datetime from collections import OrderedDict # This ensures that absolute imports of typ modules will work when # running typ/runner.py as a script even if typ is ...
{ "content_hash": "0e9c0732cc1563bd455ff8d63516d268", "timestamp": "", "source": "github", "line_count": 1371, "max_line_length": 88, "avg_line_length": 39.31582786287382, "alnum_prop": 0.5660828911728693, "repo_name": "catapult-project/catapult", "id": "dd5a07e969a870047910161c75f5f48c2ac7151c", "s...
import json from decimal import Decimal from functools import partial from unittest.mock import ANY from freezegun import freeze_time from prices import Money, fixed_discount from .....core.prices import quantize_price from .....discount import DiscountValueType, VoucherType from .....graphql.core.utils import to_glo...
{ "content_hash": "f1c9c8c0a012117f905d876743ce883e", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 88, "avg_line_length": 31.506796116504855, "alnum_prop": 0.5433255269320844, "repo_name": "mociepka/saleor", "id": "be4d63839c01f2992d19ae700e6afc76963b95e9", "size": "162...
"""This script shows an example of using the PyWavefront module.""" import sys sys.path.append('..') import ctypes import pyglet from pyglet.gl import * import pywavefront rotation = 0 meshes = pywavefront.Wavefront('uv_sphere.obj') window = pyglet.window.Window() lightfv = ctypes.c_float * 4 @window.event def o...
{ "content_hash": "585a108d8106f397d94faaa2841095db", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 67, "avg_line_length": 19.36, "alnum_prop": 0.6735537190082644, "repo_name": "kitchenknif/PyWavefront", "id": "0a2ca8938340ea2e32f0be4923a841b96de61868", "size": "990", "...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import cPickle as pickle from uuid import UUID class HMoveOneTraceBackLinkDiffRulesLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMoveOneTraceBackLinkDiffRulesLHS. ...
{ "content_hash": "20a0f7ba4179ee2463c9679233818a3f", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 143, "avg_line_length": 44.18766066838046, "alnum_prop": 0.5246960265285938, "repo_name": "levilucio/SyVOLT", "id": "ab172dd5b6c40fdbd07a0b6923e5ad4fa601d772", "size": "17...
""" Sensor for checking the air quality forecast around Norway. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/air_quality.norway_air/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_valida...
{ "content_hash": "f752c15d28eeb50bbbf207904df5adf3", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 79, "avg_line_length": 29.9, "alnum_prop": 0.6316292403248925, "repo_name": "nugget/home-assistant", "id": "712f2734ea8c667a5c41042b0dd7183b00717182", "size": "4186", "b...
"""This test checks for correct fork() behavior. """ import _imp as imp import os import signal import sys import time from test.fork_wait import ForkWait from test.support import (reap_children, get_attribute, import_module, verbose) threading = import_module('threading') # Skip test if f...
{ "content_hash": "2fc62769d3e5fecd7c8788ef2ffc34ae", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 88, "avg_line_length": 34.32432432432432, "alnum_prop": 0.5244094488188976, "repo_name": "munyirik/python", "id": "eeba306f452ce912b1ad5e29471b73462ac29ba3", "size": "3810...
from textwrap import dedent import pytest from structlog_pretty.processors import XMLPrettifier as uut cases = [ ('<elem/>', '<elem/>'), ('<elem />', '<elem/>'), ('<wrapper><elem/></wrapper>', dedent(''' <wrapper> <elem/> </wrapper> ''').strip()), ('<wrapper><elem/><elem/...
{ "content_hash": "cbe230b97457ad68133ae4329e2cb0c0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 89, "avg_line_length": 28.78181818181818, "alnum_prop": 0.542008843967151, "repo_name": "underyx/structlog-pretty", "id": "f2edfa854600979b9d2524a3aea684b2876f9669", "size"...
"""Unittests to make sure we generate and update the expected-*.txt files properly after running layout tests.""" import os import shutil import tempfile import unittest import compare_failures import path_utils import test_failures class CompareFailuresUnittest(unittest.TestCase): def setUp(self): """Makes a ...
{ "content_hash": "47f3b3bdcd167909c130765197cd9c93", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 79, "avg_line_length": 43.19927536231884, "alnum_prop": 0.6081523106600688, "repo_name": "amyvmiwei/chromium", "id": "26e2adf21fb85f2698619f76d03f0113bab5d686", "size": "1...
import os, re, subprocess user_dir = os.path.expanduser('~') def num_images(): n1 = subprocess.Popen(['ls', 'django_cam_controller/static/img'], stdout=subprocess.PIPE) n2 = subprocess.Popen(['wc', '-l'], stdin=n1.stdout, stdout=subprocess.PIPE) result = n2.stdout.read() num_images = result.repla...
{ "content_hash": "cf4fc97a6baf5a0b5a877b39006c46a9", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 202, "avg_line_length": 31.576923076923077, "alnum_prop": 0.6358099878197321, "repo_name": "davis1410/django_cam_controller", "id": "55989d9f0cdf3d22b249439a3ae60427fbd2924d"...
"""Class to hold all switch accessories.""" from __future__ import annotations import logging from typing import NamedTuple from pyhap.const import ( CATEGORY_FAUCET, CATEGORY_OUTLET, CATEGORY_SHOWER_HEAD, CATEGORY_SPRINKLER, CATEGORY_SWITCH, ) from homeassistant.components import button, input_b...
{ "content_hash": "0e25b82a30cdca96eee422a6f19106c1", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 88, "avg_line_length": 36.11072664359862, "alnum_prop": 0.6383671904944423, "repo_name": "toddeye/home-assistant", "id": "1598df015c510f733e70747407f6c98bf7b6d1ce", "size"...
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightC() print """ /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */ #ifndef CR_STATE_FEEDBACK_FUNCS_H...
{ "content_hash": "528d0de1fd92a656b0f32e46c1b0e488", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 117, "avg_line_length": 29, "alnum_prop": 0.7462422634836428, "repo_name": "egraba/vbox_openbsd", "id": "29e90520e56545945e53ce76b554d90db212f3e3", "size": "1131", "binar...
import errno import socket _ASYNC_BLOCKING_ERRNOS = {errno.EAGAIN, errno.EWOULDBLOCK, errno.EINTR} if hasattr(errno, 'WSAEWOULDBLOCK'): _ASYNC_BLOCKING_ERRNOS.add(errno.WSAEWOULDBLOCK) __all__ = [ 'socketpair' ] try: socketpair = socket.socketpair exce...
{ "content_hash": "0ba25104fd02d9cd12fd891e0c768a70", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 81, "avg_line_length": 34.12280701754386, "alnum_prop": 0.5280205655526993, "repo_name": "SethMichaelLarson/picklepipe", "id": "bc32aaed94d90fa17b336988c9c314c2a78aa99c", "...
""" Utility functions for PDF library. """ __author__ = "Mathieu Fenniak" __author_email__ = "biziqe@mathieu.fenniak.net" import sys #try importing pyCrypto for RC4_encrypt function [https://pypi.python.org/pypi/pycrypto] try: from Crypto.Cipher import ARC4 PYCRYPTO_AVAILABLE = True except ImportError: PY...
{ "content_hash": "755bd9db6aa0df311f22e17cc160a48e", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 88, "avg_line_length": 24.118279569892472, "alnum_prop": 0.578986476445237, "repo_name": "Tristan79/ComicStreamer", "id": "be0639cc715c74ec117cc1ff83f7d20306a074df", "size...
import sys reload(sys) sys.setdefaultencoding('UTF8') import json # If any of the keys below are equal to a certain value # then we can delete it because it's the default value SAFEDELS = { "Size": 0, "config": { "ExposedPorts": None, "MacAddress": "", "NetworkDisabled": False, ...
{ "content_hash": "9d178f970157b78875f1599b67697aae", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 55, "avg_line_length": 22.285714285714285, "alnum_prop": 0.5602564102564103, "repo_name": "triton/triton", "id": "439c213138782078dc583b64732b5208b460a566", "size": "906", ...