text
stringlengths
4
1.02M
meta
dict
""" Hook specifications for tox. """ from pluggy import HookimplMarker from pluggy import HookspecMarker hookspec = HookspecMarker("tox") hookimpl = HookimplMarker("tox") @hookspec def tox_addoption(parser): """ add command line options to the argparse-style parser object.""" @hookspec def tox_configure(confi...
{ "content_hash": "7010d4acf85b8c1b7bcd2a695b82197c", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 90, "avg_line_length": 33.904761904761905, "alnum_prop": 0.696067415730337, "repo_name": "loechel/tox", "id": "d139f4094844516f5c631ca5630035d50979d72d", "size": "3560", ...
__all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError', 'FFIError'] from .api import FFI, CDefError, FFIError from .ffiplatform import VerificationError, VerificationMissing __version__ = "1.4.1" __version_info__ = (1, 4, 1) # The verifier module file names are based on the CRC32 of a s...
{ "content_hash": "68677e1f1a5a78f9b15d5f2a714f4dd8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 37.15384615384615, "alnum_prop": 0.7060041407867494, "repo_name": "aliyun/oss-ftp", "id": "4de0c66430cd4adc694fa5e59c5b34d922344957", "size": "483", ...
"""The `IncrementLogProb` class.""" # Dependency imports import tensorflow.compat.v2 as tf from tensorflow_probability.python.bijectors import identity as identity_bijector from tensorflow_probability.python.distributions import distribution from tensorflow_probability.python.distributions import log_prob_ratio from ...
{ "content_hash": "d5c80f391f6bb39f384e5b2845bb76cf", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 110, "avg_line_length": 38.49444444444445, "alnum_prop": 0.6951941117044307, "repo_name": "tensorflow/probability", "id": "28c675d2b336668b504420408cc0df96712463d4", "size...
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Rack shape table. """ from sqlalchemy import CheckConstraint from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String from ...
{ "content_hash": "6c2bfe96bab9558419bae3f41201016f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 80, "avg_line_length": 32.166666666666664, "alnum_prop": 0.7015544041450777, "repo_name": "helixyte/TheLMA", "id": "0a6600d749620441a72e6dd3afd4b29531de0e03", "size": "965"...
import unittest import pytest import mock import six import docker import os import json import logging import sys import tarfile import io from io import BytesIO import uuid from docker_scripts.squash import Squash from docker_scripts.errors import SquashError if not six.PY3: import docker_scripts.lib.xtarfile ...
{ "content_hash": "0705256f5fc5bc469561f478248ff71e", "timestamp": "", "source": "github", "line_count": 446, "max_line_length": 121, "avg_line_length": 41.11210762331839, "alnum_prop": 0.5866055846422339, "repo_name": "jpopelka/docker-scripts", "id": "8776b6f1893d03bdc6b3ed0d42666dabb7ddedcc", "siz...
from decimal import Decimal from trytond.pool import Pool, PoolMeta from jinja2.filters import do_striptags from werkzeug.exceptions import NotFound from nereid import jsonify, flash, request, url_for, route, redirect, \ render_template, abort, current_locale from nereid.contrib.locale import make_lazy_gettext f...
{ "content_hash": "4b93a6d63341f85e1ae4bade64d9f66e", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 78, "avg_line_length": 31.458937198067634, "alnum_prop": 0.539004914004914, "repo_name": "sharoonthomas/nereid-webshop", "id": "d1ac04f3b5a1d9c0cb6d6dd7cf5ed50408611bfb", ...
"""Demonstrates how to find and remove shared sets/shared set criterions. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication information" section of our README. ...
{ "content_hash": "43e76154b55e93b67d7e38fb6ba0c2c6", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 32.30935251798561, "alnum_prop": 0.5771543086172345, "repo_name": "wubr2000/googleads-python-lib", "id": "56f39737329f3f6b5d29cecd0b4d1d1749da3701", ...
""" This module defines commonly used code for the mamo package """ __author__ = "Iqbal Abdullah <iqbal@marimore.co.jp>" __date__ = "$LastChangedDate$" __version__ = "$LastChangedRevision$" import re class BaseClass(object): """ BaseClass contains very common functions and implementations...
{ "content_hash": "b03118f3a7d93efd6b152e18afbe9823", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 31.393939393939394, "alnum_prop": 0.611969111969112, "repo_name": "k4ml/Marimorepy", "id": "3d3f724f0e446d56e8c2de15dc3426446ebb2348", "size": "2741"...
import benchexec.result as result from . import cbmc class Tool(cbmc.Tool): """ Tool info for JBMC (http://www.cprover.org/cbmc/). It always adds --xml-ui to the command-line arguments for easier parsing of the output, unless a propertyfile is passed -- in which case running under SV-COMP conditi...
{ "content_hash": "c16ca394fd82cecb868a5de263794935", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 30.55263157894737, "alnum_prop": 0.5986218776916451, "repo_name": "dbeyer/benchexec", "id": "732537e81d7449b6f8db883a80044857959d8018", "size": "1391...
"""Provides a menu hook for several other plugins. See :doc:`/specs/office`. """ from lino.api import ad, _ class Plugin(ad.Plugin): "See :doc:`/dev/plugins`." verbose_name = _("Office")
{ "content_hash": "657d89e95928142ed295a3060d33d7aa", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 50, "avg_line_length": 16.666666666666668, "alnum_prop": 0.635, "repo_name": "lino-framework/lino", "id": "73ff7671b47ceb1a1c1582f67502b432345df387", "size": "317", "bina...
from . import Event class Tick(Event): """ Every time the background app ticks, this event is dispatched. data contains the time at which the event was dispatched """ pass class MoveToForeground(Event): pass
{ "content_hash": "ce3722fc515a19e1a8c3dc787de471b1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 66, "avg_line_length": 19.5, "alnum_prop": 0.688034188034188, "repo_name": "Grisou13/mawie", "id": "2a6364693153dc56d15937891dd656bd89462f0c", "size": "234", "binary": fa...
"""pyzombie HTTP RESTful server handler giving a web form to add an executable.""" __author__ = ('Lance Finn Helsten',) __version__ = '1.0.1' __copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)""" __license__ = """ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f...
{ "content_hash": "2302a9d4618312f7b1218de9a9c80aab", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 73, "avg_line_length": 31.016666666666666, "alnum_prop": 0.6496507254164428, "repo_name": "lanhel/pyzombie", "id": "aeaf6f522277c07da51d62564ac3f7f877729af1", "size": "1988...
import unittest import random from scapy.packet import Raw from scapy.layers.l2 import Ether from scapy.layers.inet import IP, UDP from framework import VppTestCase, VppTestRunner from util import Host, ppp class TestL2xc(VppTestCase): """ L2XC Test Case """ @classmethod def setUpClass(cls): ""...
{ "content_hash": "0dc37b5c1e6ba81080be27e4adbd6699", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 79, "avg_line_length": 36.96506550218341, "alnum_prop": 0.5663319551092735, "repo_name": "vpp-dev/vpp", "id": "bc653f0b4fb833b57f74675f971a65ed6d5e4af0", "size": "8489", ...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^event/$', views.EventList.as_view(), name='event'), url(r'^event/(?P<pk>[0-9]+)/$', views.EventDetail.as_view(), name='detail'), url(r'^event/new$', views.EventCreate.as_view(), name='new'), url(r'^event/edit/(?P<pk>[0-9]+)/$', views.E...
{ "content_hash": "437eecc9a62bfdf63e200eb10c4d57a3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 62, "avg_line_length": 34.69230769230769, "alnum_prop": 0.6164079822616408, "repo_name": "Jhonbeltran/information-layer8", "id": "a02f2a49c16588916b26191037ec8032352e2f2a", ...
"""Record of phased-in incompatible language changes. Each line is of the form: FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples of the same form as sys.version_info: (...
{ "content_hash": "36a51992872a1838cbb6903300fb1128", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 86, "avg_line_length": 34.93835616438356, "alnum_prop": 0.606743775730249, "repo_name": "xyuanmu/XX-Net", "id": "e1135685d846ce7064559aa4aa4c24839f7145aa", "size": "5101",...
from pastebin.models import Paste class PasteRemover: def __init__(self): from pastebin.core.paste_dates import PasteDates import logging super().__init__() self.paste_dates = PasteDates() self.logger = logging.getLogger(__name__) def removeExpiredPastes(self): ...
{ "content_hash": "83e9e84e2c07553db5e568785df91d81", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 80, "avg_line_length": 34.75, "alnum_prop": 0.6276978417266187, "repo_name": "johannessarpola/django-pastebin", "id": "fda706645823155f3844e22442f1a26d10aa4daa", "size": "5...
"""Parse a timespec (https://github.com/fenhl/timespec). Usage: timespec [options] [<predicate>...] timespec -h | --help timespec --version Options: -f, --format=<format> Print the date in the given format. [Default: %Y-%m-%d %H:%M:%S] -h, --help Print this message and exit. -r, --rev...
{ "content_hash": "0c85a5a154016353a5963c562804a732", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 138, "avg_line_length": 36.69230769230769, "alnum_prop": 0.6450034940600978, "repo_name": "fenhl/python-timespec", "id": "043fc2934eb80fa99f0d277a44c16e299d4fdf4d", "size":...
from OpenGLCffi.GL import params @params(api='gl', prms=['pname', 'index', 'val']) def glSetMultisamplefvAMD(pname, index, val): pass
{ "content_hash": "ad19bd924369d3271aceedbb464d23be", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 49, "avg_line_length": 22.833333333333332, "alnum_prop": 0.708029197080292, "repo_name": "cydenix/OpenGLCffi", "id": "0e56d509fb2ed96d077ab27ce64cbadf428d7a28", "size": "137...
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFo...
{ "content_hash": "54303e1054b5eb2664a99aae9350be80", "timestamp": "", "source": "github", "line_count": 473, "max_line_length": 285, "avg_line_length": 46.35095137420719, "alnum_prop": 0.6557653712826127, "repo_name": "Azure/azure-sdk-for-python", "id": "2239718402b3692a38c3fbfa64e8773998ccc57a", "...
from senlin.tests.functional import api as test_api from senlin.tests.functional import base from senlin.tests.functional.utils import test_utils class TestReceiver(base.SenlinFunctionalTest): def setUp(self): super(TestReceiver, self).setUp() # Create profile self.profile = test_api.creat...
{ "content_hash": "5c6db24baeea906b6ff60f53651bb0dd", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 41.626666666666665, "alnum_prop": 0.572709801409353, "repo_name": "tengqm/senlin-container", "id": "a43e5a97d40e1b111cd3d1c0079256f37cd05c54", "size"...
""" Support for SQLAlchemy. Provides SQLAlchemyTarget for storing in databases supported by SQLAlchemy. The user would be responsible for installing the required database driver to connect using SQLAlchemy. Minimal example of a job to copy data to database using SQLAlchemy is as shown below: .. code-block:: python ...
{ "content_hash": "c6064438bca19ada618823047a70a34f", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 127, "avg_line_length": 39.50877192982456, "alnum_prop": 0.6198934280639432, "repo_name": "dlstadther/luigi", "id": "ad8a352df148e168c860d21dd1b82e590cb8803d", "size": "16...
from django.db import models from django.utils import timezone from django.utils.http import urlquote from django.utils.translation import ugettext_lazy as _ from django.core.mail import send_mail from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.contrib.auth.models import BaseUserMa...
{ "content_hash": "d58fd6a010e81b689c8fee47d4acb89c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 92, "avg_line_length": 37.46341463414634, "alnum_prop": 0.5553385416666666, "repo_name": "makiwara/onemoretime", "id": "97dd83d715a6e3959c0fbc91ae002865ede05503", "size": ...
"""Tests for TempJunction.""" import os import unittest # Do not edit this line. Copybara replaces it with PY2 migration helper. from src.test.py.bazel import test_base from tools.android import junction class JunctionTest(test_base.TestBase): """Unit tests for junction.py.""" def _AssertCreateJunctionWhenTarg...
{ "content_hash": "96187d7d8c5e0f6972db04d56f8e632d", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 40.795180722891565, "alnum_prop": 0.6978735971647962, "repo_name": "cushon/bazel", "id": "da60478499429bb194b7a460356bd47bc16c740f", "size": "3988", ...
r"""Entry point for Reincarnating RL experiments. # pylint: disable=line-too-long """ import functools import json import os from absl import app from absl import flags from absl import logging from dopamine.discrete_domains import run_experiment as base_run_experiment from dopamine.discrete_domains import train as...
{ "content_hash": "9c4709843ba3975fa2e848a5a1a23edb", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 80, "avg_line_length": 31.572327044025158, "alnum_prop": 0.7113545816733068, "repo_name": "google-research/reincarnating_rl", "id": "613dbbd33834561f1a07a2d5a29b648be7dd4ca4...
''' Created on Sep 26, 2013 @author: joshua ''' from django.utils.cache import patch_response_headers class CacheHeadersMiddleware(object): """ overrides all Cache-Control settings on responses and injects headers from django.utils.cach.patch_response_headers """ def process_response(self, request, response...
{ "content_hash": "7af275515ccf73c737aeadd445b2ed8a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 127, "avg_line_length": 29.36842105263158, "alnum_prop": 0.6756272401433692, "repo_name": "blitzagency/django-chatterbox", "id": "f68ccbf5e56b6d5024c76138104c0cc50552f5af", ...
import MySQLdb from fabric.api import * from cuisine import * def stop(): with settings(warn_only=True): sudo("service keepalived stop") def start(): stop() sudo("service keepalived start") def uninstall(): """Uninstall keepalived packages""" package_clean('keepalived') def install...
{ "content_hash": "76e5020300d44a250bba2ebd417be127", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 25.063291139240505, "alnum_prop": 0.6065656565656565, "repo_name": "StackOps/fabuloso-catalog-havana", "id": "b976e8510a084acea3d299f7504e28dfc8e8d74f"...
""" Holds the formencode validators for debexpo. """ __author__ = 'Jonny Lamb' __copyright__ = 'Copyright © 2008 Jonny Lamb' __license__ = 'MIT' import formencode import logging import tempfile from debexpo.lib.base import * from debexpo.lib.utils import get_gnupg from debexpo.model import meta from debexpo.model.u...
{ "content_hash": "634c786322090222d6f37b3ef380f005", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 187, "avg_line_length": 33.71370967741935, "alnum_prop": 0.6209783518717856, "repo_name": "jonnylamb/debexpo", "id": "f3477cad099fe0ffac3d33fc24f112c10fec5c21", "size": "9...
from __future__ import absolute_import, division, print_function from trakt.core.helpers import from_iso8601_datetime from trakt.objects.core.helpers import update_attributes from trakt.objects.media import Media class Video(Media): def __init__(self, client, keys=None, index=None): super(Video, self).__...
{ "content_hash": "50a8f0791668262f9c210add60cc2cf7", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 25.49, "alnum_prop": 0.5460965084346803, "repo_name": "fuzeman/trakt.py", "id": "539ceae1dfd4987a929a729adc9f48021ebf1a0c", "size": "2549", "binar...
import copy import sys class Variant: """A list of string and values used to tweak build execution.""" def __init__(self, values=None): self.values = set() self.add(values) def __contains__(self, item): return item in self.values def __str__(self): return "Variant:" + str(self.value...
{ "content_hash": "91121038b63cf07e4e089b77b9ac09c3", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 29.833333333333332, "alnum_prop": 0.5810055865921788, "repo_name": "LudoSapiens/Dev", "id": "b3438e7614b866b76be79d116be3e721066ee305", "size": "1417...
import numpy as np from matplotlib import pyplot as plt from caid.io import geopdes from caid.cad_geometry import cad_geometry geo = cad_geometry() filename = "/home/macahr/Téléchargements/geopdes_geometries/geo_Lshaped_mp.txt" #filename = "geo_Lshaped_mp_b.txt" IO = geopdes() IO.read(filename, geo) fig = plt.figur...
{ "content_hash": "fc16c1cb0abba12587489a4e5fbad3d7", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 18.96, "alnum_prop": 0.7151898734177216, "repo_name": "ratnania/caid", "id": "17836e1f767aebbb52b18b165263ffa38232a606", "size": "520", "binary": f...
VERSION = (0, 2, 1, 'stable') def get_release(): return '-'.join([get_version(), VERSION[-1]]) def get_version(): """ Returns only digit parts of version. """ return '.'.join(str(i) for i in VERSION[:3]) __author__ = 'dlancer' __docformat__ = 'restructuredtext en' __copyright__ = 'Copyright 20...
{ "content_hash": "a2cba4be2f14bbc7a5afc8830285c406", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 21.454545454545453, "alnum_prop": 0.597457627118644, "repo_name": "dlancer/django-pages-cms-extensions", "id": "8cd70afc4e5bbd9641b5a72f5c9f0c29188e11a...
from bs4 import BeautifulSoup import requests url = raw_input("Enter a website to extract the URL's from: ") r = requests.get("http://" +url) data = r.text soup = BeautifulSoup(data) for link in soup.find_all('a'): print(link.get('href'))
{ "content_hash": "ca4e2b8baaadcec55e8f8c3714d2d663", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 20.583333333333332, "alnum_prop": 0.6882591093117408, "repo_name": "mphz/bkdev", "id": "27b1726e01fc64ecf6688f5cb2b03f45f637fcab", "size": "247", "...
from __future__ import division from nose.tools import * import numpy.testing as npt import dit def test_pruned_samplespace_scalar(): """Prune a sample space from a ScalarDistribution.""" pmf = [1/2, 0, 1/2] d = dit.ScalarDistribution(pmf) d2 = dit.algorithms.pruned_samplespace(d) ss2_ = [0, 2] ...
{ "content_hash": "8dfeffdc312a614c14c316c81e616e99", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 35.96629213483146, "alnum_prop": 0.633864417369572, "repo_name": "chebee7i/dit", "id": "7d4a5f45419ca8c83acc7e82a6e648175a592a3a", "size": "3201", ...
""" Use nose `$ pip install nose` `$ nosetests` """ import yaml from urllib import quote from hyde.fs import File, Folder from hyde.model import Config, Expando from hyde.site import Node, RootNode, Site from nose.tools import raises, with_setup, nottest TEST_SITE_ROOT = File(__file__).parent.child_folder('sites/tes...
{ "content_hash": "ca81cb7cf40350911ae674449a2aec86", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 111, "avg_line_length": 35.95323741007194, "alnum_prop": 0.6284142071035518, "repo_name": "Valloric/hyde", "id": "ed0b35e2d5ae7519c7bcb3bf4c7a1d63865ab3e7", "size": "10019...
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, get_realm_by_string_id from zerver.lib...
{ "content_hash": "81c2181fc71d3ad81fbc1f1bae940b1a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 126, "avg_line_length": 43.53623188405797, "alnum_prop": 0.5875499334221038, "repo_name": "reyha/zulip", "id": "33912d17495e635cfb541ab6cf171d58bbef90c2", "size": "3004", ...
from collections import OrderedDict, Callable class DefaultOrderedDict(OrderedDict): # Source: http://stackoverflow.com/a/6190500/562769 def __init__(self, default_factory=None, *a, **kw): if (default_factory is not None and not isinstance(default_factory, Callable)): raise TypeE...
{ "content_hash": "01979aded866152d9f11fe5d82b0ecf6", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 74, "avg_line_length": 33.22727272727273, "alnum_prop": 0.5649794801641587, "repo_name": "oxinabox/Livecon-Printer", "id": "6cd8a90d6db7365e93abc5736b1c589adb026c0f", "size...
from textblob import TextBlob from operator import itemgetter class SentimentAnalysis(object): """Get sentiment analysis with only positive and negative considered. Positive means normal logs and negative sentiment refers to possible attacks. This class uses sentiment analysis feature from the TextBlob l...
{ "content_hash": "3172765b67a4c75839a7eb3d35105176", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 118, "avg_line_length": 39.83606557377049, "alnum_prop": 0.6259259259259259, "repo_name": "studiawan/pygraphc", "id": "1df7b5d307ce79b1546e6915c99e6b2ce7379d02", "size": "2...
""" vpls.py Created by Nikita Shirokov on 2014-06-16. Copyright (c) 2014-2015 Nikita Shirokov. All rights reserved. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from struct import unpack from struct import pack from exabgp.protocol.ip import IP from exabgp.protocol.family import AFI from exabgp.prot...
{ "content_hash": "ae59bd8e627f6d74b21691d816b2870c", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 85, "avg_line_length": 24.69, "alnum_prop": 0.6407452409882544, "repo_name": "fugitifduck/exabgp", "id": "b677b4e184c9f846a6652c1ee2f181f0a5eec49c", "size": "2487", "bin...
from __future__ import division, print_function import argparse import functools import gzip import json import os import os.path import sys from datetime import date from multiprocessing import Process, Queue import requests try: from io import StringIO except ImportError: from StringIO import StringIO # Re...
{ "content_hash": "e8a13177e05bc1112fda43d23fa1a773", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 138, "avg_line_length": 45.52147239263804, "alnum_prop": 0.6254716981132076, "repo_name": "dpryan79/tools-iuc", "id": "81be5253bda9d662db455737da89ea9589e5482a", "size": "...
from typing import Any, Union, cast from ...error import GraphQLError from ...language import ( SKIP, DirectiveDefinitionNode, DocumentNode, ExecutableDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, TypeDefinitionNode, VisitorAction, ) from . import ASTValidationRule __all_...
{ "content_hash": "02df932788376d3c2113906059022db0", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 80, "avg_line_length": 30.58, "alnum_prop": 0.552648790058862, "repo_name": "graphql-python/graphql-core", "id": "01c38fd68900a538c1d05cb0be98d6b05dab2a98", "size": "1529",...
import locale from invoke import ctask as task, Collection from functools import partial from invoke.runners import Local, Runner from paramiko.client import SSHClient, AutoAddPolicy class RemoteRunner(Runner): def __init__(self, *args, **kwargs): super(RemoteRunner, self).__init__(*args, **kwargs) ...
{ "content_hash": "7b37cdc3890fe7a644e217db35405239", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 114, "avg_line_length": 33.22222222222222, "alnum_prop": 0.6839464882943144, "repo_name": "ksurct/MercuryRoboticsEmbedded2016", "id": "704c9d07e1dc0b45a513fb15305007eab653b5f...
import tensorflow as tf import numpy as np import time import multiprocessing as mp import threading import Queue class CustomRunner(object): """ This class manages the the background threads needed to fill a queue full of data. # Need to call the following code block after ini...
{ "content_hash": "b0a30ae31e06d902e648d8d4f4610265", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 93, "avg_line_length": 37.157575757575756, "alnum_prop": 0.5419996737889414, "repo_name": "minyoungg/selfconsistency", "id": "f27211070cb21667d7715d9674b3810076ffeb7f", "s...
import scrapy, json from scrapy.exceptions import CloseSpider from scrapy import Request from json import loads from datetime import date from collections import OrderedDict class SegurarseComArSpider(scrapy.Spider): name = "segurarse_com_ar_spider" #start_urls = ('https://segurarse.com.ar/cotizador-de-seguros-au...
{ "content_hash": "3dd4b0dd8704760e021cada4a52c082e", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 170, "avg_line_length": 35.160919540229884, "alnum_prop": 0.6260215756783263, "repo_name": "hanjihun/Car", "id": "d96d33e62598ac7b01581838ca0ade94ed3a30c3", "size": "3083",...
import requests import random # This is like namedtuple, but mutable. (https://pypi.python.org/pypi/recordtype) # `pip install recordtype` to get it from recordtype import recordtype GHIBLI_URL = "https://ghibliapi.herokuapp.com/" session = requests.session() # We don't want to panic when we see charles custom SSL cer...
{ "content_hash": "54c24ab069a3b618b6fec86ffd0b8a51", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 108, "avg_line_length": 34.186206896551724, "alnum_prop": 0.48113778495057496, "repo_name": "noisebridge/PythonClass", "id": "f90cc0604730602a4aaae583a2f8ead38f06e506", "s...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() __title__ = 'server-profile-template' __version__ = '0.0.1' __copyright__ = '(C) Copyright (2012-...
{ "content_hash": "3759ee42f202fb0061aa488e863a3910", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 120, "avg_line_length": 42.385416666666664, "alnum_prop": 0.6225116736298845, "repo_name": "andreadean5/python-hpOneView", "id": "abff3974f2ad0cddc6348b59f589418318c7eeaa", ...
from django.conf.urls import url from django.contrib import admin from . import views admin.autodiscover() urlpatterns = [ url(r'^login/$', views.Login.as_view(), name='login'), url(r'^logout/$', views.Logout.as_view(), name='logout'), url(r'^$', views.PublicIndex.as_view(), name='public-index'), u...
{ "content_hash": "251b59ae2cda7190c5a9ce6d22904373", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 176, "avg_line_length": 81.54166666666667, "alnum_prop": 0.6734798160449668, "repo_name": "mjtamlyn/back2back", "id": "d29f6db67b3ed0479cab5465d2f24c384e925f3a", "size": "5...
def __load(): import imp, os, sys try: dirname = os.path.dirname(__loader__.archive) except NameError: dirname = sys.prefix path = os.path.join(dirname, 'unicodedata.pyd') #print "py2exe extension module", __name__, "->", path mod = imp.load_dynamic(__name__, path) ## ...
{ "content_hash": "0e5b246eed6d9a81d1b8ea075824ff87", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 58, "avg_line_length": 27.76923076923077, "alnum_prop": 0.5623268698060941, "repo_name": "hahwul/restime", "id": "f086db19d8c746d5b8947006869bc12d67665bd5", "size": "361", ...
import pytest from selenium.webdriver.common.by import By def testShouldBeAbleToDetermineTheLocationOfAnElement(driver, pages): pages.load("xhtmlTest.html") location = driver.find_element(By.ID, "username").location_once_scrolled_into_view assert location["x"] > 0 assert location["y"] > 0 @pytest.m...
{ "content_hash": "60154b13ea96ca3c4005acacd2e41b20", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 87, "avg_line_length": 37.95959595959596, "alnum_prop": 0.7272485364555614, "repo_name": "Dude-X/selenium", "id": "a6240f84989dec08313bcc15e30506be50eb66d3", "size": "4546"...
from .plot_and_save import plot_and_save from .style import CATEGORICAL_COLORS def plot_points( xs, ys, names=None, modes=None, texts=None, markers=None, textpositions=None, layout_width=None, layout_height=None, title=None, xaxis_title=None, yaxis_title=None, legen...
{ "content_hash": "e714f7e5d0a76ffd2d2c337ffadb640f", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 88, "avg_line_length": 18.477777777777778, "alnum_prop": 0.5063138905592303, "repo_name": "KwatME/plot", "id": "1cf6c06f527b9b1517a6f214d5963ed90f037597", "size": "1663", ...
from __future__ import absolute_import from __future__ import print_function import inspect import logging import sys import os import getpass import six import uuid from collections import defaultdict import functools import dataset import pandas as pd import socket import os.path import yaml from six.moves import ...
{ "content_hash": "c8b2846ac35dc947738b17ae23c11277", "timestamp": "", "source": "github", "line_count": 659, "max_line_length": 118, "avg_line_length": 38.12139605462823, "alnum_prop": 0.5150067669771515, "repo_name": "metabolite-atlas/metatlas", "id": "88f1479c43721bee5c19c64e57b9a43e0adef49b", "s...
class BERTRPCError(Exception): def __init__(self, msg = None, klass = None, bt = []): Exception.__init__(self, msg) if type(msg) == type(list()): code, message = msg[0], msg[1:] else: code, message = [0, msg] self.code = code self.message = message...
{ "content_hash": "bf0de18b8d7559346eb1c65f9854290e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 74, "avg_line_length": 24.71875, "alnum_prop": 0.6030341340075853, "repo_name": "mjrusso/python-bertrpc", "id": "870b5063168b205f1d7d8ce42dd933e9ed8cf16a", "size": "1582", ...
import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/500...
{ "content_hash": "09f5b0bef9cb8ed6500f4c9d1706ea66", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 106, "avg_line_length": 30.398190045248867, "alnum_prop": 0.5410836558499553, "repo_name": "jacky-young/crosswalk-test-suite", "id": "cc08fdccbf8c65dee48f57d187406630b990d1f...
from io import StringIO from skbio import TreeNode from qiime2.plugin import SemanticType from qiime2.plugin.util import transform from ..plugin_setup import plugin from . import NewickDirectoryFormat Phylogeny = SemanticType('Phylogeny', field_names=['type']) Rooted = SemanticType('Rooted', variant_of=Phylogeny.f...
{ "content_hash": "ddb3acda5c6f33ccfb08106e5cfcb255", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 31.294117647058822, "alnum_prop": 0.6854636591478697, "repo_name": "qiime2/q2-types", "id": "0ab94e82aa915089ca09e7d66de0b79aef684204", "size": "1946...
""" A module for all environmental layers functionality. .. moduleauthor:: Daniela Remenska <remenska@gmail.com> """ import logging from enum import Enum import pprint from rasterio.warp import calculate_default_transform, RESAMPLING # from iSDM.species import IUCNSpecies import numpy as np from geopandas impo...
{ "content_hash": "f57dd737f998b8b8cf39c2877d43c246", "timestamp": "", "source": "github", "line_count": 990, "max_line_length": 152, "avg_line_length": 51.26262626262626, "alnum_prop": 0.6180689655172413, "repo_name": "remenska/iSDM", "id": "cd29aec40456b3cc0cd20508b5da8509b7666e94", "size": "50751...
from sympy.core.sympify import _sympify, sympify from sympy.core.basic import Basic from sympy.core.singleton import Singleton, S from sympy.core.evalf import EvalfMixin from sympy.core.numbers import Float from sympy.core.compatibility import iterable from sympy.core.decorators import deprecated from sympy.mpmath imp...
{ "content_hash": "23860d2e6414ec3e43be45a40236ab1e", "timestamp": "", "source": "github", "line_count": 1273, "max_line_length": 82, "avg_line_length": 28.407698350353495, "alnum_prop": 0.55554019301496, "repo_name": "srjoglekar246/sympy", "id": "905af67dcedb506a9781495f1c8ec154f70378ed", "size": "...
"""Discovers Chromecasts on the network using mDNS/zeroconf.""" from uuid import UUID import six from zeroconf import ServiceBrowser, Zeroconf DISCOVER_TIMEOUT = 5 class CastListener(object): """Zeroconf Cast Services collection.""" def __init__(self, callback=None): self.services = {} self....
{ "content_hash": "53c6ff73cf16b9426087e4a22f88a7c4", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 31.54385964912281, "alnum_prop": 0.6262513904338154, "repo_name": "piedar/pychromecast", "id": "72b649536a2f10d686d2dd818e6b1f2a6013b171", "size": "...
"""Pylint plugin for checking in Sphinx, Google, or Numpy style docstrings """ from __future__ import print_function, division, absolute_import import astroid from pylint.interfaces import IAstroidChecker from pylint.checkers import BaseChecker from pylint.checkers import utils as checker_utils import pylint.extensio...
{ "content_hash": "bb88b3385f6049364a48972cccb1548b", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 89, "avg_line_length": 41.45497630331754, "alnum_prop": 0.5727106436492512, "repo_name": "lucidmotifs/auto-aoc", "id": "a304683e23157277d85ae37bec49884ea0f39718", "size": ...
import numpy as np import time from commons.utils import logger # import from ../../commons from commons import evallib # import from ../../commons from wsdream import NMF from scipy import stats import multiprocessing #======================================================# # Function to evalute the approach at all ...
{ "content_hash": "56c98511fed356c84696ef3560b102b7", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 86, "avg_line_length": 38.410714285714285, "alnum_prop": 0.5811250581125058, "repo_name": "wsdream/WS-DREAM", "id": "ad7febf3404bcb54676994a4eb4caf34a4c18011", "size": "236...
import os, sys usage = "usage: %s search_text replace_text [infile [outfile]]" % os.path.basename(sys.argv[0]) if len(sys.argv) < 3: print usage else: stext = sys.argv[1] rtext = sys.argv[2] input = sys.stdin output = sys.stdout if len(sys.argv) > 3: input = open(sys.argv[3]) ...
{ "content_hash": "70a81528d5ebb7e88c6b164cf03a1aa3", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 103, "avg_line_length": 29.304347826086957, "alnum_prop": 0.612759643916914, "repo_name": "ActiveState/code", "id": "657920cb2f716972c4808c78c241e215eaeeb7a0", "size": "696...
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fix is no longer needed. # XXX : originally copied from scikit-learn """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoq...
{ "content_hash": "f00008005e0394ca38cdec1463fb02df", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 100, "avg_line_length": 36.33487297921478, "alnum_prop": 0.5384224242039026, "repo_name": "jmontoyam/mne-python", "id": "7f98674c58143c5f95b87191830757a38e91f43d", "size":...
from __future__ import unicode_literals import os import sys import six import time import curses from functools import wraps from kitchen.text.display import textual_width from . import docs from .objects import Controller, Color, Command from .exceptions import TemporaryFileError from .__version__ import __version...
{ "content_hash": "37826f1920acbc0aae3eed92adaf8a67", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 80, "avg_line_length": 33.405204460966544, "alnum_prop": 0.5664366792788783, "repo_name": "shaggytwodope/rtv", "id": "7e784c2070a03f9cfc07c6687bbab9b04db07533", "size": "1...
def tree_from_traversals(preorder, inorder): if len(preorder) != len(inorder): raise ValueError('traversals must have the same length') if set(preorder) != set(inorder): raise ValueError('traversals must have the same elements') if len(set(preorder)) != len(preorder) != len(set(inorder)): ...
{ "content_hash": "4890ae5d3b81c050f515f79c70c46e9a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 41.333333333333336, "alnum_prop": 0.673963133640553, "repo_name": "exercism/python", "id": "310a89aeed1fb7934c9deab6c54f5d1ea58e42b3", "size": "868",...
""" sphinx.environment.collectors.asset ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The image collector for sphinx.environment. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os from glob import glob from os import path from typing impo...
{ "content_hash": "202377fee6b01cfa1590f51290c6f037", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 90, "avg_line_length": 43.32214765100671, "alnum_prop": 0.5888458559256391, "repo_name": "sonntagsgesicht/regtest", "id": "0a696aa8dee278c7d6174652c51ebe9bf066fab7", "size...
''' Setup script for ChirpText. Latest version can be found at https://github.com/letuananh/chirptext :copyright: (c) 2012 Le Tuan Anh <tuananh.ke@gmail.com> :license: MIT, see LICENSE for more details. ''' import io from setuptools import setup def read(*filenames, **kwargs): ''' Read contents of multiple fil...
{ "content_hash": "9d15a83c4529aa58668faa6ec69bd5fa", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 114, "avg_line_length": 38.72, "alnum_prop": 0.5833333333333334, "repo_name": "letuananh/chirptext", "id": "c0d417c4361ba986e4bb86a1d23ce5f6bbb7ca8f", "size": "2952", "bi...
""" Support for Homematic switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.homematic/ """ import logging from homeassistant.components.switch import SwitchDevice from homeassistant.const import STATE_UNKNOWN import homeassistant.components...
{ "content_hash": "fbad162fb1945c879325375f354b1c9b", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 32.27450980392157, "alnum_prop": 0.5993317132442284, "repo_name": "Julian/home-assistant", "id": "79d8960cf59c2c0a5f09564bacd6bc8784a3e45e", "size":...
import unittest from docopt import docopt from djset.commands import COMMAND, _parse_args, _create_djset from djset.djset import DjSecret, DjConfig from nose2.tools import params class TestCommand(unittest.TestCase): def test_parse_argv(self): args = docopt(COMMAND % {'cmd':'test'}, argv=['add', 'k...
{ "content_hash": "22b29bae99b7d433efa289864ebc2346", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 116, "avg_line_length": 26.923809523809524, "alnum_prop": 0.4998231340643792, "repo_name": "bretth/djset", "id": "224a98fe204580f406b1bbd262edf5b870e9be05", "size": "2827"...
""" Store packages in S3 """ import calendar import logging import posixpath import time from contextlib import contextmanager from hashlib import md5 from urllib import urlopen, quote import boto.s3 from boto.cloudfront import Distribution from boto.s3.key import Key import boto.s3.connection from pyramid.httpexcepti...
{ "content_hash": "17a320b5f929960bf5a6efd7f4ee2967", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 119, "avg_line_length": 41.73662551440329, "alnum_prop": 0.5969236836915796, "repo_name": "rubikloud/pypicloud", "id": "19cfd69d773174658a2143fdf08ae2e15e51a858", "size": ...
import hashlib from django import template from string import Template from django.conf import settings from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from urlparse import urlparse from django.shortcuts import redirect, render, get_object_or_404 from gamernews.apps...
{ "content_hash": "6205ac51f1799e86c75f3769de58ba38", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 66, "avg_line_length": 24.833333333333332, "alnum_prop": 0.7610738255033557, "repo_name": "underlost/GamerNews", "id": "e107a286440d5acefcf5c4b9fb88409969d23938", "size": "...
from heatclient.common import utils from oslo_utils import encodeutils from six.moves.urllib import parse from heatclient.openstack.common.apiclient import base class ResourceType(base.Resource): def __repr__(self): return "<ResourceType %s>" % self._info def data(self, **kwargs): return se...
{ "content_hash": "4d858fe987c7b805dc74f1dc80517dad", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 78, "avg_line_length": 30.372881355932204, "alnum_prop": 0.5825892857142857, "repo_name": "ecerulm/python-heatclient", "id": "952cc3c5ba0df76cf0f5af74b42b4f7cf6f14e5c", "si...
class FenTree (object): def __init__ (self, array): self.array, self.tree = [0] * len (array), [0] * (len (array) + 1); for i in range (len (array)): self.update (i, array [i]); def get_parent (self, child): return (child - (child & -child)); def get_next (self, index): return (index + (index & -index))...
{ "content_hash": "67b49b56e2a4fb24af0a9717d3d6561c", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 102, "avg_line_length": 29.2, "alnum_prop": 0.5966514459665144, "repo_name": "rtkasodariya/interview", "id": "794610ad8a46ae35b3bc2c63fae2e1c2b60d96b6", "size": "1849", "...
from __future__ import absolute_import, division, print_function, unicode_literals import pytest from avame.schedule import Schedule def test_schedule_seconds(): count = 2 for it in Schedule().every(1).second: print(it) count -= 1 if count <= 0: break def test_singular_...
{ "content_hash": "cca07ab8193d10ff120866122dd66a2a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 82, "avg_line_length": 22.393939393939394, "alnum_prop": 0.6062246278755075, "repo_name": "nickchen-mitac/fork", "id": "ab4425e9efd4cd01e1d92057726f8bc3f50faa16", "size": "...
import os from . import base class DF(base.ThreadedPollText): """ Disk Free Widget By default the widget only displays if the space is less than warn_space. """ orientations = base.ORIENTATION_HORIZONTAL defaults = [ ('partition', '/', 'the partition to check space'), ('warn_co...
{ "content_hash": "768549ac41dd368203933df2a29f996c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 87, "avg_line_length": 34.320754716981135, "alnum_prop": 0.565695437053326, "repo_name": "himaaaatti/qtile", "id": "e5d729dde2c48d34b05dd15e9042266517971c13", "size": "2956...
from bottle import route, run, request from fancytext import fancy @route('/fancy', method='POST') def fancify(): plain_text = request.POST['text'] return fancy(plain_text) run(host='localhost', port=8080)
{ "content_hash": "54652517117dfe1ccb5c37ca77f0d19f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 38, "avg_line_length": 21.7, "alnum_prop": 0.7050691244239631, "repo_name": "mamachanko/fancytext-api", "id": "f9aaf267116356b099f728d5fa13644eae8e4f66", "size": "242", "...
''' Agent Target ''' import sys,os import re, random from furl import * from urllib.parse import urlparse import time, signal from multiprocessing import Process import stomp import re from daemonize import Daemonize from os.path import basename current_dir = os.path.basename(os.getcwd()) if current_dir == "agents": ...
{ "content_hash": "2ba61c339982a512833444fdcaa54065", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 74, "avg_line_length": 26.189349112426036, "alnum_prop": 0.5519656574785359, "repo_name": "glaudsonml/kurgan-ai", "id": "b5be5f9027fb09208f19c15d48ef7a0458923d31", "size":...
from __future__ import unicode_literals try: from urllib import parse as urlparse except ImportError: import urlparse # Python 2 import copy from django.forms import widgets from django.utils.html import escape from django.utils.functional import Promise from django.utils.safestring import mark_safe from dj...
{ "content_hash": "8c1ef46a5c9f2cd3f5c3636a1b1553ad", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 78, "avg_line_length": 30.916666666666668, "alnum_prop": 0.6152291105121294, "repo_name": "schinckel/django-countries", "id": "f6b39db15a4bb0ee6f1578a30bac586e670d3dbf", "s...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule from ansible.module_u...
{ "content_hash": "dc5a045b590a652621b08e88bf5a757f", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 95, "avg_line_length": 30.424, "alnum_prop": 0.6571128056797265, "repo_name": "thaim/ansible", "id": "2291c02a2abcdfe09aa4f1bee9d65dabe4504c75", "size": "3960", "binary"...
import torch from mmdet.utils import util_mixins class SamplingResult(util_mixins.NiceRepr): """Bbox sampling result. Example: >>> # xdoctest: +IGNORE_WANT >>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA >>> self = SamplingResult.random(rng=10) >>> print(f'...
{ "content_hash": "ba6685a31b10b41c1c495953771d9a3f", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 81, "avg_line_length": 35.13815789473684, "alnum_prop": 0.5381014791237596, "repo_name": "open-mmlab/mmdetection", "id": "11a02c5d95a4d633dfea26df7fb3e440494a8be7", "size"...
from TASSELpy.java.util.List import List ## Python-specific class used to apply functional programming # filtering to a wrapped java list class FilterList(List): """ Python-specific class used to apply functional programming filtering to a wrapped java list """ def __init__(self, *args, **kwargs): ...
{ "content_hash": "ad5ddd5265f2cca078a0e3c610eb09cc", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 86, "avg_line_length": 34.08196721311475, "alnum_prop": 0.6339586339586339, "repo_name": "er432/TASSELpy", "id": "c914e994409e2a5ef16eec5010b7b4a5f78eeeed", "size": "2079",...
"""A limited-functionality wallet, which may replace a real wallet in tests""" from copy import deepcopy from decimal import Decimal from enum import Enum from typing import ( Any, List, Optional, ) from test_framework.address import ( base58_to_byte, create_deterministic_address_bcrt1_p2tr_op_true...
{ "content_hash": "c68d20d712be61dbb3bb3ca345f27aef", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 167, "avg_line_length": 43.27107061503417, "alnum_prop": 0.6238681827753211, "repo_name": "fujicoin/fujicoin", "id": "a7f5d00262a6b17ef7210e325ec3cc3e070c9e97", "size": "1...
import socket from django.conf import settings from django.db.models.signals import post_save, post_delete from django.db.transaction import atomic from django.utils import timezone from desecapi import metrics from desecapi.models import RRset, RR, Domain from desecapi.pdns import ( _pdns_post, NSLORD, N...
{ "content_hash": "98384b4e98186449bed0c80dd84fd5f1", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 127, "avg_line_length": 35.96767676767677, "alnum_prop": 0.5221860256122219, "repo_name": "desec-io/desec-stack", "id": "9f5dc095840184b151d1ae1897f2b6aeed6e79ae", "size":...
class OAuthToolkitError(Exception): """ Base class for exceptions """ def __init__(self, error=None, redirect_uri=None, *args, **kwargs): super(OAuthToolkitError, self).__init__(*args, **kwargs) self.oauthlib_error = error if redirect_uri: self.oauthlib_error.redirec...
{ "content_hash": "a7ac83ebc2ffd73905e5b52ee547af89", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 25.88235294117647, "alnum_prop": 0.6272727272727273, "repo_name": "Sunnepah/iupds-appscale", "id": "0546cc009a2650c85b9b7ee1ee017a8b67f905d9", "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): # Changing field 'Field.merge' db.alter_column(u'forms_field', 'merge', self.gf('django.db.model...
{ "content_hash": "7bdb462a6cfc952e946d33bc771d58b1", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 195, "avg_line_length": 75.84745762711864, "alnum_prop": 0.548268156424581, "repo_name": "Afnarel/django-forms-builder", "id": "a7390083784eefd65df8db231d5c5c80e339ad63", ...
import os.path import yaml def get_ssh_pubkey(): path = os.path.expanduser('~/.ssh/id_rsa.pub') with file(path, 'rb') as f: return f.readline().rstrip('\n') def gen_meta( name, extra_meta, ): meta_data = { 'instance-id': name, 'local-hostname': name, 'public-k...
{ "content_hash": "c7a8372cf39cb8c89bec5b839cde82ae", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 66, "avg_line_length": 22.619718309859156, "alnum_prop": 0.523038605230386, "repo_name": "tv42/downburst", "id": "c34b38de8f076ee2d50624f279751aff7dea1328", "size": "1606",...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ CHECKOUT_TYPE_SELECT = 0 CHECKOUT_TYPE_ANON = 1 CHECKOUT_TYPE_AUTH = 2 CHECKOUT_TYPES = ( (CHECKOUT_TYPE_SELECT, _(u"Anonymous and Authenticated")), (CHECKOUT_TYPE_ANON, _(u"Anonymous only")), (CHECKOUT_TYPE_AUTH, _(u"...
{ "content_hash": "0850c69a3783cec8e5960413338b222e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 114, "avg_line_length": 34.46666666666667, "alnum_prop": 0.7369439071566731, "repo_name": "diefenbach/django-lfs", "id": "68014113e013dde19d9e79b06bdeb09d1d5b49a8", "size":...
import codecs import json import pkg_resources import pytest from base64 import b64encode from jsonschema_serialize_fork import Draft4Validator from pyramid.compat import ascii_native_ from snovault import TYPES from urllib.parse import urlparse from .datafixtures import ORDER pytestmark = [pytest.mark.setone, pytes...
{ "content_hash": "1bd52535f2c1702f25b383391889f0c2", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 118, "avg_line_length": 30.18360655737705, "alnum_prop": 0.6441451227460352, "repo_name": "4dn-dcic/fourfront", "id": "776cd1cfbf4be5b938948bc8e2770fb9d82f9f55", "size": "...
__author__ = 'arul' import sys import json import time from fabric.api import * from fabric.contrib import files import re from fabric.tasks import Task """ Basically its doing mongo operations of Backup and Restore """ env.use_ssh_config = True class MongoTask(Task): DB_NAME = MONGO_HOST = MONGO_USER = MONGO_...
{ "content_hash": "898aac643e34ac4523542fb95e25fbe7", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 123, "avg_line_length": 30.688995215311003, "alnum_prop": 0.6177112566261304, "repo_name": "arulrajnet/operationalscripts", "id": "116c28c922936dccea6fd4eb40d5b018d389009a",...
from byteio import ByteReader import os class ReferencePoint(object): def __init__(self, reader): self.name = reader.read_string().decode('utf-8') self.x = reader.read_int32() self.y = reader.read_int32() self.z = reader.read_int32() class Palette(object): def __init__(self, re...
{ "content_hash": "fb3cca1f87b366e166cf8da45734a66f", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 75, "avg_line_length": 29.76923076923077, "alnum_prop": 0.5357450473729544, "repo_name": "matpow2/voxie", "id": "aae6ee7805c33a060d86b1defbd6bf2740dc4f29", "size": "3417", ...
from unittest import TestCase from intent.corpora.POSCorpus import process_wsj_file from intent.utils.dicts import CountDict __author__ = 'rgeorgi' class parse_wsj_tests(TestCase): def parse_test(self): path = '/Users/rgeorgi/Documents/treebanks/LDC95T07/RAW/combined/wsj/00/wsj_0001.mrg' tc = Co...
{ "content_hash": "0aa1e53ac05c0c4829db22883c024599", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 93, "avg_line_length": 24.72, "alnum_prop": 0.6456310679611651, "repo_name": "rgeorgi/intent", "id": "01c91ced2e9e24e536ae7671aadda2a4f6c9b812", "size": "618", "binary": ...
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import keras from keras.datasets import mnist from keras.models import Sequential from keras.la...
{ "content_hash": "790a5f0799a0bfeb07f1051d1f2e36be", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 60, "avg_line_length": 27.136363636363637, "alnum_prop": 0.6683417085427136, "repo_name": "guildai/guild", "id": "c81a493908271f22e68af1316837d639efbd5c7c", "size": "1791",...
import re from unittest import TestCase from redshift_sqlalchemy.dialect import CopyCommand class TestCopyCommand(TestCase): def test_basic_copy_case(self): expected_result = re.sub(r'\s+', ' ', "COPY schema1.t1 FROM 's3://mybucket/data/listing/' " ...
{ "content_hash": "57d617bf7c66e75c08f95a51d38cf480", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 116, "avg_line_length": 48.86666666666667, "alnum_prop": 0.5961800818553888, "repo_name": "hearsaycorp/redshift_sqlalchemy", "id": "ef212e174a890d25f4b0589605869cfe38159963",...
from test_framework.mininode import * from test_framework.test_framework import InfinitumTestFramework from test_framework.util import * from test_framework.blocktools import create_block, create_coinbase ''' SendHeadersTest -- test behavior of headers messages to announce blocks. Setup: - Two nodes, two p2p connec...
{ "content_hash": "ea639fc097946754844e8a73e940929d", "timestamp": "", "source": "github", "line_count": 618, "max_line_length": 116, "avg_line_length": 41.82200647249191, "alnum_prop": 0.6045809796486884, "repo_name": "fcecin/infinitum", "id": "3e3935eccf1bab005b99c83328b4ed52d867f4be", "size": "26...
from tests.lib import pyversion from pip.vcs.bazaar import Bazaar if pyversion >= '3': VERBOSE_FALSE = False else: VERBOSE_FALSE = 0 def test_bazaar_simple_urls(): """ Test bzr url support. SSH and launchpad have special handling. """ http_bzr_repo = Bazaar( url='bzr+http://bzr.m...
{ "content_hash": "c9805bbb3bf9b134cd817c9810a6eabf", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 74, "avg_line_length": 29.71153846153846, "alnum_prop": 0.6168284789644013, "repo_name": "1stvamp/pip", "id": "c28a23c65a1dac70def99c6fe4f11388e94fe5ca", "size": "1545", ...
""" Classes for making VMware VI SOAP calls. """ import httplib import urllib2 from oslo.config import cfg import suds from nova.i18n import _ from nova import utils from nova.virt.vmwareapi import error_util RESP_NOT_XML_ERROR = 'Response is "text/html", not "text/xml"' CONN_ABORT_ERROR = 'Software caused connecti...
{ "content_hash": "b49ec517ed6e64a95da3965d942c96cc", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 79, "avg_line_length": 40.14529914529915, "alnum_prop": 0.565147966787311, "repo_name": "viggates/nova", "id": "d4aa456c2b08ff085828c5a7dd58b377b08147f3", "size": "10083",...
import unittest from . import base class JsonTestCase(base.BaseParserTestCase, unittest.TestCase): extension = 'json'
{ "content_hash": "5db65a38217e8d71e6687bb123b72b33", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 63, "avg_line_length": 17.857142857142858, "alnum_prop": 0.768, "repo_name": "deanmalmgren/textract", "id": "290a67eefb7e5c5a01dd554be5a0be7508851861", "size": "125", "bin...
import testsupport import StringIO, unittest import sqlite3 as sqlite class LogFileTemplate: def write(self, s): pass class LogFile: def __init__(self): pass def init_LogFile(): LogFile.write = LogFileTemplate.write class CommandLoggingTests(unittest.TestCase, testsupport.TestSupport): ...
{ "content_hash": "7e8a17f1e10e3e36e836224208b31ec8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 76, "avg_line_length": 25.936708860759495, "alnum_prop": 0.582723279648609, "repo_name": "fedora-conary/conary", "id": "6ab82bccd9cc5628a5ed4d2e1f9c86c785d8ba4f", "size": "...
""" Pelix Utilities: Cached thread pool :author: Thomas Calmant :copyright: Copyright 2016, Thomas Calmant :license: Apache License 2.0 :version: 0.6.4 .. Copyright 2016 Thomas Calmant Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the...
{ "content_hash": "1cc2ca3b95863438af62ad451b1ba8bd", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 80, "avg_line_length": 31.927884615384617, "alnum_prop": 0.5271796416202379, "repo_name": "isandlaTech/cohorte-devtools", "id": "bc6031bc48121ee501c8289b5d6de32a2e9140c2", ...
"""User roles for `lino_xl.lib.polls`. """ from lino.core.roles import UserRole, SiteUser, SiteAdmin class PollsUser(UserRole): "Can see polls and create new responses." pass class PollsStaff(PollsUser): "Can create new polls." pass class PollsAdmin(PollsStaff, SiteAdmin): "Can configure pol...
{ "content_hash": "8727bef9239fb2d093a436e7724b5426", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 57, "avg_line_length": 15.909090909090908, "alnum_prop": 0.7, "repo_name": "lino-framework/xl", "id": "88f2df20463140a20d22f4d53718e13b33ac39a0", "size": "466", "binary":...
from app import db import csv from app.models.movie import Movie from app.models.location import Location from app.models.director import Director from app.models.writer import Writer from app.models.actor import Actor def import_data_from_database(): """ Build dictionaries from database :return: """ ...
{ "content_hash": "aa9f77f315b33751b8082872531d6240", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 87, "avg_line_length": 33.38255033557047, "alnum_prop": 0.4847205468435867, "repo_name": "boltzj/movies-in-sf", "id": "1973a8c864685ca1892c9ca03879177ba388d513", "size": "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('hs_core', '0007_auto_20151114_1618'), ] operations = [ migrations.AlterUniqueTogether( name='subject', unique_together=set([...
{ "content_hash": "0ebf0ca8a329f762cc6877f4f949ff5d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 74, "avg_line_length": 22.294117647058822, "alnum_prop": 0.5989445910290238, "repo_name": "FescueFungiShare/hydroshare", "id": "4ac1d9b3785ffc354b3932848d2a284461c9b996", "...
def vertical(hfile): """Reads psipred output .ss2 file. @param hfile psipred .ss2 file @return secondary structure string. """ result = '' for l in hfile: if l.startswith('#'): continue if not l.strip(): continue l_arr = l.strip().split() ...
{ "content_hash": "5c2e07d38e771e50de86a00cf9f21613", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 56, "avg_line_length": 22.75409836065574, "alnum_prop": 0.5489913544668588, "repo_name": "MMichel/contact-vis", "id": "f6942ee145df4a8d0b591aa0919ed484af9c37f9", "size": "1...