text
stringlengths
4
1.02M
meta
dict
""" flow.protocol This allows one to use flow module to create protocols, a protocol is actually a controller, but it is specialized enough to deserve its own module. """ import types from base import * from wrap import wrap from stage import Callback from twisted.internet import protocol from twisted.internet.error ...
{ "content_hash": "69880d8cefbf32c034d7ebc3aac80988", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 80, "avg_line_length": 37.236111111111114, "alnum_prop": 0.5781424841477061, "repo_name": "hortonworks/hortonworks-sandbox", "id": "f0e3ff288e85855ad4ab55fadc8d4a86b0290b35"...
from django.core.management.base import LabelCommand from optparse import make_option from django_extensions.management.jobs import get_job, print_jobs class Command(LabelCommand): option_list = LabelCommand.option_list + ( make_option('--list', '-l', action="store_true", dest="list_jobs", ...
{ "content_hash": "8b3177e1455678ddfc639bf98a399a67", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 90, "avg_line_length": 36.42307692307692, "alnum_prop": 0.5543822597676874, "repo_name": "bop/bauhaus", "id": "b698054013906bba476119c8a96e740143095100", "size": "1894", ...
import threading from collections import deque import os import zmq import zhelpers import zsync_utils from zsync_network import Transceiver, Proxy import config import logging import zlib from zsync_logger import MYLOGGER, log_file_progress class ZsyncThread(threading.Thread, Transceiver): def __init__(self, ctx...
{ "content_hash": "7202579c1921492cf48c8e8fd57c6179", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 96, "avg_line_length": 31.379464285714285, "alnum_prop": 0.5558400910513587, "repo_name": "disenone/zsync", "id": "23045f775f6e16c8402589d914f51b9540f83e1f", "size": "1408...
"""Util to invoke C/C++ compilers in the system.""" # pylint: disable=invalid-name import sys import os import subprocess from .._ffi.base import py_str def create_shared(output, objects, options=None, cc="g++"): """Create shared library. Parameters ---------- output : str The target shared ...
{ "content_hash": "c12acc913cd534960502046b5621a60b", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 94, "avg_line_length": 30.61864406779661, "alnum_prop": 0.6086354829781345, "repo_name": "Laurawly/tvm-1", "id": "64cbbd28604c08594d8c311f2477907e4781329a", "size": "8011"...
import datetime import foursquare import logging import pytz from django.contrib.auth.models import User from django.core.management.base import BaseCommand from allauth.socialaccount.models import SocialToken, SocialApp import contacts as contact_settings from contacts.models import Contact, ContactField, LogEntry, B...
{ "content_hash": "78df51c5fd947b56248b312ad42f6a6d", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 114, "avg_line_length": 42.69465648854962, "alnum_prop": 0.47416413373860183, "repo_name": "phildini/logtacts", "id": "627bb6a6a3c066d2d1d6f1c754f01b1560607974", "size": "...
""" Renumber a fasta file, starting with either number 1 or a number provided on the command line. At the end, we output the last number written. Note that this uses the roblib library that is available from this github repository. """ import os import sys import argparse from roblib import read_fasta __author__ = '...
{ "content_hash": "8c6af7dea367e2274acecba7e527aca1", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 94, "avg_line_length": 34.53703703703704, "alnum_prop": 0.5592493297587131, "repo_name": "linsalrob/EdwardsLab", "id": "1927eecf213764a58107eaed65c419cfb8d8fc75", "size": "...
from smartcoin.action import Action from smartcoin.exception import ( RequiredParameters, ParameterValueNotAllowed, MethodNotAllowed, ParameterTypeError ) class Plan(Action): def create(self, data): if not data.get('id', None): raise RequiredParameters('Plan amount not informed') ...
{ "content_hash": "0a8ace490c593730e463122ccc8c8301", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 66, "avg_line_length": 35.7, "alnum_prop": 0.6253501400560224, "repo_name": "smartcoinpayments/smartcoin-python", "id": "3b6df7159d6fea606ddcc016fb1777e7c9a567b4", "size": ...
from dstools import Env import warnings import smtplib from email.message import EmailMessage def send_email(subject, body): env = Env() msg = EmailMessage() msg.set_content(body) try: sender = env.notifications.email.sender except KeyError: sender = None try: to = ...
{ "content_hash": "717fb488df970cec74abc2c6792ef8a8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 72, "avg_line_length": 22.43243243243243, "alnum_prop": 0.6036144578313253, "repo_name": "edublancas/python-ds-tools", "id": "e0a79b987303dd6eb403e07457e0dc3d8389fb8a", "si...
"""Test Z-Wave Websocket API.""" from unittest.mock import call, patch from homeassistant.bootstrap import async_setup_component from homeassistant.components.zwave.const import ( CONF_AUTOHEAL, CONF_NETWORK_KEY, CONF_POLLING_INTERVAL, CONF_USB_STICK_PATH, ) from homeassistant.components.zwave.websocke...
{ "content_hash": "7b2a7bcf5e44767300950a7efee33a43", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 110, "avg_line_length": 28.84090909090909, "alnum_prop": 0.6028368794326241, "repo_name": "partofthething/home-assistant", "id": "9727906709ffe0ec9976345ef986323df294176e", ...
from PyQt5.QtGui import QColor, QBrush from PyQt5.QtGui import QPainter from PyQt5.QtWidgets import QWidget from Data.Vertex import Vertex from GUI.Widgets.NewDrawers import create_pens, draw_sketch, draw_area, draw_edge, draw_kp class SketchViewWidget(QWidget): def __init__(self, parent, sketch, document): QWidg...
{ "content_hash": "840a66ebc8957a65315cb7d15bac404a", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 92, "avg_line_length": 31.06787330316742, "alnum_prop": 0.6731721526361782, "repo_name": "pracedru/PracedruDesign", "id": "167ad348e143aa291df0486cda75c168dee8884d", "size...
from collections import OrderedDict class Asset: def __init__(self, **args): self.css = args.get('css', {}) self.js = args.get('js', {}) def add_js(self, js, key, type = 'file', group = 'header', weight = 0): try: container = self.js[group] except KeyError: self.js[group] = OrderedDict() # keep ord...
{ "content_hash": "5bcd556f8ae7ff44a0d7cfa411229221", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 128, "avg_line_length": 27.8375, "alnum_prop": 0.5752132914234396, "repo_name": "vinoth3v/In", "id": "a0bcb0aefe8693e0cff8aea5bc825880f1577005", "size": "2227", "binary":...
''' User API v1.0 List ''' __author__ = 'Jim Case' from flask import jsonify, request, current_app, url_for, g from ooiservices.app.main import api from ooiservices.app import db from authentication import auth from ooiservices.app.models import OperatorEvent, OperatorEventType, Watch, Organization, LogEntry from ooi...
{ "content_hash": "1f31849a9090574196ebee78117cabaf", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 186, "avg_line_length": 39.717277486910994, "alnum_prop": 0.646388083311363, "repo_name": "asascience-open/ooi-ui-services", "id": "bd28f7e428e9f327172835461ac8976b6fbd1916"...
"""Test suite for timeout_util.py""" import datetime import os import sys import time sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__))))) from chromite.lib import cros_test_lib from chromite.lib import timeout_util # pylint: disable=W0212,R0904 class TestTimeouts...
{ "content_hash": "b666b8ac58b0e596fc1e0f30fee97844", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 80, "avg_line_length": 31.21641791044776, "alnum_prop": 0.6803729380827157, "repo_name": "bpsinc-native/src_third_party_chromite", "id": "a34ca595f56988ede23469d487d15dbe1df...
import sys # # Colleague classes # each colleague communicates with its mediator whenever # it would have otherwise communicated with another colleague # class Colleague: def __init__(self, mediator, identity): self._mediator = mediator self._id = identity def getID(self): return self._id def sen...
{ "content_hash": "90fc2e4f7f4f4d09419e2feac8978a4d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 22.573333333333334, "alnum_prop": 0.67690490253987, "repo_name": "JakubVojvoda/design-patterns-python", "id": "fa66381888ee06f37201f98aee22d6783ab8fbb3...
import zipfile import biplist import tempfile import shutil import re import os import mysql class IPA(object): def __init__(self, ipa_path): self.__ipapath = ipa_path self.__plist = None # CFBundleDisplayName @property def bundle_display_name(self): return self.plist.get('CFB...
{ "content_hash": "110ad1d9c9283f22ab92b78c9da29780", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 76, "avg_line_length": 23.74074074074074, "alnum_prop": 0.5761830473218928, "repo_name": "mythkiven/python", "id": "4610cd588da957cce663bd3d2977aa115a6020c9", "size": "2032...
"""tests/test_full_request.py. Test cases that rely on a command being ran against a running hug server Copyright (C) 2016 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ...
{ "content_hash": "a204e19aaa82d5271857c7dbda5adcc4", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 112, "avg_line_length": 36.886792452830186, "alnum_prop": 0.7483375959079284, "repo_name": "timothycrosley/hug", "id": "e60bd0d0cb0bbe8d431abb8836f6cae6d4df7895", "size": "...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
{ "content_hash": "e8a1beea8552cca03d73b06d6ade29f6", "timestamp": "", "source": "github", "line_count": 381, "max_line_length": 101, "avg_line_length": 30.616797900262466, "alnum_prop": 0.5795113587655379, "repo_name": "Huyuwei/tvm", "id": "3f6b0d2eb895bd55d567000f836347c36044ee1d", "size": "11665"...
from msrest.serialization import Model class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. :param target_resource_id: The ID of the target resource to perform next-hop on. :type target_resource_id: str :param direction: The direction of the packet rep...
{ "content_hash": "36c588ece5bb88bf491f427866bbf9ec", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 155, "avg_line_length": 45.02985074626866, "alnum_prop": 0.6463374212794166, "repo_name": "v-iam/azure-sdk-for-python", "id": "c2e9bbc6e57bc5dcf73621ca2f54744bb80c6a3c", "s...
import datetime import json import celery from celery.utils.log import get_task_logger import urllib.request from . import models LOGGER = get_task_logger(__name__) @celery.task.task(name='run_subscription') def run_subscription(subscription_id, func_run_check=None): """ Get the subscription and launch...
{ "content_hash": "dc673c5ab79e41b0fc0532ba784f50e7", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 79, "avg_line_length": 29.089430894308943, "alnum_prop": 0.6444941307993293, "repo_name": "kolekti-project/kolekti-server", "id": "a752974d9ee584353c3522a133dffe5b23851cc2",...
import bleach import hashlib import hmac import urllib import sys from threading import local from urlparse import urlparse, urlsplit, urlunsplit from django.conf import settings from django.core import urlresolvers from django.utils import encoding from django.utils.translation.trans_real import parse_accept_lang_hea...
{ "content_hash": "cea26c769047dc3220573a8474de316f", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 79, "avg_line_length": 32.55597014925373, "alnum_prop": 0.6221203438395415, "repo_name": "spasovski/zamboni", "id": "8b524beec9cf46db1e92c7a1fa1de72d18870687", "size": "87...
""" Copyright 2012 GroupDocs. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
{ "content_hash": "37a736cfb3bae64c0b093c2d1697421b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 30.43243243243243, "alnum_prop": 0.6438721136767318, "repo_name": "liosha2007/temporary-groupdocs-python-sdk", "id": "4b8bac752f9a21fdd40c17f3e80e4ae55...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: tower_workflow_job_template_node author: "John Westcott IV (...
{ "content_hash": "8574f6842e7073356e5f38ecb6b9a926", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 119, "avg_line_length": 37.38636363636363, "alnum_prop": 0.6339412360688956, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "7ef9e1461978e40859da788d3e9...
__author__ = 'ganeshchand' # white spaces are very important and have meanings in python def main(): print("White spaces are important in python") # contains 4 spaces - which is by default for a block of code #print("this is another line") # contains 3 spaces...which give error print("this is outside the mai...
{ "content_hash": "a6dc9405bc63778a9bb5c1acd8a92f29", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 114, "avg_line_length": 34.5, "alnum_prop": 0.697463768115942, "repo_name": "ganeshchand/python3", "id": "2eb7be4b10f92b3e23e2938b697b839ba95effa3", "size": "552", "binar...
''' Created on 21 May 2015 @author: ssg37927 ''' import os from savu.data.plugin_list import PluginList from savu.plugins import utils as pu import pkgutil import savu class Content(object): def __init__(self, filename): self.plugin_list = PluginList() if os.path.exists(filename): ...
{ "content_hash": "1b7f1ff305c575360692fb5f00fa882d", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 84, "avg_line_length": 27.636904761904763, "alnum_prop": 0.5778591427956062, "repo_name": "mjn19172/Savu", "id": "894827659115fd88944dda4542807faf85e2a260", "size": "4643"...
""" Data formatters. Will take data from many formats, pass through a common format, and output to many formats. """ from pandas import DataFrame import numpy as np from percept.utils.models import FieldModel from percept.fields.base import Dict from percept.conf.base import settings from percept.utils.models import...
{ "content_hash": "428be8bc10f21746f9d8074ed2c702b3", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 147, "avg_line_length": 36.856, "alnum_prop": 0.6247015411330584, "repo_name": "VikParuchuri/percept", "id": "35a1423c064d2625478a0ec81e274b38bba1d1a2", "size": "4607", ...
""" A registry module for registration of searches. This is based on the registry modules from django_autocomplete_light """ from django.db import models from search_base import SearchBase class SearchRegistry(dict): """ Dict with methods for handling search registration. """ def __init__(self): ...
{ "content_hash": "f6dc45fd4096d684b7af599c971f6e90", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 85, "avg_line_length": 29.493827160493826, "alnum_prop": 0.617831728756802, "repo_name": "Unsettled/eve-wspace", "id": "69177c48d607212010bd61556fa70f8c98dc78a3", "size": "...
""" Item Exporters are used to export/serialize items into different formats. """ import csv import pprint import marshal import json import cPickle as pickle from xml.sax.saxutils import XMLGenerator from scrapy.utils.serialize import ScrapyJSONEncoder __all__ = ['BaseItemExporter', 'PprintItemExporter', 'PickleIte...
{ "content_hash": "aeca9a3ff55630f473481f3f90b6a39a", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 88, "avg_line_length": 33.25358851674641, "alnum_prop": 0.6221582733812949, "repo_name": "emschorsch/scrapy", "id": "685ab35dab275c752a9059d430a9c9441080b0f5", "size": "69...
import math import matplotlib.pyplot as plot mu = 60 sigmaSquared = 7 x = 8 pi = math.pi # 3.141 # print(pi) e = math.e # 2.718 # print(e) def evalGaussian(mu, sigmaSquared, x): a = (1 / math.sqrt(2 * pi * sigmaSquared)) b = ((-1 / 2) * math.pow((x - mu), 2)) / sigmaSquared result = a * math.pow(e, b)...
{ "content_hash": "6c10afaab5a29a73bf56bb9e19ddc700", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 68, "avg_line_length": 19.851063829787233, "alnum_prop": 0.6441586280814576, "repo_name": "swirlingsand/self-driving-car-nanodegree-nd013", "id": "1062b959071d1032833a2b006a5...
import string import random import argparse import os import shutil parser = argparse.ArgumentParser() parser.add_argument("-n", "--number", type=int, help="The number of files to make") args = parser.parse_args() number = args.number path = "08-ExerciseRandomFiles/" name = "archive-" # make some new files.... for...
{ "content_hash": "45386cb4b6c7090a89371528b7bacb01", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 133, "avg_line_length": 26.46875, "alnum_prop": 0.6564344746162928, "repo_name": "michaelcw02/Python", "id": "13a0719e7b524e8038275065a200d329326ff6d5", "size": "847", "b...
import os from logshipper.tail import Tail from st2reactor.sensor.base import Sensor class FileWatchSensor(Sensor): def __init__(self, sensor_service, config=None): super(FileWatchSensor, self).__init__(sensor_service=sensor_service, config=config) s...
{ "content_hash": "2d267dfcdaabdeaa6e062845758b0da7", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 76, "avg_line_length": 27.24074074074074, "alnum_prop": 0.5669612508497621, "repo_name": "peak6/st2", "id": "d350c87c0fff5d28b7d0761cf17769f834284760", "size": "1471", "b...
import random import string def random_string_generator(size=7, chars=string.ascii_lowercase + string.digits): return ''.join(random.choice(chars) for _ in range(size)) def make_generated_slug(instance, new_slug=None): if new_slug is not None: slug = new_slug else: slug = random_string_generator() Klass ...
{ "content_hash": "75af45d2a4c7ce11c7bf9d52138ed342", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 82, "avg_line_length": 38.7875, "alnum_prop": 0.6490493071221398, "repo_name": "caschne/quondam-link", "id": "1010835b582da1179f09399914843e9013dec205", "size": "3103", "...
import pytest @pytest.fixture(autouse=True) def ensure_diskless(): from veros import runtime_settings object.__setattr__(runtime_settings, "diskless_mode", True) def test_setup_acc(): from veros.setups.acc import ACCSetup sim = ACCSetup() sim.setup() with sim.state.settings.unlock(): ...
{ "content_hash": "8f1b74a2b2168eeba8f48923b2977223", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 21.573170731707318, "alnum_prop": 0.6636517806670436, "repo_name": "dionhaefner/veros", "id": "07b207c709fc055b93c4e9c46f43a45f3e9649c9", "size": "17...
def extractSousetsuka(item): """ # Sousetsuka """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None if 'Desumachi' in item['tags'] or 'Death March kara Hajimaru Isekai Kyousoukyoku' in item['title']: extract = re.se...
{ "content_hash": "fa0a1abddc42e3a8415cec5edf6256a4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 129, "avg_line_length": 45.06896551724138, "alnum_prop": 0.5883703136954859, "repo_name": "fake-name/ReadableWebProxy", "id": "bd5253fd1df8d0aaf928bcdbee9aaa19ac737543", "s...
""" """ from io import BytesIO from itertools import count import tarfile from time import time, sleep from click import progressbar from logbook import Logger import pandas as pd import requests from six.moves.urllib.parse import urlencode from boto import connect_s3 import tarfile from . import core as bundles fro...
{ "content_hash": "6f3cb4ae424a1e92fa0d54914699c64a", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 70, "avg_line_length": 28.352941176470587, "alnum_prop": 0.6286307053941909, "repo_name": "magne-max/zipline-ja", "id": "a500b2c57772862497ce668bf3b0556137f4f7ed", "size": ...
from .calling_conventions import DEFAULT_CC class Callable(object): """ Callable is a representation of a function in the binary that can be interacted with like a native python function. If you set perform_merge=True (the default), the result will be returned to you, and you can get the result st...
{ "content_hash": "2c3485016b6764c29515a9e36cc6b269", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 165, "avg_line_length": 41.839506172839506, "alnum_prop": 0.6279138388905282, "repo_name": "chubbymaggie/angr", "id": "0df28e7135dfdbaa6ba1b4ca2d4367ed34c59668", "size": "3...
import os import sys import django if __name__ == "__main__": os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' from django.conf import settings from django.test.utils import get_runner if django.VERSION >= (1, 7): django.setup() TestRunner = get_runner(settings) test_runne...
{ "content_hash": "17405bea98e217e5a521d451b83e0c3d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 64, "avg_line_length": 24.352941176470587, "alnum_prop": 0.6570048309178744, "repo_name": "torchingloom/django-bulk-update", "id": "dcdc38784e61a453470b202b621fc7fc4e354137",...
import jackrabbit class ExampleProxy(jackrabbit.ProxyBase): def __init__(self, uri): super(ExampleProxy, self).__init__(uri) def foo_v1(self, name, age, email): return self.exec_rpc('foo', 1, arg1=name, arg2=age, arg3=email) def bar_v1(self): return self.exec_rpc('bar', 1) prox...
{ "content_hash": "98f747cac5ba4a4eb033d5e17033ff51", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 71, "avg_line_length": 27.40740740740741, "alnum_prop": 0.6486486486486487, "repo_name": "cbigler/jackrabbit", "id": "3a26c6f65b5af34f7559928ea920f6af46801bb8", "size": "76...
from array import array import itertools import struct try: # see :pyver:old array.tostring except: def tostring(row): l = len(row) return struct.pack('%dB' % l, *row) else: def tostring(row): """Convert row of bytes to string. Expects `row` to be an ``array``. """...
{ "content_hash": "a2389c93116b35b2726e264c99e8a41f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 24.25581395348837, "alnum_prop": 0.5953978906999041, "repo_name": "ojii/pymaging-png", "id": "09b4affcd91dfb0e6c0515835dfd5d5447b3aa88", "size": "259...
import pymongo import sessionDAO import userDAO import bottle import cgi import re __author__ = 'aje' # General Discussion on structure. This program implements a blog. This file is the best place to start to get # to know the code. In this file, which is the controller, we define a bunch of HTTP routes that are h...
{ "content_hash": "e2e6eb103ff211e2184724f917c25587", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 110, "avg_line_length": 31.469945355191257, "alnum_prop": 0.6478555304740407, "repo_name": "ChrisEby/M101P-MongoDbForDevelopers", "id": "0a239b056693561964f7310e4c1883c4ac3f...
from __future__ import absolute_import, unicode_literals import json from tekton.gae.middleware import Middleware def _extract_values(handler, param, default_value=""): values = handler.request.get_all(param) if param.endswith("[]"): return param[:-2], values if values else [] else: if not...
{ "content_hash": "1981ceffb9317b2cb99a6fa0b492512b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 118, "avg_line_length": 40.16, "alnum_prop": 0.6673306772908366, "repo_name": "andersonsilvade/5semscript", "id": "87a63a497d577f18f9c98fde1ccd0b115356759c", "size": "1028"...
"""Model definitions for celebA This file is partially based on https://github.com/carpedm20/DCGAN-tensorflow/blob/master/main.py https://github.com/carpedm20/DCGAN-tensorflow/blob/master/model.py They come with the following license: https://github.com/carpedm20/DCGAN-tensorflow/blob/master/LICENSE """ import os im...
{ "content_hash": "7d3419c23498c988e3c595d8050294ca", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 106, "avg_line_length": 37.51923076923077, "alnum_prop": 0.7114300358790364, "repo_name": "AshishBora/csgm", "id": "5703cc7f1c593f863e2fbae2e9165a5e71d5b3d7", "size": "1999...
import argparse import hashlib import os import struct import subprocess import tempfile LOAD_ADDR = 0x100000 HEADER_SIZE = 0x140 SPI_CLOCK_LIST = [48, 24, 12, 8] SPI_READ_CMD_LIST = [0x3, 0xb, 0x3b] CRC_TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x...
{ "content_hash": "533c6c918c38c2eb35c49a81618c21a5", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 88, "avg_line_length": 35.13469387755102, "alnum_prop": 0.5983968401486989, "repo_name": "akappy7/ChromeOS_EC_LED_Diagnostics", "id": "7fed5a800817271dabc5a1ddacdf7d0a6f3a8c...
import pymysql from flask_restful import Resource from flask import abort ALLOWED_SHOW = ('processlist', 'databases', 'plugins', 'privileges') class Mysql(Resource): def __init__(self): self.connection = pymysql.connect(user='root') self.cursor = self.connection.cursor() def _execute(self, s...
{ "content_hash": "ff540d648a262b263dc2cdea42d80200", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 69, "avg_line_length": 29.022222222222222, "alnum_prop": 0.6026033690658499, "repo_name": "natict/roomservice", "id": "f0712b77d7a394c1a71a8038580f4fde7fe5171d", "size": "1...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 0, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "e416c598d55ddd12fe1a6649935d24ea", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 169, "avg_line_length": 38.42857142857143, "alnum_prop": 0.7100371747211895, "repo_name": "antoinecarme/pyaf", "id": "9c8650211f239ac21dc85f9fce29559c43984898", "size": "269...
import pytest from cppyy.gbl import std from .utils import * from goetia.hashing import FwdLemireShifter, UKHS from goetia.storage import count_t import pytest @using(ksize=[21, 101]) @presence_backends() def test_presence_insert(graph, ksize, random_sequence): # basic get/add test for kmer in kmers(random_s...
{ "content_hash": "92f5881e610fe3c4b46d6100b7e5321f", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 92, "avg_line_length": 27.501519756838906, "alnum_prop": 0.6467727674624226, "repo_name": "camillescott/boink", "id": "3c787f9a2bbe243378933de5e521c561c464a6b4", "size": "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PyConPosterProposal.overall_status' db.add_column(u'pycon_pyconposterproposal', 'overall_status', ...
{ "content_hash": "a1f8e4340478311ee9806ae1c77c83c9", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 218, "avg_line_length": 69.09691629955947, "alnum_prop": 0.5813197322282435, "repo_name": "pyconjp/pyconjp-website", "id": "47ac0f10dd798de8e81b2579e973e158ec96442b", "siz...
"""ByteNet tests.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensor2tensor.data_generators import problem_hparams from tensor2tensor.models import bytenet import tensorflow as tf class ByteNetTest(tf.test.TestCase): def...
{ "content_hash": "357611f0b10031ed1d6f3033dfd6c7e1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 76, "avg_line_length": 30.944444444444443, "alnum_prop": 0.6606822262118492, "repo_name": "vthorsteinsson/tensor2tensor", "id": "67fff4a5063e5f651e5395232731d71e7287b6a0", ...
from csv import DictWriter, DictReader import re import validate from csv_consts import CSV_NULL, CSV_NA, CSV_TRUE, CSV_FALSE OLD_TO_NEW = { 'Hut_ID': None, 'Date_Added': None, 'Date_Updated': 'date_updated', 'Discretion': 'discretion', 'Country': 'country', 'State': 'state', 'Region': 'region', 'Desig...
{ "content_hash": "d908a9b490477c6eeb809bd6597e8dde", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 87, "avg_line_length": 29.587719298245613, "alnum_prop": 0.5757485917580789, "repo_name": "dylanfprice/hutmap", "id": "3fa3ac8947212f10ce70c706330f264a4a7caf57", "size": "...
''' ## License The MIT License (MIT) GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi. Copyright (C) 2015 Dexter Industries Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Sof...
{ "content_hash": "c43000996fa5497f654935a871afd8d6", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 268, "avg_line_length": 37.964285714285715, "alnum_prop": 0.7403574788334901, "repo_name": "rpedersen/GrovePi", "id": "a84e627e2f19f67ce318ed6a523c9064d8e64136", "size": "2...
from CoreCatalog import app app.run(host='0.0.0.0',debug=True)
{ "content_hash": "c46fc44c90816596843b3cd05ec57c1b", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 34, "avg_line_length": 31.5, "alnum_prop": 0.746031746031746, "repo_name": "CORE-POS/CoreCatalog", "id": "04d295b03b8d4d2e62c6801585b19532baf0f3ab", "size": "63", "binary"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cart_project.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "1f0e63315fabeb69de2d7c885c43590c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 76, "avg_line_length": 25.88888888888889, "alnum_prop": 0.7124463519313304, "repo_name": "marcosmoyano/simple-cart", "id": "be400fa712fe3f5f3647cd1bbc9f06c73cbd3d0c", "size"...
from app import app def create_app(configfile=None): return app
{ "content_hash": "f06811b3dc62cb67e57d7786e491c2cd", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 32, "avg_line_length": 17, "alnum_prop": 0.75, "repo_name": "fabiansinz/pipecontrol", "id": "ccc3c4ffe18c794f091e680ce85e55cf73afb570", "size": "68", "binary": false, "c...
from PyQt4.QtCore import QModelIndex, QVariant, Qt from PyQt4.QtGui import QSortFilterProxyModel from ems.qt4.util import variant_to_pyobject class SortFilterProxyModel(QSortFilterProxyModel): def pyData(self, index, role=Qt.DisplayRole): return variant_to_pyobject(self.data(index, role)) def columnT...
{ "content_hash": "a7355229ed288912db5f784f2d561119", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 92, "avg_line_length": 31.84027777777778, "alnum_prop": 0.6427480916030535, "repo_name": "mtils/ems", "id": "22efbc74b443cf28cc2d136c5831bf94ba261581", "size": "4586", "...
"""getMessage.py: Get a message from a collection in the R2DM service.""" __author__ = "Filip Lemic" __copyright__ = "Copyright 2015, EVARILOS Project" __version__ = "1.0.0" __maintainer__ = "Filip Lemic" __email__ = "lemic@tkn.tu-berlin.de" __status__ = "Development" import sys import urllib2 import json import raw...
{ "content_hash": "b2db9b56d6266eed8ae45a4ae841f132", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 200, "avg_line_length": 32.48780487804878, "alnum_prop": 0.7102102102102102, "repo_name": "evarilos/R2DM-EVARILOS", "id": "563d18833d483aa7caa7b990994a35c2af9fecec", "size"...
from .server import PulsarDS, DEFAULT_PULSAR_STORE_ADDRESS, pulsards_url from .client import COMMANDS_INFO, redis_to_py_pattern from .parser import (PyRedisParser, RedisParser, redis_parser, RedisError, ResponseError, InvalidResponse, NoScriptError, CommandError) __all__ = ['...
{ "content_hash": "867d5b7c4bd8d7935aec360635ebbd6b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 72, "avg_line_length": 49.5, "alnum_prop": 0.6582491582491582, "repo_name": "ymero/pulsar", "id": "c5e9fd0a038bcd03bd05585c6e6f5c60308014c1", "size": "594", "binary": fal...
from django.core.management.base import BaseCommand from editor.models import Source, Format, Category class Command(BaseCommand): help = 'Adds root category for Source, Format and Category models.' def _change_root(self, model_class, verbosity=1): ROOT_NAME = '!ROOT!' try: sour...
{ "content_hash": "6e526ad6cb0ae307c5b8dad860270c15", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 95, "avg_line_length": 36.5, "alnum_prop": 0.6010958904109589, "repo_name": "CivicKnowledge/metaeditor", "id": "cba51e3ca63479dc3df1467fde9f44ce73bf633a", "size": "1850", ...
from __future__ import ( absolute_import, division, print_function, unicode_literals) from .experiment import Experiment from . import filters from . import util from .core import *
{ "content_hash": "c27b2a709b012b10b6d4e1ad9072df40", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 68, "avg_line_length": 27.285714285714285, "alnum_prop": 0.7382198952879581, "repo_name": "nicktimko/multiworm", "id": "2868989a89309478c9670f365586c77095a77a9b", "size": "2...
from __future__ import print_function from unittest import TestCase import harvester.fetcher as fetcher from test.utils import DIR_FIXTURES from test.utils import LogOverrideMixin from mypretty import httpretty # import httpretty class FlickrFetcherTestCase(LogOverrideMixin, TestCase): '''Test the fetcher for the...
{ "content_hash": "3306e628dbbbb7884fb431682ea606b9", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 79, "avg_line_length": 39.10894941634241, "alnum_prop": 0.4724405531787882, "repo_name": "ucldc/harvester", "id": "2ac768652262e8f6e884d636d3f43e48975027ae", "size": "2012...
""" Used to generate the simple dataset for testing. Generates a dataset with 1000 tuples, 2 attributes A & B. Each attribute takes values randomly from 1 to 1000. """ import os import random if __name__ == "__main__": dir_path = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path) if not os.path.isdi...
{ "content_hash": "23cc2b28fb08fc0f86fff47ca22bec36", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 96, "avg_line_length": 27.94736842105263, "alnum_prop": 0.6629001883239172, "repo_name": "mitdbg/amoeba", "id": "b752232593eb481e6222018d2d8a13ecf394127b", "size": "531", ...
from oslo_serialization import jsonutils import six from heat.common import exception from heat.engine.cfn import functions as cfn_funcs from heat.engine import constraints from heat.engine.hot import parameters as hot_param from heat.engine import parameters from heat.engine import plugin_manager from heat.engine imp...
{ "content_hash": "e32fae58c74ea0579fd819d142581b70", "timestamp": "", "source": "github", "line_count": 1894, "max_line_length": 79, "avg_line_length": 39.2713833157339, "alnum_prop": 0.5140898090884647, "repo_name": "steveb/heat", "id": "47e6fe446b4cf4544ae81b30c102067d0d2e20d7", "size": "74955", ...
from django.conf.urls.defaults import * from .views import download, download_list urlpatterns = patterns('', url(r'^$', download_list), url(r'(?P<download_id>\d+)/$', download, name='download'), )
{ "content_hash": "ea62d0cc05f0607361989ba75a892ac1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 62, "avg_line_length": 26, "alnum_prop": 0.6634615384615384, "repo_name": "NotSqrt/django-sendfile", "id": "fd4bb28a4ab9a6f556321f30177ae4b9f7e701d5", "size": "208", "bina...
"""Tests for Keras activation functions.""" from absl.testing import parameterized import numpy as np from tensorflow.python.keras import activations from tensorflow.python.keras import backend from tensorflow.python.keras import combinations from tensorflow.python.keras.layers import advanced_activations from tensor...
{ "content_hash": "5212431e5dc1a938e3911c8779c83ec5", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 78, "avg_line_length": 35.443548387096776, "alnum_prop": 0.645278725824801, "repo_name": "Intel-Corporation/tensorflow", "id": "c02402004ad3b7e92b6fe96624a8c4ee5dc2b705", ...
from framework.orchestrator_apis import * from framework.orchestrator_base import OrchestratorBase class GatewayAPI(OrchestratorBase): def __init__(self, orchestrator_driver): self.orchestrator_driver = orchestrator_driver self.orchestrator_client = self.orchestrator_driver.orchestrator_client ...
{ "content_hash": "60daa7872b82e6d5b4b0db604e69107c", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 112, "avg_line_length": 47.018348623853214, "alnum_prop": 0.7194146341463414, "repo_name": "zero-os/0-orchestrator", "id": "c8e4bfe1f308067840d44ac4a92859b8592d8ea4", "siz...
class MockDbusService(object): def __init__(self, servicename): self._dbusobjects = {} self._callbacks = {} self._service_name = servicename def add_path(self, path, value, description="", writeable=False, onchangecallback=None, gettextcallback=None): self._dbus...
{ "content_hash": "fd507d60b8dbdb544064b5806c380e8a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 104, "avg_line_length": 40.285714285714285, "alnum_prop": 0.6458333333333334, "repo_name": "victronenergy/velib_python", "id": "edcb4af6bcc365ecb33b8b533e67775a4ec99968", "...
# a backend to expose a YMAJ library via UPnP # see http://code.google.com/p/moviejukebox/ for more info on YAMJ (Yet Another Movie Jukebox): # Copyright 2007, Frank Scholz <coherence@beebits.net> # Copyright 2009, Jean-Michel Sizun <jm.sizun AT free.fr> # # TODO: add comments import urllib from coheren...
{ "content_hash": "25f64ae1e45587386f814d4f5cc4114e", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 177, "avg_line_length": 45, "alnum_prop": 0.5287128712871287, "repo_name": "ligthyear/coherence-mirror", "id": "bbdd97d579eeb504164688bef12d2055f25172db", "size": "13719",...
''' Created on Nov 15, 2013 @author: mcechini ''' from xml.dom import minidom from html import escape import sys, getopt, os # Hack for Python 2 if sys.version_info[0] < 3: reload(sys) sys.setdefaultencoding('utf8') ## Class Definitions ## class ColorMapEntry(): rgb = "" transparent = False ...
{ "content_hash": "810cf9963e6db448600ca3139b6662a6", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 113, "avg_line_length": 25.819095477386934, "alnum_prop": 0.5924484235110938, "repo_name": "nasa-gibs/onearth", "id": "4e1545463bea813c1e4d82f3c11b1a95f1915c6f", "size": "...
from defusedxml.ElementTree import fromstring from .exceptions import UnpopulatedPropertyError from .property_decorators import property_not_empty, property_is_boolean class TableItem(object): def __init__(self, name, description=None): self._id = None self.description = description self....
{ "content_hash": "cf42db40335084d835b362997d0c8399", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 89, "avg_line_length": 28.10322580645161, "alnum_prop": 0.619605142332415, "repo_name": "tableau/server-client-python", "id": "93edac63c1e0f5bcb225ee2012c79c7444b97e86", "...
from django.conf.urls import url, include urlpatterns = ( url(r'^v0/', include('api.v0.urls', namespace="api-v0")), )
{ "content_hash": "0bc9765a5e9ce5870becc736c0a5699e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 61, "avg_line_length": 20.666666666666668, "alnum_prop": 0.6532258064516129, "repo_name": "ministryofjustice/manchester_traffic_offences_pleas", "id": "486a35ba4c796a8a714a56d...
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundEr...
{ "content_hash": "9a3c97957e710d25dbc32bc850aa8d0d", "timestamp": "", "source": "github", "line_count": 5585, "max_line_length": 261, "avg_line_length": 49.42972247090421, "alnum_prop": 0.6476047307699274, "repo_name": "Azure/azure-sdk-for-python", "id": "ea82c95d34c0075c9e2f41bb68599a22f496cd39", ...
"""Parse a C++ input and try to generate SWIG %template declarations so that this template <typename T1, typename T2> DoubleVect OnBitProjSimilarity(const T1& bv1,const T2& bv2); becomes this %template(OnBitProjSimilarityEBV) OnBitProjSimilarity<ExplicitBitVect,ExplicitBitVect>; """ import re template...
{ "content_hash": "e298856e42ad0667e4ede15638999ced", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 91, "avg_line_length": 31.853658536585368, "alnum_prop": 0.6592649310872895, "repo_name": "bp-kelley/rdkit", "id": "44db1e2dce477fc48da12d96e111a7ff52a2c4f3", "size": "1327...
import argparse import logging import time import ray import wikipedia from ray.streaming.streaming import Environment logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser() parser.add_argument( "--titles-file", required=True, help="the file contai...
{ "content_hash": "a587be343d50f283cc3ce606d81f0598", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 78, "avg_line_length": 32.647619047619045, "alnum_prop": 0.6190198366394399, "repo_name": "stephanie-wang/ray", "id": "d9ce4cd54de7968e7284356a5a9e5ae42d71ce43", "size": "...
from __future__ import unicode_literals, division, absolute_import from datetime import datetime from sqlalchemy import extract, func from sqlalchemy.orm import synonym from sqlalchemy.ext.hybrid import Comparator, hybrid_property from flexget.manager import Session from flexget.utils import qualities def with_sess...
{ "content_hash": "8918fc9773619fdd6557125a805fad3f", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 116, "avg_line_length": 29.34562211981567, "alnum_prop": 0.6034861809045227, "repo_name": "voriux/Flexget", "id": "d7ea7b0987323464c63b4e5835c73639a9bcba5c", "size": "6368...
import json import datetime from unittest.mock import MagicMock, patch from django.urls import reverse from django.contrib.auth.models import User from rest_framework.test import APIRequestFactory, APITestCase, \ force_authenticate, APIClient from rest_framework.authtoken.models import Token from ehb_client.reque...
{ "content_hash": "8b8ac6a35abb7d33ca5d7b651931d906", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 142, "avg_line_length": 37.476603119584055, "alnum_prop": 0.5982704402515723, "repo_name": "chop-dbhi/biorepo-portal", "id": "da6695d70cd305948e7d66052b2506198a6f6060", "s...
import unittest from datetime import datetime import cgi import hashlib from webob import Request, Response from webob.exc import HTTPUnauthorized, HTTPCreated, HTTPNoContent,\ HTTPAccepted, HTTPBadRequest, HTTPNotFound, HTTPConflict import xml.dom.minidom import simplejson from swift.common.middleware import sw...
{ "content_hash": "6eab119e67d05aaf320111e2b9f78f13", "timestamp": "", "source": "github", "line_count": 601, "max_line_length": 81, "avg_line_length": 44.90682196339434, "alnum_prop": 0.5524472933417318, "repo_name": "ceph/swift", "id": "da49413310cc965707b450f4a6c1dafa964a8fce", "size": "27574", ...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('image_board', '0003_auto_2017062...
{ "content_hash": "0b09702e52fe698771073562a1cb5722", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 133, "avg_line_length": 34.285714285714285, "alnum_prop": 0.5791666666666667, "repo_name": "SNDjango/server", "id": "8820fec51c7ce4dbc5a14f09f6b2344121c7f0cd", "size": "199...
""" Multi Ant Colony Optimization Problema: Otimização multi-objetivo para maximização de IC com limite de custo Entrada: Equipamentos do Segmento Saida: Melhor solução de troca Este algoritmo segue a adaptação do AS (Ant System) de acordo com o trabalho de Hanxiao Shi, "Solution to 0/1 Knapsack Problem Based on Imp...
{ "content_hash": "713deb9a94e63d7d515c33ac6334145b", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 394, "avg_line_length": 41.41481481481482, "alnum_prop": 0.5696655338937578, "repo_name": "vhte/cefetdiss", "id": "8fa8d8c38eea035b1b5b11800cd8642c8b030880", "size": "1129...
print("package __init__:", __name__) from . import Child1
{ "content_hash": "715d6f92c9859acf5e47f0d8e2765fe7", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 36, "avg_line_length": 19.666666666666668, "alnum_prop": 0.6101694915254238, "repo_name": "kayhayen/Nuitka", "id": "bd0d4a13cf346d0bf2da17e1550b8254f13076ec", "size": "828",...
from hyperstream.stream import StreamInstance, StreamMetaInstance from hyperstream.tool import PlateCreationTool import logging class AssetPlateGenerator(PlateCreationTool): def __init__(self, element=None, filters=None, use_value_instead_of_key=False): """ Special tool to extract data from the a...
{ "content_hash": "974ef0c550efa3ef83dcaeb533ffdec1", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 120, "avg_line_length": 44.54838709677419, "alnum_prop": 0.6136857349746561, "repo_name": "IRC-SPHERE/HyperStream", "id": "6c20decf762d6c59b853d74483f3bc661f1dbf6b", "size"...
import os import argparse import ConfigParser from . import BlogEngine, getLogger import source import output from upload import FtpUpload from entity import Site # setup logger import logging import sys root = getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stderr) ch.setLevel(logging.DEBU...
{ "content_hash": "96fc2ed24e3958522c015ba85f52f0a4", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 126, "avg_line_length": 38.661764705882355, "alnum_prop": 0.6709775580068467, "repo_name": "tspycher/python-blogengine", "id": "d98ac1ee4060f1af2bfa23375af830ba56a9b062", "...
class IDAVProvider: """ +----------------------------------------------------------------------+ | TODO: document this interface | | For now, see wsgidav.DAVProvider instead. | +--------------------------------------------------------...
{ "content_hash": "3a9196381ea8b899a828769564b3f33f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 39.63157894736842, "alnum_prop": 0.5046480743691899, "repo_name": "mar10/wsgidav", "id": "785e71260a329260fe81c7953b1e7dadc4477b21", "size": "779", ...
from environment import * from imports import mpi # DistGraph # ========= lib.ElDistGraphCreate.argtypes = [POINTER(c_void_p),mpi.Comm] lib.ElDistGraphCreate.restype = c_uint lib.ElDistGraphDestroy.argtypes = [c_void_p] lib.ElDistGraphDestroy.restype = c_uint lib.ElDistGraphEmpty.argtypes = [c_void_p] lib.ElDis...
{ "content_hash": "a7de4d582319f7b7c4754ce4843be31b", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 79, "avg_line_length": 36.56398104265403, "alnum_prop": 0.7716137394685677, "repo_name": "sg0/Elemental", "id": "7c99208032695dc0d498cc1670527fad7219c8af", "size": "7979",...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "03a49ba249165575eca75d178ec3e2e4", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 418, "avg_line_length": 31.28388746803069, "alnum_prop": 0.7106769130150425, "repo_name": "benfinke/ns_python", "id": "b98e1988aec39a449270dfaf7eb84fad48da85ab", "size": "...
""" run the eight ball. """ ## jsb imports from jsb.utils.exception import handle_exception from jsb.lib.commands import cmnds from jsb.lib.examples import examples ## basic imports import re import random ## defines balltxt=[ "Signs point to yes.", "Yes.", "Most likely.", "Without a doubt.", ...
{ "content_hash": "12a19c14cefd36680680c445806c602e", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 66, "avg_line_length": 21.152173913043477, "alnum_prop": 0.6063720452209661, "repo_name": "melmothx/jsonbot", "id": "8a31a7e4a83909a8c8ef8f45a05ab030b68bf907", "size": "100...
""" Input and output facilities. """ __all__ = [ 'AmscaAnchor', 'MeshInfoHook', 'ProgressHook', 'FillAnchor', 'CflAnchor', 'CflHook', 'MarchSaveAnchor', 'PMarchSave', ] import os import time import math import warnings import numpy as np from solvcon import anchor from solvcon import hook from solvcon.io ...
{ "content_hash": "2d405f7cce19917b3847b09104123395", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 80, "avg_line_length": 35.943866943866944, "alnum_prop": 0.5458383943547921, "repo_name": "solvcon/solvcon", "id": "358af03f38e9d33fc6be4024a585ef2016af2d7d", "size": "188...
"""bswitch.py -- binary-tree switch statement For functions that are composed of long if statements testing a value, this rewrites their bytecode. """ # todo: try this out https://pypi.python.org/pypi/BytecodeAssembler # todo: also this http://pydoc.org/2.5.1/compiler.pyassem.html import collections, opcode, struct, d...
{ "content_hash": "2d5f5932ca17211d4970715520311b00", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 125, "avg_line_length": 46.93582887700535, "alnum_prop": 0.6949982909878091, "repo_name": "abe-winter/bswitch", "id": "36f8737220a12dee6c9527ed417e6773e0acb74e", "size": "...
"""Task sub-commands""" import importlib import json import logging import os import textwrap from contextlib import contextmanager, redirect_stderr, redirect_stdout from typing import List from pendulum.parsing.exceptions import ParserError from airflow import settings from airflow.cli.simple_table import AirflowCon...
{ "content_hash": "b7b8dc208f988a068bdba8c7ac3e5d22", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 107, "avg_line_length": 33.333333333333336, "alnum_prop": 0.6327450980392156, "repo_name": "dhuang/incubator-airflow", "id": "5324235e8f808c3d49d92b6ead60cb1bf79eaf8b", "s...
import requests class BaseService(object): def __init__(self, key=None, base_url=None): if key: self.key = key if base_url: self.base_url = base_url def new(self, resource=None): return self.request(resource, params={'schema': 'blank'}) def get(self, pk,...
{ "content_hash": "bd9acd88cc219c0f848017b8c0f90eb7", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 71, "avg_line_length": 23.41509433962264, "alnum_prop": 0.5278001611603546, "repo_name": "josesanch/prestaorm", "id": "a79a09d0956c404b88b57f992d198a814a8906bd", "size": "1...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tags', '0001_initial'), ('articles', '0008_auto_20150914_2059'), ] operations = [ migrations.AddField( model_name='article', ...
{ "content_hash": "f620d1a82db8793edfe7a32e522f73c6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 88, "avg_line_length": 23.57894736842105, "alnum_prop": 0.5870535714285714, "repo_name": "I-sektionen/i-portalen", "id": "5d455ea8d5bf57eab4775c1fadb32db6ad96b4dd", "size":...
"""A setup module for the GAPIC IAM Admin library. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages import sys install_requires = [ 'googleapis-common-protos>=1.3.5, <2.0.0dev', 'google-gax>=0.14.1, <0.15.0dev'...
{ "content_hash": "26d9e359dc3408f04c6e6621651f1999", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 106, "avg_line_length": 34.888888888888886, "alnum_prop": 0.6420382165605095, "repo_name": "landrito/api-client-staging", "id": "dd9e12e5a537cc276966de70f58df12d696a1c40", ...
import sys as __sys if __sys.version_info < (3, ): # pragma: no cover print('WARNING, Python 2 is EOL and therefore py2 support in this ' "package is deprecated. It won't be actively checked for" 'correctness') # list all the constants and export them from .__internals import PAM_ACCT_EXPIRED...
{ "content_hash": "df8fe866d86b0023d6ccb577f6331ed6", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 118, "avg_line_length": 30.59124087591241, "alnum_prop": 0.6800286327845383, "repo_name": "FirefighterBlu3/python-pam", "id": "0c6f9e0cae4aef74af562032dcc559e553180eff", "...
from unittest import mock import oslo_i18n from tacker.agent.linux import utils from tacker.tests import base _marker = object() class AgentUtilsExecuteTest(base.BaseTestCase): def setUp(self): super(AgentUtilsExecuteTest, self).setUp() self.test_file = self.get_temp_file_path('test_execute.tm...
{ "content_hash": "9fa474d4c7c275079bee9aafe8832804", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 79, "avg_line_length": 41.67669172932331, "alnum_prop": 0.6056287209092549, "repo_name": "openstack/tacker", "id": "ef7386e7d6a607a004c7fe41fc0a4010a2576219", "size": "615...
from TwitterAPI import TwitterAPI # setup TwitterAPI api = TwitterAPI( \ consumer_key='***redacted***', \ consumer_secret='***redacted***', \ access_token_key='***redacted***', \ access_token_secret='***redacted***' \ ) # get a list of already blocked users. blockedUsers = list...
{ "content_hash": "b5205b72202442cdc40c78246ffd507b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 162, "avg_line_length": 41.92, "alnum_prop": 0.6192748091603053, "repo_name": "00101010b/stuff", "id": "a3942901816c569dde330ddad2ea82da8887ea00", "size": "1177", "binary...
import IECore import Gaffer import GafferScene import GafferSceneTest class StandardOptionsTest( GafferSceneTest.SceneTestCase ) : def testSerialisation( self ) : s = Gaffer.ScriptNode() s["r"] = GafferScene.StandardOptions() s["r"]["options"]["renderCamera"]["value"].setValue( "/path/to/a/camera" ) names ...
{ "content_hash": "1e43b5fdd871808648b2e8ce7cbed4da", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 104, "avg_line_length": 31.518987341772153, "alnum_prop": 0.6566265060240963, "repo_name": "chippey/gaffer", "id": "55bcd5f709b9bb648466ce705347803028e78733", "size": "4293...
from __future__ import unicode_literals from django.db import models, migrations import uuid class Migration(migrations.Migration): dependencies = [ ('gtfs', '0011_auto_20150402_1150'), ] operations = [ migrations.CreateModel( name='Trip', fields=[ ...
{ "content_hash": "c7877a868ba87e4ef4b962858b11899f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 236, "avg_line_length": 48.1875, "alnum_prop": 0.5804150453955902, "repo_name": "MarconiMediaGroup/GTFS-Builder", "id": "ba8b79bc3ac2af844b959f03b72f057fc37d28f4", "size": ...
try: import unittest2 as unittest except ImportError: import unittest # noqa from puresasl import SASLError from puresasl.client import SASLClient from puresasl.mechanisms import AnonymousMechanism, PlainMechanism, mechanisms, DigestMD5Mechanism class SASLClientTest(unittest.TestCase): def test_init(se...
{ "content_hash": "177c06342e83926275d1e4a0645c2745", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 105, "avg_line_length": 42.901408450704224, "alnum_prop": 0.6963230466185161, "repo_name": "thobbs/pure-sasl", "id": "905d3757cda5757cd2fb1cdec3331500da1e8bac", "size": "30...
from setuptools import setup from distutils.core import setup import merlin setup(name='py-merlin', version=merlin.__version__, description='Python bindings for Blackbird Search', url="https://github.com/blackbirdtech/merlin-python", packages=['merlin', 'merlin/upload'], scripts=[ ...
{ "content_hash": "b26e7a3bf4f78a77690cce2469cb1e5a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 59, "avg_line_length": 26.42105263157895, "alnum_prop": 0.6235059760956175, "repo_name": "blackbirdtech/merlin-python", "id": "d0da604e4eea83fd62678681047e63135f7bf947", "s...
import sys import time import random #this sucks.. cannot find dis since "root" path is blah/test #we might need to create a variable we pass via the brython function # to state what the root path is. # For now, we'll hardcode a relative path. :( sys.path.append("../Lib") import dis _rand=random.random() editor=...
{ "content_hash": "999514d675787d2fff2e20498f9595a3", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 68, "avg_line_length": 20.660377358490567, "alnum_prop": 0.630593607305936, "repo_name": "sgzwiz/brython", "id": "b0d3172f6db76026966ed0add740cee24d2b6778", "size": "2190"...
from django.conf import settings from django.contrib import messages from django.shortcuts import redirect import basket import commonware.log from session_csrf import anonymous_csrf from django.utils.translation import ugettext as _ from mkt.developers.forms import DevNewsletterForm from mkt.site.utils import render...
{ "content_hash": "75020d5a521b73f41d2ff48fd6aaec64", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 75, "avg_line_length": 30.767441860465116, "alnum_prop": 0.5774754346182918, "repo_name": "mozilla/zamboni", "id": "d65a70b29b2944bf368f26ee730d7e7cad9d3ec2", "size": "2670...
"""General decorators for the landlab library. General Landlab decorators ++++++++++++++++++++++++++ .. autosummary:: :toctree: generated/ ~landlab.utils.decorators.use_file_name_or_kwds ~landlab.utils.decorators.use_field_name_or_array ~landlab.utils.decorators.make_return_array_immutable ~landl...
{ "content_hash": "7fc5b07097c35cdafb181ea11338ca20", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 78, "avg_line_length": 26.75722543352601, "alnum_prop": 0.54849859580903, "repo_name": "Carralex/landlab", "id": "1164840c6c69822865cca034d903563ecccb0097", "size": "9258"...
"""This module contains Databricks operators.""" from __future__ import annotations import re from typing import TYPE_CHECKING, Sequence from urllib.parse import urlparse from airflow.compat.functools import cached_property from airflow.exceptions import AirflowException from airflow.models import BaseOperator from a...
{ "content_hash": "730e52e7e06b7137c2e1bdbb3113a77e", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 109, "avg_line_length": 43.95406360424028, "alnum_prop": 0.6346169306214325, "repo_name": "cfei18/incubator-airflow", "id": "fbd3e21dc62e566f9da1795d3f6ca975c2e29414", "si...