text
stringlengths
4
1.02M
meta
dict
import subprocess from collections import namedtuple from .tools import is_exe, NotExecutableError # factory class for bowtie build class returned values # the order of the outfiles is defined in the build_command self._outfnames # index - this is the index file generated. # stderr Results = namedtuple("...
{ "content_hash": "70432ddd99462c89a9223e55a64a6636", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 75, "avg_line_length": 34.86538461538461, "alnum_prop": 0.5626034197462769, "repo_name": "widdowquinn/THAPBI-pycits", "id": "224c77c26fd547c465e4813cdeb1c8feadda550b", "siz...
__author__ = 'Kamo Petrosyan' class Offer: """ url URL страницы товара. Максимальная длина URL — 512 символов. Необязательный элемент для магазинов-салонов. price Цена, по которой данный товар можно приобрести. Цена товарного предложения округляется, формат, в котором она отображается, зависи...
{ "content_hash": "ea7168b0ac0c6bb7769e776f63ab31b0", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 232, "avg_line_length": 42.18589743589744, "alnum_prop": 0.7310439142987388, "repo_name": "Haikson/virtenviro", "id": "9463fd06374f46ead147b876fed3cc369e906702", "size": "...
from flask import jsonify, json """ Helper functions used in the app. """ def json_data(req): """(flask.request) -> dict Returns a dict representing the json request submitted to /email. """ return {k: v.strip() for k, v in req.get_json().iteritems()} def get_services(email, app): """(Email) -> list R...
{ "content_hash": "bffdf504a34638e1f3cbcad802a3e5c4", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 104, "avg_line_length": 25.144736842105264, "alnum_prop": 0.6708529565672423, "repo_name": "wa3l/mailr", "id": "caf8f556420d1c325f75a3fc3079748c1ce207cf", "size": "1911", ...
from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import UnsupportedAlgorithm, _Reasons from cryptography.hazmat.backends.interfaces import ( CMACBackend, CipherBackend, DERSerializationBackend, DSABackend, EllipticCurveBackend, HMACBac...
{ "content_hash": "b1d3b1e56c3eb7042e8ccb3b4dc17160", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 78, "avg_line_length": 38.99441340782123, "alnum_prop": 0.6228510028653295, "repo_name": "ARMmbed/yotta_osx_installer", "id": "9db32aa56530727dd6f66c62083038216b1c5e1a", "...
import sys from fs.opener import opener from fs.commands.runner import Command from fs.utils import print_fs class FSTree(Command): usage = """fstree [OPTION]... [PATH] Recursively display the contents of PATH in an ascii tree""" def get_optparse(self): optparse = super(FSTree, self).get_optparse()...
{ "content_hash": "7be0e0238be1807dc6402feb44de5993", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 106, "avg_line_length": 42.78082191780822, "alnum_prop": 0.4748639129042587, "repo_name": "PyFilesystem/pyfilesystem", "id": "bbb88b554fe5c96f414a090b3ad8f51f25dcd7e1", "si...
def change_base(arr, base): r = reversed(arr) total = 0 for i, val in enumerate(r): total += val * pow(base,i) return total def next_permutation(length): initial = None for p in permutation(length-2): yield [1] + p + [1] def permutation(length): for prefix in xrange(2): if length == 1: ...
{ "content_hash": "6494b283602832eb542442b12582e6b3", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 54, "avg_line_length": 23.677966101694917, "alnum_prop": 0.60773085182534, "repo_name": "clemus90/competitive-programming", "id": "d6d5fab0ed32fb8e28016212da42eff605639e44", ...
"""Volume snapshot interface (1.1 extension).""" import six try: from urllib import urlencode except ImportError: from urllib.parse import urlencode from cinderclient import base class Snapshot(base.Resource): """A Snapshot is a point-in-time snapshot of an openstack volume.""" def __repr__(self): ...
{ "content_hash": "0ee9916ecf6189dbd21117a76546d0fa", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 79, "avg_line_length": 31.04032258064516, "alnum_prop": 0.58482722785139, "repo_name": "ntt-sic/python-cinderclient", "id": "4e16ba81d97742e91de0d315e57bc5d79f121995", "si...
from ..wildchain import *
{ "content_hash": "6cf6fac213f3d2abe7737f068a25a1fc", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.7307692307692307, "repo_name": "rtfd/sphinx-autoapi", "id": "a26276a0ec1eaa078ea734e347cb462c2c34ee9b", "size": "26", "binary": ...
import re import sys import time import socket import inspect import datetime import traceback from flask import render_template, request, json from flask.ext import login from pyspider.libs import utils, sample_handler, dataurl from pyspider.libs.response import rebuild_response from pyspider.processor.project_module...
{ "content_hash": "39601b13fea2478ccf175e4edbe0d38b", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 99, "avg_line_length": 31.55440414507772, "alnum_prop": 0.5742200328407225, "repo_name": "giantoak/pyspider", "id": "281a0ca1635744d94be9f28f6209af4da7c137ee", "size": "62...
from gotham import Gotham from toaster import Toaster from nashville import Nashville from lomo import Lomo from kelvin import Kelvin
{ "content_hash": "121d32e19e3e38cd830650b3f3f7faee", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 31, "avg_line_length": 26.6, "alnum_prop": 0.8571428571428571, "repo_name": "kevinmel2000/instagram-filters", "id": "052a6797b3cfa2cdf864382666d65c8dbd137edf", "size": "133"...
from django.contrib import admin from forex.models import Currency, CurrencyPrice class CurrencyAdmin(admin.ModelAdmin): search_fields=["name", ] list_display = ('name', 'symbol', 'digits', 'num_code', 'ascii_symbol') admin.site.register(Currency, CurrencyAdmin) class CurrencyPriceAdmin(admin.ModelAdmin): ...
{ "content_hash": "ebf54ca469a9cd1a09aa3d14703ab9f1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 33.57142857142857, "alnum_prop": 0.7340425531914894, "repo_name": "Valuehorizon/valuehorizon-forex", "id": "f27e567ea795f10adfc10e083d7e0c5fef1c2c54", ...
"""Tools for working with MongoDB `ObjectIds <http://dochub.mongodb.org/core/objectids>`_. """ import binascii import calendar import datetime try: import hashlib _md5func = hashlib.md5 except ImportError: # for Python < 2.5 import md5 _md5func = md5.new import os import random import socket import st...
{ "content_hash": "aaf84c08e520cdcd8b84fe9519edf2a4", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 78, "avg_line_length": 30.63898916967509, "alnum_prop": 0.5638034641215978, "repo_name": "Mitali-Sodhi/CodeLingo", "id": "bd8c7e77aedc8d0cb4f3ca445f64d2dee6d4832b", "size"...
import json import urlparse from django.http import HttpResponse from django.http import HttpResponseRedirect, QueryDict from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateView from django.core.exceptions import ObjectDoesNotExist from oauth2.models import Client from . imp...
{ "content_hash": "6cddf5249e7550a53a0013fb75f1c144", "timestamp": "", "source": "github", "line_count": 628, "max_line_length": 83, "avg_line_length": 33.92993630573248, "alnum_prop": 0.6146987047118453, "repo_name": "Kalyzee/django-oauth2-provider", "id": "fc177bcf97be8a963a6d9c02ead2394e4a291bfa", ...
import os import time import warnings from asgiref.local import Local from django.apps import apps from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import ...
{ "content_hash": "4037b1d8933715606a4a12a77a553f21", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 93, "avg_line_length": 32.52427184466019, "alnum_prop": 0.6607462686567164, "repo_name": "theo-l/django", "id": "2ddb425f4c7bca44188a5a73624060e6bd568b59", "size": "6700",...
"""JSON implementations of cataloging searches.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allowed ...
{ "content_hash": "f42ae0a148b983b38db23f9a29a3fc5b", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 108, "avg_line_length": 40.90972222222222, "alnum_prop": 0.6610083177728738, "repo_name": "mitsei/dlkit", "id": "3901de850b16c54978427740f41363489e47c4f0", "size": "5891",...
""" This is the Bokeh charts testing interface. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with thi...
{ "content_hash": "91e05a96161b08a6e0f879514a957d32", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 37.17857142857143, "alnum_prop": 0.40634005763688763, "repo_name": "quasiben/bokeh", "id": "81719bdbbdc647e9f16b84bcb73c4a73a0aba4f9", "size": "1041"...
"""ialm_test.py """ import os import sys import unittest import numpy as np sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),'..')) import core.ialm as ialm class IALMTesting(unittest.TestCase): """Testcase for the IALM method. """ def setUp(self): """Load data. ...
{ "content_hash": "d51d9efe112b70ea9c850face140a5aa", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 82, "avg_line_length": 22.236842105263158, "alnum_prop": 0.5952662721893491, "repo_name": "matthieuheitz/TubeTK", "id": "faf46e907c53fc4b546ab526c344ea5873f9dd25", "size": ...
""" Implements the plugin API for MkDocs. """ from __future__ import annotations import logging import sys from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generic, List, MutableMapping, Optional, Tuple, Type, TypeVar, overload, ) if sys.version_info >= (3, 10)...
{ "content_hash": "6916d03e7bee51a0a98296b88ef3631d", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 114, "avg_line_length": 34.346007604562736, "alnum_prop": 0.6291929591497841, "repo_name": "mkdocs/mkdocs", "id": "63fdcb81cd9a67b048f87349f45b1c227888ba43", "size": "1806...
import frappe from frappe.deferred_insert import deferred_insert, save_to_db from frappe.tests.utils import FrappeTestCase class TestDeferredInsert(FrappeTestCase): def test_deferred_insert(self): route_history = {"route": frappe.generate_hash(), "user": "Administrator"} deferred_insert("Route History", [route_h...
{ "content_hash": "ba612782538967440af55941b18fec8c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 76, "avg_line_length": 34.416666666666664, "alnum_prop": 0.7651331719128329, "repo_name": "frappe/frappe", "id": "4f27bef4f0b1449f97b9521aacbefa162b3ab9d8", "size": "413", ...
from __future__ import absolute_import import calendar from datetime import datetime, timedelta import pytz import requests import six from django.conf import settings from sentry.utils.compat.mock import patch from sentry.utils import json from sentry.models import GroupHash, GroupRelease, Release from sentry.tsdb....
{ "content_hash": "13fb7473edf86cfd822393967ea56135", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 98, "avg_line_length": 37.03541666666667, "alnum_prop": 0.5104910839849244, "repo_name": "beeftornado/sentry", "id": "111fa2272d0ab1e91ec9ae6c66a28ef06f1c6069", "size": "1...
import json import re import logging from bs4 import BeautifulSoup from datafeeds.parser_base import ParserBase class UsfirstMatchesParser2003(ParserBase): @classmethod def parse(self, html): """ Parse the table that contains qualification match results. Note that 2002 match tables a...
{ "content_hash": "e1d0dfd2a2020efd918e0cdc22f6fc29", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 159, "avg_line_length": 45.35036496350365, "alnum_prop": 0.45163367133429905, "repo_name": "bdaroz/the-blue-alliance", "id": "8c095015fab6e6d0e01f4c56c03292fc7048ce1f", "s...
"""Tests for the extractoutput preprocessor""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from .base import PreprocessorTestsBase from ..extractoutput import ExtractOutputPreprocessor class TestExtractOutput(PreprocessorTestsBase): """Contains test func...
{ "content_hash": "af361a2bcc37aec88b725372d3c0e5b5", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 67, "avg_line_length": 37.4, "alnum_prop": 0.660873440285205, "repo_name": "mattvonrocketstein/smash", "id": "b54dbb53f69f44ec999b8590402e70cf0e968d2a", "size": "2244", "...
import logging import traceback import time from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.hooks import RedisHook class List2DictTransformer(BaseOperator): """ This Operator is used to evaluate List data and converts the input data to dict provided as skele...
{ "content_hash": "1f56f6498db0467d384b2dc7629af1c6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 172, "avg_line_length": 31.544303797468356, "alnum_prop": 0.7158908507223114, "repo_name": "vipul-tm/DAG", "id": "4f7018dbeb6e6eb5ef6fc60f9fce1b412fd85469", "size": "2492",...
import ShareYourSystem as SYS #Represent a simple object @SYS.RepresenterClass() class MakerClass(SYS.InitiatorClass): RepresentingKeyStrsList=['MadeMyInt'] def default_init(self, _MakingMyFloat=0., _MadeMyInt=0 ): pass #Definition a simple instance SimpleMaker=MakerClass(_MakingMyFloat=2.) ...
{ "content_hash": "6bef8a1bc206370e3c0b13ac187d9f38", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 22.06, "alnum_prop": 0.7688123300090662, "repo_name": "Ledoux/ShareYourSystem", "id": "1c373fcd7f1fd2a3fcc37af154dcfa67cf59996a", "size": "1118", "...
DOCUMENTATION = ''' --- inventory: openshift short_description: Openshift gears external inventory script description: - Generates inventory of Openshift gears using the REST interface - this permit to reuse playbook to setup an Openshift gear version_added: None author: Michael Scherer ''' try: import json ex...
{ "content_hash": "be98c0f6e15f8adc879dfe87c3e44256", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 95, "avg_line_length": 30.36904761904762, "alnum_prop": 0.6640533124264995, "repo_name": "abtreece/ansible", "id": "479b8085d61c7a269b018d0bc213ced0cb7d5660", "size": "3274...
from __future__ import print_function try: from StringIO import StringIO except ImportError: # pragma: nocover from io import StringIO from mock import patch from ploy.common import InstanceHooks, BaseInstance, StartupScriptMixin from ploy.config import Config, StartupScriptMassager import os import pytest c...
{ "content_hash": "d41d9a88aa15418c6e50c4da63264f1f", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 89, "avg_line_length": 35.38425925925926, "alnum_prop": 0.5500457935365695, "repo_name": "fschulze/ploy", "id": "d0d4cd01c8b95b7cdc834623e8c1af6fdebabb52", "size": "7643",...
from textcom.alien import ALIEN_DEFAULT_ITEMS, \ ALIEN_RANKS, \ ALIEN_SPECIES, \ Alien, \ ...
{ "content_hash": "f135a2678335539a506ae0f8c9249e5b", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 41.64835164835165, "alnum_prop": 0.49709762532981533, "repo_name": "flimberger/textcom", "id": "b80edcbe951d84ad062fbc91327cc0042fdb4861", "size": "4...
""" PyGeoj **Version: 0.1.0** **Date: July 25, 2014** **Author: [Karim Bahgat](https://uit.academia.edu/KarimBahgat)** **Contact: karim.bahgat.norway@gmail.com** **Homepage: https://github.com/karimbahgat/pygeoj** ## Table of Content - [About](#about) - [System Compatibility](#system-compatibility) - [Depend...
{ "content_hash": "0b1f38fbc4fbbe748f13063a5ad1502f", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 112, "avg_line_length": 22.714285714285715, "alnum_prop": 0.7202625102543068, "repo_name": "karimbahgat/PythonGis", "id": "43e0098fd935cf31bfafc1b9935cbec1a4ab931a", "size...
import torch.nn as nn import torch as T import torch.nn.functional as F import numpy as np import torch from torch.autograd import Variable import re import string def recursiveTrace(obj): print(type(obj)) if hasattr(obj, 'grad_fn'): print(obj.grad_fn) recursiveTrace(obj.grad_fn) elif hasattr(obj, 'save...
{ "content_hash": "ff726bfa392a1d53fb3d3b2b2e43afa5", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 91, "avg_line_length": 26.196319018404907, "alnum_prop": 0.6320843091334895, "repo_name": "ixaxaar/pytorch-dnc", "id": "fc246d7fe7a2a31f217d0c31feec3326d6b41be9", "size": ...
import random from keystoneclient import exceptions as k_exceptions from keystoneclient.v2_0 import client as k_client from oslo_config import cfg from oslo_utils import importutils from oslo_utils import timeutils from sqlalchemy.orm import exc from sqlalchemy.orm import joinedload from neutron.common import excepti...
{ "content_hash": "0bee58ffc910eb3836880818ed89f379", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 79, "avg_line_length": 46.84421052631579, "alnum_prop": 0.5692328434677093, "repo_name": "rdo-management/neutron", "id": "e8c3a8187f286082736268f75e0aa258ad945dcf", "size"...
import logging import optparse import time from pytries import Trie def fill(trie, data_file): ''' Initialize the Trie with the content of a file. The file should have a word per line ''' data = open(data_file,'r') for line in data: trie[line.strip()]=True data.close() def main()...
{ "content_hash": "1c0b9e043d8116c5340fd57323b2540a", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 69, "avg_line_length": 23.48076923076923, "alnum_prop": 0.5577395577395577, "repo_name": "laucia/pyTries", "id": "fc54778592066f3225f60f474729b91125ea0a90", "size": "1221",...
from unittest import TestCase import pandas as pd from alphaware.base import (Factor, FactorContainer) from alphaware.enums import (FactorType, OutputDataFormat, FreqType, FactorNormType) from alphaware.an...
{ "content_hash": "75dffc9f930cb7274709d773ed05634d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 114, "avg_line_length": 50.473684210526315, "alnum_prop": 0.5656934306569343, "repo_name": "iLampard/alphaware", "id": "0d14d6a40c50ddd85cae61d59e93b8d3eb67704a", "size": "...
from eden.converter.fasta import fasta_to_sequence from eden.converter.fasta import sequence_to_eden def test_fasta_to_sequence_graph(): fa_fn = "test/test_fasta_to_sequence.fa" seq = fasta_to_sequence(fa_fn) sequence_to_eden(seq)
{ "content_hash": "07dbaafbfb0ed93c7ab192701e7e92a3", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 50, "avg_line_length": 30.625, "alnum_prop": 0.7346938775510204, "repo_name": "antworteffekt/EDeN", "id": "1f02b6ff43ae3833a551a35962417744c3c4b013", "size": "245", "binar...
import logging import optparse import os import sys import traceback from webkitpy.common.host import Host from webkitpy.layout_tests.controllers.manager import Manager from webkitpy.layout_tests.models import test_run_results from webkitpy.layout_tests.port import configuration_options, platform_options from webkitpy...
{ "content_hash": "4773988ece0f0f3fc86cad3ed13ec578", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 154, "avg_line_length": 54.03621169916435, "alnum_prop": 0.6373524408474663, "repo_name": "hgl888/crosswalk-android-extensions", "id": "83a81417478af1be045890904fc0fc4d2a1f2...
import os import datetime import json from tempfile import NamedTemporaryFile from django.db import models from django.core.files import File from django.core.urlresolvers import reverse from django.test import TestCase from django.utils.text import capfirst import file_picker class Image(models.Model): """ ...
{ "content_hash": "2b3c95c23e7a235f44ea051f42e29a4d", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 109, "avg_line_length": 37.37847222222222, "alnum_prop": 0.5902461681374825, "repo_name": "caktus/django-file-picker", "id": "9da10a30c6986a6897327afd2ea1e938f1c5e402", "s...
from utils.exec_command import call_subprocess ############################################################################### # def do(action_context): # Persistent configuration of hostname is simply content of # `/etc/hostname` file. # Use `w` to overwrite content of the file. with open('/etc/host...
{ "content_hash": "ac6769da2da82a3501e380efcb3df29c", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 30.137931034482758, "alnum_prop": 0.4462242562929062, "repo_name": "uvsmtid/common-salt-states", "id": "68503d0752732e63b6436011701b9661aa4f9ff0", "s...
import IPython import time import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar from matplotlib.figure import Figure import matplotlib...
{ "content_hash": "eece509e822da0104126e342037418ec", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 112, "avg_line_length": 35.80882352941177, "alnum_prop": 0.5907597535934291, "repo_name": "ColumbiaCMB/kid_readout", "id": "b7be96fac9318883ec65728ae15ae642e16f9774", "siz...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
{ "content_hash": "64fa8eefa90429f03f16719042ad595a", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 173, "avg_line_length": 39.74226804123711, "alnum_prop": 0.5875486381322957, "repo_name": "Quikling/gpdb", "id": "6157af3d0edf2754eee689d7baabd29133674799", "size": "3878",...
from __future__ import absolute_import, division, unicode_literals from . import _base try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict class Filter(_base.Filter): def __iter__(self): for token in _base.Filter.__iter__(self): if token['...
{ "content_hash": "8c18fd0ce24f315155e9a1a087b709e9", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 66, "avg_line_length": 31.2, "alnum_prop": 0.5448717948717948, "repo_name": "mozilla/fjord", "id": "70e7f7a2856b28055069421a71f5adb514841c17", "size": "624", "binary": fa...
from django import forms from django_select2 import * from .models import Employee, Dept, ClassRoom, Lab, Word, School, Tag, Question, WordList from .fields import GetSearchTestField, GetModelSearchTestField from django.core.exceptions import ValidationError def validate_fail_always(value): raise ValidationErr...
{ "content_hash": "692526b3c869a035c4214ed4e25a551f", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 128, "avg_line_length": 34.365591397849464, "alnum_prop": 0.6473717146433041, "repo_name": "jrief/django-select2", "id": "f7c4a8d8f20ea111d496ad9b0cf9e05fd63000c9", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('face', '0006_auto_20170403_1707'), ] operations = [ migrations.AlterField( model_name='face', name='adivasi', fi...
{ "content_hash": "172021aaa644deaff073fc06f3924175", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 122, "avg_line_length": 27.17391304347826, "alnum_prop": 0.592, "repo_name": "PARINetwork/pari", "id": "47da464b17dd5ba5005416c4b3e13ae34388a77c", "size": "649", "binary"...
{% if created %}from django.db import models{% endif %} class {{model_name}}(models.Model): def __unicode__(self): return self.title user = models.CharField(max_length=200, db_index=True) title = models.CharField(max_length=100) #description = models.TextField(blank=False, null=False...
{ "content_hash": "f96a7828e1361c1953a63ff34aac49c3", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 106, "avg_line_length": 31.7027027027027, "alnum_prop": 0.6376811594202898, "repo_name": "TangentMicroServices/PyMicroUtils", "id": "aef04376db505c04e3bc47268e36fe46232d1760"...
from __future__ import absolute_import, division, print_function import operator from toolz import first import numpy as np from datashape import dshape, var, DataShape from dateutil.parser import parse as dt_parse from datashape.predicates import isscalar, isboolean, isnumeric from datashape import coretypes as ct, d...
{ "content_hash": "b98711ffc683fe38f1a88f8dda7a67ec", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 78, "avg_line_length": 24.048034934497817, "alnum_prop": 0.6247503177773742, "repo_name": "mrocklin/blaze", "id": "66fca34e08c21066288cab619d2fa6e2c40fd9ae", "size": "1101...
from memory_profiler import memory_usage def some_func(*args, **kwargs): return args, kwargs def test_memory_usage(): # Check that memory_usage works with functions with star args. mem, ret = memory_usage((some_func, (1, 2), dict(a=1)), retval=True) assert ret[0] == (1, 2) assert ret[1] == dict(...
{ "content_hash": "e1d56c92c4e43abe27c454de3fc6b3aa", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 72, "avg_line_length": 25.133333333333333, "alnum_prop": 0.6259946949602122, "repo_name": "olivetree123/memory_profiler", "id": "2b98a414a8fb7f234b7f958607122a1fdd9357b5", ...
""" Generic date range views. Django's generic date views only deal with a single date per model. The date range views replicate the API but deal with a start and an end date. """ import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import Http404 ...
{ "content_hash": "d0dfa70746658ad1746647f870d954bb", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 103, "avg_line_length": 33.95636363636363, "alnum_prop": 0.6059113300492611, "repo_name": "sha-red/django-shared-utils", "id": "8d1e66272600bd92977678df044be14eaf20f1cb", ...
""" WSGI config for atlas_site project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
{ "content_hash": "d18473d90d1466765214d6505e5a8faf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.5625, "alnum_prop": 0.7684478371501272, "repo_name": "flaviodrt/atlas_site", "id": "cd15ab1d8a8030aaa2681f9593a1b2faabdbc1fc", "size": "393", "b...
import re import socket import string import errno class SqueakNetException(Exception): """ Exception class for SqueakNet errors """ def __init__(self, errormessage,errnum): self.errmsg = errormessage self.errnum = errnum def __str__(self): return "SqueakNetException[%d]: %s...
{ "content_hash": "9a399cc7c357a0b95330ee4be99e0780", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 122, "avg_line_length": 36.37003058103976, "alnum_prop": 0.6077524594299167, "repo_name": "phb/squeakfs", "id": "d3640c2710d7aaaa39f44a56ab9e05ebc85c81bb", "size": "11893"...
""" Provides support to auto-tuning networks using AutoTVM. """ import os.path import logging import time from copy import deepcopy from typing import Any, Optional, Dict, List, Union from urllib.parse import urlparse import tvm from tvm import autotvm, auto_scheduler from tvm.auto_scheduler.search_task import Hardwa...
{ "content_hash": "67398f853d72f50544a7d65d743d9d8e", "timestamp": "", "source": "github", "line_count": 678, "max_line_length": 99, "avg_line_length": 35.32005899705015, "alnum_prop": 0.6351526287217606, "repo_name": "Laurawly/tvm-1", "id": "8f14c80b9695aabf73b1f4ddc79563376b619f7b", "size": "24732...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('build', '0017_auto_20180904_1457'), ] operations = [ migrations.AddField( model_name='rebuild', name='qa_comment', ...
{ "content_hash": "23818c9d6621a46fc51c2c88c037a207", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 21.5, "alnum_prop": 0.5917312661498708, "repo_name": "SalesforceFoundation/mrbelvedereci", "id": "dd45594c22d684ec7413c97e8bc5c93037364458", "size": ...
""" This sub-module provides a collection of filters for providing linq-style programming (inspired by RxPy). Each function appears as a method on the OutputThing base class, allowing for easy chaining of calls. For example:: sensor.where(lambda x: x > 100).select(lambda x: x*2) If the @filtermethod decorator is...
{ "content_hash": "33452c1ded3c37cb713cc93a5309a207", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 79, "avg_line_length": 35.125, "alnum_prop": 0.7381799694966955, "repo_name": "mpi-sws-rse/thingflow-python", "id": "03602b5a9e42c6a836e595fb86212124b2db7f82", "size": "206...
import re class SandhiRule: def __init__(self, rule, tags=None): """ rule is string of form A|B>C<D|E tags is set of strings annotating the rule for later filtering, etc. """ self.tags = tags or set() self.a, bcd, self.e = rule.split("|") self.b, cd = bcd.s...
{ "content_hash": "e96394f1e98e0fab9a3cbd81ba97cb08", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 79, "avg_line_length": 32.5609756097561, "alnum_prop": 0.5063670411985018, "repo_name": "jtauber/inflexion", "id": "8f661d61c5615c3a736d624d3707f1834d5d3d7b", "size": "1335...
from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from django.db.models import Count def fix_duplicate_attachments(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: """Migration 0041 had a bug, where...
{ "content_hash": "01f4aebc49a6a787b365dff9ebd3ae67", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 111, "avg_line_length": 46.45454545454545, "alnum_prop": 0.6854207436399217, "repo_name": "shubhamdhama/zulip", "id": "c82684d52d025e52bd57a8ce5d27c8b78e952db7", "size": "2...
from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.protocol.TBase import TBase, TExceptionBase class NotFoundError(TExceptionBase): """ Attributes: - key """ __slots__ = [ 'key', ] thrift_spec = ( None, # 0 (1, TType.STRING, 'key', None, None,...
{ "content_hash": "e965dfbc2b4150e559d844622238c2bd", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 80, "avg_line_length": 16.46875, "alnum_prop": 0.5958254269449715, "repo_name": "Willyham/tchannel-python", "id": "9c2219cf28f241b5104e3cc2193a9193635e092e", "size": "1807"...
import collections import pandas as pd def get_sec(timestamp): """ This function receives a timestamp in HH:MM:SS format and returns the number of seconds :param timestamp: the timestamp (i.e. call duration) """ call_length = timestamp.split(':') # Split timestamp on colon return int(call...
{ "content_hash": "7084d30ec0b31530548f66f88ea497da", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 94, "avg_line_length": 35.51724137931034, "alnum_prop": 0.6364077669902912, "repo_name": "brandonwolfgang/CEN4350-open-source-web-technologies", "id": "535ebed77813e4683c1c35...
""" This bot goes over multiple pages of a wiki, and edits them without changes. This is for example used to get category links in templates working. Command-line arguments: -purge Purge the page instead of touching it Touch mode (default): -botflag Force botflag in case of edit...
{ "content_hash": "b54cf726cc2df5be559b5526270f8d5a", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 77, "avg_line_length": 27.228070175438596, "alnum_prop": 0.6156572164948454, "repo_name": "wikimedia/pywikibot-core", "id": "292f8ad11841c231d5ff8d36d791a25513b2019e", "si...
"""Support for the Netatmo Weather Service.""" import logging import threading from datetime import timedelta from time import time import pyatmo import requests import urllib3 import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA fro...
{ "content_hash": "c1cb3b86c3a61ec01c4cb27a08d1fb8e", "timestamp": "", "source": "github", "line_count": 622, "max_line_length": 88, "avg_line_length": 37.9903536977492, "alnum_prop": 0.518874312314854, "repo_name": "joopert/home-assistant", "id": "1ae076c6560775bf6285ac9e8e2d95b19af112c0", "size": ...
"""Contains ModelAdmin classes for the habits app. Classes: [UserHabitInline, HabitAdmin, ScheduleAdmin] """ from django.contrib import admin from .models import Habit, UserHabit, Schedule class UserHabitInline(admin.TabularInline): model = UserHabit extra = 1 class HabitAdmin(admin.ModelAdmin): """De...
{ "content_hash": "975424cabd8f4cb44a039399c8ad19c0", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 28, "alnum_prop": 0.6795366795366795, "repo_name": "prathapsridharan/health_project", "id": "a6314f8e8a91b06eb416d705ee728820e9792105", "size": "1036...
from django.db import models from django.contrib.sites.models import Site as Site_django class Organization(models.Model): """ Describing an Organization that uses geonition services """ name = models.CharField(max_length=50, primary_key=True) class Site(models.Model): ...
{ "content_hash": "1325c2fd3c81112ce260ed8b42f82e8f", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 130, "avg_line_length": 32.745098039215684, "alnum_prop": 0.611377245508982, "repo_name": "geonition/geonition_organization_management", "id": "d9b9596541219c0411edafb4c90094...
from __future__ import print_function from bcc import BPF from sys import argv import sys import socket import os #args def usage(): print("USAGE: %s [-i <if_name>]" % argv[0]) print("") print("Try '%s -h' for more options." % argv[0]) exit() #help def help(): print("USAGE: %s [-i <if_name>]" % a...
{ "content_hash": "e76adede44dedd00ebac74df3123c193", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 97, "avg_line_length": 33.81294964028777, "alnum_prop": 0.5717021276595745, "repo_name": "iovisor/bcc", "id": "9d1e9aab01cfb436205ae54d3a392af4c5b90eb1", "size": "5260", ...
import rdtest import renderdoc as rd class D3D11_Mesh_Zoo(rdtest.TestCase): demos_test_name = 'D3D11_Mesh_Zoo' def __init__(self): rdtest.TestCase.__init__(self) self.zoo_helper = rdtest.Mesh_Zoo() def check_capture(self): self.zoo_helper.check_capture(self.capture_filename, self...
{ "content_hash": "02202e1086524c3c9cb11cd9680bdd78", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 25.615384615384617, "alnum_prop": 0.6696696696696697, "repo_name": "baldurk/renderdoc", "id": "c694240b32036e44b5d63198e493be43b28cd3b2", "size": "33...
import os from twisted.cred import portal from epsilon.scripts import certcreate from axiom import errors as userbase from axiom.scripts import axiomatic from axiom.dependency import installOn from xmantissa import website from sine import confession class Install(axiomatic.AxiomaticSubCommand): longdesc = """ ...
{ "content_hash": "dd94187a7b7844fd696428ba69f2da06", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 90, "avg_line_length": 29.6875, "alnum_prop": 0.6112280701754386, "repo_name": "habnabit/divmod-sine", "id": "c554099fbac2d664a0be849629e0ff5364a2a703", "size": "1425", "...
from urllib.request import urlopen from bs4 import BeautifulSoup html = urlopen("http://www.pythonscraping.com/pages/page1.html"); bsObj = BeautifulSoup(html.read(), "html.parser") print(bsObj.h1)
{ "content_hash": "841d6058b6d83f78cc362533e81525ac", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 65, "avg_line_length": 39.4, "alnum_prop": 0.7766497461928934, "repo_name": "fairesy/web-scraping-with-python", "id": "8332222fea628c205d08f2620b9e7f04c4399c99", "size": "19...
import pytest import ray import ray.cluster_utils @pytest.mark.parametrize( "ray_start_regular", [{"local_mode": True}, {"local_mode": False}], indirect=True ) def test_args_force_positional(ray_start_regular): def force_positional(*, a="hello", b="helxo", **kwargs): return a, b, kwargs class Te...
{ "content_hash": "aa0242cf460ca63c5e54307feef0821d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 88, "avg_line_length": 35.96629213483146, "alnum_prop": 0.6494845360824743, "repo_name": "ray-project/ray", "id": "4ebe4ce2f5496f230eb066e5e2f4e42bdf607d0e", "size": "3217"...
"""The module contains functionality for working with json templates""" import copy import json import os from lib.constants import url from lib.constants import objects class TemplateProvider(object): """Processes json templates""" RELATIVE_PATH_TEMPLATE = "template/{0}.json" parsed_data = dict() @staticm...
{ "content_hash": "9bc49b5f850d1177c5624865e093f4ca", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 31.071428571428573, "alnum_prop": 0.6743295019157088, "repo_name": "selahssea/ggrc-core", "id": "a908d622644d0666f4a318b96982725296b3bf8d", "size": "...
from .companies_house import ch_client from .ops import ops_client from .twitter import twitter_handler from .html_scraper import html_scraper
{ "content_hash": "1953a3f4012978cf5bd98b14d386d781", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 35.75, "alnum_prop": 0.8181818181818182, "repo_name": "nestauk/inet", "id": "985ff7393aa2fc71f6bd48abc160a4ae814caaa5", "size": "143", "binary": fal...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_space_greeter_dantooine_old_pilot.iff" result.attribute_template_id = 9 result.stfName("npc_name","human_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "04907d3ba5a3e8be3453e432fca7c4ce", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 24.076923076923077, "alnum_prop": 0.6996805111821086, "repo_name": "obi-two/Rebelion", "id": "a54a4a36a8ba9c66722a737a94da9405b6150f4b", "size": "458...
import types from SmartMeshSDK.ApiException import CommandError import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('ApiDefinition') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) class FieldFormats(object): ''' \brief Enumeration of p...
{ "content_hash": "bf77a7034e65e5b9e774a9134453f28b", "timestamp": "", "source": "github", "line_count": 746, "max_line_length": 105, "avg_line_length": 38.76005361930295, "alnum_prop": 0.5423828462735605, "repo_name": "realms-team/solmanager", "id": "9ccec45e2d24e03ff3ab902f619e5612e695af8b", "size...
from pyvows import Vows, expect @Vows.batch class AssertionInclude(Vows.Context): class WhenItIsAString(Vows.Context): def topic(self): return "some big string" def we_can_find_some(self, topic): expect(topic).to_include('some') def we_can_find_big(self, topic): ...
{ "content_hash": "5dfc5f03e9d1508f070dc5a605e85687", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 95, "avg_line_length": 30.44705882352941, "alnum_prop": 0.5768933539412674, "repo_name": "marcelometal/pyvows", "id": "1150804d746eb1daa5260f3647b789d1dfe7de6b", "size": "2...
from __future__ import absolute_import from cubes.browser import * from cubes.errors import * from cubes.model import * from .store import DEFAULT_TIME_HIERARCHY from .utils import * from collections import defaultdict from datetime import datetime import pytz class _MixpanelResponseAggregator(object): def __in...
{ "content_hash": "f0d8a14c7c78b8f88f8b8a83b474ffaf", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 148, "avg_line_length": 37.691542288557216, "alnum_prop": 0.5818373812038015, "repo_name": "DataBrewery/cubes-mixpanel", "id": "1a5734dea82122b77c95351190ebbe095b1b7d51", ...
import os import cv2 import numpy as np import sys import pickle from optparse import OptionParser import time from keras_frcnn import config import keras_frcnn.resnet as nn from keras import backend as K from keras.layers import Input from keras.models import Model from keras_frcnn import roi_helpers from keras_frcnn ...
{ "content_hash": "1c29a0a3629ad53dcfadcaa2697eb3da", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 115, "avg_line_length": 31.99298245614035, "alnum_prop": 0.5701908313226585, "repo_name": "npetrenko/recurrent_frcnn", "id": "34534bce4a8d1b77842ae486c84e9b4cb1fcb877", "s...
import nibabel as nib import numpy as np import logging from time import time import os.path as op from AFQ.definitions.utils import Definition, find_file from dipy.align import syn_registration, affine_registration import AFQ.registration as reg import AFQ.data.s3bids as afs from AFQ.tasks.utils import get_fname fro...
{ "content_hash": "8f9e25b0987e90199a72b81595cb491b", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 76, "avg_line_length": 33.51717171717172, "alnum_prop": 0.5867036345006329, "repo_name": "yeatmanlab/pyAFQ", "id": "2d2a15a1c0f03e1195f12469dc7d62002390fccd", "size": "165...
import requests from biicode.common.settings.fixed_string import FixedStringWithValue from biicode.client.exception import BiiException, ConnectionErrorException from requests.auth import AuthBase from requests.exceptions import ConnectionError, Timeout import urllib from biicode.common.utils.bii_logging import logger ...
{ "content_hash": "336402157ca57102d56f7453e21d9d05", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 99, "avg_line_length": 35.24561403508772, "alnum_prop": 0.6508213041314087, "repo_name": "biicode/client", "id": "bb7f240a2d445943513da36b376b0cfd7f490e73", "size": "4018"...
import zipfile as zipfile import os def IsPathValid(path, ignoreDir, ignoreExt): splited = None if os.path.isfile(path): if ignoreExt: _, ext = os.path.splitext(path) if ext in ignoreExt: return False splited = os.path.dirname(path).split('\\/') else:...
{ "content_hash": "7050debfaafddbdcda879594005ee4b5", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 138, "avg_line_length": 34.26136363636363, "alnum_prop": 0.6159203980099502, "repo_name": "tangziwen/Cube-Engine", "id": "4fc3326b96990b95f16c1ea3b4a9d41a59c92316", "size":...
from __future__ import absolute_import import requests import json from typing import Optional, Text from django.conf import settings from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import human_users_only from zerver.lib.push_notifications ...
{ "content_hash": "a9b11be0ab126ef8c9c5794b81c7bda8", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 86, "avg_line_length": 38.61290322580645, "alnum_prop": 0.7309941520467836, "repo_name": "vaidap/zulip", "id": "2959a2819870f186cbca5349e82a329d085840f1", "size": "2394", ...
from __future__ import unicode_literals from django.db import models class Tag(models.Model): name = models.CharField(max_length = 100) def __str__(self): return self.name class Category(models.Model): name = models.CharField(max_length = 100) def __str__(self): return self.name class Author(models.Model):...
{ "content_hash": "6517c38c874e8a586e9fa2f7284ae309", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 69, "avg_line_length": 30.272727272727273, "alnum_prop": 0.7327327327327328, "repo_name": "narsi84/digilib", "id": "a526779d2b822d6e000fecdfce1fb4d2d044b1ac", "size": "999"...
import os import ast import importlib import types import sys import json def activatefile(self, source, convention, SnafuFunctionSource): sourceinfos = None try: sourceinfos = SnafuFunctionSource(source) sourcecode = sourceinfos.content except: print("Warning: {} is not parseable, skipping.".format(source), ...
{ "content_hash": "d8a98a1529698e28b75f3b948a5aab15", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 108, "avg_line_length": 31.974025974025974, "alnum_prop": 0.6941510966693745, "repo_name": "serviceprototypinglab/snafu", "id": "3f165edbd914229a5a7d2a486bf03af21fcdd6e6", ...
from defaults import * from i18n import * from static import * from generic.date_based import *
{ "content_hash": "b3d6d3ae96976ed4ec14c5f1a9b63022", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 32, "avg_line_length": 23.75, "alnum_prop": 0.7789473684210526, "repo_name": "paulsmith/geodjango", "id": "2c8c5b4a92645d9147afbfa931ba05df9769b55f", "size": "95", "binary...
import argparse import pysam def get_reads(bam_file, reference_name,mapq=20): bamfile = pysam.AlignmentFile(bam_file) reads = bamfile.fetch(reference_name) count_total_ref = 0 for read in reads: if (read.mapping_quality >= mapq): count_total_ref += 1 head = bamfile.header fo...
{ "content_hash": "3313476b5cb777bb74c3a0e2cb37891f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 120, "avg_line_length": 41.44117647058823, "alnum_prop": 0.6394606103619588, "repo_name": "theboocock/ancient_dna_pipeline", "id": "ebfa7fb9e00cdb568ec3c22831489fe6f4bc036d",...
from __future__ import print_function, division, unicode_literals import argparse import os from astropy.io import votable from astropy.coordinates import SkyCoord from astropy import units import casda def parseargs(): """ Parse the command line arguments :return: An args map with the parsed arguments...
{ "content_hash": "c4fcfa1375e570eb0d87670a2755f168", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 172, "avg_line_length": 44.67142857142857, "alnum_prop": 0.6039334825711544, "repo_name": "csiro-rds/casda-samples", "id": "fed7e894c4ea46a62410f98982ce151f7fcb3094", "siz...
from mock import Mock from tests.testcase import TestCase from jobrunner.logbook import get_atoms_for_flow class TestGetAtomsForFLow(TestCase): def setUp(self): self.flow = Mock() self.persistence_backend = Mock() def test_get_atoms_for_flow_gets_atoms_for_flow(self): get_atoms_for_f...
{ "content_hash": "8cd8a0c84bffa7efa63294d8f9d381fe", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 28.64, "alnum_prop": 0.6759776536312849, "repo_name": "vdloo/jobrunner", "id": "40e97996b3775f0bc56e39065185f8084b21ddad", "size": "716", "binary":...
from model.new_user_data import N_u_d import random def test_new_contact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contact.Create() app.contact.Fill_in(N_u_d(namef="Rus", namem="Si", namel="An")) old_contacts = db.get_contact_list() contact = random.choice(old_contacts) ...
{ "content_hash": "9d5fabe1930cfc62b797ae5041d74e20", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 119, "avg_line_length": 42.529411764705884, "alnum_prop": 0.656984785615491, "repo_name": "SCLT1975/python_training", "id": "7103a3d22e1f798562fd17356d9c681b7eaa2c8d", "siz...
""" Display DNS resolution success on a configured domain. This module launch a simple query on each nameservers for the specified domain. Nameservers are dynamically retrieved. The FQDN is the only one mandatory parameter. It's also possible to add additional nameservers by appending them in nameservers list. The de...
{ "content_hash": "a7770ef4717d9119a9a87d76ca5a2a1d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 87, "avg_line_length": 29.45977011494253, "alnum_prop": 0.6082715567694108, "repo_name": "hburg1234/py3status", "id": "f91843e6a0f03d3f2ff31cf9852d5e35cbdcb0c6", "size": "2...
"""Person detection using Sighthound cloud service.""" import io import logging from pathlib import Path from PIL import Image, ImageDraw, UnidentifiedImageError import simplehound.core as hound import voluptuous as vol from homeassistant.components.image_processing import ( CONF_ENTITY_ID, CONF_NAME, CON...
{ "content_hash": "ebf71c071d0b2579df433397244c503b", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 88, "avg_line_length": 32.18079096045198, "alnum_prop": 0.6218398876404494, "repo_name": "sdague/home-assistant", "id": "e15fab1aaa3139f1c134249e497ecfff76efd0d5", "size":...
import argparse import sys import iptracker def main(args=None): if args is None: args = sys.argv[1:] parser = argparse.ArgumentParser(description='Track your IP in realtime') # parser.add_argument("--", help="increase output verbosity") iptracker.main(parser.parse_args()) if __name__ == "...
{ "content_hash": "e8f1426ef6ca126bef2d327c6a41fd02", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 77, "avg_line_length": 20.11764705882353, "alnum_prop": 0.652046783625731, "repo_name": "davidomil/IPTracker", "id": "7a85b42676b50030744a6ec166be74cca5c7168a", "size": "36...
import threading from django.contrib.sites.models import Site from django.conf import settings from django.http.request import split_domain_port _thread_local = threading.local() def current_request(): """ Provides access to the current request at deeper project levels. """ return getattr(_thread_l...
{ "content_hash": "3be4b9e8d51c1d0eb1423de4bbff3539", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 68, "avg_line_length": 24.81081081081081, "alnum_prop": 0.6612200435729847, "repo_name": "cdubz/timestrap", "id": "0ed04a0ae2cbf44ed4a786304d9ce7bcd8e1e509", "size": "918",...
from __future__ import print_function import time, sys, atexit from upm import pyupm_isd1820 as upmIsd1820 def main(): # Instantiate a ISD1820 on digital pins 2 (play) and 3 (record) # This example was tested on the Grove Recorder. myRecorder = upmIsd1820.ISD1820(2, 3) doRecord = False if len(sys...
{ "content_hash": "12bd3cd160c5ef9df1b92c902af7bbb8", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 71, "avg_line_length": 29.313725490196077, "alnum_prop": 0.65685618729097, "repo_name": "spitfire88/upm", "id": "726ba89b9b6e60aa61611ca32fec68f50b6223a2", "size": "2651", ...
from amaranth import Cat, Signal, signed from amaranth_cfu import all_words, SimpleElaboratable, tree_sum from .delay import Delayer from .post_process import PostProcessor from .registerfile import Xetter class Madd4Pipeline(SimpleElaboratable): """A 4-wide Multiply Add pipeline. Pipeline takes 2 addition...
{ "content_hash": "1e04f5c4089321ae0005f2be896e28e6", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 80, "avg_line_length": 30.208333333333332, "alnum_prop": 0.5793103448275863, "repo_name": "google/CFU-Playground", "id": "a4116d10a3b980cfbe41845d7484b514b68837a9", "size"...
from ray.rllib.evaluation.episode import MultiAgentEpisode from ray.rllib.evaluation.rollout_worker import RolloutWorker from ray.rllib.evaluation.policy_evaluator import PolicyEvaluator from ray.rllib.evaluation.interface import EvaluatorInterface from ray.rllib.evaluation.policy_graph import PolicyGraph from ray.rlli...
{ "content_hash": "44115c613c16bd9a6adb4b846d32de7e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 38.096774193548384, "alnum_prop": 0.79424216765453, "repo_name": "stephanie-wang/ray", "id": "f743cca647725ba7d2ad7c698990476c583a8ec3", "size": "118...
import unittest from unittest import mock from . import model, parts, signing, test_config def _get_identity_hash(i): if i == '[IDENTITY]': return 'identity' raise class TestGetParts(unittest.TestCase): def test_get_parts_no_base(self): config = test_config.TestConfig() all_pa...
{ "content_hash": "414e176198c7d03e8cc93e6d654888c5", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 102, "avg_line_length": 38.17910447761194, "alnum_prop": 0.5947028928850665, "repo_name": "nwjs/chromium.src", "id": "1735f4e4dbfdb4c88eded932a97ac0559bf899b7", "size": "1...
import os import subprocess as sp import sys from textwrap import dedent import pytest @pytest.fixture def cython_testpackage(tmpdir, request): """ Creates a trivial Cython package for use with tests. """ test_pkg = tmpdir.mkdir('test_pkg') test_pkg.mkdir('_eva_').ensure('__init__.py') test...
{ "content_hash": "269913b124729910957cc7ce40022b93", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 75, "avg_line_length": 25.15714285714286, "alnum_prop": 0.5718341851220897, "repo_name": "embray/astropy_helpers", "id": "64764929bec0fec873e66557b53043d0111fd638", "size":...
from past.builtins import basestring from builtins import * # noqa: F403, F401 from xml.etree import ElementTree class XmlDictObject(dict): """ Adds object like functionality to the standard dictionary. """ def __init__(self, initdict=None): if initdict is None: initdict = {} ...
{ "content_hash": "4cb13ad6e6647ff8415bf0cbae002716", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 94, "avg_line_length": 30.21897810218978, "alnum_prop": 0.585024154589372, "repo_name": "CI-WATER/tethys_dataset_services", "id": "4bbafe488d16bef693f835db669c88a16b6e4582",...
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from djangobmf.conf import settings from djangobmf.models import BMFModel from djangobmf.fields import CurrencyField from djangobmf...
{ "content_hash": "674a3666c843573f044435be53e72a3f", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 105, "avg_line_length": 33.142857142857146, "alnum_prop": 0.6426724137931035, "repo_name": "django-bmf/django-bmf", "id": "16ac2e2a4f15bd5d9415b39ea2c8b79e63b55294", "size...
from __future__ import absolute_import import six from six import reraise from six.moves import http_client from six.moves import StringIO from six.moves import zip from six import u from six import iteritems import sys import os import socket import subprocess import time from six.moves.urllib.parse import urlparse ...
{ "content_hash": "7d98ee15b44ab370e11fc5d1343bd222", "timestamp": "", "source": "github", "line_count": 1659, "max_line_length": 121, "avg_line_length": 39.41169379144063, "alnum_prop": 0.6249847057384069, "repo_name": "Infinidat/pyvmomi", "id": "8f880714283f6c5de5bf401de46433ed1f2d6e7c", "size": "...
from .client import RakutenClient
{ "content_hash": "2f13faaddd3dd38fe65979de8763f358", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 33, "avg_line_length": 34, "alnum_prop": 0.8529411764705882, "repo_name": "claudetech/python_rakuten", "id": "ab21d61c55fa92a8fa573be7464d5a498cf00bfb", "size": "34", "bin...
import mock import pytest try: import ipywidgets except ImportError: ipywidgets = None @pytest.mark.skipif(ipywidgets is None, reason='ipywidgets is not installed') class TestExperimentWidget(object): @pytest.fixture def exp(self): from dallinger.experiment import Experiment return Ex...
{ "content_hash": "61acbdc3e2daa86f70d2ba362558fbe6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 32.38235294117647, "alnum_prop": 0.6857402361489555, "repo_name": "jcpeterson/Dallinger", "id": "18d75ca174c42ca1bb950c586224e1f25fefcb43", "size": "...
from unittest import mock from oslotest import base as test_base from oslo_service import fixture from oslo_service import loopingcall class FixtureTestCase(test_base.BaseTestCase): def setUp(self): super(FixtureTestCase, self).setUp() self.sleepfx = self.useFixture(fixture.SleepFixture()) ...
{ "content_hash": "85b15e7b909892c94a379ebf584d8ee8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 35.4, "alnum_prop": 0.6519774011299435, "repo_name": "openstack/oslo.service", "id": "6b2670e77bdb5d9e0f9b55814b5a206d711c9aa8", "size": "1458", "b...
"""Jacobian ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.python.ops import gradients as gradient_op...
{ "content_hash": "8117580ca24f46efd1cc9cdcad1c6647", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 80, "avg_line_length": 39.1203007518797, "alnum_prop": 0.6609648279838555, "repo_name": "renyi533/tensorflow", "id": "94ab49951aa001bc23e40f4b50af5e44de826c62", "size": "5...
import sys from optparse import OptionParser import urllib2 import json import getpass VERSION = '0.1' SUPPORTED_PROTO = ['tcp'] def getUrl(opts, path): return URL % (opts.host, opts.port, path) def buildRequest(data, url, cmd): j = { "id" : "ovxctl", "method" : cmd , "jsonrpc" : "2.0" } h = {"Content-...
{ "content_hash": "6dec896decf2ca415fcf027d2a2fad76", "timestamp": "", "source": "github", "line_count": 825, "max_line_length": 172, "avg_line_length": 46.305454545454545, "alnum_prop": 0.6189990052876813, "repo_name": "fnkhan/second", "id": "52b77d559f44dc12a0d4f568bced3aac727746b3", "size": "3833...
import btnlib as btn import ledlib as led import time #the led.startup() function cycles through the leds led.startup() time.sleep(1) print("All on and off") #to turn on all leds, use the led.turn_on_all() function: led.turn_on_all() time.sleep(2) #to turn off all: led.turn_off_all() time.sleep(1) print("Red on and ...
{ "content_hash": "68314909adf5abf1a5b4e005e3c23c69", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 109, "avg_line_length": 28.38888888888889, "alnum_prop": 0.7270058708414873, "repo_name": "majikpig/ubtech", "id": "26fff381d6d235fa574afacde72bd215fcff452e", "size": "2122...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('product', '0014_auto_20170324_1630'), ] operations = [ migrations.AlterField( model_name='product', name='product_price', ...
{ "content_hash": "aa78558822a6baffebf124f99eefa5a4", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 84, "avg_line_length": 26, "alnum_prop": 0.58, "repo_name": "rodrigocnascimento/django-teste", "id": "4c7dc41700dcb53b49bb71a59a5c5930cb41ea81", "size": "723", "binary": ...