text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Verifies build of an executable with C++ defines.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('defines.gyp')
test.build('defines.gyp')
expect = """\
FOO is defined
VALUE is 1
2*PAREN_VALUE is 12
"""
test.run_built_executable('defines', stdout=expect)
test.pass_test()
| {
"content_hash": "33c234bb9847bb2b112a58fb8793172b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 51,
"avg_line_length": 14.55,
"alnum_prop": 0.697594501718213,
"repo_name": "creationix/gyp",
"id": "0b6d64b85539939216ccf0e2bb8524999fe9c691",
"size": "471",
"binary": f... |
import re
import phonenumbers
from django import template
from django.utils.translation import gettext as _
from ..models import PhoneDevice
register = template.Library()
phone_mask = re.compile('(?<=.{3})[0-9](?=.{2})')
@register.filter
def mask_phone_number(number):
"""
Masks a phone number, only first ... | {
"content_hash": "bf170c143029f453a189e6add91c3e74",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 91,
"avg_line_length": 26.271186440677965,
"alnum_prop": 0.6664516129032259,
"repo_name": "Bouke/django-two-factor-auth",
"id": "13297865c82c4a501979cdeac234f5f6a79b60f5",
... |
"""
The middleware that adds the surrogate keys.
"""
from selector import Selector
from .surrogates import current_uri_keys
def initialize_routes(config):
"""
Initialize a new selector that maps routes to surrogate-key
generation. At the moment this is an empty map to which things
can be added (see ... | {
"content_hash": "6909269d4a09c75d0af663cfcc38e666",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 71,
"avg_line_length": 32.27777777777778,
"alnum_prop": 0.6672403901319564,
"repo_name": "cdent/tiddlywebplugins.fastly",
"id": "c3cde39cb3edea9bfe6f869af471e9abb6e0fbe5",
... |
"""
Django settings for myproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | {
"content_hash": "ef35e59700e94401481ca6ecd84abcc6",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 71,
"avg_line_length": 24.31764705882353,
"alnum_prop": 0.7213352685050798,
"repo_name": "Perkville/django-tastypie",
"id": "e3b6ac1ba43ae0fd39ed6aeb855f480d168d3bab",
"siz... |
import threading
# django
from django.core.mail import send_mail
# local django
from user import constants
class SendMail(threading.Thread):
"""
Responsible to send email in background.
"""
def __init__(self, email, HealthProfessional, SendInvitationProfile):
self.email = email
self.... | {
"content_hash": "277e119038280df518d954644a563c66",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 90,
"avg_line_length": 32.65384615384615,
"alnum_prop": 0.6666666666666666,
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"id": "f74184a99db0ef4c8a715360c6d769d1aa83e... |
from django.contrib.syndication.views import Feed
from django.conf import settings
from django.shortcuts import get_object_or_404
from website_showroom.models import Edition, EditionWebsite
class RssFeed(Feed):
title = "Chicagocrime.org site news"
link = "/rss/"
description = "Updates on changes and addit... | {
"content_hash": "ab86fdee82a433cf361899ab4f4183ac",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 73,
"avg_line_length": 30.26923076923077,
"alnum_prop": 0.7001270648030495,
"repo_name": "holgerd77/django-website-showroom",
"id": "b57d70c1433b4564ebc0d5d8a6a6895185a99f0b"... |
"""
__MT_post__Operation.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sun Feb 15 10:31:27 2015
____________________________________________________________________________
"""
from ASGNode import *
from ATOM3Typ... | {
"content_hash": "c124babf52a7b0689be22eafe21a4662",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 745,
"avg_line_length": 48.99145299145299,
"alnum_prop": 0.5680390788555478,
"repo_name": "levilucio/SyVOLT",
"id": "796dccb990cd83d13d7238b5b81e5a1b4be55c7f",
"size": "57... |
from typing import NamedTuple
import kfp
from kfp.components import func_to_container_op
# Stabilizing the test output
class StableIDGenerator:
def __init__(self, ):
self._index = 0
def get_next_id(self, ):
self._index += 1
return '{code:0{num_chars:}d}'.format(code=self._index, num_... | {
"content_hash": "ae8cdc413e229f2c7e9c03ac968357ae",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 121,
"avg_line_length": 28,
"alnum_prop": 0.6718426501035196,
"repo_name": "kubeflow/kfp-tekton-backend",
"id": "ebcb8c28024035d137d616a35e9ed460fd571510",
"size": "2531",
... |
from ..adapters.teradata import Teradata
from .base import SQLDialect
from . import dialects, sqltype_for
@dialects.register_for(Teradata)
class TeradataDialect(SQLDialect):
@sqltype_for('integer')
def type_integer(self):
return 'INT'
@sqltype_for('text')
def type_text(self):
return '... | {
"content_hash": "4992dac84e28b200358c9c4921f35b81",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 79,
"avg_line_length": 28.604166666666668,
"alnum_prop": 0.5713765477057539,
"repo_name": "niphlod/pydal",
"id": "82aa116980460414a1597f46821ca1da88189da2",
"size": "2746",... |
from robot.output.xmllogger import XmlLogger
class OutputWriter(XmlLogger):
def __init__(self, output):
XmlLogger.__init__(self, output, generator='Rebot')
def start_message(self, msg):
self._write_message(msg)
def close(self):
self._writer.end('robot')
self._writer.clos... | {
"content_hash": "cf01239991d994e6c2bc05e4995d988c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 59,
"avg_line_length": 22.352941176470587,
"alnum_prop": 0.6210526315789474,
"repo_name": "ktan2020/legacy-automation",
"id": "0be04efb2db79cc238ceafabaeebca8b0469bf9d",
"s... |
import pytest
from datadog_checks.base import AgentCheck
# Minimal E2E testing
@pytest.mark.e2e
def test_e2e(aggregator, instance, dd_agent_check):
# Prevent the integration from failing before even running the check
instance['ticket_location'] = '.'
dd_agent_check(instance, rate=True)
aggregator.a... | {
"content_hash": "220c9726ab15a8cc6c6f602c943518fc",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 27.428571428571427,
"alnum_prop": 0.7447916666666666,
"repo_name": "DataDog/integrations-core",
"id": "39c16541e910704cf4d7522dca80da2328ad41d0",
"si... |
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
"""
Template settings
All settings which a... | {
"content_hash": "0c9e5ae2a5b803f96f28fb0b5b8ecf77",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 137,
"avg_line_length": 35.98675496688742,
"alnum_prop": 0.6404122193595878,
"repo_name": "gnarula/eden_deployment",
"id": "4a1dd70e18f744e9f06b1a6aaf2c1a0aba24ce02",
"siz... |
from collections import abc
from unittest import mock
from cloudkittyclient.tests.unit.v1 import base
from cloudkittyclient.v1 import report_cli
class TestReportCli(base.BaseAPIEndpointTestCase):
def test_report_tenant_list(self):
class DummyAPIClient(object):
def get_tenants(*args, **kwarg... | {
"content_hash": "c46b638db18816983a3bdf337f634ea8",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 79,
"avg_line_length": 34.51020408163265,
"alnum_prop": 0.5955056179775281,
"repo_name": "openstack/python-cloudkittyclient",
"id": "bce53d546bb160916a2aa944faaa919212b7adb4"... |
import pkg_resources
__version__ = pkg_resources.get_distribution('erajp').version
| {
"content_hash": "03aaf05bb840b41b5678b551278bab00",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 61,
"avg_line_length": 17.2,
"alnum_prop": 0.7441860465116279,
"repo_name": "intermezzo-fr/erajp",
"id": "5b7fe01b1affc6fd87dc3a13e64fa69db470cd59",
"size": "110",
"binary... |
"""
Enumerations used by text and related objects
"""
from __future__ import absolute_import
from .base import (
alias,
Enumeration,
EnumMember,
ReturnValueOnlyEnumMember,
XmlEnumeration,
XmlMappedEnumMember,
)
class MSO_AUTO_SIZE(Enumeration):
"""
Determines the type of automatic si... | {
"content_hash": "035a039113845fd57579eeaa80aa7407",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 88,
"avg_line_length": 32.39525691699605,
"alnum_prop": 0.5833333333333334,
"repo_name": "scanny/python-pptx",
"id": "54297bbd51d1b46efd336ec90378e213a2bce7bf",
"size": "8... |
from setuptools import setup
if __name__ == '__main__':
setup(
name="LabbookDB",
version="0.0.1",
description = "A Wet-Work-Tracking Database Application Framework",
author = "Horea Christian",
author_email = "horea.christ@yandex.com",
url = "https://github.com/TheChymera/LabbookDB",
keywords = [
"la... | {
"content_hash": "cd78a23952d5149fde16fb45c1316492",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 21.7027027027027,
"alnum_prop": 0.6151930261519303,
"repo_name": "TheChymera/LabbookDB",
"id": "18985c663eaa4d19dcc5be49a33c7440631f4958",
"size": "8... |
"""
Setup/build script for LBN EBB Optionifier (py2app on a Mac)
Copyright (c) 2013, Jake Hartz. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE.txt file.
Usage (Mac OS X):
./setup-mac.py
/System/Library/Frameworks/CoreServices.framework/Framew... | {
"content_hash": "55574161ef1c168061f1dd651d11ac9b",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 153,
"avg_line_length": 40.144329896907216,
"alnum_prop": 0.5190035952747817,
"repo_name": "jhartz/lbn-ebb-optionifier",
"id": "15bbad0626d9d2d94e06eb97e6224fe5b8f67b05",
"... |
from envi.const import *
from envi import IF_NOFALL, IF_PRIV, IF_CALL, IF_BRANCH, IF_RET, IF_COND
IF_BYTE = 1<<8
# no operand instructions
nocode = [
'.word' # Something is wrong, so return the dirty word
]
# single operand intructions
scode = [
('rrc', 0), # RRC Rotate right through carry
('swpb... | {
"content_hash": "842e0b284ee21c61b8412542e7a51aa1",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 342,
"avg_line_length": 44.12162162162162,
"alnum_prop": 0.6055130168453292,
"repo_name": "pwns4cash/vivisect",
"id": "1715d80c02a8243d1f72132b6990b8e45cdcb65f",
"size": "... |
from flask import Flask, render_template, request, current_app
import logging
import gevent.wsgi
import json
from vote import queue, redis_handler
from vote.signals import app_start
app = Flask(__name__, instance_path='/voting-machine/vote/web/')
TEAMS_COMPETING = []
def init_app(app):
"""
Initialize the r... | {
"content_hash": "9534f53ad13f2b2b999ab76232a839eb",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 76,
"avg_line_length": 23.75925925925926,
"alnum_prop": 0.6083398285268901,
"repo_name": "mschlue/voting-machine",
"id": "f399e16a5b6797eddfb960826ba5e058cb4e9a52",
"size"... |
"""Bcp server for clients which connect and disconnect randomly."""
from mpf.exceptions.runtime_error import MpfRuntimeError
from mpf.core.utility_functions import Util
from mpf.core.mpf_controller import MpfController
class BcpServer(MpfController):
"""Server socket which listens for incoming BCP clients."""
... | {
"content_hash": "56339b5085770540a34c47e43e2277e0",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 119,
"avg_line_length": 37.17777777777778,
"alnum_prop": 0.6120741183502689,
"repo_name": "missionpinball/mpf",
"id": "5c22ab0a6e05efcfb81cd875c3f3d3eb1a7f2a7a",
"size": "1... |
"""
Contains plotting tools developed after the implementation of analysis v2
"""
import matplotlib.pyplot as plt
from matplotlib import colors as mpl_colors
import numpy as np
import logging
log = logging.getLogger(__name__)
def scatter_pnts_overlay(
x,
y,
fig=None,
ax=None,
t... | {
"content_hash": "1bff4bfbf449a23dba0d675daa1bef4c",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 80,
"avg_line_length": 29.978378378378377,
"alnum_prop": 0.5191128741435269,
"repo_name": "DiCarloLab-Delft/PycQED_py3",
"id": "a62690810701b0c4c8fdf9a772743117e0dd33f7",
... |
import sys
from copy import deepcopy
import pytest
from paramiko import Transport
from paramiko.channel import Channel
from paramiko.sftp_client import SFTPClient
from pytest_sftpserver.sftp.server import SFTPServer
# fmt: off
CONTENT_OBJ = dict(
a=dict(
b="testfile1",
c="testfile2",
f=["... | {
"content_hash": "314abb4b3ff26b55183142584ff48f1e",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 84,
"avg_line_length": 28.352631578947367,
"alnum_prop": 0.6547243363653239,
"repo_name": "ulope/pytest-sftpserver",
"id": "4b23f0be1451d571ab5a430788f94e6cbbeae964",
"siz... |
from six import text_type as unicode
import os
from robot.errors import DataError
from .filelogger import FileLogger
from .loggerhelper import AbstractLogger, AbstractLoggerProxy
from .monitor import CommandLineMonitor
from .stdoutlogsplitter import StdoutLogSplitter
class Logger(AbstractLogger):
"""A global l... | {
"content_hash": "60d09f25e186b1537781456ac9238587",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 84,
"avg_line_length": 34.866336633663366,
"alnum_prop": 0.6284253869089876,
"repo_name": "userzimmermann/robotframework-python3",
"id": "d85cfc40e0954b9bf2e1d55369b2936d320... |
import datetime
import trainer.corpora as crp
import trainer.features as ftr
import trainer.classifier_test as cls
import os
# vars
type = "bigram-stop"
nltk_run = True
sklearn_run = False
COUNT = 5000
cut = int((COUNT / 2) * 3 / 4)
array = [[True, False], [False, True], [True, True]]
def run(dataset):
nlt = di... | {
"content_hash": "e0960b508406e8a5eb549be2415bcfb3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 100,
"avg_line_length": 28.714285714285715,
"alnum_prop": 0.554726368159204,
"repo_name": "bromjiri/Presto",
"id": "e64f4b99f4787afc87b9e820149868a0b29ab421",
"size": "2010... |
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
from . import movies
from . import politics
from . import weather
api = movies.add_resources(api)
api = politics.add_resources(api)
api = weather.add_resources(api)
| {
"content_hash": "df21c4d45c209a1ab0be791c1850b09d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 18.066666666666666,
"alnum_prop": 0.7380073800738007,
"repo_name": "microstack/api_gateway",
"id": "54295518d2dea526c6ecfcc5dddc00227e45c2f7",
"size"... |
__author__ = 'Zhang Shaojun'
# listening address and port
CC_HOST = '172.27.0.2'
CC_PORT = 60521
# max message id
MAX_XID = 0xffffffff
# version of TransFormed Layered Controller
TFLC_VERSION_1 = 1
# packet_out timeout event
PACKET_OUT_TIMEOUT = 65536
# load_report interval
LOAD_REPORT_INTERVAL = 10
# the window ... | {
"content_hash": "0cd82862d157f4bd533e9a661d84d13a",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 74,
"avg_line_length": 21.045454545454547,
"alnum_prop": 0.6976241900647948,
"repo_name": "halexan/Headquarters",
"id": "e91baf72980d92cf0bd7baf42621f49524909ad1",
"size": ... |
from django import VERSION as djangoVersion
if djangoVersion[:2] >= (1, 8):
from django.db.backends.base.introspection import BaseDatabaseIntrospection, TableInfo
else:
from django.db.backends import BaseDatabaseIntrospection
from sqlanydb import ProgrammingError, OperationalError
import re
import sqlanydb
cl... | {
"content_hash": "73f68f705d380af605f57789ab3060f2",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 114,
"avg_line_length": 48.42201834862385,
"alnum_prop": 0.5496400151572566,
"repo_name": "sqlanywhere/sqlany-django",
"id": "451af0216c6aab18f2dbe07c662b687d8e5a3ee3",
"s... |
from freezegun import freeze_time
from CTFd.models import Awards, Fails, Solves, Users
from CTFd.schemas.users import UserSchema
from CTFd.utils import set_config
from CTFd.utils.crypto import verify_password
from tests.helpers import (
create_ctfd,
destroy_ctfd,
gen_award,
gen_challenge,
gen_fail,... | {
"content_hash": "f09921a91041188ddb8a5b8417c66e58",
"timestamp": "",
"source": "github",
"line_count": 918,
"max_line_length": 106,
"avg_line_length": 35.58278867102396,
"alnum_prop": 0.534517067197306,
"repo_name": "ajvpot/CTFd",
"id": "6cf01793b07d8a592571da800e1e582f3a556fa5",
"size": "32712",
... |
"""
esky.bdist_esky: distutils command to freeze apps in esky format
Importing this module makes "bdist_esky" available as a distutils command.
This command will freeze the given scripts and package them into a zipfile
named with the application name, version and platform.
The main interface is the 'Esky' class, ... | {
"content_hash": "c6179d92cb4052bc25de09612d170620",
"timestamp": "",
"source": "github",
"line_count": 837,
"max_line_length": 180,
"avg_line_length": 41.800477897252094,
"alnum_prop": 0.5676394089233143,
"repo_name": "timeyyy/esky",
"id": "369be679b0654d953db349d55a84c1f72079e8d9",
"size": "35108... |
import networkx
from yaiep.graph.Node import Node
##
# Classe che rappresenta l'intero spazio di ricerca che viene
# generato via via che il metodo di ricerca ispeziona nuovi nodi
#
class SearchGraph(networkx.DiGraph):
##
# Crea il grafo di ricerca come un grafo direzionato
# il quale ha come nodo inizial... | {
"content_hash": "e16cd9747a024fd478c8efd5042b7fd2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 90,
"avg_line_length": 29.923076923076923,
"alnum_prop": 0.636675235646958,
"repo_name": "aleSuglia/YAIEP",
"id": "34e1ac88e6e3ecc68e91a8e3b1579571f09f56f6",
"size": "1169"... |
from __future__ import unicode_literals
from collections import deque
from contextlib import contextmanager
from six.moves import configparser
from pathlib import Path
import distutils.util
import io
import json
import logging
import os
import six
import sys
logger = logging.getLogger(__file__)
marker = object()
LO... | {
"content_hash": "7ced6946d0bfb879a5ae0b9b09544d05",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 88,
"avg_line_length": 35.625,
"alnum_prop": 0.5739893211289092,
"repo_name": "Dallinger/Dallinger",
"id": "11f60e5b36d25b1555be49abe3f04c54a66729a8",
"size": "13110",
"... |
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
| {
"content_hash": "07b8191e8c41d5177a86b27e96d772be",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 64,
"avg_line_length": 32.75,
"alnum_prop": 0.6564885496183206,
"repo_name": "plum-umd/pasket",
"id": "a2ac095cafa00f055f17e9d0dd235f3070dd349b",
"size": "248",
"binary": ... |
from setuptools import setup, find_packages
import codecs
import os.path
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if ... | {
"content_hash": "c1cc0d5a959a0f5ce486c29fac7c7496",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 64,
"avg_line_length": 31.238095238095237,
"alnum_prop": 0.6219512195121951,
"repo_name": "Kaggle/kaggle-environments",
"id": "ee1242916588872005ae0d7b575ea214e9109d6c",
"s... |
"""Test config flow."""
from unittest.mock import patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import mqtt
from homeassistant.components.hassio import HassioServiceInfo
from homeassistant.core import HomeAssistant
from homeassist... | {
"content_hash": "96a44209fb49290c06d83cdcb645015e",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 87,
"avg_line_length": 32.57903780068729,
"alnum_prop": 0.6043985021887032,
"repo_name": "home-assistant/home-assistant",
"id": "befdc139eeba7edbbd0de3208d409464b61ff98a",
... |
r"""
Biological sequences (:mod:`skbio.core.sequence`)
=================================================
.. currentmodule:: skbio.core.sequence
This module provides functionality for working with biological sequences,
including generic sequences, nucelotide sequences, DNA sequences, and RNA
sequences. Class methods a... | {
"content_hash": "5ae63a9a0e35621a9b2576ad63f04a7d",
"timestamp": "",
"source": "github",
"line_count": 1417,
"max_line_length": 79,
"avg_line_length": 27.726887791107973,
"alnum_prop": 0.5438926926111635,
"repo_name": "Jorge-C/bipy",
"id": "3a6304b5f292ebb9b240c0db6056b37174cfcd7b",
"size": "39311... |
import datetime, hashlib, feedparser
from django.core.management.base import BaseCommand, CommandError
from aggregator.models import Feed, FeedPost
from unidecode import unidecode
class Command(BaseCommand):
args = ''
help = 'Updates all feeds'
def handle(self, *args, **options):
all_feeds = Feed.objects.all()... | {
"content_hash": "e385aac2498a9aaf0c40be7adce3ce75",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 88,
"avg_line_length": 25.696428571428573,
"alnum_prop": 0.6004169562195969,
"repo_name": "wd5/jangr",
"id": "3879367e2293462badb7e568e126c1e11008d355",
"size": "1463",
"... |
'''Provides an object model for a Singer Catalog.'''
import json
import sys
from . import metadata as metadata_module
from .bookmarks import get_currently_syncing
from .logger import get_logger
from .schema import Schema
LOGGER = get_logger()
def write_catalog(catalog):
# If the catalog has no streams, log a wa... | {
"content_hash": "6bdd1041e52dda0f9eb8d03d49c74179",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 81,
"avg_line_length": 35.22435897435897,
"alnum_prop": 0.6032757051865332,
"repo_name": "singer-io/singer-python",
"id": "1767ff15c8e5b0c6c551dbcac0a3e4db661397cb",
"size... |
from . import util
DOCKER_IMAGE = 'gcr.io/skia-public/cmake-release:3.13.1_v2'
INNER_BUILD_SCRIPT = '/SRC/skia/infra/cmake/build_skia.sh'
def compile_fn(api, checkout_root, _ignore):
out_dir = api.vars.cache_dir.join('docker', 'cmake')
configuration = api.vars.builder_cfg.get('configuration', '')
if configurat... | {
"content_hash": "a5def6297e4b26267812883c8cb06569",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 46.044444444444444,
"alnum_prop": 0.6916023166023166,
"repo_name": "endlessm/chromium-browser",
"id": "22de11f0fdf23b1e4e6fdbe0347c93e6a8fb671c",
"si... |
from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.core.decorators import wraps
def recurrence_memo(initial):
"""
Memo decorator for sequences defined by recurrence
See usage examples e.g. in the specfun/combinatorial module
"""
cache = initial
... | {
"content_hash": "7e580ffe6a2c16ae55a092241863a0fa",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 84,
"avg_line_length": 24.725806451612904,
"alnum_prop": 0.5146771037181996,
"repo_name": "kaushik94/sympy",
"id": "6d23a15017658901d449164a58225d30eee1eade",
"size": "1533... |
from django import forms
from django.core.validators import RegexValidator
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from .models import Drug, Category
class UserModelChoiceField(forms.ModelChoiceField):
# return the name instead of the object in the select option... | {
"content_hash": "186d949fd7a9ae888e4d6106e4f6e62c",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 120,
"avg_line_length": 46.156462585034014,
"alnum_prop": 0.5025792188651437,
"repo_name": "thodoris/djangoPharma",
"id": "6db68b9ac86431a1a6d40e8ea71731dfe4aef6e2",
"size... |
import os
import sys
import errno
import importlib
import contextlib
from maya import cmds, OpenMaya
import maya.utils
import maya.api.OpenMaya as om
from pyblish import api as pyblish
from . import lib, compat
from ..lib import logger, find_submodule
from .. import api
from ..tools import workfiles
from ..vendor.Qt ... | {
"content_hash": "c270bf19dd380f69ebbdf13e216e0159",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 79,
"avg_line_length": 28.007518796992482,
"alnum_prop": 0.6018255033557047,
"repo_name": "mindbender-studio/core",
"id": "ba4005b999ee07f26d3e684bf71114f23bffdf78",
"size... |
import mapper
import time
from simplecoremidi import MIDISource, MIDIDestination
from mapper import Note, Tap, LongPress, Controller, Program, MIDIMapper, Keystroke, key, Change, Send, Compare, typename
import sys
import os
# TODO: parse from a file
ACTIONS = {
Note(1): { LongPress(): Keystroke(key.K_F16), Tap(): ... | {
"content_hash": "11dfc09ee8cbe82602d739abcd8e2cba",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 121,
"avg_line_length": 44.1764705882353,
"alnum_prop": 0.6158455392809588,
"repo_name": "jokester01au/simplecoremidi",
"id": "5e8ec19642f7480da63dbe0977a0db89e4f49c0d",
"s... |
"""
sentry.plugins.sentry_mail
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
| {
"content_hash": "94fbce2b43bbc8854b57b15823be8dcc",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 75,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6195652173913043,
"repo_name": "chayapan/django-sentry",
"id": "31c6868acf8f88fead44915c0b361d7b3308f6c4",
"size":... |
import json
import logging
import math
import re
import sys
import time
from django import forms
from django.contrib import messages
from django.contrib.auth.models import User
from django.db.models import Q
from django.http import HttpResponse, QueryDict
from django.shortcuts import redirect
from django.utils.html im... | {
"content_hash": "8dc62b31c06a27abc62aaa30018ae727",
"timestamp": "",
"source": "github",
"line_count": 998,
"max_line_length": 160,
"avg_line_length": 34.13226452905812,
"alnum_prop": 0.6680072804133396,
"repo_name": "dulems/hue",
"id": "bb73229284277532c3db8f8b56f946e7209cc6e6",
"size": "34856",
... |
from blinker import Namespace
_signals = Namespace()
get_cloners = _signals.signal('get_cloners', """
Expected to return one or more ``EventCloner`` subclasses implementing
a cloning operation for something within an event.
""")
management_url = _signals.signal('management-url', """
Expected to return a URL for th... | {
"content_hash": "3b60698522f5e1dcd4db308fd2c7810d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 82,
"avg_line_length": 39.12903225806452,
"alnum_prop": 0.7436108821104699,
"repo_name": "mvidalgarcia/indico",
"id": "19a3c881c9f38580e8675faa3a4984c61ad1122c",
"size": "1... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mturk', '0006_auto_20160129_2154'),
]
operations = [
migrations.AlterField(
model_name='mturkhit',
name='status',
... | {
"content_hash": "387949f77a20f22380066e1ff3b27528",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 135,
"avg_line_length": 25.72222222222222,
"alnum_prop": 0.5853131749460043,
"repo_name": "aginzberg/crowdsource-platform",
"id": "0128c729c1b5e2fe5ef3cbe96e99f28a0f4faff2",
... |
import scrapy
import re
from locations.items import GeojsonPointItem
class ShopkoSpider(scrapy.Spider):
name = "surlatable"
allowed_domains = ['surlatable.com']
start_urls = (
'https://www.surlatable.com/storeHome.xml',
)
def parse(self, response):
response.selector.remove_namesp... | {
"content_hash": "406e5c4cba0d17fc2f783b72b4531fc5",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 140,
"avg_line_length": 40.82222222222222,
"alnum_prop": 0.5737615677735438,
"repo_name": "iandees/all-the-places",
"id": "c09f460849bfae86d67430d251fb5f8cea96e837",
"size"... |
class Graph:
"""
Data structure to store graphs (based on adjacency lists)
"""
def __init__(self):
self.num_vertices = 0
self.num_edges = 0
self.adjacency = {}
def add_vertex(self, vertex):
"""
Adds a vertex to the graph
"""
... | {
"content_hash": "02e3b44e60a2fa7b333b1a2084d7aa80",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 78,
"avg_line_length": 30.071428571428573,
"alnum_prop": 0.4614862572107228,
"repo_name": "TheAlgorithms/Python",
"id": "6c72615cc729d7e00320f5b49c48cac74d256f3f",
"size":... |
from collections import defaultdict
from django.core.exceptions import ObjectDoesNotExist
from django.db import IntegrityError, transaction
from django.db.models import Count
from junction.devices.models import Device
from junction.schedule.models import ScheduleItem, ScheduleItemType
from .models import (
Choic... | {
"content_hash": "f203a0ad3eef3468989f9368a1e58137",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 84,
"avg_line_length": 32.2734375,
"alnum_prop": 0.6146211571048172,
"repo_name": "pythonindia/junction",
"id": "0d06d8af41067439cceed5fbab3890256142f453",
"size": "8287",... |
"""An interactive Python prompt in the Porcupine process, accessible from the "Run" menu.
Unlike a normal ">>>" prompt, the one here lets you run commands that affect
the current Porcupine instance. You can e.g. access the opened tabs.
For example, this sets the color of the last tab:
>>> get_tab_manager().tabs()... | {
"content_hash": "9941c747c6688778037e55da93d32bbb",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 93,
"avg_line_length": 36.451219512195124,
"alnum_prop": 0.6423553027768485,
"repo_name": "Akuli/porcupine",
"id": "95fc08f09d0963c6de3460b18433de468d29203f",
"size": "2989... |
from yambopy import *
from itertools import product
def calculate_distances(kpoints):
"""
take a list of k-points and calculate the distances between all of them
"""
kpoints = np.array(kpoints)
distances = [0]
distance = 0
for nk in range(1,len(kpoints)):
distance += np.linalg.norm(... | {
"content_hash": "824074f1242ccab7613726a7673de4df",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 129,
"avg_line_length": 29.407185628742514,
"alnum_prop": 0.6131134188556302,
"repo_name": "alexmoratalla/yambopy",
"id": "9b69fc1da191b3c07913dc813e1bfc049850fc38",
"size... |
__all__ = ['imread']
from numpy import array
def imread(fname, flatten=False):
"""
Load an image from file.
Parameters
----------
fname : str
Image file name, e.g. ``test.jpg``.
flatten : bool, optional
If true, convert the output to grey-scale. Default is False.
Returns
... | {
"content_hash": "2f7f83c4956af98fea87f187d44b621f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 26.325581395348838,
"alnum_prop": 0.5653710247349824,
"repo_name": "lesserwhirls/scipy-cwt",
"id": "20ab6e4471d0315c2509ca46c1b19f9a97dfe469",
"size"... |
import logging
import optparse
import subprocess
import sys
from webkitpy.common.system.executive import Executive
from webkitpy.common.system.filesystem import FileSystem
from webkitpy.common.webkit_finder import WebKitFinder
_log = logging.getLogger(__name__)
class Bucket(object):
def __init__(self, tests):
... | {
"content_hash": "08937d02843b1abb18415e0502e3ac29",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 142,
"avg_line_length": 36.72027972027972,
"alnum_prop": 0.6084555322795658,
"repo_name": "axinging/chromium-crosswalk",
"id": "f4fc025607cf1052a0956811207228baa79eb7c2",
... |
"""
Statespace Tools
Author: Chad Fulton
License: Simplified-BSD
"""
import numpy as np
from scipy.linalg import solve_sylvester
import pandas as pd
from statsmodels.compat.pandas import Appender
from statsmodels.tools.data import _is_using_pandas
from scipy.linalg.blas import find_best_blas_type
from . import (_init... | {
"content_hash": "6cc09dcc5fa1e79b236c8f2d2f6fccd8",
"timestamp": "",
"source": "github",
"line_count": 1883,
"max_line_length": 79,
"avg_line_length": 35.059479553903344,
"alnum_prop": 0.6060105730342185,
"repo_name": "jseabold/statsmodels",
"id": "cfd452532ae86dfeb13dca07aaaa2d6653248cb8",
"size"... |
from time import sleep
from pytest import raises, fixture
from threading import Event
from promise import (
Promise,
is_thenable,
promisify,
promise_for_dict as free_promise_for_dict,
)
from concurrent.futures import Future
from threading import Thread
from .utils import assert_exception
class Delay... | {
"content_hash": "ef9ae5b5e6618b5d3875648f3593cf20",
"timestamp": "",
"source": "github",
"line_count": 668,
"max_line_length": 121,
"avg_line_length": 21.69610778443114,
"alnum_prop": 0.5925619264472504,
"repo_name": "syrusakbary/pypromise",
"id": "4a083718d134ede122d5a761c592318a9fa5748e",
"size"... |
"""
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import gtk
if gtk.pygtk_version < (2, 7, 0):
import cairo.gtk
from matplotlib import cbook
from... | {
"content_hash": "845f1a2cd84a8d3273c2fcc04bab29c7",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 77,
"avg_line_length": 31.40625,
"alnum_prop": 0.6945273631840796,
"repo_name": "louisLouL/pair_trading",
"id": "a8cdf076a93f2d422c9dcb1c4f91ea5f9a92d022",
"size": "2010",
... |
import numpy
from ginga.gw import Widgets
from ginga.misc import Bunch
from ginga import GingaPlugin
class Info(GingaPlugin.GlobalPlugin):
def __init__(self, fv):
# superclass defines some variables for us, like logger
super(Info, self).__init__(fv)
self.active = None
self.info ... | {
"content_hash": "c28c2b51deca9ed0df514b8a082c2f85",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 77,
"avg_line_length": 36.5048231511254,
"alnum_prop": 0.5432044393552365,
"repo_name": "stscieisenhamer/ginga",
"id": "09079eacc46abf58446b3874c95d3a592baa7430",
"size": ... |
import time
from neutronclient.common import exceptions as neutron_client_exc
from oslo.config import cfg
from nova.compute import flavors
from nova.compute import utils as compute_utils
from nova import conductor
from nova import exception
from nova.network import base_api
from nova.network import model as network_m... | {
"content_hash": "443fbeea649c2069b5d37dfaadffc9b9",
"timestamp": "",
"source": "github",
"line_count": 1223,
"max_line_length": 79,
"avg_line_length": 46.0670482420278,
"alnum_prop": 0.5582712105076323,
"repo_name": "CiscoSystems/nova",
"id": "f397cbe8ef102648ddcb081ffe9440ec851080a3",
"size": "57... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: lambda_alias
short_description: Creates, updates or deletes... | {
"content_hash": "9fa8e9905df50467a202fdb1f0b7fc4d",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 130,
"avg_line_length": 31.25065963060686,
"alnum_prop": 0.6176122931442081,
"repo_name": "e-gob/plataforma-kioscos-autoatencion",
"id": "78aae3cdb051cd277b850d58a1e684648cc... |
import sys
import os
import shutil
from datetime import datetime
def createBackup(rootDir, backupPath):
for root, dirs, files in os.walk(rootDir):
for f in files:
filename = (f).replace('\\', "/")
rVal = root.replace(rootDir, "")
dst = (os.path.join("./", backupPath + "/" +... | {
"content_hash": "d0ca39e7aa9bbbb334b571351dfd7f89",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 153,
"avg_line_length": 29.945054945054945,
"alnum_prop": 0.4704587155963303,
"repo_name": "evast/XNATImageViewer",
"id": "533eb4adaa9d6014125fce095a71642f3fcfc15c",
"size"... |
'''
Created on 25 Jun 2015
@author: meghann
'''
import tkinter as tk
import tkinter.font
from tkinter import ttk
import lists
import energycalc
class Options(ttk.Labelframe):
def __init__(self, parent):
ttk.LabelFrame.__init__(self, parent, text="Fuel comparison options")
self.parent... | {
"content_hash": "ac2a3bed5141a409dfe1266cf2f1f0c7",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 106,
"avg_line_length": 51.413636363636364,
"alnum_prop": 0.5150148822679987,
"repo_name": "MeghannMears/CyclistVsCar",
"id": "1671790091a787e58a1b0e4139d35dac08b57e6f",
"... |
import sys
import asyncio
import telepot
from telepot.aio.helper import InlineUserHandler, AnswererMixin
from telepot.aio.delegate import per_inline_from_id, create_open, pave_event_space
"""
$ python3.5 inlinea.py <token>
It demonstrates answering inline query and getting chosen inline results.
"""
class InlineHandl... | {
"content_hash": "29ac3f31e8311093573eab7aa031556a",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 95,
"avg_line_length": 32.93478260869565,
"alnum_prop": 0.6607260726072607,
"repo_name": "TEJESH/gandhi",
"id": "f064b729effb117acbfbc096cb2cdcde47475245",
"size": "1515",
... |
import datetime
from django.utils.translation import ugettext_lazy as _
from google.appengine.ext import db as models
from ragendja.auth.google_models import GoogleUserTraits
from common.models import DeletedMarkerModel
from common import properties
from common.models import PRIVACY_PRIVATE, PRIVACY_CONTACTS, PRIVACY_P... | {
"content_hash": "04796e7a2e4f5a4b9931cec4c3ed6011",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 126,
"avg_line_length": 34.992805755395686,
"alnum_prop": 0.6252055921052632,
"repo_name": "tallstreet/jaikuenginepatch",
"id": "39565613539769456ebfe02a7d84c4ff7df9d95f",
... |
"""Tests for the Cloudflare integration."""
from typing import List
from unittest.mock import AsyncMock, patch
from pycfdns import CFRecord
from homeassistant.components.cloudflare.const import CONF_RECORDS, DOMAIN
from homeassistant.const import CONF_API_TOKEN, CONF_ZONE
from tests.common import MockConfigEntry
EN... | {
"content_hash": "441816d9c5ca79b4fa7d7c61bdae7914",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 78,
"avg_line_length": 25.287128712871286,
"alnum_prop": 0.6366483946750195,
"repo_name": "partofthething/home-assistant",
"id": "c72a9cd84b01267b777e7292041967d66eb3913f",
... |
import argparse
import json
import logging
import textwrap
from os_cloud_config.cmd.utils import _clients
from os_cloud_config.cmd.utils import environment
from os_cloud_config import nodes
def parse_args():
description = textwrap.dedent("""
Register nodes with either Ironic or Nova-baremetal.
The JSON ... | {
"content_hash": "e20c6924114bca26279fc8db276f5b9d",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 37.41269841269841,
"alnum_prop": 0.6419176919813322,
"repo_name": "shakamunyi/os-cloud-config",
"id": "5d80fd5b5107ca383c64f2f6bb10a822f71de446",
"si... |
import os
import argparse
import gettext
t = gettext.translation('globofs', os.path.join(os.path.dirname(__file__), 'locale'), fallback=True)
_ = t.ugettext
def run():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(help=_('Commands'), dest='command')
# A list command
list_pa... | {
"content_hash": "08d1f3dcf97cb0b4ae551cc21b25ee40",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 100,
"avg_line_length": 25.418181818181818,
"alnum_prop": 0.6015736766809728,
"repo_name": "GloboFS/GloboFS",
"id": "504071df8ef741b7ad0a2cfb09a4a1b7cdc78ab3",
"size": "144... |
'Save a subset of lines from an input file; start at offset and count n lines'
'default 100 lines starting from 0'
import sys
input_file = sys.argv[1]
output_file = sys.argv[2]
try:
offset = int( sys.argv[3] )
except IndexError:
offset = 0
try:
lines = int( sys.argv[4] )
except IndexError:
lines = 100
i = op... | {
"content_hash": "07a289abab0715285db55cd3065550df",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 78,
"avg_line_length": 12.357142857142858,
"alnum_prop": 0.6204238921001927,
"repo_name": "amunategui/phraug",
"id": "993b55443e8e47239b0ab6c77d5bc58cb6333398",
"size": "51... |
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_... | {
"content_hash": "982a63d9f00bf1230cc7f157f804a4e0",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 209,
"avg_line_length": 52.285714285714285,
"alnum_prop": 0.6174863387978142,
"repo_name": "Atilla106/members.atilla.org",
"id": "715f91fbcbe480d2b8d60ee651c857984191a594",
... |
import os, sys, time
import urllib2
def main():
# host = "http://localhost:30001/control?port=/dev/ttyUSB0"
host = "http://localhost:30001/control?port=/dev/ttyUSB0&dtr=1&rts=0"
try:
req = urllib2.urlopen(host)
print("Reply data:")
print(req.read())
except Exception as e:
... | {
"content_hash": "446b87fd3c5be5c4db49477553a87197",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 23.555555555555557,
"alnum_prop": 0.5801886792452831,
"repo_name": "IECS/MansOS",
"id": "e15349b386968723821f5416f370db7d91451234",
"size": "466",
... |
import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import Pipeline... | {
"content_hash": "a24fc1e3c823356946ebf7dbb6a19262",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 225,
"avg_line_length": 46.04532577903683,
"alnum_prop": 0.6651285837332349,
"repo_name": "Azure/azure-sdk-for-python",
"id": "689b92d93bde1f0c1283f56ec3340110e01a1aa0",
"... |
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication, BasicAuthentication, SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from .models import Version
from .serializers import VersionSerializer
class VersionViewSet(viewsets.ModelViewSet):
... | {
"content_hash": "0c05b839298b272116b2dc3072576cf2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 105,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.7512315270935961,
"repo_name": "bellhops/TapeDeck",
"id": "b81cc2aa4b759b825dd8b6ea8fc12f6853bd4f62",
"size": "8... |
"""
AIR compilation environment.
"""
from __future__ import print_function, division, absolute_import
# Any state that should persist between passes end up in the environment, and
# should be documented here
air_env = {
# blaze expression graph
#'expr_graph': None,
# strategy determined for each O... | {
"content_hash": "cdc0dec64111d87bb9b4e5a0f5370e06",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 77,
"avg_line_length": 26.878048780487806,
"alnum_prop": 0.6451905626134301,
"repo_name": "aaronmartin0303/blaze",
"id": "a33c9f6bd51e9a6e6562adcb89aa150298cf19b6",
"size":... |
import collections
from supriya.tools.ugentools.UGen import UGen
class OffsetOut(UGen):
r'''A bus output unit generator with sample-accurate timing.
::
>>> source = ugentools.SinOsc.ar()
>>> ugentools.OffsetOut.ar(
... bus=0,
... source=source,
... )
... | {
"content_hash": "cee82802c2da32c5d6f0a1c040857b3e",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 71,
"avg_line_length": 22.80701754385965,
"alnum_prop": 0.4826923076923077,
"repo_name": "andrewyoung1991/supriya",
"id": "5f791e85303be1e4a07b63f63ee1760d36f8f458",
"size... |
from array import array
from six.moves import collections_abc
import six
from ..operator import Operator
class ContainOperator(Operator):
"""
Asserts if a given value or values can be found
in a another object.
Example::
# Should style
'foo bar' | should.contain('bar')
['foo... | {
"content_hash": "55707fca57237644f79c33004aea8f6d",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 71,
"avg_line_length": 29.61904761904762,
"alnum_prop": 0.577491961414791,
"repo_name": "grappa-py/grappa",
"id": "6da10c97120500f561682e3b7e57915195484c7c",
"size": "3134... |
"""Display the aggregated feeds."""
from datetime import date
from .database import Entry
from .utils import expose
from .utils import Pagination
from .utils import render_template
#: number of items per page
PER_PAGE = 30
@expose("/", defaults={"page": 1})
@expose("/page/<int:page>")
def index(request, page):
... | {
"content_hash": "f1637fcc556ddda3f4daa56979e8a6dd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 74,
"avg_line_length": 29.41176470588235,
"alnum_prop": 0.649,
"repo_name": "fkazimierczak/werkzeug",
"id": "1729f9a23a080636fda99b6817e5e756722468c7",
"size": "1000",
"b... |
import sys
from pylint.lint import Run
min_score = 10
results = Run(['pypoabus', 'tests'], exit=False)
global_note = results.linter.stats['global_note']
if global_note >= min_score:
print('Minimum score reached! min_score = {}'.format(str(min_score)))
else:
print('Minimum score not reached! min_score = {}'.... | {
"content_hash": "0fee70532fde038ade0ae96ae29e50a9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 77,
"avg_line_length": 25.714285714285715,
"alnum_prop": 0.6805555555555556,
"repo_name": "jonathadv/PyPoABus",
"id": "be06b7fead13ffdb77bb1c2eaf81637f9a4e20db",
"size": "3... |
import os
class Dict(object):
"""
Dict utils.
"""
@staticmethod
def flat_dict(d, delimiter="/", start_char="^", end_char="$", key="", out={}):
"""
Flats hierarhical dict.
"""
for k,v in d.iteritems():
new_key = key + delimiter + k
if isinstance(v, dict):
Dict.flat_dict(v, delimiter, start_char,... | {
"content_hash": "8186d93f948a02b824fac2806a1de63f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 19.236559139784948,
"alnum_prop": 0.6003353828954723,
"repo_name": "stanislavfeldman/putils",
"id": "e0ea88fc58a3cc681604d05196868d215d501265",
"size... |
from abc import ABCMeta
from abc import abstractmethod
import signal
import sys
import traceback
EXECUTION_TIME_LIMIT_IN_SECONDS = 2
def signal_handler(signum, frame):
raise Exception("Execution timed out!")
class Seller(object):
"""
Abstract class of a simulation game seller. Defines a common interfa... | {
"content_hash": "a79d4413fca82d459dff224d8a07882f",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 126,
"avg_line_length": 34.36486486486486,
"alnum_prop": 0.635863153755407,
"repo_name": "gutin/DynamicPricingGame",
"id": "46255167af3339d37246391a64cd75f305f13919",
"size... |
import json
import Image, ImageDraw, math
def generate_image(jsonData, sizeX=0, sizeY=0):
"""Parses the JSON data from signature-panel to produce a bitmap image"""
if sizeX < 0:
raise ValueError("sizeX must be >= 0")
if sizeY < 0:
raise ValueError("sizeY must be >= 0")
data = json.loa... | {
"content_hash": "f759a65f1691ed36763c59505c4a6e7e",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 134,
"avg_line_length": 39.425,
"alnum_prop": 0.5932149651236525,
"repo_name": "jes-sherborne/jquery-signature-panel-plugin",
"id": "f69a6ec131ceb36db1040f8d9506760fe7c98cba"... |
"""
PEP386-version comparison algorithm.
(c) Tarek Ziade and others
extracted unmodified from https://bitbucket.org/tarek/distutilsversion
licensed under the PSF license (i guess)
UPDATE 2017-09-06: removed suggest_normalized_version function as it is not needed by the project
"""
import re
class IrrationalVersionE... | {
"content_hash": "99a88ac40e9eea1636652d825b2b2e7a",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 97,
"avg_line_length": 36.5695067264574,
"alnum_prop": 0.5200490496627835,
"repo_name": "loechel/tox",
"id": "dca82156a40fba206ec93bb40175f8731dfedb6e",
"size": "8155",
... |
r"""TestplanEntry and Testplan classes for maintaining testplan entries
"""
import re
import sys
from tabulate import tabulate
class TestplanEntry():
"""An entry in the testplan
A testplan entry has the following information: name of the planned test (testpoint),
a brief description indicating intent, ... | {
"content_hash": "4ea2b621640f4e769a53de9abcc113aa",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 94,
"avg_line_length": 40.124161073825505,
"alnum_prop": 0.4999581834908422,
"repo_name": "chipsalliance/Surelog",
"id": "f38cbfb755654092ca17d91fedd13065a5e0c54c",
"size"... |
from setuptools import setup
setup(
name='libovs',
version='0.0.1',
description='A simple OVSDB library',
author='Atzm WATANABE',
author_email='atzm@atzm.org',
license='BSD-2',
py_modules=['libovs'],
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Appro... | {
"content_hash": "c679d39054ac91f2ebc565b4b5231d74",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 49,
"avg_line_length": 24.72222222222222,
"alnum_prop": 0.5842696629213483,
"repo_name": "atzm/libovs",
"id": "be9521cd71564cf4a5d8133177c8549724feac57",
"size": "492",
"... |
"""Test compilation database flags generation."""
import imp
import platform
from os import path
from unittest import TestCase
from EasyClangComplete.plugin.flags_sources import compilation_db
from EasyClangComplete.plugin.utils import tools
from EasyClangComplete.plugin.utils import flag
from EasyClangComplete.plugin... | {
"content_hash": "a797221331b0d3b2ca9e175fd0f13b7c",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 78,
"avg_line_length": 41.46808510638298,
"alnum_prop": 0.5542158371814606,
"repo_name": "niosus/EasyClangComplete",
"id": "0eea22a32544f5034ce8ac571a3d99cd734b70f1",
"siz... |
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credent... | {
"content_hash": "2b7e3b3a19614dca7563f499f5c28899",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 161,
"avg_line_length": 40.95426195426195,
"alnum_prop": 0.6198791816843494,
"repo_name": "googleads/google-ads-python",
"id": "84668a7dee258e18ef99c93f18b69abe0795076b",
... |
u"""
Created on 2017-1-6
@author: cheng.li
"""
import unittest
import numpy as np
import pandas as pd
from PyFin.Enums import Factors
from PyFin.Analysis.SecurityValueHolders import SecurityLatestValueHolder
from PyFin.Analysis.CrossSectionValueHolders import CSRankedSecurityValueHolder
from PyFin.Analysis.CrossSecti... | {
"content_hash": "09c7f7a5b7de2481c0150ffe8ac33ae7",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 132,
"avg_line_length": 54.298288508557455,
"alnum_prop": 0.5503422190201729,
"repo_name": "wegamekinglc/Finance-Python",
"id": "c330e784330c39013feebaab317341baa7c97aa9",
... |
import copy
import re
import sys
import tempfile
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, AsyncMock, _Call, _CallList,
create_autos... | {
"content_hash": "88f81ab761ee4bd12ee94d80fb7687be",
"timestamp": "",
"source": "github",
"line_count": 2085,
"max_line_length": 98,
"avg_line_length": 32.96306954436451,
"alnum_prop": 0.5443778372715633,
"repo_name": "xyuanmu/XX-Net",
"id": "1cde45e9aea5550b42c2150306842552b902ef79",
"size": "6872... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as file:
long_description = file.read()
setup(
author='Silas Boyd-Wickizer',
author_email='silas@godaddy.com',
classifiers=(
'Development Status :: 5 - Production/Stable',
'Framework :... | {
"content_hash": "62fffde813cfcd2fe80a1e6fa289e153",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 83,
"avg_line_length": 33.35294117647059,
"alnum_prop": 0.6957671957671958,
"repo_name": "godaddy/django_transaction_barrier",
"id": "d81d079de1d95f57a551871e820cb44a24272170... |
"""Tests for IdentityOp."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorf... | {
"content_hash": "63e71968c8d06ab898dd52057c29ab9f",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 78,
"avg_line_length": 34.095238095238095,
"alnum_prop": 0.6620111731843575,
"repo_name": "ghchinoy/tensorflow",
"id": "40ec9db4226a89305732683118f7f906db1ba965",
"size": "... |
import nba, os
import sys
for netdev in nba.get_netdevices():
print(netdev)
for coproc in nba.get_coprocessors():
print(coproc)
node_cpus = nba.get_cpu_node_mapping()
for node_id, cpus in enumerate(node_cpus):
print('Cores in NUMA node {0}: [{1}]'.format(node_id, ', '.join(map(str, cpus))))
# The values r... | {
"content_hash": "5e1781149255f617bc0b14453442d6ad",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 105,
"avg_line_length": 34.642857142857146,
"alnum_prop": 0.6439862542955327,
"repo_name": "ANLAB-KAIST/NBA",
"id": "616c145e82c7aa29aeea387781b1b53be7880ef7",
"size": "293... |
from yz_js_django_tpl import BaseJsFilter, JsProcessorRegistry
class HashJsFilter(BaseJsFilter):
"""
Converts the "hash" filter in django templates to native javascript hash look up,
i.e. {{exampleVar|hash:varB}}
Examples:
>>> from yz_js_django_tpl import TemplateJsNode,JsTplSettings
>>> from ... | {
"content_hash": "67f01402c03944a1f9835e0744c6a269",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 94,
"avg_line_length": 37.52173913043478,
"alnum_prop": 0.6361529548088065,
"repo_name": "comolongo/Yz-Javascript-Django-Template-Compiler",
"id": "cb73ba976dfdaff91708f8057d... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "b93bb2620c1ec7ef7ac70d6f49189caa",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 80,
"avg_line_length": 32.15983606557377,
"alnum_prop": 0.7075315407161973,
"repo_name": "powellc/hogandhomereport",
"id": "84adf0b5e70f33a0e137773e6103b95019e65277",
"siz... |
"""
This module contains the 'create_password' menu node.
"""
from hashlib import sha256
from textwrap import dedent
from menu.password import LEN_PASSWD
def create_password(caller, input):
"""Ask the user to create a password.
This node creates and validates a new password for this
account. It then ... | {
"content_hash": "91416b574d864c4a8c5cc5824343d136",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 66,
"avg_line_length": 26.685185185185187,
"alnum_prop": 0.5343511450381679,
"repo_name": "vlegoff/mud",
"id": "46184f114b00a6184b53ec5b3dfa54d6a1db87f8",
"size": "1443",
... |
import os
def src_dir_path():
r"""The path to the top of the MenpoDetect Python package.
Useful for locating where the models folder is stored.
Returns
-------
path : `str`
The full path to the top of the MenpoDetect package
"""
return os.path.split(os.path.abspath(__file__))[0]
... | {
"content_hash": "896fe70e0666b52550c1382cc8eb1bfb",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 75,
"avg_line_length": 23.76,
"alnum_prop": 0.6313131313131313,
"repo_name": "yuxiang-zhou/menpodetect",
"id": "bb824b5e1ded036a4617744de41e16eda1332cd5",
"size": "594",
... |
import datetime as dt
from flask.ext.login import UserMixin
from vBurgundy.extensions import bcrypt
from vBurgundy.database import (
Column,
db,
Model,
ReferenceCol,
relationship,
SurrogatePK,
)
class Role(SurrogatePK, Model):
__tablename__ = 'roles'
name = Column(db.String(80), uniq... | {
"content_hash": "c8433e98725710d72a18fef526a3eadf",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 80,
"avg_line_length": 31.203389830508474,
"alnum_prop": 0.6512764801738186,
"repo_name": "michaelrice/vBurgundy",
"id": "8bf4ecc87b0e3d1d30de21a5a8a285d80e575686",
"size":... |
import sys, os, datetime, configparser
import numpy as np
def maptext(char):
if char.isdigit(): return 'NUM'
elif char.isalpha(): return char.lower()
return char
def count(filename, vocab = dict()):
for line in open(filename):
for word in map(maptext, line.split()):
if word in vocab: vocab[word] += 1
else... | {
"content_hash": "5bbdc84a183415bf64c8bfee6782eae0",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 124,
"avg_line_length": 41.55652173913043,
"alnum_prop": 0.6631094371207366,
"repo_name": "aaiijmrtt/AUTOPOSTEDIT",
"id": "a36c7fc09fa44aee00e0309a5516e6327ac1d0aa",
"size... |
"""empty message
Revision ID: 4e32e2d01c28
Revises:
Create Date: 2017-12-22 12:06:04.886300
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4e32e2d01c28'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | {
"content_hash": "8c8636963a810d4dbe8b11f7384f05f4",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 91,
"avg_line_length": 37.625,
"alnum_prop": 0.6537467700258398,
"repo_name": "CodingCrush/WeeklyReport",
"id": "f16e2389758d06fcb96a33d9e8e4aff24162834c",
"size": "2709",
... |
from distutils.core import setup
setup(
name = "htmldom",
packages = ['htmldom'],
version = '2.0',
description = 'HTML parser which can be used for web-scraping applications',
long_description = 'htmldom parses the HTML file and provides methods for iterating and searching and modifying the parse tree in a simila... | {
"content_hash": "8f6753851afac411b0e1ead855d4a060",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 156,
"avg_line_length": 43.95652173913044,
"alnum_prop": 0.5934718100890207,
"repo_name": "bhimsen92/htmldom",
"id": "807af24a9f3cd9eab876cc6c62c1fba83406c4d9",
"size": "10... |
from ckan.plugins import toolkit
try:
from ckan.tests import helpers
from ckan.tests import factories
from ckan.tests.helpers import assert_in
except ImportError:
from ckan.new_tests import helpers
from ckan.new_tests import factories
from ckan.new_tests.helpers import assert_in
from ckanext.is... | {
"content_hash": "74042c5d9a00a2ef401ca5d1e2f9df28",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 77,
"avg_line_length": 37.11904761904762,
"alnum_prop": 0.5766516998075689,
"repo_name": "datagovuk/ckanext-issues",
"id": "9f928126edcb0ce4aa4ef8e8d5cdaa724daa75e1",
"size... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class UpdateContactProfileEmailAddress(Choreography):
def __init__(self, temboo_session):
"... | {
"content_hash": "55c37ba50c77cd632807abdbd9ad777b",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 280,
"avg_line_length": 47.75,
"alnum_prop": 0.7332751599767307,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "2bdb9024497429d1d44390da75e2c7f91ecfd889",
"size": "4303",
... |
import os
import subprocess
import yaml
from six import print_
from ccmlib import common
from . import TEST_DIR
from . import ccmtest
CLUSTER_PATH = TEST_DIR
class TestCCMCmd(ccmtest.Tester):
def __init__(self, *args, **kwargs):
ccmtest.Tester.__init__(self, *args, **kwargs)
class TestCCMCreate(Test... | {
"content_hash": "2e7460bb677a91bf05e9dc70116c3a4e",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 102,
"avg_line_length": 31.54639175257732,
"alnum_prop": 0.5748366013071895,
"repo_name": "thobbs/ccm",
"id": "caf9793d463d3a85b2f3e610789eda05c8fb026a",
"size": "3060",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.