text
stringlengths
4
1.02M
meta
dict
import json import unittest import os #import sys #import tempfile from pycoin.serialize import h2b from pycoin.tx import TxIn, TxOut, Tx from pycoin.tx.script import ScriptError from pycoin.tx.script import flags from pycoin.tx.script.tools import compile from pycoin.tx.script.vm import eval_script from pycoin.tx.sc...
{ "content_hash": "ee6954438076427fa7a035e5e768b1f7", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 104, "avg_line_length": 33.850467289719624, "alnum_prop": 0.6167863059083379, "repo_name": "XertroV/pycoin", "id": "3806110c517f754821f1ba71bd5e7cc29d17ab0c", "size": "364...
from twisted.trial import unittest import sys import functools from unittest import skipUnless import six def fake_import(orig, name, *args, **kw): if name in ['GeoIP']: raise ImportError('testing!') return orig(*((name,) + args), **kw) class TestImports(unittest.TestCase): @skipUnless(six.PY2...
{ "content_hash": "127db05c9533bac067fcc6279f2fccf3", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 91, "avg_line_length": 29.770833333333332, "alnum_prop": 0.5675297410776767, "repo_name": "meejah/txtorcon", "id": "b2285c964005c7038226596f97c5840819dcd215", "size": "1429...
{"name": "disabled_addon", "installable": False}
{ "content_hash": "352a054032377251e5e61713c6c2a64e", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 48, "avg_line_length": 49, "alnum_prop": 0.673469387755102, "repo_name": "Tecnativa/docker-odoo-base", "id": "32114e6b6cb503069bf0b91447e1eceab228ff56", "size": "73", "bin...
"""Handle legacy notification platforms.""" from __future__ import annotations import asyncio from functools import partial from typing import Any, cast from homeassistant.const import CONF_DESCRIPTION, CONF_NAME from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import ...
{ "content_hash": "68c5141d99010f2e23248c6417887fd1", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 107, "avg_line_length": 36.577777777777776, "alnum_prop": 0.6136087484811664, "repo_name": "GenericStudent/home-assistant", "id": "af29a9fba99f960fdbaebf5e284752206099af58",...
import _plotly_utils.basevalidators class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="metasrc", parent_name="scattergl", **kwargs): super(MetasrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "61de5c9970602e0f6cfbf2c239025670", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 81, "avg_line_length": 36.666666666666664, "alnum_prop": 0.6068181818181818, "repo_name": "plotly/python-api", "id": "4ecf38a5ff9e27341d9ffce3c765239c6cdcbb11", "size": "44...
"""Entry points into the Beta API of gRPC Python.""" # threading is referenced from specification in this module. import abc import enum import threading # pylint: disable=unused-import # cardinality and face are referenced from specification in this module. from grpc._adapter import _intermediary_low from grpc._ada...
{ "content_hash": "dbab315e400126cf41dcb607bef75405", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 114, "avg_line_length": 38.47979797979798, "alnum_prop": 0.7437327733298333, "repo_name": "msiedlarek/grpc", "id": "a0ca330d2c02bda4883a5643daaf08b1c0edf53d", "size": "167...
__author__ = 'Joe Linn' import unittest import pylastica from tests.base import Base class FilteredTest(unittest.TestCase, Base): def test_filtered(self): client = self._get_client() index = client.get_index('test') index.create(options=True) doc_type = index.get_doc_type('hellowo...
{ "content_hash": "cdb64b0b496b5387c87b3657af4a7dca", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 139, "avg_line_length": 35.5945945945946, "alnum_prop": 0.6203492786636294, "repo_name": "jlinn/pylastica", "id": "3b5b015aea6fb7103f9136aa14f83c5391479957", "size": "1317"...
from py4j.protocol import Py4JJavaError from pyflink.table import expressions as expr from pyflink.table.window import Session, Slide, Tumble, Over from pyflink.testing.test_case_utils import PyFlinkStreamTableTestCase, \ PyFlinkBatchTableTestCase class StreamTableWindowTests(PyFlinkStreamTableTestCase): de...
{ "content_hash": "4e5c839a887cf46ae0c1a7a1e5a65d83", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 93, "avg_line_length": 43.19117647058823, "alnum_prop": 0.6142322097378277, "repo_name": "gyfora/flink", "id": "26bd9a4519313e5f20a2c40df37726a148ce9598", "size": "3896", ...
""" Synchronisation, Controllers @author: Dominic König <dominic[at]aidiq[dot]com> """ module = request.controller prefix = "sync" # common table prefix module_name = T("Synchronization") # ----------------------------------------------------------------------------- def index(): """ Module...
{ "content_hash": "f692640fc1b37beed767fc46aa1d9490", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 33.194244604316545, "alnum_prop": 0.43541395752058953, "repo_name": "flavour/ssf", "id": "4342bf3ece005f7cacc7ddb3a97371a515a8768a", "size": "4640",...
from __future__ import unicode_literals from django.db import migrations, models def remove_duplicate_pathtype(apps, schema_editor): PathType = apps.get_model('compose', 'PathType') ComposeRelPath = apps.get_model('compose', 'ComposeRelPath') qs = PathType.objects.values('name') uniq = set([]) dup ...
{ "content_hash": "e389eac9470e1fe00e363468f61d4f30", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 96, "avg_line_length": 29.848484848484848, "alnum_prop": 0.5949238578680203, "repo_name": "product-definition-center/product-definition-center", "id": "1142667bce7d1694f575a3...
from os.path import abspath from sys import path path.insert(0, abspath('../..')) import settings
{ "content_hash": "1928950323bcf16cd9a0b288a26c4280", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 19.8, "alnum_prop": 0.7272727272727273, "repo_name": "kug3lblitz/Heat-Replay", "id": "20bb760ee7d82f232df9e4f16c643498ddf41d1c", "size": "99", "bina...
__author__ = 'stefan' from ediplug.smartplug import SmartPlug
{ "content_hash": "d74814e8043737e6ec63bbe8cded4e01", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 21, "alnum_prop": 0.746031746031746, "repo_name": "wendlers/ediplug-py", "id": "8f7125fe7d8b4846394308fc4a0a469d0dd0bf5f", "size": "63", "binary": f...
from PyQt4.QtGui import * from PyQt4.QtCore import * import sys import qrc_resource QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8")) class MainWindow(QMainWindow): def __init__(self,parent=None): super(MainWindow,self).__init__(parent) self.setWindowTitle("QMainWindow") self.text=...
{ "content_hash": "3cc977328ca7a3917aa8cbc4a02b00c0", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 81, "avg_line_length": 37.64035087719298, "alnum_prop": 0.6569564204148217, "repo_name": "ptphp/PyLib", "id": "3115b7eea3cd4b8928de0223b7576e18b83f26f5", "size": "4455", ...
from gpiozero import MotionSensor import sys def write_log(file_name, value): out_file = open(file_name, 'w') out_file.write(value) out_file.close() if len(sys.argv) != 2: print("[!] please enter a output filename!") exit(1) pir = MotionSensor(4) noticed = False filename = sys.argv[1] while Tru...
{ "content_hash": "5ae7633aa380e6ed70c47d5a4c5f080f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 48, "avg_line_length": 20.24, "alnum_prop": 0.6027667984189723, "repo_name": "syxanash/joshua_bot", "id": "57f27b43cd9a383325316d8b4af13314e4b3a14b", "size": "506", "bina...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 ''' MAIN FUNCTION ''' def main(): # Grab 'data' from Demisto Arguments data = demisto.args()['data'] # Encode the data, ignoring characters try: encoded_data = data.encode('ascii', 'ignore').decode("ut...
{ "content_hash": "79b68886ca3a6eb7d246c68b1ac68d9e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 80, "avg_line_length": 28.384615384615383, "alnum_prop": 0.6341463414634146, "repo_name": "demisto/content", "id": "391f0c36e523834d5b31fdd34ddbbb1a0ac6e95e", "size": "738"...
import io import os import sys from typing import Generator from typing import TextIO import pytest from _pytest.config import Config from _pytest.config.argparsing import Parser from _pytest.nodes import Item from _pytest.stash import StashKey fault_handler_stderr_key = StashKey[TextIO]() fault_handler_originally_e...
{ "content_hash": "245826fef8f0d25bed7d0408ed9a5796", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 91, "avg_line_length": 32.845360824742265, "alnum_prop": 0.7033898305084746, "repo_name": "RonnyPfannschmidt/pytest", "id": "b9c925582ca0e2a5275a258740ab9f2e856fc7d5", "siz...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/weapon/shared_shield_effectiveness_intensifier_mk3.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### ...
{ "content_hash": "d9638cf7cd90f22494a70e5aa9fc8026", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 104, "avg_line_length": 25.615384615384617, "alnum_prop": 0.7117117117117117, "repo_name": "obi-two/Rebelion", "id": "6082a4780a782e3b9e0c69552bf6399aa14cf959", "size": "47...
import logging def setup_logging(): logging.basicConfig(level=logging.DEBUG) formatter = logging.Formatter('#ts:%(asctime)s#level:%(levelname)s#name:%(name)s%(message)s') err_handler = logging.FileHandler('errorlog-server.log', mode='w', delay=True) err_handler.setLevel(logging.ERROR) err_handler....
{ "content_hash": "cb89cd91a26cc5b611993067ab4fa043", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 97, "avg_line_length": 31.88235294117647, "alnum_prop": 0.7158671586715867, "repo_name": "chrido/i13monserver", "id": "bfee1cb2ec1b7ef8c3198856e9b1f1dd4da96a0a", "size": "5...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event from flexget.entry import Entry from flexget.utils.imdb import make_url as make_imdb_url try: from flexget.plugins.filter.movie_queue import queue_get except ImportError: ...
{ "content_hash": "c5ebe19e30923924318022ef5728b6e7", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 115, "avg_line_length": 36.895348837209305, "alnum_prop": 0.5534194768358021, "repo_name": "tvcsantos/Flexget", "id": "fb5d4f618ac5f18e0dd9c6637dbe1f2a1115bfac", "size": "3...
""" Current WsgiDAV version number. http://peak.telecommunity.com/DevCenter/setuptools#specifying-your-project-s-version http://peak.telecommunity.com/DevCenter/setuptools#tagging-and-daily-build-or-snapshot-releases Example "1.2.0b1", "1.2.0pre1" or "1.2.0" """ __version__ = "1.2.1pre1"
{ "content_hash": "8f154615aa4449f2cf5f5308c731296c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 95, "avg_line_length": 37.25, "alnum_prop": 0.7315436241610739, "repo_name": "StraNNiKK/wsgidav", "id": "277ea8d33a50272749e9a89ca60762a82ae03090", "size": "298", "binary"...
from __future__ import unicode_literals from django.contrib import auth from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.auth.signals import user_logged_in from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from ...
{ "content_hash": "4a125896184bf8f90407f06294391311", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 102, "avg_line_length": 33.3355408388521, "alnum_prop": 0.6463148135885041, "repo_name": "rhertzog/django", "id": "725563424a0cfad04d59566d4109f5dd489fcb9f", "size": "1510...
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * faminsts = IN[0] elementlist = list() for item in faminsts: try: n = UnwrapElement(item).Name except: try: # for parameters... n = UnwrapElement(item).Definition.Name except: n = None # Use a built-in property of (wrapped) Dynamo...
{ "content_hash": "d73076b9066166b204aac08fb9f17d8d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 82, "avg_line_length": 19.82608695652174, "alnum_prop": 0.6864035087719298, "repo_name": "dimven/ClockworkForDynamo", "id": "35f872e321501703e7fd2c2807e5a635f2c73a72", "siz...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
{ "content_hash": "86e189c7c2d2936527c9255324e1229d", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 147, "avg_line_length": 47.05128205128205, "alnum_prop": 0.5940054495912807, "repo_name": "OrhanOdabasi/weirdbutreal", "id": "9dc274b0fe11932b8f53d1849d4b17d6fa7b0e06", "si...
import subprocess from setuptools import setup, find_packages LONG_DESCRIPTION = """ Django REST app to help track page/screen views (and other events) in offline-capable websites/web-apps/hybrid apps. """ def parse_markdown_readme(): """ Convert README.md to RST via pandoc, and load into memory (fallbac...
{ "content_hash": "17e6790a116cd99a6a5b9888bc987196", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 69, "avg_line_length": 28.721311475409838, "alnum_prop": 0.5976027397260274, "repo_name": "wq/offline-website-logger", "id": "0fb91a4ea2b9b40ae28e8ee50442ff5249e4bec7", "si...
"""Tests for the tags of the ``image_gallery`` app.""" from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.middleware import SessionMiddleware from django.template.context import RequestContext from django.test import TestCase from django.test.client import RequestFactory from model_baker...
{ "content_hash": "ca9cf1e27a512133a7e43166cd067cad", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 39.270833333333336, "alnum_prop": 0.6726790450928382, "repo_name": "bitmazk/cmsplugin-image-gallery", "id": "f5906c3d459bb3049869f5511b3b2305b578fe90",...
import os from unittest import TestCase,mock from tiingo.wsclient import TiingoWebsocketClient from tiingo.exceptions import MissingRequiredArgumentError class TestRestClientWithSession(TestCase): def setUp(self): def msg_cb(msg): print(msg) self.cb=msg_cb self.config = { ...
{ "content_hash": "1c4181261506ed125af0110966d293cd", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 102, "avg_line_length": 40.38636363636363, "alnum_prop": 0.6702307259425999, "repo_name": "hydrosquall/tiingo-python", "id": "af3b7b8b2860aef2ee32692d328eaa9572f883ac", "si...
import glob import json import os import yaml _vendors_path = os.path.dirname(os.path.realpath(__file__)) _vendor_defaults = None def get_profile(profile_name): global _vendor_defaults if _vendor_defaults is None: _vendor_defaults = {} for vendor in glob.glob(os.path.join(_vendors_path, '*.y...
{ "content_hash": "47f417b6ae2c70984ba9cbe59a54d51c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 33.78260869565217, "alnum_prop": 0.6023166023166023, "repo_name": "dtroyer/os-client-config", "id": "3e1d20a5a848da78d12ce62de7ad5745f7f7fc2c", "size...
"""A base class session manager. Authors: * Zach Sailer """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this ...
{ "content_hash": "de7de9acc886d21353a4adb291e7c521", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 90, "avg_line_length": 34.85427135678392, "alnum_prop": 0.5415224913494809, "repo_name": "omni5cience/django-inlineformfield", "id": "ec96778d0258023f1763dfde6686c979192b760...
pass <caret><selection>n = 0 while n: print("spam")</selection> pass
{ "content_hash": "408adf83fcc9e96c257bd209dcfabc15", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 29, "avg_line_length": 10.571428571428571, "alnum_prop": 0.6486486486486487, "repo_name": "mdaniel/intellij-community", "id": "635871304aff727052764d6cb7f1ea7bd927e6a8", "si...
"""Glance exception subclasses""" import six import six.moves.urllib.parse as urlparse from glance import i18n _ = i18n._ _FATAL_EXCEPTION_FORMAT_ERRORS = False class RedirectException(Exception): def __init__(self, url): self.url = urlparse.urlparse(url) class GlanceException(Exception): """ ...
{ "content_hash": "fe41ef6eb7c4e5c9724d267567b64eb8", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 79, "avg_line_length": 30.813996316758747, "alnum_prop": 0.6756514463303849, "repo_name": "ozamiatin/glance", "id": "b7796fae084ca4bd163aac5ccc5b804b35a7be4d", "size": "17...
""" foorep is a forensic repository """ import foorep from bson import json_util import argparse import json def main(): """ The main entry point for the foorep cli tool """ def add(args, repo): try: doc = repo.insert(args.path) except IOError: print('File not ...
{ "content_hash": "93d3a03d1003786dcf6ecd36918c3713", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 110, "avg_line_length": 38.229885057471265, "alnum_prop": 0.6256764882742033, "repo_name": "berggren/foorep", "id": "b87835a1235bce5eeb76fe2f38ed1706ac44ddde", "size": "344...
from django.contrib.auth import views as auth_views from django.urls import path, re_path, reverse_lazy from django.views.generic.base import TemplateView from registration.backends.default.views import ActivationView, RegistrationView, ResendActivationView from registration.forms import RegistrationFormUniqueEmail fr...
{ "content_hash": "3a6e1286bfd5901d3089cf2dc3aa6d04", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 149, "avg_line_length": 25.666666666666668, "alnum_prop": 0.5829493087557603, "repo_name": "devenney/reverie", "id": "72bfdc2e1bb4f3e52a2fa1f5593c734ba24c76be", "size": "4...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import os import re from abc import abstractmethod from collections import defaultdict from glob import glob1 from twitter.common.collections import Or...
{ "content_hash": "a172379cb59fca32cc072e4deb1a8a37", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 100, "avg_line_length": 35.94822006472492, "alnum_prop": 0.6702376665466331, "repo_name": "scode/pants", "id": "d393862742934181bf136ba8fb983f4d578f2673", "size": "11255",...
from office365.onedrive.lists.list import List from office365.runtime.client_object import ClientObject from office365.runtime.queries.service_operation import ServiceOperationQuery from office365.runtime.paths.resource_path import ResourcePath from office365.sharepoint.webs.web import Web class RemoteWeb(ClientObjec...
{ "content_hash": "bb9f79df28e291b5100426f69c9f57a4", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 119, "avg_line_length": 38.4054054054054, "alnum_prop": 0.6868402533427164, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "cce1a9d4e5f1776ba300fe5d5f0916c43ab9a0ff...
""" Check the estimated waiting time for an identification This estimate is done by IDNow using the average of a 10 minute sliding window, rounded to about 15 second intervals and adding a small buffer. The estimates seem to take your booked SLA times into account when calculating a default (in case there were no cus...
{ "content_hash": "0824c2324e50f6cbac30e105ec1ece02", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 105, "avg_line_length": 34.333333333333336, "alnum_prop": 0.6308613922743235, "repo_name": "gtudan/check_idnow", "id": "84b419800397998f5de9e1bcb8e8f0cabf6f22fb", "size": ...
import netaddr import re from sqlalchemy.orm import exc from sqlalchemy import sql from neutron.api.v2 import attributes from neutron.common import constants from neutron.common import exceptions as n_exc import neutron.db.api as db from neutron.db import models_v2 from neutron.openstack.common import log as logging f...
{ "content_hash": "f7c30a943118a1a0f02ada398a970f11", "timestamp": "", "source": "github", "line_count": 1600, "max_line_length": 79, "avg_line_length": 42.76375, "alnum_prop": 0.5907164362339599, "repo_name": "gopal1cloud/neutron", "id": "b9093da21ba9fd515a77978883dd70c1db74da26", "size": "69224", ...
""" Module for managing the PROJ network settings. """ import os from pathlib import Path from typing import Union import certifi from pyproj._network import ( # noqa: F401 pylint: disable=unused-import _set_ca_bundle_path, is_network_enabled, set_network_enabled, ) def set_ca_bundle_path(ca_bundle_pat...
{ "content_hash": "015e1f5a001fece658526cd069c04379", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 85, "avg_line_length": 32.42372881355932, "alnum_prop": 0.6523784631468897, "repo_name": "ocefpaf/pyproj", "id": "f25a34b450899ea8053ec7273a97b0d7a038ca65", "size": "1913",...
""" PyTorch Speech2Text model.""" import math import random from typing import Optional, Tuple, Union import torch from torch import nn from torch.nn import CrossEntropyLoss from ...activations import ACT2FN from ...modeling_outputs import ( BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Se...
{ "content_hash": "ad997004f222036baabe06690eddda6c", "timestamp": "", "source": "github", "line_count": 1407, "max_line_length": 150, "avg_line_length": 46.8862828713575, "alnum_prop": 0.6263548030135366, "repo_name": "huggingface/transformers", "id": "c464f4aa842ba5eba7644ad598ef358485ab7ed8", "si...
''' Functions to extract data and create databases. ''' from dmrg_helpers.extract.database import Database from dmrg_helpers.extract.locate_estimator_files import locate_estimator_files from dmrg_helpers.core.dmrg_logging import logger def create_db_from_file(filename, database_name=":memory:"): """Creates a data...
{ "content_hash": "ee0d3778bf65f8e9eaccb16bfe782c58", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 35.506493506493506, "alnum_prop": 0.6565471836137527, "repo_name": "iglpdc/dmrg_helpers", "id": "336ad0ee3928f98bda763c80070294ff09ebc41c", "size": "...
from django.conf.urls import patterns, include, url from django.views.generic import TemplateView from django.contrib import admin from posts.views import PostListView admin.autodiscover() urlpatterns = patterns('', url(r'^$', PostListView.as_view(), name='index'), url(r'^about/', TemplateView.as_view(templa...
{ "content_hash": "f7f31fbf276e3d002b93c302cc99394a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 84, "avg_line_length": 39.59090909090909, "alnum_prop": 0.661308840413318, "repo_name": "inchingforward/gh", "id": "52c77812ed2d5cf99e2f05e201e5c0be4aa1c1ba", "size": "871"...
"""gcloud dns record-sets changes list command.""" from googlecloudsdk.api_lib.dns import util from googlecloudsdk.calliope import base from googlecloudsdk.core import list_printer from googlecloudsdk.core import properties from googlecloudsdk.third_party.apitools.base.py import list_pager class List(base.Command): ...
{ "content_hash": "17192c0389acab74a602414edfce874f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 71, "avg_line_length": 29.87719298245614, "alnum_prop": 0.6641221374045801, "repo_name": "flgiordano/netcash", "id": "b31608b56596668d1aee5258857c77ce634cfdd5", "size": "22...
import os from functools import partial import logging from pathlib import Path from typing import Union from contextlib import contextmanager from mlflow.environment_variables import MLFLOW_TRACKING_AWS_SIGV4 from mlflow.store.tracking import DEFAULT_LOCAL_FILE_AND_ARTIFACT_PATH from mlflow.store.db.db_types import D...
{ "content_hash": "2c4e7f6235ef658cfe2a0e4582d1eabc", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 97, "avg_line_length": 35.06550218340611, "alnum_prop": 0.6718555417185554, "repo_name": "mlflow/mlflow", "id": "a996483062dd4cedd867db5d5381ebbfdda852af", "size": "8030",...
""" Author ------ Bo Zhang Email ----- [email protected] Created on ---------- - Wed Jan 4 14:00:00 2016 Modifications ------------- - Aims ---- - SONG echelle spectra extractor """ import numpy as np from twodspec import ccdproc_mod as ccdproc def produce_master(t, method="median", imagetp='FLAT', slc=Non...
{ "content_hash": "fa8f3666c4a942e556a859391db81ecd", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 79, "avg_line_length": 22.776470588235295, "alnum_prop": 0.5976239669421488, "repo_name": "hypergravity/hrs", "id": "dea45bd52cfa26a93181587c0654ace265b32a78", "size": "196...
import copy import math import unittest import paddle.fluid as fluid import paddle.fluid.layers as layers import paddle.fluid.framework as framework import paddle.fluid.core as core def exponential_decay(learning_rate, global_step, decay_steps, decay_...
{ "content_hash": "54a9d6962f28c9c7cadc595a2e5e8403", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 87, "avg_line_length": 35.157534246575345, "alnum_prop": 0.5375024352230664, "repo_name": "putcn/Paddle", "id": "6382e290eb30c621da64d5c600be6d8a7c6254f1", "size": "5743",...
from django.conf.urls import patterns, include, url from django.contrib import admin from server import views from bookreview import views urlpatterns = patterns('', # Examples: url(r'^$', 'bookreview.views.index', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.sit...
{ "content_hash": "668821116bcede67b8c70be4928734d3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 54, "avg_line_length": 27.666666666666668, "alnum_prop": 0.6837349397590361, "repo_name": "iscarecrow/sb", "id": "d7f7bb2785150e2ae2226ddde138f03281ddb71e", "size": "332", ...
import odbpy as odb import os current_dir = os.path.dirname(os.path.realpath(__file__)) tests_dir = os.path.abspath(os.path.join(current_dir, os.pardir)) opendb_dir = os.path.abspath(os.path.join(tests_dir, os.pardir)) data_dir = os.path.join(tests_dir, "data") db = odb.dbDatabase.create() odb.read_lef(db, os.path.j...
{ "content_hash": "05376b445445f76adb3dfcd24f72e292", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 32.705882352941174, "alnum_prop": 0.7014388489208633, "repo_name": "QuantamHD/OpenROAD", "id": "9b7bd3a8d6fef5b614a68af362518c62fe3e6400", "size": "5...
""" A fairly complicated migration taken from the real world, mangled so as not to disclose much about the meaning of the models / fields. """ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): ...
{ "content_hash": "c6a8057fce6b9984154cc29a0f2e39b3", "timestamp": "", "source": "github", "line_count": 688, "max_line_length": 201, "avg_line_length": 87.99273255813954, "alnum_prop": 0.5431209633459423, "repo_name": "cberzan/django-anger", "id": "5db3719ed1e2c7239d218d1095918160e3d2fab7", "size":...
"""Support for getting collected information from PVOutput.""" import logging from collections import namedtuple from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.components.sensor import PLAT...
{ "content_hash": "fb97188326ff171e93484c8ff946f100", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 83, "avg_line_length": 31.16393442622951, "alnum_prop": 0.63387690689111, "repo_name": "Cinntax/home-assistant", "id": "90084ab799913dd8b0ce77be6126b180d00d2b4e", "size": ...
from django.conf.urls import patterns, include, url from rest_framework import routers from django_usda.modelviewsets import FoodViewSet, FoodGroupViewSet, FoodLanguaLFactorViewSet, LanguaLFactorViewSet, NutrientDataViewSet, NutrientViewSet, SourceViewSet, DerivationViewSet, WeightViewSet, FootnoteViewSet, DataLinkView...
{ "content_hash": "1b9d7e112424789c54c314a79704d4d5", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 272, "avg_line_length": 48.57142857142857, "alnum_prop": 0.7867647058823529, "repo_name": "Zundrium/django-usda-demo", "id": "d5c1f919258bf7fcccd35a42e9ca849a5cfff470", "si...
import sys sys.path.insert(1, "../../../") import h2o, tests import numpy as np from sklearn.cluster import KMeans from sklearn.preprocessing import Imputer def benignKmeans(): # Connect to a pre-existing cluster # connect to localhost:54321 # Log.info("Importing benign.csv data...\n") benign_h2o...
{ "content_hash": "93f21f7c45e419ef1ffa39a7954fba23", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 90, "avg_line_length": 32.51428571428571, "alnum_prop": 0.6511423550087874, "repo_name": "kyoren/https-github.com-h2oai-h2o-3", "id": "98bbaf2e04e72eb156aa6639f24687e69433b13...
import numpy as np import random import json import math neuron_decay=0.9 maxneuronsperunit=64 maxaxonsperunit=128 maxunits=10 binary_io=True bitsize=8 runtime=20 testsize=20 class neuron: id=-1 myunit=-1 active=False can_mutate=True threshold=999 amount=0 decay=neuron_decay ...
{ "content_hash": "0acf1aceff4e0073da4b4921216843e3", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 210, "avg_line_length": 30.287569573283857, "alnum_prop": 0.48820826952526797, "repo_name": "barisser/Neural", "id": "aed4b94784009f028c6198933f63d047f6a0b13c", "size": "1...
''' Copyright (c) 2013 Potential Ventures Ltd Copyright (c) 2013 SolarFlare Communications Inc All rights reserved. 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 retain the above c...
{ "content_hash": "2ef53368101ee9e791fcabd450507cd9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 48.23684210526316, "alnum_prop": 0.7741407528641571, "repo_name": "mkreider/cocotb2", "id": "bee3bf3ef40efbf0d72c948445607d3f21ef2ef9", "size": "1833...
"""keyrotator Cleanup command.""" from datetime import datetime from datetime import timedelta import logging from dateutil import parser from delete import DeleteCommand from list import ListCommand import pytz class CleanupCommand(object): """Implementation of the keyrotator cleanup command.""" def run(self,...
{ "content_hash": "b15e5a4ad70d7c5a372dc48ed875a7b6", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 80, "avg_line_length": 28.314814814814813, "alnum_prop": 0.670372792674951, "repo_name": "GoogleCloudPlatform/keyrotator", "id": "2a0b9c2e9a38237cc19fb7ca83bf6d87d79e2e39", ...
import curses stdscr = curses.initscr() finished = False try: while not finished: c = stdscr.getch() if c == curses.CRTL: print("Pressed: CTRL") except (KeyboardInterrupt, SystemExit): finished = True curses.endwin()
{ "content_hash": "7d585a317a9f9f59cf85dc6b7ebd3c63", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 39, "avg_line_length": 15.266666666666667, "alnum_prop": 0.7030567685589519, "repo_name": "meigrafd/Sample-Code", "id": "a2957fbac59fa3029b942201024fd4a03a18b855", "size": ...
import logging from typing import Dict import pandas as pd from PyQt5.QtCore import pyqtSignal, Qt from PyQt5.QtWidgets import QAction from pyqtgraph import Point from pyqtgraph.GraphicsScene.mouseEvents import MouseClickEvent from dgp.core import Icon from dgp.core import StateAction from dgp.core.oid import OID fro...
{ "content_hash": "d62e2d2a99203c46f2906037283719c1", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 83, "avg_line_length": 34.38429752066116, "alnum_prop": 0.613868525417618, "repo_name": "DynamicGravitySystems/DGP", "id": "e59211d465e777b0df9a4352e0a75123c6541b62", "siz...
from django.core.mail.message import EmailMessage from django.core.urlresolvers import reverse from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.http import HttpResponsePermanentRedirect, HttpResponseRedirect, HttpResponse from django.short...
{ "content_hash": "b2912327bb3b08fc4c05ecb88a9ce8cc", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 94, "avg_line_length": 37.318385650224215, "alnum_prop": 0.5651285748618121, "repo_name": "FreezyExp/dndtools", "id": "eac1a6214971756baeda60c62e25b8e1d63354a9", "size": "...
import webob from jacket.api.compute.openstack.compute import access_ips from jacket.api.compute.openstack.compute import extension_info from jacket.api.compute.openstack.compute.legacy_v2 import servers as servers_v20 from jacket.api.compute.openstack.compute import servers as servers_v21 from jacket.api.compute.open...
{ "content_hash": "230673e6d44694e5ce02fa23c291e8ef", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 81, "avg_line_length": 40.09002433090024, "alnum_prop": 0.6022334162772349, "repo_name": "HybridF5/jacket", "id": "7de5b98d7f3edaa983cc1b1a0dccb26e4de49fb2", "size": "1707...
import os import unittest from conans.test.utils.tools import TestClient from conans.util.files import load class SysrootTest(unittest.TestCase): def test(self): client = TestClient() sysroot = """from conans import ConanFile class Pkg(ConanFile): def package_info(self): self.cpp_info...
{ "content_hash": "fe1b467f65d4e038986effd834090fe9", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 100, "avg_line_length": 37.20454545454545, "alnum_prop": 0.6511912034208919, "repo_name": "birsoyo/conan", "id": "3a0154674ead315db67c3be417d0d5f1c19e5073", "size": "1637",...
"""IIR and FIR filtering and resampling functions.""" from collections import Counter from copy import deepcopy from functools import partial import numpy as np from .annotations import _annotations_starts_stops from .io.pick import _picks_to_idx from .cuda import (_setup_cuda_fft_multiply_repeated, _fft_multiply_re...
{ "content_hash": "a485a3a5f058b6805386540cc3abbf42", "timestamp": "", "source": "github", "line_count": 2345, "max_line_length": 126, "avg_line_length": 38.33262260127932, "alnum_prop": 0.5504505506730448, "repo_name": "olafhauk/mne-python", "id": "01c16d3f8aebdf41c3d963ad4890b6da7b203e11", "size":...
from nose.tools import * from dateutil.parser import parse as time_parse import yawhois class TestWhoisNicBjStatusRegistered(object): def setUp(self): fixture_path = "spec/fixtures/responses/whois.nic.bj/status_registered.txt" host = "whois.nic.bj" part = yawhois.record.Par...
{ "content_hash": "a661902ac343f04a94c4029331e0f7b1", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 95, "avg_line_length": 44.36842105263158, "alnum_prop": 0.6654804270462633, "repo_name": "huyphan/pyyawhois", "id": "a54d86f03233d9582d6ead97de0215316710529e", "size": "363...
import datetime import json import logging import requests import dateutil.parser as dp from django.utils.encoding import smart_text from django.utils.translation import ugettext_lazy as _ from awx.main.notifications.base import AWXBaseEmailBackend from awx.main.notifications.custom_notification_base import CustomNot...
{ "content_hash": "9599a0cf6dd2763032dae10fdb5cf90f", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 155, "avg_line_length": 53.173469387755105, "alnum_prop": 0.6269430051813472, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "8e8b6489520bcc2cbeec1a78a04...
import sys import hashlib import importlib import gc import logging import subprocess import os # import own modules sys.path.append('./') try: import sensors except Exception as e: print e class MiniProbe(object): """ Main class for the Python Mini Probe """ def __init__(self): gc.e...
{ "content_hash": "26f9c7f2ce494ed44ecbe2653a538ea1", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 117, "avg_line_length": 32.403225806451616, "alnum_prop": 0.5189148830263813, "repo_name": "eagle00789/PythonMiniProbe", "id": "54c756f6d619915b14fd529288bb2e64c8fc5e18", ...
from oslo_config import cfg from oslo_log import log as logging from oslo_versionedobjects import fields from cinder import db from cinder import exception from cinder.i18n import _ from cinder import objects from cinder.objects import base from cinder import utils CONF = cfg.CONF # NOTE(thangp): OPTIONAL_FIELDS are ...
{ "content_hash": "03101e3272749c855aa3db429ca86c19", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 78, "avg_line_length": 38.68487394957983, "alnum_prop": 0.5930270446399478, "repo_name": "tlakshman26/cinder-https-changes", "id": "c482313894cde4282c39645a08a77c08bd468855"...
import shutil, sys, os, stat from subprocess import * #idaBatchAnalyze.py "C:\Program Files (x86)\Intuit" "C:\analysis\Intuit" "C:\Program Files (x86)\IDA\idag.exe" C:\analysis\analysis_script.py #idaBatchAnalyze.py "C:\Users\apridgen\Desktop\ICA_Client" "C:\analysis\ICA_Client" "C:\Program Files (x86)\IDA\idag....
{ "content_hash": "72f698842135b3d08c99c148b0248a77", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 152, "avg_line_length": 32, "alnum_prop": 0.6427364864864865, "repo_name": "deeso/python_scrirpts", "id": "a33d4785079efffbbb578ca0346c63c35a0e8eb7", "size": "3942", "bi...
"""info module tests.""" import mox import stubout from google.apputils import app from google.apputils import basetest from simian.mac.api import info class InfoModuleTest(mox.MoxTestBase): def setUp(self): mox.MoxTestBase.setUp(self) self.stubs = stubout.StubOutForTesting() def tearDown(self): ...
{ "content_hash": "57398bd5ac71d15309505788c4ab478c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 51, "avg_line_length": 16.322580645161292, "alnum_prop": 0.7035573122529645, "repo_name": "alexandregz/simian", "id": "7ce3e291d82cd4c293d87fc763ff4c405d239d8c", "size": "1...
import speech_recognition as sr def recognize(): r = sr.Recognizer() with sr.Microphone(device_index = 1, sample_rate = 44100, chunk_size = 512) as source: print("Say something!") audio = r.listen(source) try: # for testing purposes, we're just using the default API key # to use ano...
{ "content_hash": "247e5fb2a698ad2a025238038965ca44", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 102, "avg_line_length": 33.34615384615385, "alnum_prop": 0.615916955017301, "repo_name": "TrevorEdwards/Jauffre", "id": "90295a185fba57fd7463a5354e3fa1724a3713c1", "size": ...
import time import json import urllib from django.http import HttpResponseRedirect, HttpResponse from django.contrib import auth from utils.shortcuts import error_response, error_page from .models import ADMIN class SessionSecurityMiddleware(object): def process_request(self, request): if request.user.is_...
{ "content_hash": "f3b56c148aa1c7ebf55217887b3d16df", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 115, "avg_line_length": 43.73913043478261, "alnum_prop": 0.5894632206759444, "repo_name": "mcmdhr/CSOJ", "id": "4295598f40d0f76f092d62f5ea985928d1585c75", "size": "1357", ...
import os #os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings") import string import random import hashlib from datetime import datetime from netaddr import IPAddress, IPNetwork from xos import settings from django.core import management from core.models import * from xos.config import Config try: from ...
{ "content_hash": "4b15e29db412de7491a4eca27ef30d03", "timestamp": "", "source": "github", "line_count": 568, "max_line_length": 112, "avg_line_length": 40.41021126760563, "alnum_prop": 0.5499934649065482, "repo_name": "wathsalav/xos", "id": "42b1ef18aa5ef6ca67e24a18a57ec7fabb7c6949", "size": "22953...
""" urlresolver XBMC Addon Copyright (C) 2015 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
{ "content_hash": "766996bfd9ba65cc794b827b2ec04fff", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 155, "avg_line_length": 37.2991452991453, "alnum_prop": 0.5955545371219065, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "d4397074bfe8fa88520a760949844c76a8b49d97", ...
"""The tests for the Tasmota light platform.""" import copy import json from unittest.mock import patch from hatasmota.const import CONF_MAC from hatasmota.utils import ( get_topic_stat_result, get_topic_tele_state, get_topic_tele_will, ) from homeassistant.components import light from homeassistant.compo...
{ "content_hash": "e1ce5d7fd1397c46d4c8ee4de9233329", "timestamp": "", "source": "github", "line_count": 1816, "max_line_length": 88, "avg_line_length": 35.625, "alnum_prop": 0.6443310920472989, "repo_name": "kennedyshead/home-assistant", "id": "b74799d1d122bd3a16ffc2fdda674e1326636785", "size": "64...
import traceback from urllib.request import urlopen import json from time import sleep import geomath import math from datetime import datetime from configparser import ConfigParser # Read the configuration file for this application. parser = ConfigParser() parser.read('config.ini') # Assign receiver variables. recei...
{ "content_hash": "df12f76ce0b55278f82706c5582418a1", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 117, "avg_line_length": 30.963414634146343, "alnum_prop": 0.4705264539845083, "repo_name": "kevinabrandon/AboveTustin", "id": "167644f2dcfe5f6cf6cef9282693395898e34b56", "...
import unittest import seed_database class parseIntoProbabilityHashTests(unittest.TestCase): def testKeySetting(self): string2 = "This apple is red." one = "this apple" two = "apple is" three = "is red" outcome = {one: 1, two: 1, three: 1} probabilityHash2 = seed_database.parseIntoProbabilit...
{ "content_hash": "172f75186af176b9db3b19fc9474813c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 111, "avg_line_length": 32.81818181818182, "alnum_prop": 0.6897506925207756, "repo_name": "hollabaq86/haikuna-matata", "id": "1ad6af97cfd12c3f21cd00a19fef64a29785c5d9", "si...
import flask from flask import Flask, render_template, request import json import time app = Flask(__name__) form_post_count = 0 # Ensure application exceptions are raised. app.debug = True class AppError(Exception): pass @app.route("/") def hello(): resp = flask.make_response("""Hello world! <a href="wi...
{ "content_hash": "83944bab6b85dd30e0c9fd20b66b9d9e", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 102, "avg_line_length": 22.32751091703057, "alnum_prop": 0.6416976334832779, "repo_name": "elliterate/capybara.py", "id": "eaa18cb77706ffa6c124ae5d5c08a69ccc6e36a1", "size...
import sys import os import time __author__ = 'andymhan' # Output example: [======= ] 75% # width defines bar width # percent defines current percentage def progress(width, percent): linestr = "\r%s %d%%\r"%(('%%-%ds' % width) % (int(width * percent/100) * '='), percent) os.write(1,bytes(linestr, 'UTF-8')) ...
{ "content_hash": "da999803e92c06e59f07f8885ac62e10", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 92, "avg_line_length": 32.87155963302752, "alnum_prop": 0.6008931063354731, "repo_name": "andymhan/NLP_TEST", "id": "3d5096425109dbb358db15914fd858b55443c148", "size": "35...
"""Image represented by either a URI or byte stream.""" from base64 import b64encode from google.cloud._helpers import _to_bytes from google.cloud._helpers import _bytes_to_unicode from google.cloud.vision.annotations import Annotations from google.cloud.vision.feature import Feature from google.cloud.vision.feature...
{ "content_hash": "955530714f43f8892ce1c30db44613c3", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 80, "avg_line_length": 32.05769230769231, "alnum_prop": 0.6045290941811637, "repo_name": "Fkawala/gcloud-python", "id": "d094b6702537ff0efc9c9379cfb41c1d60d530f2", "size":...
""" This script triggers a bug in pbzip2 (version 0.94). """ __author__ = "Baris Kasikci, [email protected]" from lib import constants from lib.plugins import create_big_file from lib.trigger import BaseTrigger class Trigger(BaseTrigger): """ Pbzip2-specific Intel PT tracing """ def __init__(se...
{ "content_hash": "f5d3cf9eaf066f1a2dc4e7ffff13682d", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 119, "avg_line_length": 25.35483870967742, "alnum_prop": 0.5820610687022901, "repo_name": "dslab-epfl/bugbase", "id": "015074248b8d81f6919b8c0872c2f42e7edb6dae", "size": "1...
from model.contact import Contact def test_modify_first_contact(app): if app.contact.count_of_contact() == 0: app.contact.create_new(Contact(firstname="testContact")) app.contact.modify_first_contact(Contact(firstname="dupa1"))
{ "content_hash": "f4b0d4cadeda37077ead3e60606304de", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 64, "avg_line_length": 35.142857142857146, "alnum_prop": 0.7276422764227642, "repo_name": "Lucas1985/kurs_pythona", "id": "629a727800e543d645f24927e8ec8db4ba9b4169", "size":...
import fixtures import mock from nova import context from nova.image import glance from nova import objects from nova import test from nova.tests.unit import fake_instance import nova.tests.unit.image.fake from nova.tests.unit import utils from nova.tests.unit.virt.vmwareapi import fake as vmwareapi_fake from nova.tes...
{ "content_hash": "dc127804a8b0fc6fa45fbc6684ca7a57", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 79, "avg_line_length": 43.251612903225805, "alnum_prop": 0.533263723150358, "repo_name": "rajalokan/nova", "id": "b280c9c7e7c9303b5aae12cf1b01a3cdcf342f93", "size": "7344"...
import logging import os import sys # pylint: disable=wrong-import-position sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from deep_qa import score_dataset_with_ensemble, compute_accuracy from deep_qa.common.checks import ensure_pythonhashseed_set logger = logging.getLogger(__name__) # pylint: disab...
{ "content_hash": "fc2fc2be7cc7f198eeaee3a646ba15e2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 86, "avg_line_length": 32.06666666666667, "alnum_prop": 0.6621621621621622, "repo_name": "allenai/deep_qa", "id": "c5b74f6d5ee9b1deb0092f4ecd4bc2b4e266438e", "size": "962",...
from __future__ import print_function, division, unicode_literals import re import sys import time import threading from math import ceil import six if six.PY2: from backports.shutil_get_terminal_size import get_terminal_size input = raw_input else: from shutil import get_terminal_size from builtins i...
{ "content_hash": "fef54fd16b8634015f59036f507b7022", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 137, "avg_line_length": 34.19948849104859, "alnum_prop": 0.5461411905474125, "repo_name": "Yinzo/reprint", "id": "746f8c24bcac59b8f7cd9e4fa639d69bfb312c0f", "size": "13790...
from __future__ import annotations import collections from contextlib import contextmanager from dataclasses import dataclass import functools as ft import glob import json import itertools as it import os import time import Box2D as B import IPython.display import matplotlib.pyplot as plt import numpy as np import p...
{ "content_hash": "c7276333f846c369432df4899f536c32", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 108, "avg_line_length": 31.173020527859236, "alnum_prop": 0.5269049858889934, "repo_name": "DouglasOrr/Snippets", "id": "f6d45a337b71b11d08ea0c0ea9e59aa5d4025812", "size":...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1alpha1R...
{ "content_hash": "94e19edcd75c7cff4e50aa2acd96ddf7", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 281, "avg_line_length": 32.07692307692308, "alnum_prop": 0.5961630695443645, "repo_name": "djkonro/client-python", "id": "bd3e4efc0f9ac4f3fc5042a33a690f5d623dd205", "size"...
""" The deprecated lazy command objects """ import warnings from libqtile.command import base, client, graph, interface from libqtile.lazy import LazyCommandInterface __all__ = [ "lazy", "base", "client", "graph", "interface", ] class _LazyTree(client.InteractiveCommandClient): def __getatt...
{ "content_hash": "427e80b55dc1210be1d9da4d70987174", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 93, "avg_line_length": 23.464285714285715, "alnum_prop": 0.6712328767123288, "repo_name": "qtile/qtile", "id": "1618a214afc8ba6c0fbd3b73a0bbb437a6bd3e50", "size": "1772", ...
"""These are flows designed to discover information about the host.""" from grr.lib import aff4 from grr.lib import artifact from grr.lib import flow from grr.lib import rdfvalue from grr.lib import worker from grr.proto import flows_pb2 class EnrolmentInterrogateEvent(flow.EventListener): """An event handler whi...
{ "content_hash": "897f154ec63ceca09d15419354aaa999", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 80, "avg_line_length": 36.44106463878327, "alnum_prop": 0.6535893155258765, "repo_name": "simsong/grr-insider", "id": "21b8e798235f139eb8a420af7b09fd592530f051", "size": "...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
{ "content_hash": "201bd85397f06733a126efe74e60763c", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 94, "avg_line_length": 34.40869565217391, "alnum_prop": 0.6611068991660348, "repo_name": "toirl/gisela", "id": "59a43e4dad3122e38b990509c9dffff1dfaff4bb", "size": "3999", ...
from libs import elastic_libs import csv from datetime import datetime def get_users_tweets(screen_name, time_range="7d"): query = { "from": 0, "size": 1000, "sort": [ {"@timestamp": {"order": "desc"}} ], "query": { "bool": { "must":...
{ "content_hash": "a54f70f4414837d7a72aba2c1dc5d75a", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 138, "avg_line_length": 31.980392156862745, "alnum_prop": 0.4978540772532189, "repo_name": "gradiuscypher/internet_illithid", "id": "9ffab9a86e56f92b2e6c82178333802de05aa5a5"...
import datetime import os from pathlib import Path from unittest import mock import pytest from cumulusci.core.config import OrgConfig from metaci.build.models import Build from metaci.conftest import ( BranchFactory, BuildFactory, BuildFlowFactory, PlanFactory, PlanRepositoryFactory, PlanSche...
{ "content_hash": "9dcb597c9e1d2fb8a06bbb42265ea7bd", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 87, "avg_line_length": 33.174418604651166, "alnum_prop": 0.6291622853137049, "repo_name": "SalesforceFoundation/mrbelvedereci", "id": "b394dff0b92cdd0475664f0060fa9652eaf790...
import unittest import sys import time import os from robot.utils.asserts import * from robot.errors import * from robot.running.timeouts import TestTimeout, KeywordTimeout # thread_resources is here sys.path.append(os.path.join(os.path.dirname(__file__),'..','utils')) from thread_resources import passing, failing, s...
{ "content_hash": "cc817d705276e443013683091519f871", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 94, "avg_line_length": 36.78947368421053, "alnum_prop": 0.6034334763948498, "repo_name": "Senseg/robotframework", "id": "fd32c32eefea9c7cf0c6ba47916de0f76c7c6c7d", "size":...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Bookmark' db.create_table(u'xadmin_bookmark', ( (u'id', self.gf('djan...
{ "content_hash": "51b5be6988dbadedd42b0ea4c3d2a829", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 195, "avg_line_length": 63.27350427350427, "alnum_prop": 0.566392003241929, "repo_name": "cgcgbcbc/django-xadmin", "id": "bacc01b5360338cba27050fc610456eec5d95e0d", "size"...
import os import json import sys def main(): if len(sys.argv) != 3: print('Usage: write_labels.py labels_json out_dir', file=sys.stderr) sys.exit(1) labels_by_target = json.loads(sys.argv[1]) out = sys.argv[2] for target_name, labels in labels_by_target.items(): with open(os.path.join(out, target...
{ "content_hash": "c02647f07ba5960f7eafe1c7575a71de", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 72, "avg_line_length": 22.210526315789473, "alnum_prop": 0.6184834123222749, "repo_name": "FeliciaLim/oss-fuzz", "id": "338ac716f3bfd4a549dc5a23ddc2cf3a18d3be9a", "size": "...
import logging import datetime import time from modularodm import Q from oauthlib.oauth2 import OAuth2Error from dateutil.relativedelta import relativedelta from framework.celery_tasks import app as celery_app from scripts import utils as scripts_utils from website.app import init_app from website.addons.box.model ...
{ "content_hash": "e88aa484bcee6285fcb9fec5bbd2ab74", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 102, "avg_line_length": 35.21649484536083, "alnum_prop": 0.6086065573770492, "repo_name": "mluke93/osf.io", "id": "5df1b3e605e0b4600b5e7f793b6536538c47f4f3", "size": "3457"...
class Handler(object): """ """ def __init__(self): pass def return_service_details(): pass
{ "content_hash": "4f849ce6e0ad25851ccedcc55876b93a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 33, "avg_line_length": 12.6, "alnum_prop": 0.47619047619047616, "repo_name": "epheo/shaddock", "id": "350e446a189cbbdbc169a76d8db1a92f591aa1f3", "size": "827", "binary": ...
"""Tests for the default Windows Registry plugin.""" import unittest # pylint: disable=unused-import from plaso.formatters import winreg as winreg_formatter from plaso.parsers.winreg_plugins import default from plaso.parsers.winreg_plugins import test_lib from plaso.winreg import test_lib as winreg_test_lib class T...
{ "content_hash": "b1183452af829464db6bfd20a4d2b0ab", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 79, "avg_line_length": 33.6551724137931, "alnum_prop": 0.6680327868852459, "repo_name": "iwm911/plaso", "id": "9989058a221bafc6d07395d08fe9b58ad9a76cc1", "size": "2650", ...
from sklearn.ensemble import RandomForestClassifier def get_estimator(): clf = RandomForestClassifier(n_estimators=1, max_leaf_nodes=2, random_state=61) return clf
{ "content_hash": "d14fb5756ac931b7164d218a6b89db7d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 66, "avg_line_length": 29.571428571428573, "alnum_prop": 0.6473429951690821, "repo_name": "paris-saclay-cds/ramp-workflow", "id": "661d88c2b720a0567c7e407453898f451f6c0577", ...
"""\ ========================= Abstract SMTP Mailer Core ========================= This component effectively forms the skeleton of an SMTP server. It expects an SMTP client to connect and send various SMTP requests to it. This basic SMTP Mailer Core however, does not actually do anything in response to any of the SMT...
{ "content_hash": "b94ccdf8893d05b1ac1e3f0f8db14404", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 96, "avg_line_length": 34.36666666666667, "alnum_prop": 0.6418525703200776, "repo_name": "sparkslabs/kamaelia", "id": "423fe97d2916817ee994ccd788fb7fac68b34fc9", "size": "...
from django import test from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.db import models from django.db.models.fields.related import ( ForeignKey, ForeignObject, ForeignObjectRel, ManyToManyField, ManyToOneRel, OneToOneField, ) from .models import AllField...
{ "content_hash": "22b76509e97aaef47de54d062d29f5f8", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 103, "avg_line_length": 32.762331838565025, "alnum_prop": 0.6167533534081577, "repo_name": "indevgr/django", "id": "33f49a139dee117c6615bbb64cc81b847c7c5904", "size": "730...
from mongoengine import ValidationError import six from st2api.controllers import resource from st2common.exceptions.db import StackStormDBObjectNotFoundError from st2common import log as logging from st2common.content import utils from st2common.models.api.action import ActionAPI from st2common.models.utils import ac...
{ "content_hash": "55cc651d9e515d3e101972534f768a4e", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 100, "avg_line_length": 34.73118279569893, "alnum_prop": 0.5863777089783282, "repo_name": "tonybaloney/st2", "id": "dc89925827272a276b2fb5bc7ab4eea268217677", "size": "724...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models from cmsplugin_filer_utils.migration import rename_tables_new_to_old class Migration(DataMigration): cms_plugin_table_mapping = ( # (old_name, new_name), ('cmsplugin_filerfolder', 'cmsplugin_fil...
{ "content_hash": "cb4a9ebeec2cd2d7426b0b9ce80a5aa5", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 187, "avg_line_length": 71.48245614035088, "alnum_prop": 0.5625230089581543, "repo_name": "Venturi/oldcms", "id": "2f26ffda3af2e527f5d97fae2ac0b99d940bbd80", "size": "8173...
"""Tests for reconstruction_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.signal.python.ops import reconstruction_ops from tensorflow.python.framework import constant_op from tensorflow.python.framework ...
{ "content_hash": "040f35dc604602ad79efda49849027dd", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 80, "avg_line_length": 38.668539325842694, "alnum_prop": 0.6280691558913265, "repo_name": "dongjoon-hyun/tensorflow", "id": "c476cd4e00d621bbf694b27236d82f18e8699c8c", "si...
""" Various helper functions for plotting. """ import numpy as np from replot import adaptive_sampling from replot import exceptions as exc def plot_function(data, *args, **kwargs): """ Helper function to handle plotting of unevaluated functions (trying \ to evaluate it nicely and rendering the p...
{ "content_hash": "201dafe331592dca3ab6ec3ca63a3a80", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 36.2093023255814, "alnum_prop": 0.630057803468208, "repo_name": "Phyks/replot", "id": "ecb686ac81457f0f4d315e56150dd9cfed849c7a", "size": "1557", "...