text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function import argparse import gzip import os import re import sys import json import psycopg2 from time import sleep from pymongo import MongoClient from datetime import datetime, timedelta from collections import OrderedDict from multiprocessing import Process, Queue, cpu_count, curren...
{ "content_hash": "d73cfd3b31160e184c3dccfbfb18986f", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 84, "avg_line_length": 35.86065573770492, "alnum_prop": 0.48205714285714285, "repo_name": "smlng/bgp-stats", "id": "b5c6c1830844b70b480016caa8a4b6fad31da5e3", "size": "131...
import six from kmip import enums from kmip.core import primitives from kmip.core import utils from kmip.core.messages.payloads import base class GetUsageAllocationRequestPayload(base.RequestPayload): """ A request payload for the GetUsageAllocation operation. Attributes: unique_identifier: The ...
{ "content_hash": "5754ef3c890e8cd625b1873fbc292881", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 78, "avg_line_length": 34.52715654952077, "alnum_prop": 0.593689275469603, "repo_name": "OpenKMIP/PyKMIP", "id": "9e98f84e5eb6e120266d6245f32a5e7359466876", "size": "11453...
""" # @package coursera2012 # @author Rolf Hemmerling <hemmerling@gmx.net> # @version 1.00 # @date 2015-01-01 # @copyright Apache License, Version 2.0 # # Implementation of the game # "Guess The Number" # for the Coursera course # "An Introduction to Interactive Programming in Python" ...
{ "content_hash": "a526f61fa106f845d2b90e21148998be", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 146, "avg_line_length": 42.42622950819672, "alnum_prop": 0.6477331272539928, "repo_name": "hemmerling/python-coursera2012", "id": "67e899b282efcf05ce192d0dee9600aeed41dcba",...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test how we handle a no-results test specified on the command line. """ import TestRuntest pythonstring = TestRuntest.pythonstring test = TestRuntest.TestRuntest() test.subdir('test') test.write_no_result_test(['test', 'no_result.py']) expect_stdo...
{ "content_hash": "a4f1d74495081707b97bbbec8390540e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 67, "avg_line_length": 19.135135135135137, "alnum_prop": 0.6666666666666666, "repo_name": "azverkan/scons", "id": "8e0d0ddb935d8b596bb2e840ba30094ddfe9bcf2", "size": "1810"...
from __future__ import absolute_import, division, print_function, unicode_literals from collections import Counter, defaultdict from datetime import timedelta, datetime from functools import wraps import inspect import json import logging import os import pprint import sys import time import six import yaml from c7n...
{ "content_hash": "b1537fada0a2597e04504e5106aad487", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 98, "avg_line_length": 32.87826086956522, "alnum_prop": 0.592964824120603, "repo_name": "JohnTheodore/cloud-custodian", "id": "972e4046b03ffd82d0a74d7c99bc4d63d5a5e5ac", "...
from api import app from api.constants import USER_AGENT from api.exceptions import InvalidRequest from lxml import html from requests import get class HTMLFromLoadstone(object): def __init__(self, url): self.url = url def __enter__(self): app.logger.debug('Attempting to parse url {}'.forma...
{ "content_hash": "329401ddd50c3eb43a0b59366530966f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 25.846153846153847, "alnum_prop": 0.6428571428571429, "repo_name": "Demotivated/loadstone", "id": "c57f50f02f3c0b860d482e4a36090504a1e2167f", "size":...
from unittest import mock from django.core.checks import Error, Warning as DjangoWarning from django.db import connection, models from django.db.models.fields.related import ForeignObject from django.test.testcases import SimpleTestCase from django.test.utils import isolate_apps, override_settings @isolate_apps('inv...
{ "content_hash": "41da2f058c67fd5b20a5a1646fb0bedf", "timestamp": "", "source": "github", "line_count": 1499, "max_line_length": 111, "avg_line_length": 38.09873248832555, "alnum_prop": 0.547995097180879, "repo_name": "simonw/django", "id": "786573672f38555576a75a47b13586f2c0ddd929", "size": "57118...
import getpass import socket DEBUG = True TEMPLATE_DEBUG = DEBUG DEFAULT_FROM_EMAIL = '%s@%s' % (getpass.getuser(), socket.gethostname()) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_ps...
{ "content_hash": "5399e26ba0221794a092c8702013e364", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 122, "avg_line_length": 34.22222222222222, "alnum_prop": 0.6844919786096256, "repo_name": "opennode/django-sshkey", "id": "90e5eeee1ed91857dd5ccef02e5ce90b3caa16f9", "size...
from __future__ import division, absolute_import, print_function from future.builtins import super from iris_sdk.models.base_resource import BaseResource from iris_sdk.models.data.sip_peer import SipPeerData from iris_sdk.models.data.address import Address from iris_sdk.models.data.calling_name import CallingName from...
{ "content_hash": "0ee316c2c879bdbe14fe42842746122e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 67, "avg_line_length": 28.3, "alnum_prop": 0.6946996466431096, "repo_name": "scottbarstow/iris-python", "id": "6ced3eb946a71372ab2b19fa5912a7af06e2fc14", "size": "1438", ...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Player(object): """ NOTE: This class is auto generated by the swag...
{ "content_hash": "3e0c190254cf0878e8f11857df9b3433", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 77, "avg_line_length": 24.059701492537314, "alnum_prop": 0.49503722084367247, "repo_name": "kinow-io/kinow-python-sdk", "id": "c5f4c9cc2eb3565c41785b5ae96db88b040f2791", "...
import unicodecsv as ucsv import uuid import json import cStringIO from datetime import datetime from django.contrib.auth.models import User from onadata.libs.utils.logger_tools import dict2xml, safe_create_instance from onadata.apps.logger.models import Instance def get_submission_meta_dict(xform, instance_id): ...
{ "content_hash": "62fb0756d6fd1541e6d5fec650a11968", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 79, "avg_line_length": 38.097744360902254, "alnum_prop": 0.6050917702782712, "repo_name": "awemulya/fieldsight-kobocat", "id": "3c5a7a487d035a4732f389dfda47b6be81f14428", ...
#win_notify ''' This will setup your computer to enable auditing for specified folders inputted into a yaml file. It will then scan the event log for changes to those folders every 5 minutes and report when it finds one. ''' from __future__ import absolute_import import collections import datetime import fnmatch imp...
{ "content_hash": "3a3f0335f77e457ed3822a77da3c682f", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 137, "avg_line_length": 43.062248995983936, "alnum_prop": 0.5522965726276521, "repo_name": "HubbleStack/Pulsar", "id": "06352cef15c0c8396ea3580fc3122445181f59f2", "size": ...
""" Tokenize words. __author__ = hjenvild@gmail.com, arildlil@protonmail.com """ import re def tokenize(line): assert isinstance(line, str), "The input is not a string, was a %r"%type(line) line = line.strip().lower() ord = re.split("([^a-zA-Z0-9æøåÆØÅ])", line) ord = [o for o in ord if o != ' ' an...
{ "content_hash": "eb32d1e2da4e1247e5403878f839d2b4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 20.41176470588235, "alnum_prop": 0.5994236311239193, "repo_name": "hanscje/PySearch", "id": "3c72cb408bd1306370db9f9f96367a895060a648", "size": "353"...
import logging import re from urllib.parse import unquote, urlparse from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream from streamlink.utils.url import update_scheme log = logging.getLogger(__name__) @pluginmatcher(re.compile( ...
{ "content_hash": "b158f8f53ad687b83cda4331ac6d5d5e", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 99, "avg_line_length": 35.58974358974359, "alnum_prop": 0.5435878962536023, "repo_name": "melmorabity/streamlink", "id": "6b50bd96157b3b0f41436bb0e234cb782493c00f", "size":...
from nvchecker.api import session, GetVersionError URL = 'https://www.archlinux.org/packages/search/json/' async def request(pkg): res = await session.get(URL, params={"name": pkg}) return res.json() async def get_version(name, conf, *, cache, **kwargs): pkg = conf.get('archpkg') or name strip_release = conf...
{ "content_hash": "dfbc7b55ac13b450d25b89f13ac482dd", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 28.419354838709676, "alnum_prop": 0.6435868331441543, "repo_name": "lilydjwg/nvchecker", "id": "de321c4e9254bc3de5cb7445de0318a70dd56cd9", "size": "9...
import nose import requests import fixture @nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo) def test_version(): response = requests.get(fixture.plugin_url("tangelo", "version")) expected = "0.8.1-dev" assert response.content == expected
{ "content_hash": "e0385dfdf5c48b74c0c216743f5fbc17", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 69, "avg_line_length": 22.166666666666668, "alnum_prop": 0.7255639097744361, "repo_name": "mathstuf/tangelo", "id": "fbf6aa035a95d405be3d6dc4f9c0703553d3e1a2", "size": "266...
#!/usr/bin/env python # 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 # "Li...
{ "content_hash": "36be6b32cc54016afe1e3ac5365f804e", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 132, "avg_line_length": 31.894039735099337, "alnum_prop": 0.6619601328903655, "repo_name": "apache/tashi", "id": "3b2fa1a81858f43a235d07ed86d10b994d425e40", "size": "4816"...
import matplotlib.pyplot as plt from prep_terrain_data import makeTerrainData from class_vis import prettyPicture from time import time features_train, labels_train, features_test, labels_test = makeTerrainData() ### the training data (features_train, labels_train) have both "fast" and "slow" points mixed ### in toge...
{ "content_hash": "3c68157c5afbd38b31ea47a36bb4b2be", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 99, "avg_line_length": 31.817073170731707, "alnum_prop": 0.7117669605212725, "repo_name": "tuanvu216/udacity-course", "id": "5dc3d4a8b93bbc6e97ba7ef3286a848b092674b6", "siz...
import unittest import os import os.path import inspect import functools import contextlib import traceback as traceback_lib try: import ctypes except ImportError: ctypes = None import sys try: import stackless._wrap as stackless_wrap except ImportError: stackless_wrap = None __pau...
{ "content_hash": "82cb58d1ce9788ca82c7558f5b0a072f", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 79, "avg_line_length": 34.74168797953964, "alnum_prop": 0.5256919905771495, "repo_name": "masamitsu-murase/pausable_unittest", "id": "7b867ad14eed814eb6d7961a48eb25d013c4556...
import unittest import torch from gpytorch.lazy import ZeroLazyTensor from gpytorch.test.utils import approx_equal class TestZeroLazyTensor(unittest.TestCase): def test_evaluate(self): lv = ZeroLazyTensor(5, 4, 3) actual = torch.zeros(5, 4, 3) res = lv.evaluate() self.assertLess(...
{ "content_hash": "4f4af1e53f8a376a13524aa44c17193d", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 100, "avg_line_length": 47.37903225806452, "alnum_prop": 0.5962553191489361, "repo_name": "jrg365/gpytorch", "id": "cba98bb733b30210dad987c21d86ba1458b2a104", "size": "589...
"""Schedules.""" import time import random from heapq import heappush, heappop from twisted.internet import task from ..components import * from ..metacomponents import * import logging from .base import MetaComponent logger = logging.getLogger(__name__) class Scheduler(MetaComponent): heap = [] allow_clie...
{ "content_hash": "ef4b5c5d6bea60b865ea3472bd3506f6", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 112, "avg_line_length": 35.986301369863014, "alnum_prop": 0.5496764370003807, "repo_name": "hiidef/hiispider", "id": "5fa73d560622e9d7b6ebaf178f74d05bf6b59edf", "size": "26...
import collections class SliceableDict(collections.OrderedDict): def __getitem__(self, key): stop_offset = 0 if isinstance(key, tuple): key, stop_offset = key if isinstance(key, slice): return self.values()[self.__calculate_slice(key, stop_offset)] return ...
{ "content_hash": "b69e6cadd28522c18565224b06fff21a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 26.612903225806452, "alnum_prop": 0.52, "repo_name": "mivdnber/roetsjbaan", "id": "813a8dd332912a95f0af250de0e2fda6d0e5a2bd", "size": "825", "binar...
from __future__ import print_function try: from setuptools import Extension, Command, setup except ImportError: from distutils.core import Extension, Command, setup from distutils.command.build_ext import build_ext from distutils.command.build_py import build_py import re import os import sys import shutil imp...
{ "content_hash": "5c23e2292fce05af25399592f6bd020d", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 105, "avg_line_length": 33.03719008264463, "alnum_prop": 0.5867417135709818, "repo_name": "kawamon/hue", "id": "74ea6e114fc954609bd9bf0756fa59000309c2d5", "size": "17015",...
import codecs # Use regular expressions import re # Nice command line argument parsing import argparse # Module to check the properties of wave files import wave # Module to check files and paths import os.path import sys # Create an command-line argument parser parser = argparse.ArgumentParser(description="Conve...
{ "content_hash": "a3de629414688234bd74dd5d9beb4a86", "timestamp": "", "source": "github", "line_count": 867, "max_line_length": 193, "avg_line_length": 36.089965397923876, "alnum_prop": 0.6217961009907319, "repo_name": "janstrunk/LangDocMAUS", "id": "3973df2d7e7c15703a90c5f6290d455b9adb91f9", "size...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: mso_schema_template_bd short_description: Manage Bridge Doma...
{ "content_hash": "ed0eb11c2c9cae64cd975aeff326da49", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 131, "avg_line_length": 28.5121107266436, "alnum_prop": 0.6192961165048544, "repo_name": "thaim/ansible", "id": "72d5f9c7b371e2d3355ad4fb6f27c2d64fae6718", "size": "8441",...
from google.cloud import speech_v2 def sample_create_phrase_set(): # Create a client client = speech_v2.SpeechClient() # Initialize request argument(s) request = speech_v2.CreatePhraseSetRequest( parent="parent_value", ) # Make the request operation = client.create_phrase_set(req...
{ "content_hash": "056d56d76e545a3f563e5eeb5e752e3b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 57, "avg_line_length": 22.782608695652176, "alnum_prop": 0.6908396946564885, "repo_name": "googleapis/python-speech", "id": "c311d648c15f360f9e1e63f74cc5813013ee07c8", "siz...
import ant, os, usb.core, time, binascii, T1932_calibration, sys import Tkinter as tkinter def update_status(label, status): label.config(text=status) window.update_idletasks() window.update() window = tkinter.Tk() window.title("Tacx calibration") window.geometry("600x300") tkinter.Label(window, text="Status: "...
{ "content_hash": "2a7537a600ded6eeae2aa8cd0c0956b5", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 185, "avg_line_length": 37.87982832618026, "alnum_prop": 0.6571493315205076, "repo_name": "john-38787364/antifier", "id": "db6d26e5db9fb7c7d5bc1f4cd9a8489203529513", "size...
from __future__ import print_function import re from collections import defaultdict import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from zerver.lib.user_agent import parse_user_agent user_agents_parsed = defaultdict(int) # type: Dict[str, int] user_agents_path = os.path.join(os...
{ "content_hash": "6ab9cc8dacbe10ac84a027069a59ac06", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 80, "avg_line_length": 30.424242424242426, "alnum_prop": 0.647410358565737, "repo_name": "Frouk/zulip", "id": "78aa1c5acd0bd3cd20a7baedd4ff3be2358c81a3", "size": "1029", ...
import requests import re import json import sys import argparse import concurrent.futures import random def updateJSON(): with open(FILE, 'w') as file: json.dump(USERS, file, indent=2) def murl(path): return 'https://%s%s' % (DOMAIN, path) def register(i, sess, csrf): sess.post(murl('/register'), data={ ...
{ "content_hash": "02fdc08fc0d341e1b2c822df42479956", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 143, "avg_line_length": 31.152985074626866, "alnum_prop": 0.6463049467002037, "repo_name": "google/google-ctf", "id": "9318d386fb40b6f9c167e4056169a9824a44440e", "size": "...
from django.db import models class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question_text class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASC...
{ "content_hash": "ecaecd5a752b9b8b0acd3494160427e4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 92, "avg_line_length": 27.72222222222222, "alnum_prop": 0.6993987975951904, "repo_name": "danicarrion/pyrestcli", "id": "3d61611c505d2ec73a6414ea9572cf41badabf5b", "size": ...
from feti.models.campus import Campus from feti.models.course import Course from django.core.management.base import BaseCommand __author__ = 'Rizky Maulana Nugraha "lucernae" <lana.pcfre@gmail.com>' __date__ = '16/07/15' class Command(BaseCommand): help = 'Update long description in Campus and Course models' ...
{ "content_hash": "4b1afc2530f12cfd3b2a402db434b568", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 38.04761904761905, "alnum_prop": 0.6345431789737171, "repo_name": "cchristelis/feti", "id": "9b34a6e97351320cbe1bf63ec9902325bd950b39", "size": "814"...
"""Wrapper for running a fleetspeak client in a virtualenv setup. This script is meant to be used for development. Requirements for running this script: * Running from a virtualenv. * PIP package `fleetspeak-client-bin` is installed. * `grr_config_updater initialize` has been run. * Fleetspeak has been enabled. ...
{ "content_hash": "6b91164f9982cf16912b405b09573464", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 113, "avg_line_length": 36.773109243697476, "alnum_prop": 0.7047531992687386, "repo_name": "google/grr", "id": "f33dc66331c315209c242ec42c15afdf17911040", "size": "4398", ...
"""Script to parse perf data from Chrome Endure test executions, to be graphed. This script connects via HTTP to a buildbot master in order to scrape and parse perf data from Chrome Endure tests that have been run. The perf data is then stored in local text files to be graphed by the Chrome Endure graphing code. It ...
{ "content_hash": "d99c10ded1dc3c75f681bbd345147f2c", "timestamp": "", "source": "github", "line_count": 819, "max_line_length": 80, "avg_line_length": 35.21001221001221, "alnum_prop": 0.6230883933835004, "repo_name": "anirudhSK/chromium", "id": "f477270e4895f0d87f820cc3c28bcf34a7d96666", "size": "2...
from . import Pmod PMOD_OLED_PROGRAM = "pmod_oled.bin" CLEAR_DISPLAY = 0x1 PRINT_STRING = 0x3 DRAW_LINE = 0x5 DRAW_RECT = 0x7 class Pmod_OLED(object): """This class controls an OLED Pmod. The Pmod OLED (PB 200-222) is 128x32 pixel monochrome organic LED (OLED) panel powered by the Solomon Systech SS...
{ "content_hash": "14832756aa0e1fee3686a91b254c1bbb", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 77, "avg_line_length": 27.813333333333333, "alnum_prop": 0.5141418983700863, "repo_name": "Xilinx/PYNQ", "id": "2891fa64ca0375b5ff49c169ca047b46df33144c", "size": "4253", ...
"""Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ from __future__ import print_function import os import re import shutil import subprocess import stat import string import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # A regex m...
{ "content_hash": "74d5b16b5e278bf2941c4c54a2ce8f06", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 80, "avg_line_length": 40.68064516129032, "alnum_prop": 0.6346840060264848, "repo_name": "refack/node-gyp", "id": "bca0b9e346a5ba0763c044e9480248c42e9e65e3", "size": "1279...
from librdbms.jdbc import query_and_fetch from notebook.connectors.jdbc import JdbcApi from notebook.connectors.jdbc import Assist class JdbcApiClickhouse(JdbcApi): def _createAssist(self, db): return ClickhouseAssist(db) class ClickhouseAssist(Assist): def get_databases(self): dbs, description = query_...
{ "content_hash": "c2697962380bea0bb8232bfabc39a03e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 153, "avg_line_length": 47.11538461538461, "alnum_prop": 0.6889795918367347, "repo_name": "cloudera/hue", "id": "0d16abb485d32c56cb1d8d0c2b6ada9c1a66f0f8", "size": "2017", ...
from functionaltests.api import base class VersionDiscoveryTestCase(base.TestCase): def test_version_get_as_unauthenticated(self): """Covers retrieving version as unauthenticated user.""" self._do_version_test(use_auth=False) def test_version_get_as_authenticated(self): """Covers ret...
{ "content_hash": "58446df4a3300309e191e8487067f84c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 40.15151515151515, "alnum_prop": 0.6618867924528302, "repo_name": "openstack/barbican", "id": "3501b4dcf5887f68359c3ebe7ebdee2f895a3029", "size": "19...
"""Maps package for VisTrails. This package uses the Google Maps API to display information using Qt's WebKit in the spreadsheet. """ # 2014-02-04 -- 0.1.0 # * Package created (from existing local work from 2013) from __future__ import division from identifiers import * def package_dependencies(): return ...
{ "content_hash": "cb49ffede0d46d57c5858bd631945cc1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 21.526315789473685, "alnum_prop": 0.7163814180929096, "repo_name": "VisTrails/VisTrails", "id": "2ab5042d74a64b99af7012ef44713f7e5edd06d8", "size": "...
""" Azure Functions Queue Trigger Python Sample that send email by using SendGrid bindings. SendGrid binding reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-sendgrid """ import os, json _AZURE_FUNCTION_QUEUE_INPUT_ENV_NAME = "inputMessage" _AZURE_FUNCTION_SENDGRID_OUTPUT_ENV_NAME...
{ "content_hash": "3c0f56c0932419477b2b908a070bf4c1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 87, "avg_line_length": 29.054054054054053, "alnum_prop": 0.6753488372093023, "repo_name": "yokawasa/azure-functions-python-samples", "id": "b7760023ce979f926727bf6b11189b88d4...
import json # django imports from django.contrib.auth import authenticate, login, logout #from django.contrib.auth.views import authenticate, login, logout from django.shortcuts import render_to_response, RequestContext, HttpResponse, redirect from django.core.urlresolvers import reverse from django import forms from ...
{ "content_hash": "580acf10136e4af5c65a78e70e1506e4", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 109, "avg_line_length": 40.43434343434343, "alnum_prop": 0.5578316262802898, "repo_name": "Bergurth/new-openid-server", "id": "1b7a4357ae1c844e7057fb9517688b46b43b8c4f", "s...
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": "5e606d890b76aa8dd2e65f39ab7edfcb", "timestamp": "", "source": "github", "line_count": 954, "max_line_length": 320, "avg_line_length": 32.81341719077568, "alnum_prop": 0.7013800153335037, "repo_name": "atopuzov/nitro-python", "id": "daa52249177be33bd2351385f69bd8338175b1c4", "size"...
"""Tools for connecting to a MongoDB replica set. .. seealso:: :doc:`/examples/replica_set` for more examples of how to connect to a replica set. To get a :class:`~pymongo.database.Database` instance from a :class:`ReplicaSetConnection` use either dictionary-style or attribute-style access: .. doctest:: >>> fr...
{ "content_hash": "c229b5d95310ca1f41936d788c269ae1", "timestamp": "", "source": "github", "line_count": 929, "max_line_length": 79, "avg_line_length": 37.853606027987084, "alnum_prop": 0.5409202070181425, "repo_name": "couchbaselabs/litmus", "id": "750745b411eaff6f2105282151837db6864791c6", "size":...
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-paytm', vers...
{ "content_hash": "db35477dd42a98d3ad7c50715ea78c02", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 78, "avg_line_length": 32.31372549019608, "alnum_prop": 0.5843446601941747, "repo_name": "nareshchaudhary37/django-paytm", "id": "e8164f5900bdff3ef906da86c67f7340eaf9b840", ...
import pytest import libqtile.layout import libqtile.bar import libqtile.widget import libqtile.config import libqtile.confreader class GBConfig: auto_fullscreen = True keys = [] mouse = [] groups = [ libqtile.config.Group("a"), libqtile.config.Group("bb"), libqtile.config.Gro...
{ "content_hash": "d3b7ab9489f16255425950c50fe42e38", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 79, "avg_line_length": 27.58, "alnum_prop": 0.5492204496011602, "repo_name": "frostidaho/qtile", "id": "b5f5c63d53f342bfd38b900ba25120770eb78538", "size": "12270", "bina...
""" Helper functions for creating Form classes from Django models and database field objects. """ from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) from django.forms.fields import ChoiceField,...
{ "content_hash": "d608fe22abfc92e9874dd919e64ab5dc", "timestamp": "", "source": "github", "line_count": 1360, "max_line_length": 116, "avg_line_length": 41.28382352941176, "alnum_prop": 0.5847789691162327, "repo_name": "sametmax/Django--an-app-at-a-time", "id": "fe8a67ed2bb5d5d5cd4d6fa8b5a2aafb4303ea...
from create import CommentNewHandler from delete import CommentDeleteHandler from edit import CommentEditHandler
{ "content_hash": "308a9ce1b9a8429322dc072a804e58d7", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 37.333333333333336, "alnum_prop": 0.9017857142857143, "repo_name": "brusznicki/multi-user-blog", "id": "783ee33d9108e931175eef710e558ec5f76feb44", "si...
from __future__ import absolute_import from pychron.core.ui import set_qt set_qt() __author__ = "ross" import unittest import os from pychron.pyscripts.measurement_pyscript import ( MeasurementPyScript, MeasurementCTXObject, ) class DocstrContextTestCase(unittest.TestCase): @classmethod def setUpCl...
{ "content_hash": "b72bf4c31dbf0ac4287eee3073db7676", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 75, "avg_line_length": 28.582278481012658, "alnum_prop": 0.6328609388839681, "repo_name": "NMGRL/pychron", "id": "06f76b2b2ca65ba309a03bff472760e24c237569", "size": "2258",...
""" @author: xuk1 @license: (C) Copyright 2013-2017 @contact: kai.a.xu@intel.com @file: network.py @time: 8/17/2017 12:55 @desc: """ import numpy as np import pandas as pd from component.base import CommonBase class Network(CommonBase): """ Node network attribute, phasing network data ...
{ "content_hash": "908cb68b7a2a1e5297867c2205765ab5", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 101, "avg_line_length": 46.03896103896104, "alnum_prop": 0.5528913963328632, "repo_name": "kaiseu/pat-data-processing", "id": "d06c60e6287f73b5b77eb7835fe7764aa33a777f", "s...
from cardboard import types from cardboard.ability import ( AbilityNotImplemented, spell, activated, triggered, static ) from cardboard.cards import card, common, keywords, match @card("Phantasmal Dragon") def phantasmal_dragon(card, abilities): def phantasmal_dragon(): return AbilityNotImplemented ...
{ "content_hash": "b2a5b1df2e281171889c0d5995ef51c9", "timestamp": "", "source": "github", "line_count": 1019, "max_line_length": 79, "avg_line_length": 19.18547595682041, "alnum_prop": 0.7011253196930947, "repo_name": "Julian/cardboard", "id": "09fe47da008fdd447a2409f96748571c540526d1", "size": "19...
from weclapp4py import Weclapp tenant = None api_key = None print("Weclapp API Example script") print("**************************\n") if tenant is None or api_key is None: print("You can set tenant and api key inside example.py to avoid the following questions.\n") tenant = input("Enter company/tenant name: "...
{ "content_hash": "5f2116bb521301887ebeb7e7ae9fbd63", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 97, "avg_line_length": 33.26829268292683, "alnum_prop": 0.6752199413489736, "repo_name": "useblocks/weclapp4py", "id": "ea749b020c66adc65191cda8a96f27be79bc0e11", "size": "...
from __future__ import absolute_import, division, print_function, unicode_literals from .common import BaseTest from c7n.resources.dynamodb import DeleteTable from c7n.executor import MainThreadExecutor class DynamodbTest(BaseTest): def test_resources(self): session_factory = self.replay_flight_data('te...
{ "content_hash": "63cf9a990e2d454559f3eadfb23d1ebe", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 82, "avg_line_length": 39.04838709677419, "alnum_prop": 0.540272614622057, "repo_name": "jimmyraywv/cloud-custodian", "id": "91d121591413f49f004027e2a202105c998553a5", "si...
import argparse import os import signal import sys import time import rtmidi def signal_handler(signal, frame): """Handler for Ctrl-C""" sys.exit(0) def midi_in_callback(value, args): """Function called when MIDI data is received""" data = value[0] if args.hex: print('[' + ', '.join('0x...
{ "content_hash": "6eb717889e6415e45afefa8822b78dfe", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 77, "avg_line_length": 35.86029411764706, "alnum_prop": 0.515070740209145, "repo_name": "sourcebox/midiutil", "id": "e44d0b542a843fff2c4eb85e7c518bb3a3c2f94a", "size": "49...
"""FeatureColumn serialization, deserialization logic.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.feature_column import feature_column_v2 as fc_lib from tensorflow.python.feature_column import sequence_feature_colu...
{ "content_hash": "9ccb94cbf382d07f14f5c892be2d4524", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 80, "avg_line_length": 36.426829268292686, "alnum_prop": 0.6947606293940408, "repo_name": "petewarden/tensorflow", "id": "8da7c217826ee934af13b84ff0b068a844fde759", "size"...
""" FileInstall: Polls for changes on files in a directory and notifies listeners :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.5.8 :status: Beta .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you m...
{ "content_hash": "691cc3ec764ee4f8a13aa8e9b528fabc", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 80, "avg_line_length": 32.29866666666667, "alnum_prop": 0.5434280052840158, "repo_name": "isandlaTech/cohorte-demos", "id": "8d695305aa2d1a32432eb1f21e7d7b906c0faf00", "si...
import sys class Settings: defaults = { #: A list of one or more sitemaps to inform robots about: "SITEMAP_URLS": ("ROBOTS_SITEMAP_URLS", []), "USE_SITEMAP": ("ROBOTS_USE_SITEMAP", True), "USE_HOST": ("ROBOTS_USE_HOST", True), "CACHE_TIMEOUT": ("ROBOTS_CACHE_TIMEOUT", None)...
{ "content_hash": "83c7008d33693cefcab5efc37eb29d09", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 67, "avg_line_length": 32.391304347826086, "alnum_prop": 0.6013422818791946, "repo_name": "jazzband/django-robots", "id": "bcd58daa975f5398504b2d47a990010eed4a8cfd", "size"...
import numpy as np from ...tests.instance import gaussian_instance from ..lasso import data_carving, data_splitting def sim(): X, Y, _, active, sigma = gaussian_instance() print(sigma) G = data_carving.gaussian(X, Y, 1., split_frac=0.9, sigma=sigma) G.fit() if set(active).issubset(G.active) and G.a...
{ "content_hash": "dc8a0065bb36efad273201ab6b50234c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 83, "avg_line_length": 36.38095238095238, "alnum_prop": 0.650523560209424, "repo_name": "selective-inference/selective-inference", "id": "2e140e0a298a673768e25d8897e50820ff1f...
""" Meraki API Setup module. """ from os import path from codecs import open as codecs_open from setuptools import setup, find_packages from meraki_api import __version__ HERE = path.abspath(path.dirname(__file__)) # Get the long description from the README file with codecs_open(path.join(HERE, 'README.rst'), encodi...
{ "content_hash": "a7532d654e0845980e0be1710274fd03", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 77, "avg_line_length": 34.534246575342465, "alnum_prop": 0.6390321301071004, "repo_name": "guzmonne/meraki_api", "id": "a3d87c752c03f0a9b8a423c00e1928ec8006a84b", "size": "...
import pytest from mock import call, sentinel from ensime_shared.editor import Editor @pytest.fixture def editor(vim): mockeditor = Editor(vim) assert vim.mock_calls == [call.eval("has('nvim')")] vim.reset_mock() # Clear above constructor vim calls from call list return mockeditor def test_append...
{ "content_hash": "7dafb23e0f44b69bc7ab444781fc3755", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 76, "avg_line_length": 27.426356589147286, "alnum_prop": 0.6458451102317694, "repo_name": "ensime/ensime-vim", "id": "708e86e605be848398a968f43b823429ea55dbed", "size": "3...
from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: distribution = Beta(0.2, 0.6, -1.0, 2.0) size = 10000 sample = distribution.getSample(size) factory = BetaFactory() estimatedDistribution = factory.build(sample) print "distribution=", repr(distribution) print "Estimate...
{ "content_hash": "3a14518359b6fc84c6504afc21720764", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 40.86363636363637, "alnum_prop": 0.7246941045606229, "repo_name": "sofianehaddad/ot-svn", "id": "6427020847dd0c61efa42df6df41515ba577274d", "size": "...
import unittest import random from tests import testutils from common import environment from tests import testconstants from services.repower.repower import repowerservice from services.repower.repower.domain import repowerrequest from services.repower.repower.domain import transactionamount from services.repower.repo...
{ "content_hash": "fe49d45af4d245dff4d91549701818bc", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 128, "avg_line_length": 47.63013698630137, "alnum_prop": 0.6560253091745758, "repo_name": "M4gn4tor/mastercard-api-python", "id": "aba5848cbf3ac0e2105228651b39a61fe9dbd798", ...
""" Test `redirects.views` file """ from django.urls import resolve, reverse_lazy from django.views.generic import TemplateView import pytest from ratelimit.mixins import RatelimitMixin from redirects.forms import RedirectModelForm from redirects.models import Redirect from redirects.views import RedirectFormView, Ac...
{ "content_hash": "b624fbf830171b609c27745978dcd532", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 78, "avg_line_length": 31.448051948051948, "alnum_prop": 0.6231674581870741, "repo_name": "pawelad/fakester", "id": "6bdc72ac5a33878b04cbd8fb955d33738f8ca212", "size": "48...
"""Utility functions.""" from __future__ import unicode_literals from datetime import datetime from collections import OrderedDict from builtins import str def from_iso_date(str): """Convert an ISO8601 to a datetime. Args: str(string): The ISO8601 formatted string to convert Returns: A...
{ "content_hash": "a44cad02f8a303b33c22a63318237911", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 26.489208633093526, "alnum_prop": 0.6409560021727322, "repo_name": "helium/helium-python", "id": "126b364f1b29dfa20fdf5cf6ddb05f54a7783c69", "size":...
""" WSGI config for tracebin project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
{ "content_hash": "860dfa013667cc61240e3540e0c912d1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 41, "alnum_prop": 0.7973086627417998, "repo_name": "alex/tracebin", "id": "c2a95cb45c44d67304990449163dd6103401dbd8", "size": "1189", "binary": fal...
''' Created on Aug 30, 2012 @author: vencax ''' import re import string from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from django.forms.widgets import Textarea from .models import PC mac_re = re.compile(r'([0-9A-Fa-f]{2}[:-]?){5}(...
{ "content_hash": "fcbeaf73b0c29956378a2097a2db7b1d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 64, "avg_line_length": 20.944444444444443, "alnum_prop": 0.629973474801061, "repo_name": "stare-vaskoviny/django-dhcp-admin", "id": "4ea2f6c9259387af1d600109b55db7572f839fc8"...
from .base import * # NOQA import sys import logging.config # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True TEMPLATES[0]['OPTIONS'].update({'debug': True}) # Turn off debug while imported by Celery with a workaround # See http://stackoverflow.com/a/4806384 if "celery" in sys...
{ "content_hash": "14249637e98253c6f781348aceb2d1c3", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 119, "avg_line_length": 27.776315789473685, "alnum_prop": 0.6210326859308385, "repo_name": "contactr2m/remote_repo", "id": "d6fe9363913ca1e197f9cfea5086591c9a4e09ab", "siz...
""" WSGI config for project_name project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_...
{ "content_hash": "5f861ed985550acdc6562aac5bff9861", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 28.8, "alnum_prop": 0.7245370370370371, "repo_name": "bruth/wicked-django-template", "id": "fc06ded7ad59b98ee2b04345c7409265888ebfd1", "size": "432",...
""" Support for Insteon switch devices via local hub support. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.insteon_local/ """ import json import logging import os from datetime import timedelta from homeassistant.components.switch import Switc...
{ "content_hash": "c8ef36a9ce85f36bc5ce2694dc9ca2ec", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 33.4320987654321, "alnum_prop": 0.6100443131462334, "repo_name": "keerts/home-assistant", "id": "6935ad21abe0f6af6022da0d9cb97190a37b1663", "size": ...
import sys from setuptools import setup from setuptools import find_packages version = '0.2.0.dev0' install_requires = [ # load_pem_private/public_key (>=0.6) # rsa_recover_prime_factors (>=0.8) 'cryptography>=0.8', 'ndg-httpsclient', # urllib3 InsecurePlatformWarning (#304) 'pyasn1', # urllib...
{ "content_hash": "3476e1eb26dd3af535fa3b029fb2ae9a", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 27, "alnum_prop": 0.608656849620705, "repo_name": "goofwear/letsencrypt", "id": "e35b40d6e2ff0e9f839b4f9000d1fb7d19501abf", "size": "2241", "binary...
from asyncio import Lock, sleep from time import time class AsyncFrequency(object): """AsyncFrequency controller, means concurrent running n tasks every interval seconds. Basic Usage:: from torequests.frequency_controller.async_tools import AsyncFrequency from asyncio import ensu...
{ "content_hash": "b80d94ddd9b3a9f2e45ddc50981e7f20", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 90, "avg_line_length": 30.945454545454545, "alnum_prop": 0.5185076380728555, "repo_name": "ClericPy/torequests", "id": "3500d431b53f0e0ade00c71e0eab6d849ce77f62", "size": ...
""" Copyright [2009-2021] EMBL-European Bioinformatics Institute 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...
{ "content_hash": "d972a475795e88b954d5feef44245bf9", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 72, "avg_line_length": 33.758620689655174, "alnum_prop": 0.6618998978549541, "repo_name": "RNAcentral/rnacentral-import-pipeline", "id": "89dd4ceb8a03ee615aae5a30b3fed39f88d4...
from google.cloud.video import stitcher_v1 def sample_update_slate(): # Create a client client = stitcher_v1.VideoStitcherServiceClient() # Initialize request argument(s) request = stitcher_v1.UpdateSlateRequest( ) # Make the request response = client.update_slate(request=request) #...
{ "content_hash": "34df8412998635c6e9660e7f3ae15207", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 81, "avg_line_length": 24.666666666666668, "alnum_prop": 0.7319819819819819, "repo_name": "googleapis/python-video-stitcher", "id": "8985aa3bdfa871811bca362d42e9c0d355df1fbd"...
import sys try: import _tkinter except: sys.exit("Please install python module 'Tkinter'") import direct from direct.directbase.DirectStart import* from direct.showbase.TkGlobal import spawnTkLoop from Tkinter import * from tkFileDialog import * from direct.directtools.DirectGlobals import * from direct.tkwidgets.AppS...
{ "content_hash": "eab1b1a0d231e6407e97b6f1d6359e82", "timestamp": "", "source": "github", "line_count": 1707, "max_line_length": 230, "avg_line_length": 44.85120093731693, "alnum_prop": 0.5351157900236413, "repo_name": "jjkoletar/panda3d", "id": "e47df9ddcbdbcbafa47840497f30110cedca1ce9", "size": "...
""" Coplanar joint orient tool 0.9.0 Ilya Seletsky 2015 TODO (known issues): -Preview plane size setting (Width and Height) -Handle when scene is closed while window open to reset things if possible -Make the preview plane creation somehow not contribute to the undo history if possible or find a different way to displ...
{ "content_hash": "b305a4047c5f58cd27b1fe123bcbf6df", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 138, "avg_line_length": 37.61538461538461, "alnum_prop": 0.7191547375596455, "repo_name": "ill/CoplanarJointOrient", "id": "508622f349766c878143f0d8e4b7cdd4d4b93302", "size...
import discord from discord.ext import commands AVOID = ['342891382584770560', '300564141096304650', '360722519860445184', '312038519294001152', '321832332279676928'] class Modtools: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def propagateMute(self, ctx): if self...
{ "content_hash": "f427561e59e699ffecb931857763bace", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 134, "avg_line_length": 36.52482269503546, "alnum_prop": 0.6566990291262136, "repo_name": "matthew-morrison/csss-minion", "id": "9ad3d7b62be83b51903c09bbc948de1c39cc4602", ...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.python.pants_requirement import PantsRequirement from pants.backend.python.python_artifact import PythonArtifact from pants.backend.python.python_re...
{ "content_hash": "79a0abe7e9168c5c2474ab5aafe0bf91", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 93, "avg_line_length": 48.5945945945946, "alnum_prop": 0.7906006674082313, "repo_name": "baroquebobcat/pants", "id": "e8cb9dae58141ae0de1d0757e2fa8bc475488f6e", "size": "37...
from __future__ import print_function from __future__ import absolute_import import os from os.path import abspath import sys import subprocess import re from collections import defaultdict import argparse from six.moves import filter from typing import Union, List, Dict def get_ftype(fpath, use_shebang): # type:...
{ "content_hash": "843f55d91d22daa7b405288041f357d5", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 112, "avg_line_length": 42.15447154471545, "alnum_prop": 0.6005785920925747, "repo_name": "Vallher/zulip", "id": "61ac5c12a9efe6e474a1f6fca991c1a2eef5acab", "size": "5207"...
""" Test if comibnations of words are working as expected. """ import unittest from collections import Iterable from tests.utils import get_words_generator from itertools import product from thechronic.utils import is_iterable from thechronic.thechronic import TheChronic class CombinationsTestCase(unittest.TestCase):...
{ "content_hash": "2cee2da0d732df4eb3dcb8e9cdcfb26c", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 37.05725190839695, "alnum_prop": 0.6053146565042744, "repo_name": "iluxonchik/the-chronic", "id": "decd08f8737ef60581c1f25d6826a461ef1542d1", "size"...
import sys 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, Resourc...
{ "content_hash": "0826012ed8f82e63c26634f1c9171458", "timestamp": "", "source": "github", "line_count": 819, "max_line_length": 263, "avg_line_length": 47.7997557997558, "alnum_prop": 0.6479513640543578, "repo_name": "Azure/azure-sdk-for-python", "id": "97f61edd1806ef8efda0bfe7ffb806d300689e96", "s...
''' Test DNS TTL behavior. ''' # 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 ...
{ "content_hash": "47698fcad6264daca9da16842b555527", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 90, "avg_line_length": 37.26315789473684, "alnum_prop": 0.6486581920903954, "repo_name": "SolidWallOfCode/trafficserver", "id": "cd0d7ff6299667471d57e317c20a7dda6e836470", ...
import unittest from pycomb import combinators, context from pycomb.combinators import dictionary from pycomb.test import util class TestDictionary(unittest.TestCase): def test_ok(self): d = { 1: 'hello', 2: 'Hello', 3: 4 } sut = dictionary(combinators...
{ "content_hash": "e7b12bac9a18ef9df0125e366f68f58f", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 117, "avg_line_length": 28.793478260869566, "alnum_prop": 0.5432238580596451, "repo_name": "fcracker79/pycomb", "id": "820f89963bb0b0627faea22733573e55e3920aa9", "size": "2...
"""Library of Cloud TPU helper functions for data loading.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.data.experimental.ops import batching from tensorflow.python.data.experimental.ops import interleave_ops from tensorflow.pyt...
{ "content_hash": "f6f4ffff001ed4d082396ad0a8560323", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 80, "avg_line_length": 39.06666666666667, "alnum_prop": 0.7060580204778157, "repo_name": "girving/tensorflow", "id": "c694e9c1bca10d9930492c29dd1c3cbc7f7f5d04", "size": "7...
import multiprocessing import random workId = 0 class Work: def __init__(self, part, startIndex, debug=False, depth=0): global workId self.startIndex = startIndex self.part = part self.pivot = None self.works = [] # for debugging only self.debug = debug ...
{ "content_hash": "7ce9e2d2705d8659e037c1efbcf0ae59", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 125, "avg_line_length": 27.054945054945055, "alnum_prop": 0.5446791226645004, "repo_name": "bennyk/MyPythonEssentialsClass-2015", "id": "0479bcae3a9c0298ca01be28648af858daadc...
""" Requests HTTP Library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> r.status_code 200 >>> 'Python is a programming language' in r.content True ... or POST: >>> p...
{ "content_hash": "9870979f925c50647af18e7d3944647f", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 102, "avg_line_length": 31.267175572519083, "alnum_prop": 0.67626953125, "repo_name": "stopstalk/stopstalk-deployment", "id": "9fb6633ed8bd620e47d1dbef5e23f09c80e6a24f", "...
import os import unittest from mi.core.log import get_logger from mi.dataset.dataset_driver import ParticleDataHandler from mi.dataset.driver.pco2w_abc.imodem.pco2w_abc_imodem_recovered_driver import parse from mi.dataset.driver.pco2w_abc.imodem.resource import RESOURCE_PATH __author__ = 'mworden' log = get_logger() ...
{ "content_hash": "59e39cb9348acb44a3b159cfe2ac0459", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 86, "avg_line_length": 28.741935483870968, "alnum_prop": 0.7115600448933782, "repo_name": "oceanobservatories/mi-instrument", "id": "8fc4d6333d36d14b66d7171337f485d41d67a11e"...
""" @authors: Sergei Garbuzov @status: Development @version: 1.1.0 """ import time from pybvc.controller.controller import Controller from pybvc.openflowdev.ofswitch import (OFSwitch, FlowEntry, Match, ...
{ "content_hash": "f485fa150a827b8cbb138651e3c37322", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 77, "avg_line_length": 30.546610169491526, "alnum_prop": 0.5436260230267721, "repo_name": "tnadeau/pybvc", "id": "87a6dc80974ae7581529d86cc3e7eaf41fbf08d7", "size": "8783"...
"""OWASP Dependency Check source.""" from ..meta.entity import Color, EntityAttributeType from ..meta.source import Source from ..parameters import access_parameters, MultipleChoiceWithAdditionParameter, Severities ALL_OWASP_DEPENDENCY_CHECK_METRICS = [ "dependencies", "security_warnings", "source_up_to_...
{ "content_hash": "69abcff4de3e1be50fdae2b85f8b4e7a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 120, "avg_line_length": 46.0625, "alnum_prop": 0.7042062415196744, "repo_name": "ICTU/quality-time", "id": "1eb184760318c8b3ace63cd4fbb842e8d3b61ca1", "size": "2211", "bi...
""" The huginn.constants module contains the constant values used by the simulator """ # speed of sound at sea level (knots) a0 = 661.4788 # standard sea level temperature (Kelvin) T0 = 288.15 # pressure at sea level (Pascal) p0 = 101325.0 # gravity constant in m/s g = 9.80665 # molar mas of air M = 28.97 # gas ...
{ "content_hash": "40bb63133dd3b1be4494f2750041be13", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 78, "avg_line_length": 15.590909090909092, "alnum_prop": 0.6997084548104956, "repo_name": "pmatigakis/Huginn", "id": "516b89c11e711f54008da5ce80ae731a12011798", "size": "34...
""" Configuration file and options A number of globals are defined here to be available everywhere. """ import logging import os import shutil import sys import glob from collections import OrderedDict from distutils.util import strtobool import warnings import numpy as np import pandas as pd try: from scipy.sig...
{ "content_hash": "a2ebb53659650ad808da92bda536fec7", "timestamp": "", "source": "github", "line_count": 907, "max_line_length": 87, "avg_line_length": 37.187431091510476, "alnum_prop": 0.6201784814254796, "repo_name": "bearecinos/oggm", "id": "a589f28ff3fd73667f2ea323f550101b5957cff8", "size": "337...
import _plotly_utils.basevalidators class TickwidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="tickwidth", parent_name="layout.scene.zaxis", **kwargs ): super(TickwidthValidator, self).__init__( plotly_name=plotly_name, pare...
{ "content_hash": "cfc5cb7a6b9423ea8a4b5aba247981f4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 34.06666666666667, "alnum_prop": 0.5870841487279843, "repo_name": "plotly/python-api", "id": "78f0faff0d705d2f4e095f8e490a0781d14a0d62", "size": "511...
import argparse from astropy.io import fits # PARSE OPTIONS ############################################################### parser = argparse.ArgumentParser(description="An astropy snippet") parser.add_argument("filearg", nargs=1, metavar="FILE", help="the FITS file to process") args = parser.parse_args() file_path =...
{ "content_hash": "5bd5c59afe24ea3d5e0b9fff58856db0", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 88, "avg_line_length": 21.22222222222222, "alnum_prop": 0.5198204936424832, "repo_name": "jeremiedecock/snippets", "id": "f9d57773d0f7a5efce2b87c39d6da4c2d19cd59e", "size":...
from enum import Enum, auto from operator import attrgetter import networkx as nx import pendulum import uuid from share.exceptions import ShareException from share.schema import ShareV2Schema from share.schema.exceptions import SchemaKeyError from share.schema.shapes import AttributeDataType, RelationShape from shar...
{ "content_hash": "b1d7621f6ff38e220ed31abe0a3256c9", "timestamp": "", "source": "github", "line_count": 581, "max_line_length": 136, "avg_line_length": 37.44750430292599, "alnum_prop": 0.5890058372018201, "repo_name": "aaxelb/SHARE", "id": "21c7094fb83c7b02598f51d2f51d078ea7a941f0", "size": "21757"...
import os from decimal import Decimal import requests import simplejson as json class RatesNotAvailableError(Exception): """ Custome Exception when https://theforexapi.com is Down and not available for currency rates """ pass class DecimalFloatMismatchError(Exception): """ A float has been ...
{ "content_hash": "b7b143c53b80782b8629ca8edb15880f", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 107, "avg_line_length": 35.7962962962963, "alnum_prop": 0.6137265045697534, "repo_name": "MicroPyramid/forex-python", "id": "390a11a175c40ef6ed47c577d21425bfe6193dbf", "si...
import uuid from msrest.pipeline import ClientRawResponse from .. import models class MetricsOperations(object): """MetricsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param dese...
{ "content_hash": "d6d69854e7ae357a0ca07f220f53ef5f", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 200, "avg_line_length": 47.43846153846154, "alnum_prop": 0.6416409923787904, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "aca37e3d615383dfcfc6ef9b6a8b5dd98d19699e"...
import sys, shutil, hashlib, os.path, urllib.parse, sqlite3 target_dir = os.path.expanduser("~/.banshee2itunes") # remove the data directory if it exists if os.path.lexists(target_dir): shutil.rmtree(target_dir) os.makedirs(target_dir + "/music/") # make an in-memory copy of the database in case Banshee changes it...
{ "content_hash": "ec9770837860a42a9adffbfc8a7198c4", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 84, "avg_line_length": 29.891304347826086, "alnum_prop": 0.7025454545454546, "repo_name": "chriskuehl/banshee2itunes", "id": "ac986ef49acc91b5630af100fc45148aba2352a9", "si...
import ujson import datetime from magic import Magic from tempfile import NamedTemporaryFile from flask import request from flask_restful import Resource, abort from docsbox import app, rq from docsbox.docs.tasks import remove_file, process_document class DocumentView(Resource): def get(self, task_id): ...
{ "content_hash": "39ccb28d37f005a9027ad4c9dad13c24", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 103, "avg_line_length": 41.56989247311828, "alnum_prop": 0.4813760993274703, "repo_name": "docsbox/docsbox", "id": "87bbca0db647e6dffb2f20254ca8a278c1ac87f4", "size": "3866...
from docutils import nodes from docutils.core import publish_string from docutils.transforms import Transform, writer_aux from docutils.writers.html4css1 import Writer import imp import logging from operator import attrgetter import os import re import shutil import tempfile import urllib import urllib2 import urlparse...
{ "content_hash": "7d3d4831e8256a95ad1169e5bf9dba0f", "timestamp": "", "source": "github", "line_count": 808, "max_line_length": 201, "avg_line_length": 45.100247524752476, "alnum_prop": 0.5764111852034796, "repo_name": "diogocs1/comps", "id": "b327871c953ace5897304067bc610515dfb37a17", "size": "374...
from oslo_config import cfg from tooz import coordination from tooz import locking from st2common import log as logging from st2common.util import system_info LOG = logging.getLogger(__name__) COORDINATOR = None __all__ = [ 'configured', 'get_coordinator', 'coordinator_setup', 'coordinator_teardow...
{ "content_hash": "64b36b2e5e82dafc4ca55d2df37cf049", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 97, "avg_line_length": 24.164634146341463, "alnum_prop": 0.6482462780721675, "repo_name": "tonybaloney/st2", "id": "eb4c434f785ff981994fa6f8e67ac8cb38002713", "size": "474...
from django.test import TestCase from api import * from pprint import pprint # Create your tests here. #pprint(get_certificate_count("CSE101", "2017", "IITB")) #pprint(get_all_courses_certificate_count()) #pprint(get_certificate_students("AP101","2017","APIx")) #pprint(get_all_courses_certificate_students())
{ "content_hash": "7eaae6a96e4e4142e30c59c632e0ece6", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 56, "avg_line_length": 31.1, "alnum_prop": 0.7556270096463023, "repo_name": "jaygoswami2303/course_dashboard_api", "id": "380719721bd83b2bd9c1c5fdc17d7fd92f5b0f00", "size":...
from runner.koan import * class AboutTuples(Koan): def test_creating_a_tuple(self): count_of_three = (1, 2, 5) self.assertEqual(5, count_of_three[2]) def test_tuples_are_immutable_so_item_assignment_is_not_possible(self): count_of_three = (1, 2, 5) try: count_of_t...
{ "content_hash": "97f382aa80cd78edd5d64b412337eb19", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 91, "avg_line_length": 34.93846153846154, "alnum_prop": 0.5689123734037869, "repo_name": "ryanfitch/Python3_Koans_Solutions", "id": "9a8fb3dfaa7298b64a4303baa19e69b80c0c0515"...
"""remove constraint from markers: provider_and_id_idx_markers Revision ID: 9d24fbb0f1fa Revises: 3f07363021f6 Create Date: 2019-10-19 21:00:22.609457 """ # revision identifiers, used by Alembic. revision = '9d24fbb0f1fa' down_revision = '3f07363021f6' branch_labels = None depends_on = None from alembic import op ...
{ "content_hash": "79c86351b919e0fefc40988647475a3e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 96, "avg_line_length": 29.321428571428573, "alnum_prop": 0.6942752740560292, "repo_name": "hasadna/anyway", "id": "c8971a4a00e3b49db5df15bed9f17e9d815e005d", "size": "821",...