text stringlengths 4 1.02M | meta dict |
|---|---|
from bson.objectid import ObjectId
import vacker.database
class MediaCollection(object):
_show_hidden = False
def __init__(self, id):
self._id = id
self._initialise()
def _initialise(self):
pass
def show_hidden(self):
self._show_hidden = True
def get_media_ids... | {
"content_hash": "661af119a0810089e188a907fecb4403",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 131,
"avg_line_length": 33.4863813229572,
"alnum_prop": 0.5539158726469905,
"repo_name": "MatthewJohn/vacker",
"id": "e0abafa544dcc7459e7694e04eaf7848277e366c",
"size": "8... |
REDDIT_USERNAME = '' # YOUR USERNAME as string
REDDIT_PASS = '' # YOUR PASSWORD as string
| {
"content_hash": "24100c18389253194e351c47fcfcc544",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 47,
"avg_line_length": 46,
"alnum_prop": 0.6956521739130435,
"repo_name": "smithi35/RedditBot",
"id": "67067ed0319f08925e1b27dba43e40faeb8ab389",
"size": "235",
"binary": ... |
"""Calculate reproducibility coefficients for parametric maps. Input consists
of pmap scan pairs grouped together.
"""
import argparse
import glob
import os.path
import re
import numpy as np
import dwi.files
import dwi.plot
import dwi.stats
import dwi.util
def parse_args():
"""Parse command-line arguments."""
... | {
"content_hash": "171e4feb41a0ece3cecce74a45044b12",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 77,
"avg_line_length": 33.43362831858407,
"alnum_prop": 0.5579671784012705,
"repo_name": "jupito/dwilib",
"id": "4a5dd284b3a53520b323b7ba63f564a03bd4edc6",
"size": "7576",... |
from owslib.etree import etree
from owslib import crs, util
from owslib.util import testXMLValue, testXMLAttribute, nspath_eval, xmltag_split, dict_union, extract_xml_list
from owslib.namespaces import Namespaces
def get_namespaces():
n = Namespaces()
namespaces = n.get_namespaces(["sml", "gml", "xlink"])
... | {
"content_hash": "7b32703a8391048e5c16a0980cdc4598",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 119,
"avg_line_length": 40.30277777777778,
"alnum_prop": 0.6603487490523123,
"repo_name": "geopython/OWSLib",
"id": "d4d8b0382f9729dce994e79baf64b6143dea44e7",
"size": "14... |
default_app_config = 'profiles.apps.ProfilesConfig'
| {
"content_hash": "0190070450ea602479b3c038d70ec36f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 51,
"avg_line_length": 52,
"alnum_prop": 0.8076923076923077,
"repo_name": "un33k/djangoware",
"id": "361a18c7d5aa66541899126417045f38aa20a126",
"size": "262",
"binary": fa... |
from euca2ools.commands.argtypes import delimited_list
from euca2ools.commands.elasticloadbalancing import ELBRequest
from requestbuilder import Arg
from requestbuilder.mixins import TabifyingMixin
class ApplySecurityGroupsToLoadBalancer(ELBRequest, TabifyingMixin):
DESCRIPTION = ('[VPC only] Associate one or mor... | {
"content_hash": "270f40a75e4f2f3ac1edc073e14d3edd",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 50.142857142857146,
"alnum_prop": 0.647673314339981,
"repo_name": "vasiliykochergin/euca2ools",
"id": "24bde3f8fd15dd563719fced86dd149312ba43ee",
"si... |
from django.contrib.auth.models import User
from django.db import models
class PlayerStat(models.Model):
user = models.OneToOneField(User, related_name="stats")
points = models.IntegerField(default=0)
| {
"content_hash": "09c93f8b461076bd13ef369bed3e9162",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 59,
"avg_line_length": 30.142857142857142,
"alnum_prop": 0.7677725118483413,
"repo_name": "kinsights/brabeion",
"id": "1f38c200b94bed6f9fd6640901ac70db704b9387",
"size": "21... |
import os
import re
import json
import collections
from ..cgi import BASE_PATH, save, MyDict
from ..emailer import sendemail
import markdown
from jinja2 import Environment, Markup, PackageLoader
md = markdown.Markdown(extensions=['markdown.extensions.nl2br'],
output_format='xhtml5')
env = Enviro... | {
"content_hash": "35f6b1e49d167bc6c0f17ac63fff0672",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 102,
"avg_line_length": 32.75,
"alnum_prop": 0.6802374893977947,
"repo_name": "oskar456/ldform",
"id": "353b41f62a8951b290973d934cf52d3b820a45fc",
"size": "1182",
"binary... |
"""
Interface for all diagnostic tests plugins.
"""
from control.plugin import DeclareFramework
@DeclareFramework('diagnostics')
class Diagnostics(object):
"""Interface for diagnostics classes."""
def __init__(self, **options):
"""Init function"""
pass
def launch_diags(self, device, bmc):... | {
"content_hash": "ea69750b2f026bdfaf904fbedfbed28a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 66,
"avg_line_length": 25.0625,
"alnum_prop": 0.6608478802992519,
"repo_name": "intel-ctrlsys/actsys",
"id": "5353a0c851cfa340e98285aad495b6350b4de053",
"size": "463",
"b... |
import requests
import logging
import time
from ..model.Scanner import NetworkScanner
from ..configuration import Configuration
def sync_with_server(data):
r = requests.post(Configuration.SERVER_URI, data=data)
if r.status_code == 200:
logging.warning('Networking data send was successfull!')
else:... | {
"content_hash": "75389e99c8dab783af9d720568220fd2",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 89,
"avg_line_length": 29.419354838709676,
"alnum_prop": 0.631578947368421,
"repo_name": "rdenadai/raspberry-home-auto",
"id": "b1f32b0ab5fc4c7a2caa1ce354fe6cebeff404cf",
"... |
"""Test the topology module's Server Selection Spec implementation."""
import os
import sys
sys.path[0:0] = [""]
from test import unittest
from test.utils_selection_tests import create_selection_tests
# Location of JSON test specifications.
_TEST_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__))... | {
"content_hash": "6f72f12cb24e13b10182214470f1fb87",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 22.681818181818183,
"alnum_prop": 0.7054108216432866,
"repo_name": "ramnes/mongo-python-driver",
"id": "b54eea4f3c56b4b88231ced775c446b11c2bca59",
"s... |
import os
import json
import logging
import pkg_resources
import cssutils
from flask import Flask, g
from flask_wtf import CSRFProtect
from flask_login import current_user
from flask_principal import Principal, UserNeed, identity_loaded
from flaskapp.lib import template_helpers
from flaskapp.meta import mail, db, lm
... | {
"content_hash": "79df8827cc22c35c0bdf7900192cdc31",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 24.47826086956522,
"alnum_prop": 0.650088809946714,
"repo_name": "ChIaSg/flaskapp",
"id": "dff7adc177b5170deece4a2991fd31071dbe2da6",
"size": "2252",... |
@task()
def path(self):
url = self.locust.host + '/path'
data = '''content'''
self.response = self.client.request(
method='POST',
url=url,
data=data,
)
| {
"content_hash": "6cb1632775d331e3bbaa43958eaa73ac",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 20.90909090909091,
"alnum_prop": 0.43478260869565216,
"repo_name": "xaxa89/mitmproxy",
"id": "989df455fcfb071f2d426e4f2ef39aba553c5007",
"size": "230... |
NAME="Immediate Alert"
UUID=0x1802
| {
"content_hash": "27d4f0cce80a37edb4ddab4de119d260",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 22,
"avg_line_length": 17.5,
"alnum_prop": 0.8,
"repo_name": "brettchien/PyBLEWrapper",
"id": "d506989a5b4bdab3c0efe727e5f0f03c1cb4421c",
"size": "35",
"binary": false,
... |
"""Provides a seam for taskqueue-related operations."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import json
from google.appengine.api import taskqueue
from google.appengine.ext import deferred
# NOTE... | {
"content_hash": "b0e1aa86d6f209cb6a7c872b5f7e0ead",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 80,
"avg_line_length": 38.25806451612903,
"alnum_prop": 0.7099494097807757,
"repo_name": "prasanna08/oppia",
"id": "44eaff1b55542791c856dc1d42e87374d08bb5a2",
"size": "2995... |
import pytest
from py2neo import Graph, Node
from py2neo.ext.ogm import Store
class Person(object):
__primarykey__ = "email"
def __init__(self, email=None, name=None, age=None):
self.email = email
self.name = name
self.age = age
def __eq__(self, other):
return self.emai... | {
"content_hash": "a0e1fa772a1f2879aedba9c915c91938",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 86,
"avg_line_length": 35.5279805352798,
"alnum_prop": 0.576016983974798,
"repo_name": "nicolewhite/py2neo",
"id": "ed23a7b33720bf3011f273b5e9820cda98606066",
"size": "152... |
"""
Manages information about the guest.
This class encapsulates libvirt domain provides certain
higher level APIs around the raw libvirt API. These APIs are
then used by all the other libvirt related classes
"""
import time
from lxml import etree
from oslo_log import log as logging
from oslo_service import loopingc... | {
"content_hash": "242e2173b973e01d23948b8c4d8221eb",
"timestamp": "",
"source": "github",
"line_count": 933,
"max_line_length": 81,
"avg_line_length": 41.264737406216504,
"alnum_prop": 0.5978441558441558,
"repo_name": "rahulunair/nova",
"id": "e8d4d637a22270d2d438d5a3f786294064f53981",
"size": "394... |
from django.conf import settings
def report_exception(exception=None):
if getattr(settings, "SENTRY_ACTIVE", False):
from sentry_sdk import capture_exception
capture_exception(exception)
| {
"content_hash": "e581f06b0bc29e925b5699a15dfa264e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 49,
"avg_line_length": 26.25,
"alnum_prop": 0.7285714285714285,
"repo_name": "DXCanas/content-curation",
"id": "aaa3dc10a3b7863e4b023b7159f5b0e8a9509249",
"size": "210",
"... |
'''
'''
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
import logging # isort:skip
log = logging.getLogger(__name__)
#--------------------------------------------------------------------------... | {
"content_hash": "0bac7c3783f0ba8620b695ba267b5d32",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 138,
"avg_line_length": 35.33720930232558,
"alnum_prop": 0.5886804870023034,
"repo_name": "ericmjl/bokeh",
"id": "92caa10a48c89c52e942725104a7fe87624e5a44",
"size": "15526... |
"""Sliver manager API.
This module exposes an XMLRPC interface that allows PlanetLab users to
create/destroy slivers with delegated instantiation, start and stop
slivers, make resource loans, and examine resource allocations. The
XMLRPC is provided on a localhost-only TCP port as well as via a Unix
domain socket that... | {
"content_hash": "8dfc511388ec290f452b600c691635cb",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 116,
"avg_line_length": 42.972972972972975,
"alnum_prop": 0.639832285115304,
"repo_name": "wangyang2013/NodeManager",
"id": "7b5ab95f73d230be7eaad4a7d30f6bec1b267f06",
"si... |
import time
import os
import sys
import pygame
import PicoBorgRev
# Re-direct our output to standard error, we need to ignore standard out to hide some nasty print statements from pygame
sys.stdout = sys.stderr
# Setup the PicoBorg Reverse
PBR = PicoBorgRev.PicoBorgRev()
#PBR.i2cAddress = 0x44 # Unco... | {
"content_hash": "fc640da67d96fd8c754387e4f6ec03c6",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 127,
"avg_line_length": 42.14545454545455,
"alnum_prop": 0.5787316652286454,
"repo_name": "Steven-Eardley/pibot_motor",
"id": "bdc22a7b64df8a3eca8704786faafda3c145001c",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tracker', '0004_auto_20160218_0811'),
]
operations = [
migrations.AddField(
model_name='connection',
... | {
"content_hash": "a0e572398c67e25e3e2711c1e360d4d0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 141,
"avg_line_length": 32.64705882352941,
"alnum_prop": 0.5954954954954955,
"repo_name": "paftree/WHturk",
"id": "4c2801abc0396f499e5e5dcc40715cf253724d83",
"size": "1182"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0014_merge'),
]
operations = [
migrations.AlterField(
model_name='job',
name='email',
field=models.EmailField(max_length=254, verbose_name='Conta... | {
"content_hash": "15cf1a35d6018e8b0f0126003908a20d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 82,
"avg_line_length": 21.8125,
"alnum_prop": 0.5702005730659025,
"repo_name": "manhhomienbienthuy/pythondotorg",
"id": "bb4d8427eabb29443ed60af0135247f7716712db",
"size": ... |
from .base import SourceTestCase
class TestCase(SourceTestCase):
generator = 'excel'
output_name = 'chinook_xlsx.json'
def generate(self):
uri = self.input_path('chinook.xlsx')
client = self.module.Client(uri=uri)
return client.generate()
| {
"content_hash": "300fdd88236c966e3044fe365f931712",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 45,
"avg_line_length": 25.272727272727273,
"alnum_prop": 0.6618705035971223,
"repo_name": "chop-dbhi/prov-extractor",
"id": "2c28b82789ed87e362c873acc80290fb89a0c079",
"siz... |
"""Test Solr search using the synchronizer, i.e. as it would be used by an user
"""
import logging
import os
import time
import sys
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path[0:0] = [""]
from pymongo import MongoClient
from tests import solr_pair, mongo... | {
"content_hash": "78c04ceb33e921d8cd7cd38991913716",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 80,
"avg_line_length": 37.06112469437653,
"alnum_prop": 0.5494788230637287,
"repo_name": "sat2050/mongo-connector",
"id": "9ca92b626933b96db18e64cb7ac87ac153efc9ae",
"size... |
import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="line", parent_name="scatterternary.marker", **kwargs
):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | {
"content_hash": "f48462cdbb104a345b637985c13386c9",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 48.471698113207545,
"alnum_prop": 0.5455430128454651,
"repo_name": "plotly/python-api",
"id": "47d6c3278697b4c1ad1d5b2a121248eb6bd02903",
"size": "5... |
import argparse
import sys
from pathlib import Path
import fontTools.designspaceLib
import fontTools.ttLib
import statmake.classes
import statmake.lib
def main(args=None):
if not args:
args = sys.argv[1:]
parser = argparse.ArgumentParser()
parser.add_argument(
"stylespace_file", type=Pa... | {
"content_hash": "1348093e0a4d385c6b1b9530697b8fc1",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 86,
"avg_line_length": 29.525,
"alnum_prop": 0.7027942421676545,
"repo_name": "googlefonts/statmake",
"id": "3ef28edb8ff76f9ab8688a7ca8fbd3b0e47f2777",
"size": "1181",
"b... |
from authorize import gen_xml as xml, util, base, responses as resp
from authorize.gen_xml import x, AuthorizeSystemError
from authorize.util import request
from authorize.gen_xml import INDIVIDUAL, BUSINESS, ECHECK_CCD, ECHECK_PPD, ECHECK_TEL, ECHECK_WEB
from authorize.gen_xml import BANK, CREDIT_CARD, DAYS_INTERVAL,... | {
"content_hash": "9ab53543ceb3b0852cfc6cf62bf59be4",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 98,
"avg_line_length": 36.685483870967744,
"alnum_prop": 0.5832051000219829,
"repo_name": "imtapps/authorize",
"id": "0c36a4e54e9850cf0be046921690912ef6d54532",
"size": "4... |
__all__ = ["experiment", "curve", "segment"] | {
"content_hash": "0b5cf4543380b38e4f5657708ee37730",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 44,
"avg_line_length": 44,
"alnum_prop": 0.5681818181818182,
"repo_name": "massimovassalli/SingleCellForceSpectroscopy",
"id": "82183f0c8938e39cc5abefabea3bf80585a866ab",
"s... |
from fauxmo.fauxmo import poller,upnp_broadcast_responder,fauxmo
import os
import time
# Import handler classes
from ir_remote import tv_power_handler,tv_mute_handler
from pianobar import play_workout_handler
# Main script that activates the listener. This polls continuously waiting for a signal
# from the amazon ... | {
"content_hash": "b46eaa676052f029f87114fd3d833ed4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 96,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.6416107382550336,
"repo_name": "markveillette/smarthome",
"id": "4348587e92ac365762a2172d08a7785231e931fd",
"size... |
from collections import namedtuple, Counter
__all__ = ('Field', 'namedbuffer', 'buffer_for',)
Field = namedtuple(
'Field',
('name', 'size_bytes', 'format_string', 'encoder'),
)
Pad = namedtuple(
'Pad',
('size_bytes', 'format_string'),
)
def make_field(name, size_bytes, format_string, encoder=None)... | {
"content_hash": "6143727b79c15aa9bf4c3c7781193ac0",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 88,
"avg_line_length": 27.502824858757062,
"alnum_prop": 0.5708709942481512,
"repo_name": "charles-cooper/raiden",
"id": "e1bc0e8b7078d4f1890756501f088b4b52a65dea",
"size"... |
GroupData = {
'options': ['insert if not exists'],
'csv': 'group.csv',
}
| {
"content_hash": "ff0180caedd7edb5e4aa4d3a0605585d",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 40,
"avg_line_length": 21.25,
"alnum_prop": 0.5176470588235295,
"repo_name": "aagusti/o-sipkd",
"id": "d7a768cd454c99cd2906fb71c1458cb2eaf0b621",
"size": "85",
"binary": f... |
"""S3/CloudFront Let's Encrypt installer plugin."""
from __future__ import print_function
import os
import sys
import logging
import time
import zope.interface
import boto3
import botocore
from certbot import interfaces
from certbot.plugins import common
logger = logging.getLogger(__name__)
@zope.interface.imp... | {
"content_hash": "693c23f64acec44c9930d162bf05718d",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 125,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.6288372093023256,
"repo_name": "dlapiduz/letsencrypt-s3front",
"id": "405f01aa0764b1cca43e3dc1136116e9c9a81b1e",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import glob
import argparse
def convert_execute_and_sync_script(script_path):
def run(cmd):
subprocess.run([cmd], shell=True)
notebook_path = script_path.replace('py', 'ipynb')
run(f"jupytext --update --to notebook {script_path}")
... | {
"content_hash": "cac7fab7f46db92b85d729a348750e41",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 31.093023255813954,
"alnum_prop": 0.6477187733732236,
"repo_name": "interactiveaudiolab/nussl",
"id": "57ab55ef2fc068ead39cfc59a676de247580402b",
"si... |
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
class PlanetPlugin(CMSPluginBase):
"""
The contents of this plugin are never rendered.
Only render the toolbar entries.
"""
parent_classes = ['SolarSystemPlugin']
render_template = 'nested_plugins_app/planet.html... | {
"content_hash": "ff6b6d132b9f818f9c662321d3757998",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 60,
"avg_line_length": 27.5,
"alnum_prop": 0.743801652892562,
"repo_name": "datakortet/django-cms",
"id": "4d75c5238974628146a351b9e38b818b0b8e62ca",
"size": "605",
"bina... |
import email
import os.path
import time
from django.conf import settings
from django.test import TestCase
from django_mailbox import models, utils
from django_mailbox.models import Mailbox, Message
class EmailIntegrationTimeout(Exception):
pass
def get_email_as_text(name):
with open(
os.path.join(... | {
"content_hash": "aefd0fdda37974d056427c017563a584",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 79,
"avg_line_length": 35.92670157068063,
"alnum_prop": 0.5504226173127368,
"repo_name": "ad-m/django-mailbox",
"id": "b1215c5e326689eb1deeaa4859152fa5b8f48552",
"size": "... |
import time
from typing import Any, Dict, List, Optional, Union
from datadog import api, initialize
from airflow.exceptions import AirflowException
from airflow.hooks.base import BaseHook
from airflow.utils.log.logging_mixin import LoggingMixin
class DatadogHook(BaseHook, LoggingMixin):
"""
Uses datadog API... | {
"content_hash": "37c56ede0da647d8c4733b74a608bf60",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 106,
"avg_line_length": 38.57516339869281,
"alnum_prop": 0.6247034903422569,
"repo_name": "airbnb/airflow",
"id": "b4f7fac2f067fae1060aa07d7250513cb4a12dc3",
"size": "6690... |
import logging
import os
import fixtures
import shade
import testtools
import yaml
from nodepool import tests
from nodepool.provider_manager import shade_inner_exceptions
class TestShadeIntegration(tests.IntegrationTestCase):
def _cleanup_cloud_config(self):
os.remove(self.clouds_path)
def _use_clo... | {
"content_hash": "971c393e1040d7706f8cf72f2f5ba0f1",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 77,
"avg_line_length": 38.96590909090909,
"alnum_prop": 0.6112569262175561,
"repo_name": "seandst/nodepool",
"id": "b1430d20aca1914013f08a78923732924b093bd5",
"size": "4040... |
'''
This module contains sciluigi's subclasses of luigi's Task class.
'''
import datetime
import luigi
import logging
import os
import sciluigi
import sciluigi.audit
import sciluigi.interface
import sciluigi.dependencies
import sciluigi.slurm
log = logging.getLogger('sciluigi-interface')
# ==========================... | {
"content_hash": "72ddabb64a0c70de5a0ac89c1fa654f4",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 106,
"avg_line_length": 35.92258064516129,
"alnum_prop": 0.5678879310344828,
"repo_name": "pharmbio/sciluigi",
"id": "63f9738c8af0e5087d57fbfd3060d25f852beab2",
"size": "5... |
from typing import Any, List, Mapping, Optional, Tuple
from xml.etree.ElementTree import Element, SubElement
import markdown
from markdown.extensions import Extension
from zerver.lib.markdown import ResultWithFamily, walk_tree_with_family
class NestedCodeBlocksRenderer(Extension):
def extendMarkdown(self, md: m... | {
"content_hash": "97ae438a6ea7c0190d00e2939862739b",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 97,
"avg_line_length": 37.04938271604938,
"alnum_prop": 0.6081306231256248,
"repo_name": "punchagan/zulip",
"id": "6492db8e432bec118a65f713c5c82ba09a77448d",
"size": "3001"... |
import annoying.fields
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_add_banned_status'),
]
operations = [
migrations.AddField(
model_name='user... | {
"content_hash": "2253b9ab79dd8287f71eccc56f4d2c10",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 171,
"avg_line_length": 33.541666666666664,
"alnum_prop": 0.6509316770186335,
"repo_name": "rtfd/readthedocs.org",
"id": "f5d6ae3d0295075c036f5fb1d41e693aa7e70dec",
"size":... |
from FeatureGenerator import *
from TfidfFeatureGenerator import *
import pandas as pd
import numpy as np
from scipy.sparse import vstack
import cPickle
from sklearn.decomposition import TruncatedSVD
from helpers import *
class SvdFeatureGenerator(FeatureGenerator):
def __init__(self, name='svdFeatureGenerator')... | {
"content_hash": "79c7d7945b014e1365d4705a08bff558",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 104,
"avg_line_length": 40.201438848920866,
"alnum_prop": 0.6347530422333572,
"repo_name": "Cisco-Talos/fnc-1",
"id": "f2fe1d1faf56141f1549b6614625080e41c04948",
"size": "... |
from django.contrib import admin
from custom_field.custom_field import CustomFieldAdmin
from .models import Foo, Bar, Place, Waiter, Restaurant
@admin.register(Foo)
class FooAdmin(admin.ModelAdmin):
pass
@admin.register(Bar)
class BarAdmin(CustomFieldAdmin, admin.ModelAdmin):
pass
admin.site.register(Plac... | {
"content_hash": "49cce4ced2c5db2616d8bb98bd5e57fc",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 55,
"avg_line_length": 21.27777777777778,
"alnum_prop": 0.7911227154046997,
"repo_name": "AbhiAgarwal/django-report-builder",
"id": "a51f3c18199ab3b246ea3fc7de7136c4119229b3"... |
import mock
from airflow.providers.google.suite.operators.gcs_to_sheets import GCSToGoogleSheetsOperator
GCP_CONN_ID = "test"
SPREADSHEET_ID = "1234567890"
VALUES = [[1, 2, 3]]
BUCKET = "destination_bucket"
PATH = "path/to/reports"
class TestGCSToGoogleSheets:
@mock.patch("airflow.providers.google.suite.operato... | {
"content_hash": "a4eec1b93498a1220880f140338d011e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 92,
"avg_line_length": 37.645833333333336,
"alnum_prop": 0.6646375207526287,
"repo_name": "wooga/airflow",
"id": "dda4a978957c0e1e011767536158b54c4a6c6f06",
"size": "2593",... |
import datetime
import typing
import attr
from tracki.src.domain import exceptions
from tracki.src.domain.entities import category as category_entity
@attr.s
class Shift:
category: category_entity.Category = attr.ib()
start_time: typing.Optional[datetime.datetime] = attr.ib(default=None)
end_time: typin... | {
"content_hash": "6e09b3f9208dd4cd68b3f7d76347daf7",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 74,
"avg_line_length": 30.033333333333335,
"alnum_prop": 0.6936736958934517,
"repo_name": "rok-povsic/Tracki",
"id": "c7369faf1ff70c33ff5960ee130974d62ca32a13",
"size": "90... |
from base import *
from bibserver.importer import Importer
import bibserver.dao
import os
class TestImporter:
@classmethod
def setup_class(cls):
pass
@classmethod
def teardown_class(cls):
conn, db = dao.get_conn()
conn.delete_index(TESTDB)
def test_upload(self):
o... | {
"content_hash": "e24a5f0bfae753a99d4018d7fc073457",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 89,
"avg_line_length": 33.21739130434783,
"alnum_prop": 0.6073298429319371,
"repo_name": "flowsta/bibserver",
"id": "7b17ffd85edc2ba1f00cd7da1e828d80909cc058",
"size": "152... |
import tweepy, psycopg2, os, json, datetime,sys
f = open("sosagua.txt", "a")
#connstr para bd
#dev str
conn_string = "host='localhost' dbname='sosagua' user='postgres' password='Guatemala1'"
#produccion str
#conn_string = "host='localhost' dbname='sosagua' user='postgres' password='postgres2020!Incyt'"
'''... | {
"content_hash": "0e8d54356be17fb7b05a96aca6dc89db",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 312,
"avg_line_length": 37.16260162601626,
"alnum_prop": 0.6168234521986437,
"repo_name": "Locottus/Python",
"id": "83c2821374b4867092ec951730f03bf92bf7ec33",
"size": "915... |
google = runtime.start('google','GoogleSearch')
python.subscribe('google', 'publishResults')
def onResults(data):
print(data)
google.search('what is a goat?')
| {
"content_hash": "dc0b81f08993edc48d5506a536a8d222",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 47,
"avg_line_length": 24.142857142857142,
"alnum_prop": 0.7041420118343196,
"repo_name": "MyRobotLab/myrobotlab",
"id": "eec89b5151ac0a9d2d422ae01d03457d7d127c28",
"size": ... |
from oslo_log import log
import six
import webob
from webob import exc
from manila.api.openstack import wsgi
from manila.common import constants
from manila import exception
from manila.i18n import _, _LI
from manila import share
LOG = log.getLogger(__name__)
class ShareUnmanageMixin(object):
@wsgi.Controller.... | {
"content_hash": "488c027a57c7fa11abc524190638e4af",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 79,
"avg_line_length": 37.43283582089552,
"alnum_prop": 0.6000797448165869,
"repo_name": "scality/manila",
"id": "af866c6f5445bf661f577afe2e4288f581672a54",
"size": "3106",... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import time
#
# INFO: Your Parameters.
# You can adjust them after completing the lab
C = 1
kernel = 'linear'
iterations = 5000 # TODO: Change to 200000 once you get to Question#2
#
# INFO: You can set this to false ... | {
"content_hash": "be0c5f76ea2624c5d7b0b7f07a9251fd",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 119,
"avg_line_length": 28.103092783505154,
"alnum_prop": 0.6513206162876009,
"repo_name": "mr3bn/DAT210x",
"id": "5228d1a6deb5b9b4e08b4e4d5643a356fc0b474a",
"size": "5452... |
import pytest
from pyproj import CRS, Proj
from pyproj.exceptions import CRSError, ProjError
def test_proj_exception():
with pytest.raises(ProjError, match="Internal Proj Error"):
Proj("+proj=bobbyjoe")
def test_crs_exception():
with pytest.raises(CRSError, match="Internal Proj Error"):
CRS... | {
"content_hash": "bb094f7b2949993c2393e0d671bd8065",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 63,
"avg_line_length": 24.214285714285715,
"alnum_prop": 0.7109144542772862,
"repo_name": "ocefpaf/pyproj",
"id": "9969a04ecf7b728d3fa1e39ac13d539454d45e32",
"size": "339",... |
from .base import BaseElement
from ..utils import html_property
class Title(BaseElement):
"""
Title widget analogous to the HTML <h{n}> elements.
"""
def build(self, text, size=1):
"""
:param text: Text of the widget
:param size: Size of the text (Higher size = smaller title)... | {
"content_hash": "0348f9533039e61e027b0dae28bb01fb",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 67,
"avg_line_length": 19.123287671232877,
"alnum_prop": 0.5401146131805158,
"repo_name": "Dalloriam/engel",
"id": "56a0f8a03e92ee7f1ea617c6527538cfd732b558",
"size": "1396... |
from util import *
import json
class ChromeTabFinder(object):
def __init__(self, host, port):
self._next_seq = 0
self._timer = Timer(250)
self._timer.tick.add_listener(self._tick)
self._host = host
self._port = port
self._session = None
self._get_tab_list_pending = False
self._tick... | {
"content_hash": "ad55bb844d992e5661621e4c1388c9c9",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 119,
"avg_line_length": 25.736263736263737,
"alnum_prop": 0.645602049530316,
"repo_name": "natduca/ndbg",
"id": "75f264f5ecf208464b513e92ceadebebf05eb6b1",
"size": "2918",
... |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------------------------------------------... | {
"content_hash": "720edcab90ba44d5be1926061addb7f3",
"timestamp": "",
"source": "github",
"line_count": 550,
"max_line_length": 117,
"avg_line_length": 44.52,
"alnum_prop": 0.670505595033897,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e8298d6a3f6081b85b801cd6ef686bba99104172",
"size": "24488... |
class thisislog(object):
def __init__(self):
self.paths = []
def getCusPath(self):
with open('cusPath', 'r') as f:
for line in f:
self.paths.append(line)
def showPathOptions(self):
self.getCusPath()
for pathNo, cusPath in enumerate(self.paths):
... | {
"content_hash": "5d1f793a17c851a951113aab449256dc",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 65,
"avg_line_length": 22.137931034482758,
"alnum_prop": 0.5093457943925234,
"repo_name": "m170897017/thisislog",
"id": "6705dcf27d7537048262215be4ff4c897d01a5c3",
"size": ... |
class Solution(object):
def readBinaryWatch(self, num):
"""
:type num: int
:rtype: List[str]
The bin() method
"""
return_list = []
for hour in range(12):
for minute in range(60):
if sum(map(lambda number: int(bin(number)[2:].count('... | {
"content_hash": "b688a3c95d4bcb7098375ff629841f1a",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 156,
"avg_line_length": 31.26,
"alnum_prop": 0.4708893154190659,
"repo_name": "aenon/OnlineJudge",
"id": "c02e51b27407f77c28270d1febc6c14266ced00f",
"size": "2498",
"bina... |
import ast
import os
from Bio.Blast import NCBIXML
from Bio.Blast.Applications import NcbiblastnCommandline, NcbitblastnCommandline, NcbiblastpCommandline, \
NcbiblastxCommandline
from django.shortcuts import render
from blastplus import utils
from blastplus.forms import BlastForm, TBlastnForm, BlastpForm, Blastx... | {
"content_hash": "2d48ae040afa7e20fad19e24bcf9eca5",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 115,
"avg_line_length": 50.58771929824562,
"alnum_prop": 0.620253164556962,
"repo_name": "michal-stuglik/django-blastplus",
"id": "eecc77e736b42365a43ca8375727d08a4116b9ae",... |
from __future__ import absolute_import
import bisect
from .gtfsfactoryuser import GtfsFactoryUser
from . import problems as problems_module
from . import util
class Shape(GtfsFactoryUser):
"""This class represents a geographic shape that corresponds to the route
taken by one or more Trips."""
_REQUIRED_FIELD_NA... | {
"content_hash": "79540102a7d5f100591a4c26fb3ca814",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 80,
"avg_line_length": 41.38961038961039,
"alnum_prop": 0.614841543771572,
"repo_name": "avilaton/transitfeed",
"id": "35cfb2075c5f58fc211c80bb23decccc5f01d809",
"size": "... |
import os
import sys
import re
import inspect
import cgi
validExtensions = (".cpp", ".h", ".js")
# specify the paths in which docublocks are searched. note that js/apps/* must not be included because it contains js/apps/system/
# and that path also contains copies of some files present in js/ anyway.
searchPaths = ["a... | {
"content_hash": "9003586ac4c96b71a6f61c3680ca5363",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 153,
"avg_line_length": 30.74537037037037,
"alnum_prop": 0.5699442854991719,
"repo_name": "kkdd/arangodb",
"id": "5e7d03be4edfe08aaebb14ed2382d9d2f87686f2",
"size": "6641"... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | {
"content_hash": "e135d9f23aa33fff88b520c380917b39",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 24.185185185185187,
"alnum_prop": 0.6616896375701888,
"repo_name": "Procoin-project/Procoin-Done",
"id": "c0337e22ccbdad62c224ad81ba9cd4abf7b01dc9",
... |
from google.cloud import aiplatform
def create_custom_job_sample(
project: str,
display_name: str,
container_image_uri: str,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_opti... | {
"content_hash": "9f1d786eaf8ef1c0453f313f9581ccd8",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 94,
"avg_line_length": 36.26829268292683,
"alnum_prop": 0.5447209145931405,
"repo_name": "sasha-gitg/python-aiplatform",
"id": "e15ecce26ba7d01f07ffbb314347a376111de45b",
"... |
from setuptools import setup
from setuptools.command.build_py import build_py as setuptools_build_py
# these lines allow the version to be specified in Makefile.private
import os
version = os.environ.get("MODULEVER", "0.0")
# find the build scripts
savecwd = os.getcwd()
os.chdir("dls_ade")
build_scripts = []
for roo... | {
"content_hash": "0c9b6ab61b9207c614a8ad74337ba5fa",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 103,
"avg_line_length": 38.95061728395062,
"alnum_prop": 0.6167987321711569,
"repo_name": "dls-controls/dls_ade",
"id": "7895c147276026375041ab99e621a2994c159887",
"size": ... |
import telnetlib
class PyNUTError( Exception ) :
""" Base class for custom exceptions """
class PyNUTClient :
""" Abstraction class to access NUT (Network UPS Tools) server """
__debug = None # Set class to debug mode (prints everything useful for debuging...)
__host = None
__port... | {
"content_hash": "9f03e7d89fcdef8f5ec00f041679e3b3",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 106,
"avg_line_length": 34.387205387205384,
"alnum_prop": 0.5116028591011456,
"repo_name": "ab77/beastcraft-telemetry",
"id": "9a9399cff3f8e35e0113fe20782e94d558e1d3ac",
"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... | {
"content_hash": "c0ff2ca4a60de3eac2bb1a8124a8f7f8",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 148,
"avg_line_length": 34.18333333333333,
"alnum_prop": 0.6387128230131643,
"repo_name": "thaim/ansible",
"id": "9be73fb2c4fa48159a8d3b46c90ce3656bfbe692",
"size": "6890"... |
'''
browser.py: part of nidmviewer package
Functions to visualize in browser
Copyright (c) 2014-2018, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code mus... | {
"content_hash": "0a5a762ea8fbe26472737430dc0ac88f",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 38.67307692307692,
"alnum_prop": 0.7105917454002983,
"repo_name": "vsoch/nidmviewer",
"id": "7fb6e25bcd1a67b059850fdaea25d4230180ed3e",
"size": "402... |
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts.
For a description of arguments recognized by test scripts, see
`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`.
"""... | {
"content_hash": "486e2d3f20c51f9876699eb358ee8ad9",
"timestamp": "",
"source": "github",
"line_count": 645,
"max_line_length": 205,
"avg_line_length": 38.87286821705426,
"alnum_prop": 0.6079448011805528,
"repo_name": "myriadcoin/myriadcoin",
"id": "980f4656073ab7487978bf471c273f9acc5684a0",
"size"... |
"""
A module for our virtual or dynamic adapters
"""
from zope.interface import Interface
__author__ = 'dimd'
class IVirtualAdapter(Interface):
"""
A base class marker for our dynamic or virtual adapters
"""
| {
"content_hash": "0ef9bb5a737497e7db42a398c891af92",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 59,
"avg_line_length": 20.181818181818183,
"alnum_prop": 0.6936936936936937,
"repo_name": "dimddev/NetCatKS",
"id": "485a392df9df54946a2d54b6810827b32bcc5328",
"size": "222... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0011_auto_20161106_1320'),
]
operations = [
migrations.AddField(
model_name='outboundcontactphoneinfo',
name='is_avai... | {
"content_hash": "8a24f038f92d4d2eb8c390edbcbe4557",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.6115288220551378,
"repo_name": "bpatyi/simpleCRM",
"id": "f7ce0961fd20de47559814e7b8ed2f5faea8c5df",
"size": "472... |
import wx
from odmtools.controller.frmAddPoints import AddPoints
from odmtools.controller.olvAddPoint import Points
__author__ = 'Jacob'
class TestAddPoints:
def setup(self):
self.app = wx.App()
self.frame = AddPoints(None)
self.olv = self.frame.olv
assert self.olv
asser... | {
"content_hash": "fcc924cc39672bb0ef507d2709a4c436",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 119,
"avg_line_length": 30.935672514619885,
"alnum_prop": 0.57882797731569,
"repo_name": "ODM2/ODMToolsPython",
"id": "777efdbea21b6669f31d1046a21d502514085ff7",
"size": "... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from django.urls import reverse
from django.utils.timezone import now
from le_utils.constants import content_kinds
from rest_framework.test import APITestCase
from kolibri.core.auth.models import Class... | {
"content_hash": "02d4e908a001bca79cd7acd1377ba4b2",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 86,
"avg_line_length": 39.352380952380955,
"alnum_prop": 0.6246369796708615,
"repo_name": "learningequality/kolibri",
"id": "449e914f82294b5e613dfe81b542d48eb39524bf",
"si... |
import sys
sys.path.append("/home/ppershing/python/numberjack/local_lib");
sys.setrecursionlimit(4000)
import Numberjack
import time
import pystp
import os
from datetime import datetime
def readfile(filename):
f = open(filename, "r")
tmp = f.readline()
cur_cost = float(tmp.strip())
tmp = f.readline()
N = int(tmp.... | {
"content_hash": "80851e947e2b1b527b7a2850323611bb",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 122,
"avg_line_length": 26.765903307888042,
"alnum_prop": 0.6259150109325982,
"repo_name": "usamec/travelling-santa",
"id": "b3b682c17ebb958ef4cda5bccf1b16897b7f03db",
"si... |
"""Implementation of data processing ops.
All ops should return data processing functors. Data examples are represented
as a dictionary of tensors.
Most of these were originally implemented by: Lucas Beyer, Alex Kolesnikov,
Xiaohua Zhai and other collaborators from Google Brain Zurich.
"""
import tensorflow.compat.v1... | {
"content_hash": "61f4dcab6e0912fdc8ad31aea0fccb22",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 94,
"avg_line_length": 30.884848484848487,
"alnum_prop": 0.6704277864992151,
"repo_name": "google-research/vmoe",
"id": "f530bded9d23d061485b0db2df86c595f662ce66",
"size":... |
import operator
import threading
from mapproxy.grid import bbox_intersects, bbox_contains
from mapproxy.util.py import cached_property
from mapproxy.util.geom import (
require_geom_support,
load_polygon_lines,
transform_geometry,
bbox_polygon,
EmptyGeometryError,
)
from mapproxy.srs import SRS
imp... | {
"content_hash": "bf5519f536993cf7139f831ba9d2a483",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 84,
"avg_line_length": 29.43225806451613,
"alnum_prop": 0.6083954405962297,
"repo_name": "olt/mapproxy",
"id": "4479d2abf2e259e3b1a20b6c89717800fba2b2d1",
"size": "9769",
... |
"""
This script will generate two headers that describe all of the clang cross compiled
functions.
The script outputs (run: 'palo/common/function-registry/gen_functions.py')
- be/src/generated-sources/palo-ir/palo-ir-functions.h
This file contains enums for all of the cross compiled functions
- be/src/generated... | {
"content_hash": "3f92189a12d2b1f4209772649e3c6f91",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 84,
"avg_line_length": 37.62011173184357,
"alnum_prop": 0.6645381645381645,
"repo_name": "lingbin/palo",
"id": "bae420095cf0cd5e51b0ea7d22b710e78d416680",
"size": "7621",
... |
"""Tests for the Atag config flow."""
from unittest.mock import PropertyMock, patch
from pyatag import errors
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.atag import DOMAIN
from homeassistant.core import HomeAssistant
from tests.components.atag import (
PAIR_REPLY,
... | {
"content_hash": "0f11f997d6a67174e9ed12889b0a8510",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 83,
"avg_line_length": 34.103092783505154,
"alnum_prop": 0.664752116082225,
"repo_name": "turbokongen/home-assistant",
"id": "81375792c711f4be23374fb34db14f58fb4ceaec",
"si... |
"""This code example updates the destination URL of a single image creative.
To determine which image creatives exist, run get_all_creatives.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more informatio... | {
"content_hash": "4eaef56cbe9a054eb0177967fd923be0",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 77,
"avg_line_length": 31.470588235294116,
"alnum_prop": 0.6822429906542056,
"repo_name": "cctaylor/googleads-python-lib",
"id": "66d4451905d7580fb3049bade1325cc23a7950ba",
... |
from typing import Callable, Dict, List, Tuple
import GPy
import numpy as np
import scipy as sp
from GPy.inference.latent_function_inference.posterior import Posterior
from GPy.util import choleskies
from GPy.util.linalg import dpotrs, dtrtrs, jitchol, pdinv, tdot
from GPy.util.univariate_Gaussian import cdfNormal, de... | {
"content_hash": "cee0cc0c789d36ac9cb0e0bcd894da8e",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 199,
"avg_line_length": 40.36907730673317,
"alnum_prop": 0.6402891030392883,
"repo_name": "EmuKit/emukit",
"id": "e5819e6d09731374cf0e5606a90b2fa5c1ae69ec",
"size": "16188... |
import pyeq2
import numpy, scipy.interpolate, scipy.stats
numpy.seterr(over = 'raise', divide = 'raise', invalid = 'raise', under = 'ignore') # numpy raises warnings, convert to exceptions to trap them
class IModel(object):
splineFlag = False
userSelectablePolynomialFlag = False
userSelectablePolyfuncti... | {
"content_hash": "55a7f103f841b126d3ac20d492ab9113",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 235,
"avg_line_length": 42.60958904109589,
"alnum_prop": 0.5803461394202433,
"repo_name": "JMoravec/unkRadnet",
"id": "f8a27f7becebe809cba5521271c570188b6e0621",
"size": "... |
import sh
import click
import sys
from os import path, getcwd, makedirs
from .device import device_list
from .utils import cd, logger
from .config import get_config
from .prepare import prepare_file, prepare_lib
# UIAutomation Instruments Template location. Accurate as at Xcode 6.3
INSTRUMENTS_AUTOMATION_TEMPLATE_PATH... | {
"content_hash": "eba1cca4b743b0ff0d58cfb93b4dd840",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 193,
"avg_line_length": 31.28205128205128,
"alnum_prop": 0.6491803278688525,
"repo_name": "Stupeflix/fixxd",
"id": "bbc37209ad12739dc06fc79797f1684be4a9634f",
"size": "2441... |
"""
Pegasus utility for checking file integrity after transfers
Usage: pegasus-integrity-check [options]
"""
from __future__ import print_function
import glob
import json
import logging
import optparse
import os
import pprint
import sys
import time
from datetime import datetime
from Pegasus.tools import worker_utils... | {
"content_hash": "57526c26ae1d2da4878643f388684b20",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 99,
"avg_line_length": 26.279605263157894,
"alnum_prop": 0.5389285267242458,
"repo_name": "pegasus-isi/pegasus",
"id": "fd0c643a1a8129e1cf5f0b3db8b27e1349a0ce75",
"size": ... |
""" Copyright (c) 2009 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, ... | {
"content_hash": "472912c3bc990da7ebde71925f61ebf0",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 167,
"avg_line_length": 51.213235294117645,
"alnum_prop": 0.6982053122756641,
"repo_name": "g2p/SimpleTAL",
"id": "8acc0a91cf491a404437cc742a3f4a65b8ac0d01",
"size": "6983... |
from web_graphics import gradient, RADIAL, NO_NOISE, get_pixel_intensities
from itertools import izip_longest
import numpy as np
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
width = 100
h... | {
"content_hash": "8982b7a560f8ed454a3c76971c22f674",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 25.653846153846153,
"alnum_prop": 0.6761619190404797,
"repo_name": "caglar/Arcade-Universe",
"id": "e73d13bee9748f322fdf6ae4eb46b16bbea4376c",
"size"... |
import random
import copy
import sys
from Observation import *
from Reward import *
from Action import *
class Environment:
# The grid world
# 1 = walls
# 4 = goal (non-terminal)
# 5 = goal (terminal)
map = [[1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 4, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1... | {
"content_hash": "ab61dd9f3b40b6ad1d202fe857781c96",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 154,
"avg_line_length": 25.574074074074073,
"alnum_prop": 0.6473569876900797,
"repo_name": "markriedl/westworld",
"id": "ec0554aa433757f4af2820d34bfe2c42e94f5ecb",
"size":... |
"""Tests for epi_forecast_stat_mech.statistical_models.bic_model."""
from absl.testing import parameterized
from epi_forecast_stat_mech.statistical_models import bic_model
from epi_forecast_stat_mech.statistical_models import linear_model_test
import numpy as np
from absl.testing import absltest
class BicLinearMo... | {
"content_hash": "fc98028b6f6a7fbe4492272f80c8115d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 80,
"avg_line_length": 30.854166666666668,
"alnum_prop": 0.6482106684672518,
"repo_name": "HopkinsIDD/EpiForecastStatMech",
"id": "2994ae73298845662bf79f836a0fbd39a8cd36bd",
... |
import logging
import feedparser
import pkg_resources
import time
import os
try:
from cStringIO import cStringIO as StringIO
except ImportError:
from StringIO import StringIO
from twisted.web import client
from twisted.web.client import HTTPPageGetter, HTTPClientFactory
from twisted.internet import reactor, p... | {
"content_hash": "df5f03eab3c1faf30da28842646d7db3",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 90,
"avg_line_length": 35.565916398713824,
"alnum_prop": 0.5757164813308019,
"repo_name": "ralphbean/moksha",
"id": "912f809c134de721d237b587a02b42942da9d7c9",
"size": "11... |
"""
Support for the Microsoft Cognitive Services text-to-speech service.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts.microsoft/
"""
from http.client import HTTPException
import logging
import voluptuous as vol
from homeassistant.components.tts ... | {
"content_hash": "6cbcafb21b91c40d8656f3bae3ca6164",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 79,
"avg_line_length": 35.07079646017699,
"alnum_prop": 0.6116578349735049,
"repo_name": "jamespcole/home-assistant",
"id": "55cf7a4ae7a016d87c9da37521284531ca3bffef",
"si... |
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet,
inlineformset_factory,
modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from django.test import TestCase
from .mo... | {
"content_hash": "dedd6b40667e0883ad91f34cd007a80f",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 87,
"avg_line_length": 36.43344709897611,
"alnum_prop": 0.5802810304449648,
"repo_name": "rsalmaso/django",
"id": "0ccc2c04901f37071e0aab48e176824f87a33bea",
"size": "2135... |
import os
import time
from atx.device.windows import Window, FrozenWindow, WindowsDevice
# def _input_left_mouse(self, x, y):
# left, top, right, bottom = self.position
# width, height = right - left, bottom - top
# if x < 0 or x > width or y < 0 or y > height:
# return
# win32... | {
"content_hash": "73cf3b59e2f4dff5af9a978bfc274c11",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 67,
"avg_line_length": 26.789473684210527,
"alnum_prop": 0.5808775376555337,
"repo_name": "Andy-hpliu/AirtestX",
"id": "981b4c5c2a8d909660a46ab42da979388e50a8e1",
"size": "... |
from authy import __version__
from authy.api.resources import Users
from authy.api.resources import Tokens
from authy.api.resources import Apps
from authy.api.resources import StatsResource
from authy.api.resources import Phones
class AuthyApiClient(object):
"""
A client for accessing the Authy REST API
"... | {
"content_hash": "c5c15088da4ea59342d4be94d1104f6c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 65,
"avg_line_length": 29.703703703703702,
"alnum_prop": 0.6396508728179551,
"repo_name": "FloorLamp/authy-python",
"id": "38a9cc6d275bf52ffa3e89fe7e9eb30f3607ab38",
"size"... |
"""
A Styles is a collection of PropertySets that can be applied to a particular RTF element.
At present there are only two, Text and Paragraph but ListStyles will be added soon too.
"""
from PropertySets import *
class TextStyle:
def __init__(self, textProps, name=None, shading_props=None):
self.textPro... | {
"content_hash": "fe1ee2d79c1f83ec9ea50dfaf69c87ba",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 101,
"avg_line_length": 35.93589743589744,
"alnum_prop": 0.677488405280057,
"repo_name": "shvechikov/python-rtfng",
"id": "df14fe6ce5a3d7aad5c4170cc348dff1c8870dda",
"size"... |
from django import forms
from django.forms import TextInput
from th_wallabag.models import Wallabag
class WallabagForm(forms.ModelForm):
"""
for to handle Wallabag service
"""
class Meta:
model = Wallabag
fields = ('tag',)
widgets = {
'tag': TextInput(attrs={'... | {
"content_hash": "de02e4c3d975649884b3b407f22c03e5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 62,
"avg_line_length": 18.48,
"alnum_prop": 0.6385281385281385,
"repo_name": "foxmask/django-th",
"id": "32b39f70ef9ec2247b28e374896c4c515203b54d",
"size": "479",
"binary... |
from __future__ import absolute_import
from google.api_core.protobuf_helpers import get_messages
from google.identity.accesscontextmanager.v1 import (
access_level_pb2,
access_policy_pb2,
service_perimeter_pb2,
)
_modules = [access_level_pb2, access_policy_pb2, service_perimeter_pb2]
names = []
for mod... | {
"content_hash": "f167a3f7b6cbf73f778bb368cabdc2c4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 71,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.7139588100686499,
"repo_name": "googleapis/python-access-context-manager",
"id": "90c8729b3e6ca26c3012bdf574880894c... |
import paddle.fluid as fluid
from utils import gen_data
from nets import mlp
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import (
fleet,
)
from paddle.fluid.incubate.fleet.base import role_maker
input_x = fluid.layers.data(name="x", shape=[32], dtype='float32')
input_y = fluid.layers.da... | {
"content_hash": "ecd8d002f41edd5a7e46d1dc66ea04c4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 80,
"avg_line_length": 30.125,
"alnum_prop": 0.6705394190871369,
"repo_name": "luotao1/Paddle",
"id": "d14605a6179f7a956bf0220146563d0faa8e888f",
"size": "1816",
"binary"... |
import json
import logging
import numpy as np
import itertools as it
from utils import parse_flag_file
from analyze import (
remove_extra_loci, get_resolution,
get_summary_data, get_haplotype_matrix,
get_resolution_matrix)
class Haplotype:
def __init__(self, patterns, minimum_spanning_set,
... | {
"content_hash": "fb43ec28df916dda78fc82f033fd76ac",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 98,
"avg_line_length": 43.3125,
"alnum_prop": 0.5682219015552349,
"repo_name": "FofanovLab/VaST",
"id": "ce3e9b2ffad2f2abacd1f93f7e33ae7ee0566e01",
"size": "6237",
"bina... |
''' Some tests for the documenting decorator and support functions '''
import numpy as np
from numpy.testing import assert_equal, assert_raises
from nose.tools import assert_true
from scipy.misc import doccer
docstring = \
"""Docstring
%(strtest1)s
%(strtest2)s
%(strtest3)s
"""
param_doc1 = \
"""A... | {
"content_hash": "a407964c03231f34ecf0cb29d893d578",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 70,
"avg_line_length": 25.629213483146067,
"alnum_prop": 0.64138535729943,
"repo_name": "teoliphant/scipy",
"id": "6204a9b60306dcbb749b204d9a4f813409e1cd1d",
"size": "2281"... |
"""Base class for RPC testing."""
import configparser
from enum import Enum
import argparse
import logging
import os
import pdb
import random
import re
import shutil
import subprocess
import sys
import tempfile
import time
from .authproxy import JSONRPCException
from . import coverage
from .p2p import NetworkThread
f... | {
"content_hash": "d484b184c8beb918217e8229ef70ba1a",
"timestamp": "",
"source": "github",
"line_count": 822,
"max_line_length": 312,
"avg_line_length": 44.071776155717764,
"alnum_prop": 0.6004913462334722,
"repo_name": "LIMXTEC/BitSend",
"id": "c1402a991bfef260eb6dcdef272a87623f2a8204",
"size": "36... |
import math
import numbers
# Special dependencies
import numpy
class InfiniteType:
def __init__(self, multiplier=1.):
if multiplier == 0.: raise ZeroDivisionError, "Cannot multiply infinity and zero."
self._multiplier = multiplier
def __repr__(self):
if self is Infinity:
r... | {
"content_hash": "02ad3940ad02065b1081266c1bec3d0f",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 172,
"avg_line_length": 33.517560073937155,
"alnum_prop": 0.5835769039872056,
"repo_name": "opendatagroup/cassius",
"id": "3f21d6228358294021a1f5756160e7e0e51e3e49",
"size... |
import discord
from discord.ext import commands
import asyncio
from random import choice as randchoice
class Hal:
"""The HAL (Heuristically programmed ALgorithmic Computer) 9000 computer is an artificial intelligence and the onboard computer on the spaceship Discovery One"""
def __init__(self, bot):
s... | {
"content_hash": "88e34df5da6747198888ee019e784907",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 226,
"avg_line_length": 82.83529411764705,
"alnum_prop": 0.6232069308336884,
"repo_name": "irdumbs/Dumb-Cogs",
"id": "6e70df07ea25c834c16282b56902f3546ce5d956",
"size": "70... |
""" this stand-alone program supports running jobs for any scheduler type
"""
import sys
import os
import datetime
import json
import logging
import errno
import platform
def convert(inp):
if isinstance(inp, dict):
return {convert(key): convert(value) for key, value in inp.iteritems()}
elif isinstanc... | {
"content_hash": "34f38c6e5432b3774d1a93c51e65f1cb",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 107,
"avg_line_length": 31.64021164021164,
"alnum_prop": 0.587123745819398,
"repo_name": "losalamos/Pavilion",
"id": "a4bd87ed44599dc3694b82a3ef3aca411ea02ef9",
"size": "8... |
import ipaddress
import argparse
parser = argparse.ArgumentParser(description="Generate NAT plugin config.")
parser.add_argument(
"static_map_num", metavar="N", type=int, nargs=1, help="number of static mappings"
)
args = parser.parse_args()
file_name = "nat_static_%s" % (args.static_map_num[0])
outfile = open(fi... | {
"content_hash": "2998388f2c7eee1c9b3f3de7bf16144d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 88,
"avg_line_length": 46.166666666666664,
"alnum_prop": 0.7283393501805054,
"repo_name": "chrisy/vpp",
"id": "009cf099582bb8229dacb42eb7625060d3c0fc36",
"size": "1131",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.