text stringlengths 4 1.02M | meta dict |
|---|---|
import os,sys
sys.path = ['..'] + sys.path
import mbuild
env = mbuild.env_t()
env.parse_args()
env['jobs']=8
work_queue = mbuild.work_queue_t(env['jobs'])
all_cmds = ['python -c "print(2+2)"']
subs = {}
command_list = []
for cmd in all_cmds:
cmd = cmd % (subs)
mbuild.msgb('ADDING', cmd)
c = mbuild.comman... | {
"content_hash": "5e3537d621f7f51bd52cf403fc81914a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 53,
"avg_line_length": 21.64,
"alnum_prop": 0.6229205175600739,
"repo_name": "intelxed/mbuild",
"id": "980da3cf3a27ceb57b8346e7025ff9d75e2eb615",
"size": "1204",
"binary"... |
"""
The MIT License (MIT)
Copyright (c) <2016> <Larry McCaig (aka: Larz60+ aka: Larz60p)>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rig... | {
"content_hash": "e38b1d8a8ef5d1e0b9b2e171a5cc8713",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 100,
"avg_line_length": 59.69044006069803,
"alnum_prop": 0.4790268456375839,
"repo_name": "Larz60p/TkArgs",
"id": "a3ff94a22dcc7f72e8fab5521273ca057f544c6a",
"size": "3933... |
import base64
import cgi
import copy
import csv
import datetime
import decimal
import os
import shutil
import sys
import types
from ._compat import PY2, StringIO, pjoin, exists, hashlib_md5, \
integer_types, basestring, iteritems, xrange, implements_iterator, \
implements_bool, copyreg, reduce
from ._globals i... | {
"content_hash": "5f1ff07440d8beca8eb7dbd405ee83a4",
"timestamp": "",
"source": "github",
"line_count": 2767,
"max_line_length": 129,
"avg_line_length": 36.991326346223346,
"alnum_prop": 0.5205607933173758,
"repo_name": "manuelep/pydal",
"id": "eedeac1a4b4e184629598da08ca445ccd685ba8a",
"size": "10... |
import proto # type: ignore
from google.ads.googleads.v10.enums.types import advertising_channel_type
from google.ads.googleads.v10.enums.types import device
from google.ads.googleads.v10.enums.types import seasonality_event_scope
from google.ads.googleads.v10.enums.types import seasonality_event_status
__protobuf_... | {
"content_hash": "0b2dd32896f84edc49ae124edc4e218a",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 133,
"avg_line_length": 37.21167883211679,
"alnum_prop": 0.6502550019615535,
"repo_name": "googleads/google-ads-python",
"id": "ed450b0d75be35186d4b73823dbf4769134c7b04",
... |
import logging
import sys
import click
import yaml
LOG_MAP = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
def get_config(config_path):
config = yaml.safe_load(config_path.read_bytes())
required_settings = [
"twitch_username",
"twitch_oauth",
"twitch_channels",
"cli... | {
"content_hash": "a74d174c0094d81e082e71011262a93a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 137,
"avg_line_length": 29.43859649122807,
"alnum_prop": 0.4731823599523242,
"repo_name": "shughes-uk/twitchchat_display",
"id": "e453e79862b37faa5338317fa8389db844a46a0b",
... |
"""Fixer for 'raise E, V'
From Armin Ronacher's ``python-modernize``.
raise -> raise
raise E -> raise E
raise E, 5 -> raise E(5)
raise E, 5, T -> raise E(5).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), 5 -> raise E(5)
raise "foo", V, T -... | {
"content_hash": "987f39761156c07e828ac18daa36422d",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 80,
"avg_line_length": 36.48598130841121,
"alnum_prop": 0.5322745901639344,
"repo_name": "PythonCharmers/python-future",
"id": "d113401c7df885320d326a8733172d3cc07bd407",
... |
from unittest import mock
from trove.common import cfg
from trove.common.rpc import conductor_guest_serializer as gsz
from trove.common.rpc import conductor_host_serializer as hsz
from trove.tests.unittests import trove_testtools
CONF = cfg.CONF
class FakeInstance(object):
def __init__(self):
self.uui... | {
"content_hash": "e25c94358b7da037fa0620cb38e354d2",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 76,
"avg_line_length": 40.255319148936174,
"alnum_prop": 0.6664904862579282,
"repo_name": "openstack/trove",
"id": "cc4faea15fa1c84fbe6dfa8a21198c56df084ccb",
"size": "4414... |
"""
The cutoffs module gives a few different options for smoothly sending the GP
kernel to zero near the boundary of the cutoff sphere.
"""
from math import cos, sin, pi
from numba import njit
@njit
def hard_cutoff(r_cut: float, ri: float, ci: float):
"""A hard cutoff that assigns a value of 1 to all interatomic ... | {
"content_hash": "bf00337920e97051fc7655e3da55c055",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 76,
"avg_line_length": 26.821428571428573,
"alnum_prop": 0.6091877496671105,
"repo_name": "mir-group/flare",
"id": "c64cf01e845d3ffa28ae9e030ee2e463c56ae649",
"size": "300... |
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfgang Frisch.
Formatt... | {
"content_hash": "3cd435ef664d9b5df7205321ce7bf2d2",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 88,
"avg_line_length": 34.90909090909091,
"alnum_prop": 0.5424107142857143,
"repo_name": "uncled1023/pygments",
"id": "5110bc9ee8466e1829e9dfe5d71fcca2ecee4288",
"size": "... |
import itertools
from metrika.contender import Contender
from metrika.variable import *
__author__ = 'Javier Pimás'
class Suite:
def __init__(self, name=""):
self.name = name
self.variables = []
def add_variable_from_dict(self, name, values):
values = [NamedValue(name, value) for nam... | {
"content_hash": "80e65e072b2e60875bf6bee7e62fbe7c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 76,
"avg_line_length": 33.375,
"alnum_prop": 0.6134831460674157,
"repo_name": "dc-uba/metrika",
"id": "6e119e6795a7e4f6ac78b9a7e1190210d6853844",
"size": "1361",
"binary"... |
"""
Scraper for requesting, caching and parsing house.mo.gov lists.
"""
from scraper.interpreters import BaseInterpreter, HouseBillPageContentInterpreter
from scraper.url_helpers import house_url
class HouseBillPageInterpreter(BaseInterpreter):
def __init__(self, url):
self._actions = None
self._... | {
"content_hash": "bb5e3ee7c7745e80ee4c61a722bf260e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 81,
"avg_line_length": 30.083333333333332,
"alnum_prop": 0.6795937211449676,
"repo_name": "access-missouri/am-django-project",
"id": "8e5cb2d6ada6f650af17bfb535db64e6f58cb692... |
from muckrake.services.background_thread import BackgroundThreadService
import json
class VerifiableProducer(BackgroundThreadService):
logs = {
"producer_log": {
"path": "/mnt/producer.log",
"collect_default": True}
}
def __init__(self, context, num_nodes, kafka, topic, ... | {
"content_hash": "59d5a751cda7e64b5dde94b50cb779d2",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 116,
"avg_line_length": 32.308510638297875,
"alnum_prop": 0.5706289101086599,
"repo_name": "edenhill/muckrake",
"id": "cedf3ece93953ae268fc90fd6f44d42865d389b2",
"size": "3... |
"""
Removes entity mentions of zero length from mentions
that survived all pre-processing stages of AFET.
Divide sanitized mentions into train/dev/test split.
"""
import sys
import json
import random
from datetime import datetime
# Test start number according to mention_type_test.txt
TSN = {}
TSN['BBN'] = 86078
TSN[... | {
"content_hash": "42d7fa6bc273acbccd3ade9c83763ff8",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 97,
"avg_line_length": 40.76129032258064,
"alnum_prop": 0.5620449509338398,
"repo_name": "abhipec/fnet",
"id": "1efe363ab08a971450159c42f6f11b82a434ab8c",
"size": "6318",
... |
import _plotly_utils.basevalidators
class GaugeValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="gauge", parent_name="indicator", **kwargs):
super(GaugeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "389ee752878293a4150fd6b9d46dedc4",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 37.93181818181818,
"alnum_prop": 0.5344517675254643,
"repo_name": "plotly/python-api",
"id": "ea8857002d14898cbf7d10cf8e49d0808c01c8e1",
"size": "166... |
import os
import sys
from astroid import MANAGER, builder
from astroid.bases import BUILTINS
DATA_DIR = os.path.join("testdata", "python3")
RESOURCE_PATH = os.path.join(os.path.dirname(__file__), DATA_DIR, "data")
def find(name):
return os.path.normpath(os.path.join(os.path.dirname(__file__), DATA_DIR, name))
... | {
"content_hash": "c9097ac3adcf04cb0b13107fa5729f94",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 84,
"avg_line_length": 29.903846153846153,
"alnum_prop": 0.6861736334405145,
"repo_name": "ruchee/vimrc",
"id": "20adc2f804aa5ca53d42d9a6a7488526e06e3601",
"size": "2180",
... |
from __future__ import print_function
import unittest
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.dygraph.nn import Embedding
import paddle.fluid.framework as framework
from paddle.fluid.optimizer import Adam
from paddle.fluid.dygraph.base import to_variable
from test_... | {
"content_hash": "4b456ba7e72f2e29c3d560ddc997d823",
"timestamp": "",
"source": "github",
"line_count": 710,
"max_line_length": 89,
"avg_line_length": 42.7112676056338,
"alnum_prop": 0.5100412201154163,
"repo_name": "chengduoZH/Paddle",
"id": "7cfd9bd5a2777d1b7810be3bd0a2f60572342df4",
"size": "309... |
from webob.request import Request
from webob.dec import wsgify
from webob.exc import no_escape
from webob.exc import strip_tags
from webob.exc import HTTPException
from webob.exc import WSGIHTTPException
from webob.exc import _HTTPMove
from webob.exc import HTTPMethodNotAllowed
from webob.exc import HTTPExceptionMiddle... | {
"content_hash": "81d341ecf0c1f914c112c03e62296abc",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 72,
"avg_line_length": 30.696022727272727,
"alnum_prop": 0.6090698750578436,
"repo_name": "ioram7/keystone-federado-pgid2013",
"id": "ba4edeebc90d58e4cf1b26b5a5aecb2b4f41b4e... |
from distutils.core import setup
with open('README') as file:
long_description = file.read()
setup(
name='Pizco',
version='0.1',
description='Python remote objects with ZMQ',
long_description=long_description,
author='Hernan E. Grecco',
author_email='hernan.grecco@gmail.com',
url='http... | {
"content_hash": "24548ee5b820b525040bd6dee3a03dd1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 51,
"avg_line_length": 32.72222222222222,
"alnum_prop": 0.6001697792869269,
"repo_name": "hgrecco/pizco",
"id": "dfb394616458aedd145bb685e84d0ea20fe9f0bb",
"size": "1201",
... |
from google.appengine.ext import ndb
class Article(ndb.Model):
title = ndb.StringProperty()
author = ndb.StringProperty()
tags = ndb.StringProperty(repeated=True)
def print_author_tags():
query = Article.query()
articles = query.fetch(20, projection=[Article.author, Article.tags])
for articl... | {
"content_hash": "f893fbd0c33ee9e6f3a37a9c138679d9",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 76,
"avg_line_length": 27.5531914893617,
"alnum_prop": 0.6911196911196911,
"repo_name": "amboutin/GCP",
"id": "fb0c325435110539682d49fab0edc84025162ff2",
"size": "1892",
... |
from django import forms
# import autocomplete_light
from .models import Organisation, User
class OrganisationForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(OrganisationForm, self).__init__(*args, **kwargs)
class Meta:
model = Organisation
exclude = ('user', 'cre... | {
"content_hash": "7f4b65e05b6250fcd0ef1db783009cd8",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 87,
"avg_line_length": 33.69491525423729,
"alnum_prop": 0.6167002012072434,
"repo_name": "shankig/wye",
"id": "2b2d30374feb60d26b49b7057358cf9ed4fa37f4",
"size": "1988",
... |
import configparser
import hashlib
import os
import platform
import random
import tempfile
from typing import Any, Dict, Optional
# download delegate
__wget__ = ("WGET_PATH",)
__transmission__ = (
"TRANSMISSION_RPC_URL",
"TRANSMISSION_RPC_PORT",
"TRANSMISSION_RPC_USERNAME",
"TRANSMISSION_RPC_PASSWORD",... | {
"content_hash": "53617c121e0c2197ea802fefd8ea98b6",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 87,
"avg_line_length": 27.50778816199377,
"alnum_prop": 0.5629671574178935,
"repo_name": "codysk/BGmi",
"id": "433d25cbf72398c9a6cf1aa7bcec4ea3030fc83a",
"size": "8830",
... |
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | {
"content_hash": "f859062405711f888365aaf30707f353",
"timestamp": "",
"source": "github",
"line_count": 773,
"max_line_length": 88,
"avg_line_length": 27.927554980595083,
"alnum_prop": 0.5432647767278117,
"repo_name": "alianmohammad/pd-gem5-latest",
"id": "73d6f9c699947e22fb5424db1ccd8253621e5dd7",
... |
"""Support for Daikin AC sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from pydaikin.daikin_base import Appliance
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorState... | {
"content_hash": "e00fe7e88bc4f6ead62ef3e2b25cf23d",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 86,
"avg_line_length": 33.36548223350254,
"alnum_prop": 0.6963334854708657,
"repo_name": "GenericStudent/home-assistant",
"id": "39a6f4aa853474c5951792905ecefdf03865b5e8",
... |
from bluesky.callbacks.olog import logbook_cb_factory
from functools import partial
from pyOlog import SimpleOlogClient
import queue
import threading
from warnings import warn
import nslsii
# Set up the logbook. This configures bluesky's summaries of
# data acquisition (scan type, ID, etc.).
LOGBOOKS = ['Data Acquis... | {
"content_hash": "3c865248db890e91b7f2ba5c4d161b84",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 33.125,
"alnum_prop": 0.7924528301886793,
"repo_name": "NSLS-II-XPD/ipython_ophyd",
"id": "dcf4891d1f48bba0e6a1e9adcbf1e1afef76d7e3",
"size": "795",
... |
import multiprocessing as mp
import numpy as np
import pyfftw
import scipy.ndimage as ndi
def apple_core_3d(shape, res, nm):
r"""Return a binary array with the apple core in 3D
Parameters
----------
shape: list-like, length 3
Shape of the reconstruction volume for which to compute
th... | {
"content_hash": "4566fe42057846357cf7675d9b1c26c1",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 77,
"avg_line_length": 33.47933884297521,
"alnum_prop": 0.5887435201184893,
"repo_name": "paulmueller/ODTbrain",
"id": "9d9b7e7f8896ef9eeed70237dd27f2616df814ad",
"size": ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Story.time'
db.delete_column(u'scrum_story', 'time')
# Adding field 'Story.last_modified'
db.add_... | {
"content_hash": "893dd090339ec530d8f4920b96589626",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 203,
"avg_line_length": 65.45185185185186,
"alnum_prop": 0.5552286102308737,
"repo_name": "OpenSourceSag/django-dash2013",
"id": "29eed5b98414069f8b0bf15b8448ad2c22b1c35e",
... |
import re
def variableName(name):
# Return if its a valid variable name. It should start with
# an alphabetic character or with underscore, and then can be
# followed by any alphanumeric characters and underscores.
return bool(re.match("^[a-zA-Z_][a-zA-Z_0-9]*$", name))
| {
"content_hash": "7a73856e03f0095df98f453ab1e641d9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 65,
"avg_line_length": 47.833333333333336,
"alnum_prop": 0.7038327526132404,
"repo_name": "zubie7a/CPP",
"id": "8b0c1e3a6813af2f06a6b2defec405ace584ffb8",
"size": "351",
"... |
'''
Created on Nov 2, 2013
@author: peterb
'''
import logging
class Shy(object):
QUEUE = "queue"
def __init__(self):
self.subscriptions = []
def subscribe(self, listener, name=None):
self.subscriptions.append((name,listener))
logging.info("subscript... | {
"content_hash": "f1ad077ff7d85f9beda05b1b0b55fdfb",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 85,
"avg_line_length": 24.970588235294116,
"alnum_prop": 0.552414605418139,
"repo_name": "blueshed/blueshed-py",
"id": "83718cd9cfc33bf4f957ed2fe05c311ec7b573f4",
"size": "... |
"""OpenStack logging handler.
This module adds to logging functionality by adding the option to specify
a context object when calling the various log methods. If the context object
is not specified, default formatting is used. Additionally, an instance uuid
may be passed as part of the log message, which is intended ... | {
"content_hash": "219e6ee43280aa3643e2716c5446c20e",
"timestamp": "",
"source": "github",
"line_count": 696,
"max_line_length": 78,
"avg_line_length": 36.775862068965516,
"alnum_prop": 0.5924753867791842,
"repo_name": "vmthunder/nova",
"id": "5b8c6857912dc49d2314616e8d4a524ad39c895b",
"size": "2636... |
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Wind Models
-----------
"""
import numpy as np
class NoWind(object):
def __init__(self):
# Wind velocity: FROM North to South, FROM East to West,
# Wind velocit... | {
"content_hash": "e6f61e34c04289d28b8fab97616a0274",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 64,
"avg_line_length": 22.09090909090909,
"alnum_prop": 0.6378600823045267,
"repo_name": "AlexS12/PyFME",
"id": "4d6d51a4e800f5cdca3eae7ad7d9578052aa88ab",
"size": "486",
... |
from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import url
from openstack_dashboard.dashboards.project.networks.ports.views \
import DetailView
PORTS = r'^(?P<port_id>[^/]+)/%s$'
VIEW_MOD = 'openstack_dashboard.dashboards.project.networks.ports.views'
urlpatterns = patterns(VIEW_M... | {
"content_hash": "fe6dd4c819f28d07a998ffa3a74eacb5",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7403598971722365,
"repo_name": "rackerlabs/horizon",
"id": "be839b52d88578eef9af8e6d0eac83190b23d5b2",
"size": "1... |
def divide(numerator, denominator):
""" function to perform division of two numbers. This should not perform
integer division
Raises:
ZeroDivisionError: raised if denominator is zero
"""
return numerator/denominator | {
"content_hash": "6c68059cd04b15755f489bf6e0b7964b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 76,
"avg_line_length": 33,
"alnum_prop": 0.6628787878787878,
"repo_name": "aaronta/illinois",
"id": "8a508385f088d820b6b93aecd5481dc81c6a8a79",
"size": "264",
"binary": fa... |
import sys
import pickle
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
from tester import dump_classifier_and_data
### Task 1: Select what features you'll use.
### features_list is a list of strings, each of which is a feature name.
### The first feature must be "poi".
fea... | {
"content_hash": "9867e263f87e2ca2ad38926b55d0db97",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 128,
"avg_line_length": 37.95813953488372,
"alnum_prop": 0.6403627006494302,
"repo_name": "harish-garg/Machine-Learning",
"id": "715b367af2a70dc2ddc190d5e41d8c264ec0ffe5",
... |
'''
Informations Retrieval Library
==============================
SuperList is an alternatice to Python's default lists (arrays)
'''
# Author: Tarek Amr <@gr33ndata>
class SuperList(list):
''' SuperList: An alternatice to Python's default lists (arrays)
So that we can add some helper methods and functi... | {
"content_hash": "9e2bdb36175fc112ad35e47a4c89b634",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 76,
"avg_line_length": 32.627906976744185,
"alnum_prop": 0.5407460204324067,
"repo_name": "gr33ndata/irlib",
"id": "b7446bed4975536104f463c10eb63a87e470a643",
"size": "420... |
from settings import *
DEBUG = False
ALLOWED_HOSTS = [
'*',
]
DEFAULT_FILE_STORAGE = 'balin.s3utils.MediaRootS3BotoStorage'
STATICFILES_STORAGE = 'balin.s3utils.StaticRootS3BotoStorage'
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', '')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', ''... | {
"content_hash": "836dd15196a18849525bc6d06b2be249",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 30.40909090909091,
"alnum_prop": 0.6995515695067265,
"repo_name": "gilsondev/balin",
"id": "eb62a0311f75b97a495259f08c264af122627f34",
"size": "693",... |
from __future__ import print_function
import argparse
import time
from arrow.apollo import get_apollo_instance
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Sample script to add an account via web services')
parser.add_argument('email', help='User Email')
parser.add_argument('... | {
"content_hash": "91aa51de73fe6ae04d2826a66c4f3d43",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 100,
"avg_line_length": 36.4375,
"alnum_prop": 0.6552315608919382,
"repo_name": "galaxy-genome-annotation/galaxy-tools",
"id": "bb30afdd90ce00370da87e6491b35b71a20d067a",
"... |
import StringIO
from twisted.python import reflect, failure
from twisted.python.util import dsu
from twisted.internet import defer
from twisted.trial import unittest, runner, reporter
class MockEquality(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return "MockEqual... | {
"content_hash": "900fe65f6547e4cc84dc5232920a32b6",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 80,
"avg_line_length": 39.01424501424501,
"alnum_prop": 0.5709799912370381,
"repo_name": "santisiri/popego",
"id": "0d74e32b69a962bdb7de4edccef204f282f24a5a",
"size": "136... |
from skrutil import string_utils
from skrutil.string_utils import indent
_JNI_BR = '\n\n'
_JNI_SPACE = ' '
class JniClass:
"""JNI part generator, responsible for generating JNI source code for Object and ObjectManager.
"""
def __init__(self, group_name, class_name, jni_variable_list, jni_manager_or_non... | {
"content_hash": "4d81d30a68173b3ab4b986c1924cd384",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 122,
"avg_line_length": 43.75816993464052,
"alnum_prop": 0.5944734876773712,
"repo_name": "DaYeSquad/cpp-core-model-builder",
"id": "46a0521000f9f969487580a9ea72f3d8c53c7959... |
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.21
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import ApiException
from... | {
"content_hash": "17bddfc61d51600f11097bd2ebf02e26",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 19.275,
"alnum_prop": 0.6770428015564203,
"repo_name": "kinow-io/kinow-python-sdk",
"id": "65be9623d7bef264fc3eba3564b9f1feccef6185",
"size": "788",
... |
import logging
import threading
LOG = logging.getLogger(__name__)
def version_is_compatible(imp_version, version):
"""Determine whether versions are compatible.
:param imp_version: The version implemented
:param version: The version requested by an incoming message.
"""
version_parts = version.s... | {
"content_hash": "b28eec222211ca90c98cef81928faf55",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 76,
"avg_line_length": 31.252173913043478,
"alnum_prop": 0.6288258208124652,
"repo_name": "apporc/oslo.messaging",
"id": "cec94bb48ae4bbf8b4e8fa87ec7dcb829006c002",
"size"... |
import datetime
import random
from salmon.metrics import models
def generate_sample_data(point_numbers, interval):
"""
This function generates sample data and populates the databases
:point_numbers: is an int defining the number of values for each metric
:interval: is an int defining the inte... | {
"content_hash": "6df19aa6a758b87221537243cdbfe981",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 39.432432432432435,
"alnum_prop": 0.5812200137080192,
"repo_name": "lincolnloop/salmon",
"id": "778650437f43b701972ba8376403067f73f3cfe3",
"size": "1... |
import copy
import tempfile
import uuid
import jsonschema
import mock
from oslo_serialization import jsonutils as json
from oslo_utils import uuidutils
from sahara import context
from sahara.db.templates import api as template_api
from sahara.db.templates import utils as u
from sahara.tests.unit.conductor import base... | {
"content_hash": "0949ac07c347c7dfe6739548507f17c7",
"timestamp": "",
"source": "github",
"line_count": 791,
"max_line_length": 79,
"avg_line_length": 39.582806573957015,
"alnum_prop": 0.5724049824337273,
"repo_name": "ekasitk/sahara",
"id": "bb225ea95ab3a0ea50c0ef095e2e7956de30a205",
"size": "3188... |
"""
sphinx.util.pycompat
~~~~~~~~~~~~~~~~~~~~
Stuff for Python version compatibility.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import io
import sys
import codecs
import warnings
from six import class_types
from six.moves import ... | {
"content_hash": "7439e98bccf0bdfe1501f17d241d8465",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 80,
"avg_line_length": 32.130434782608695,
"alnum_prop": 0.6019717765319931,
"repo_name": "fzheng/codejam",
"id": "0daa87981efbda9b3c396f7f7015dbed1b41ed74",
"size": "5197... |
import markdown
class LinkifyPattern(markdown.inlinepatterns.Pattern):
"""
Pattern to replace bare links with <a> elements.
"""
def __init__(self):
super(LinkifyPattern, self).__init__(r'(https?:\/\/[^\s\b)]+)')
def handleMatch(self, m):
e = markdown.util.etree.Element('a')
... | {
"content_hash": "278be1bfd1343264fc5a04d60208b3ed",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 71,
"avg_line_length": 24.625,
"alnum_prop": 0.5710659898477157,
"repo_name": "2buntu/2buntu-blog",
"id": "fb5d15032b0d0c2098b38a65a2bfeeeb60122bb7",
"size": "394",
"bina... |
import copy
try:
from guardian.shortcuts import assign_perm
except ImportError:
def assign_perm(perm_name, group_or_user, obj):
pass
from groups_manager.utils import get_permission_name
def assign_related(related_groups, perms, obj):
if isinstance(perms, dict):
default = set(perms.pop('d... | {
"content_hash": "41be803894ffb643034c538102dc6b88",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 102,
"avg_line_length": 40.18487394957983,
"alnum_prop": 0.6369719782517775,
"repo_name": "vittoriozamboni/django-groups-manager",
"id": "604f65be427afc2a7bb7f7183e2d2eae22e... |
import urllib2
from xml.dom import minidom, Node
answer()
say( "Welcome to the python Yahoo weather reader" )
result = ask( "Enter the ZIP code for a weather check", { 'choices' : "[5 DIGITS]" })
if result.name == 'choice' :
log( "zipCode <" + result.value + ">" )
urlRead = urllib2.urlopen('http://weather.ya... | {
"content_hash": "ece27476887a869d55eb1b90bf060509",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 105,
"avg_line_length": 49.541666666666664,
"alnum_prop": 0.4554247266610597,
"repo_name": "tropo/tropo-samples",
"id": "fd74a508d8166c99e2857ef47d470acf42cc5f2e",
"size": ... |
"""HiGHS Linear Optimization Methods
Interface to HiGHS linear optimization software.
https://www.maths.ed.ac.uk/hall/HiGHS/
.. versionadded:: 1.5.0
References
----------
.. [1] Q. Huangfu and J.A.J. Hall. "Parallelizing the dual revised simplex
method." Mathematical Programming Computation, 10 (1), 119-1... | {
"content_hash": "7fbb115470736ec4d0b86d3e367e7bf4",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 82,
"avg_line_length": 39.656612529002324,
"alnum_prop": 0.5994032295810906,
"repo_name": "vigna/scipy",
"id": "2f0b53c64e61a61fb683f963cb9d025fd6506749",
"size": "17092",... |
import random
__author__ = "Patrick Lampe"
__email__ = "uni at lampep.de"
class AbstractNode:
"""
Parameter
---------
Attributes
----------
"""
def __init__(self, node_id):
self.crnt_movement_pattern = None
self.dict_of_movement_pattern = {}
self.node_id = node_... | {
"content_hash": "5179dab3b9544b99ae481f91704125d6",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 110,
"avg_line_length": 20.76829268292683,
"alnum_prop": 0.4926600117439812,
"repo_name": "miniworld-project/miniworld_core",
"id": "9edcbecc6948f1a0c3eb3db258104e956852ecb6"... |
"""Family module for MediaWiki wiki."""
#
# (C) Pywikibot team, 2006-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
from pywikibot import family
# The MediaWiki family
class Family(family.WikimediaFamily, family.SingleSiteFamily):
"""Family mo... | {
"content_hash": "e3e141077edf06a3e1f231c5443826f9",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 22.5,
"alnum_prop": 0.7234567901234568,
"repo_name": "magul/pywikibot-core",
"id": "5d5a3675c5eaabaa75517f8804514cb74770ae32",
"size": "429",
"bina... |
from __future__ import print_function
import argparse
import git
import logging
import logging.config
import os
import shutil
import sys
import tarfile
import six
from past.builtins import basestring
from six.moves.urllib.parse import urlparse, urlunparse, urlencode
from six.moves.urllib.request import urlopen
from s... | {
"content_hash": "ac15ad802bbc0f571ec44e2d6c735d68",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 109,
"avg_line_length": 31.641148325358852,
"alnum_prop": 0.5646453954332376,
"repo_name": "twang817/rubyenv",
"id": "c8279f085768791cad32ff2a07ee3ba3404f7512",
"size": "6... |
import _plotly_utils.basevalidators
class XaxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name="xaxis", parent_name="image", **kwargs):
super(XaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
dfl... | {
"content_hash": "94e1f6497503ffbe5e7f87bfd45dfde3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 37.92307692307692,
"alnum_prop": 0.5983772819472617,
"repo_name": "plotly/python-api",
"id": "aefb3fb4a36aeeca62a6880db10418f1aeeda2e8",
"size": "493... |
"""Test the Soundtouch component."""
from unittest.mock import call, patch
from libsoundtouch.device import (
Config,
Preset,
SoundTouchDevice as STD,
Status,
Volume,
ZoneSlave,
ZoneStatus,
)
import pytest
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
... | {
"content_hash": "bd24bb19a48120627873e9da8ac77ffa",
"timestamp": "",
"source": "github",
"line_count": 1062,
"max_line_length": 88,
"avg_line_length": 30.129943502824858,
"alnum_prop": 0.6421651353209575,
"repo_name": "GenericStudent/home-assistant",
"id": "4ed8a648c770cbf2b062cf66447fc0f19d6ae45e",... |
import unittest
from cStringIO import StringIO
import trac.tests.compat
from trac.mimeview.patch import PatchRenderer
from trac.test import EnvironmentStub, Mock
from trac.web.api import RequestDone
from trac.web.href import Href
from trac.wiki.web_api import WikiRenderer
class WikiRendererTestCase(unittest.TestCase... | {
"content_hash": "121ba5a731e440a433f10ff5d9fc0bcd",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 72,
"avg_line_length": 29.425925925925927,
"alnum_prop": 0.5947136563876652,
"repo_name": "pkdevbox/trac",
"id": "adbf0e548543c0000d53bf7490806863c59f67eb",
"size": "2081",... |
from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest import config
from tempest.openstack.common import log
from tempest.scenario import manager
from tempest import test
CONF = config.CONF
LOG = log.getLogger(__name__)
class TestVolumeBootPattern(manager.ScenarioTest):
... | {
"content_hash": "e73e8a75f8a4382ea1752bd03d45e56b",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 79,
"avg_line_length": 42.37362637362637,
"alnum_prop": 0.6130705394190872,
"repo_name": "rzarzynski/tempest",
"id": "3c5e88cda626b4255a3c207a6a70eeef6cbffb07",
"size": "8... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(315, 410)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Prefe... | {
"content_hash": "34af9940db4fa55ff23fe1c99d05b836",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 139,
"avg_line_length": 62.61764705882353,
"alnum_prop": 0.7120713950211367,
"repo_name": "mgraupe/acq4",
"id": "d72f2ed79594fe528e0e9ae794bce95cc40cb283",
"size": "10930"... |
"""
Script to upload images to wikipedia.
Arguments:
-keep Keep the filename as is
-filename Target filename without the namespace prefix
-noverify Do not ask for verification of the upload description if one
is given
-abortonwarn: Abort upload on the specified warning type. If... | {
"content_hash": "8da22b7e808d233b48539686dd1ebbf0",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 87,
"avg_line_length": 40.484652665589664,
"alnum_prop": 0.5368715083798883,
"repo_name": "icyflame/batman",
"id": "060d1119754820c712f6120a1e20c546bdaffac2",
"size": "251... |
'''
Copyright 2012 Will Snook (http://willsnook.com)
MIT License
Utility code for generating antenna geometry files in nec2 card stack format
'''
import math
# =======================================================================================================
# Field formatting functions (i.e. "columns" in punc... | {
"content_hash": "6444156d5a039fe8e0e95c599225cd01",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 114,
"avg_line_length": 36.1764705882353,
"alnum_prop": 0.5173054587688733,
"repo_name": "ckuethe/nec2-toys",
"id": "0e8b97e053d57fa180eb85aae967e9faffa4124d",
"size": "43... |
"""Tests for src.analyzer.morphotactics.validator."""
from src.analyzer.morphotactics import validator
from absl.testing import absltest
from absl.testing import parameterized
class ValidateTest(parameterized.TestCase):
@parameterized.named_parameters([
{
"testcase_name": "EpsilonRuleInputAndOutp... | {
"content_hash": "1c0949d8e932e2477a3e2366deca8ed5",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 77,
"avg_line_length": 26.804761904761904,
"alnum_prop": 0.42689642920589804,
"repo_name": "google-research/turkish-morphology",
"id": "3bca9d4cb632818acdf7054a01bec2e2b13fb... |
import math
import os
import platform
import ssl
import subprocess
import sys
import distro
import docker
import compose
from ..const import IS_WINDOWS_PLATFORM
def yesno(prompt, default=None):
"""
Prompt the user for a yes or no.
Can optionally specify a default value, which will only be
used if t... | {
"content_hash": "9a8e1be21883151658e95accb9c73057",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 86,
"avg_line_length": 24.71527777777778,
"alnum_prop": 0.5903343635852768,
"repo_name": "thaJeztah/compose",
"id": "6a4615a966083ce871a204aefe2a786a46b2c8cd",
"size": "35... |
import cPickle
import os
from pyglm.inference.coord_descent import coord_descent
from pyglm.plotting.plot_results import plot_results
from synth_harness import initialize_test_harness
def run_synth_test():
""" Run a test with synthetic data and MCMC inference
"""
options, popn, data, popn_true... | {
"content_hash": "91e5a6d7f499e994befc0e9f3ad550b3",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 28.8,
"alnum_prop": 0.6398809523809523,
"repo_name": "slinderman/theano_pyglm",
"id": "56706e2504386e47166ba35353258809b3b406ff",
"size": "1058",
"... |
"""
Implements data iterators and I/O related functions for sequence-to-sequence models.
"""
import bisect
import gzip
import logging
import pickle
import random
from collections import OrderedDict
from typing import Dict, Iterator, Iterable, List, NamedTuple, Optional, Tuple
import mxnet as mx
import numpy as np
fro... | {
"content_hash": "b814ee90cd281811ef685ed161db5b20",
"timestamp": "",
"source": "github",
"line_count": 573,
"max_line_length": 120,
"avg_line_length": 44.01396160558464,
"alnum_prop": 0.587827121332276,
"repo_name": "KellenSunderland/sockeye",
"id": "058a2b9cf9a01454e538c54ead09fcc85c25910f",
"siz... |
import cufunction
import pdb
import sys, os, os.path, shutil
def print_code(code, dest_path, name, ext):
o_file = open(os.path.join(dest_path, name + ext), 'w')
print >>o_file, code
o_file.close()
def mkdir(dirname):
exists = os.access(dirname, os.F_OK)
if not exists:
os.mkdir(dirname)
... | {
"content_hash": "511866014eae8be124127415acf5100f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 67,
"avg_line_length": 30.512820512820515,
"alnum_prop": 0.5453781512605042,
"repo_name": "shyamalschandra/copperhead",
"id": "713811d4828aef6f5e2bcdc64c8179ac926681cf",
"s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Mate Soos
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in th... | {
"content_hash": "eeaf8f56b63c73c86318f8b7289a06b1",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 81,
"avg_line_length": 24.17241379310345,
"alnum_prop": 0.5455471775015285,
"repo_name": "aristk/static-analyser",
"id": "67940962280a16806921ea4ca66e7c8f7608d49a",
"size"... |
import json
from browser import window, document
from browser import ajax, console
from controller import Controller
from editor import Editor
from broker import Broker
class Context(object):
""" application context object provides an interface to server-side api calls """
def __init__(self):
self.seq... | {
"content_hash": "3ec5cdbbd4b3c84ff66de1aa351f9a48",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 118,
"avg_line_length": 37.91724137931035,
"alnum_prop": 0.6038559476173154,
"repo_name": "bitwrap/bitwrap-io",
"id": "a3deabb2b44411dc2b3ed78569e5182f5861a36c",
"size": "... |
import os
import unittest
from unittest import mock
from alligator.backends.locmem_backend import Client as LocmemClient
CONN_STRING = os.environ.get("ALLIGATOR_CONN")
@unittest.skipIf(
not CONN_STRING.startswith("locmem:"), "Skipping Locmem tests"
)
class LocmemTestCase(unittest.TestCase):
def setUp(self)... | {
"content_hash": "c85efd0813fe1d966f5c27e79cc06671",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 77,
"avg_line_length": 35.2680412371134,
"alnum_prop": 0.5919321835720549,
"repo_name": "toastdriven/alligator",
"id": "b5453dd4511b9fc2b887a6fe1d1cedf2ecf393fe",
"size": "... |
DOCUMENTATION = '''
---
module: ec2_group
version_added: "1.3"
short_description: maintain an ec2 VPC security group.
description:
- maintains ec2 security groups. This module has a dependency on python-boto >= 2.5
options:
name:
description:
- Name of the security group.
required: true
descriptio... | {
"content_hash": "afb5021837f64f1936b961bfd9429087",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 142,
"avg_line_length": 35.735897435897435,
"alnum_prop": 0.5564325177584846,
"repo_name": "ygol/dotfiles",
"id": "b502bd1db53c0ddc26ff8de273d0563afc272a62",
"size": "1398... |
"""Implementation of embedding layer with shared weights."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf # pylint: disable=g-bad-import-order
from official.transformer.model import model_utils
from official.utils.accelerator im... | {
"content_hash": "1f005864f584e9831c1cb78233e3283e",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 80,
"avg_line_length": 37.44210526315789,
"alnum_prop": 0.6671352263143098,
"repo_name": "mlperf/training_results_v0.5",
"id": "cc189626bc919fe165f902437fa4c9cf7fb2bc69",
"... |
import pymel.core as pm
from functools import partial
import System.utils as utils
reload(utils)
class AttachGeoToBlueprint_ShelfTool:
def AttachWithParenting(self):
self.parenting = True
self.skinning = False
self.ProcessInitialSelection()
def AttachWithSkinning(self):
self.skinning = True
self.p... | {
"content_hash": "89883afc5b3cfbb20d63ffc84a61b581",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 174,
"avg_line_length": 29.57837837837838,
"alnum_prop": 0.7200292397660819,
"repo_name": "Shadowtags/ModularRiggingTool",
"id": "954034b6ae30394961654fc5c63044d8f8c377c0",
... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0018_alter_job_last_export_run'),
]
operations = [
migrations.AlterField(
model_name='datamodelpreset',
name='id',
field=models.BigAutoField(auto... | {
"content_hash": "3dad20afc320d4261baa9a90b279d34e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 111,
"avg_line_length": 36.24390243902439,
"alnum_prop": 0.5895020188425303,
"repo_name": "venicegeo/eventkit-cloud",
"id": "c28bb5021a219925dc33dcd17259b582b2a31b5f",
"siz... |
r"""
.. currentmodule:: pylayers.gis.selectl
.. autosummary::
"""
from __future__ import print_function
import os
import pdb
from PIL import Image
import numpy as np
from pylayers.util import geomutil as geu
from pylayers.util import pyutil as pyu
import pylayers.util.plotutil as plu
import matplotlib.pyplot as plt... | {
"content_hash": "95bd51e319e95b57434d335aef33ee21",
"timestamp": "",
"source": "github",
"line_count": 1230,
"max_line_length": 127,
"avg_line_length": 33.96504065040651,
"alnum_prop": 0.4567106302510951,
"repo_name": "pylayers/pylayers",
"id": "af5a7e136349afcc98fd60f82c00b1118363ea5a",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('scraps', '0001_initial'),
]
operations = [
... | {
"content_hash": "c48894548efcd6b14a5aa2a014030049",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 147,
"avg_line_length": 43.372093023255815,
"alnum_prop": 0.6144772117962467,
"repo_name": "tonysyu/scrappyr-app",
"id": "601cc3f9c53ba31637340500e694f2321455e6fc",
"size":... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
im... | {
"content_hash": "62557fccdca76e2847f96ab0b9b5c0d0",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 105,
"avg_line_length": 20.2,
"alnum_prop": 0.6806930693069307,
"repo_name": "sebgoa/client-python",
"id": "814210935fd35b68237bfdaaff86c44cc70cb64d",
"size": "825",
"bin... |
import csv
import sys
from graphmagic import graphanalyse
def main():
"""Takes csv file path as a parameter in command line call."""
# take path from sysarg
if len(sys.argv) < 2:
print("Please enter csv file source")
return
path = sys.argv[1]
with open(path, 'rb') as csvfile:
... | {
"content_hash": "9b07da98ac6372a02e6328749e4f9942",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 66,
"avg_line_length": 23.08,
"alnum_prop": 0.5944540727902946,
"repo_name": "katepavlovic/graphmagic",
"id": "1d74c437734896967777a02d2f2e3145012b79ff",
"size": "1207",
... |
"""
>>> from pyspark.context import SparkContext
>>> sc = SparkContext('local', 'test')
>>> b = sc.broadcast([1, 2, 3, 4, 5])
>>> b.value
[1, 2, 3, 4, 5]
>>> from pyspark.broadcast import _broadcastRegistry
>>> _broadcastRegistry[b.bid] = b
>>> from cPickle import dumps, loads
>>> loads(dumps(b)).value
[1, 2, 3, 4, 5]... | {
"content_hash": "6d5442217a7545c3d3177ffa8a4f4167",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 29.42,
"alnum_prop": 0.6349422161794698,
"repo_name": "cloudera/spark",
"id": "43f40f8783bfd426cb94f031527cc11ee43059c7",
"size": "2256",
"binary":... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
from .models import User
@admin.register(User)
class UserAdmin(UserAdmin):
fieldsets = (
(None, {'fields': ('email',... | {
"content_hash": "f6f7f55f38e0b50bd09083bfe9873ada",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 30.22222222222222,
"alnum_prop": 0.6053921568627451,
"repo_name": "silverlogic/blockhunt-back",
"id": "e9d0e8c8cb6c7648849f855d6b4c242a6d7074af",
"si... |
"""An example to train TD3 algorithm on InvertedDoublePendulum PyTorch."""
import torch
from torch.nn import functional as F
# from garage.np.exploration_policies import AddGaussianNoise
from garage import wrap_experiment
from garage.envs import GymEnv, normalize
from garage.experiment.deterministic import set_seed
fr... | {
"content_hash": "762ea6484fc24374ffceee68e93a28ac",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 78,
"avg_line_length": 40.83969465648855,
"alnum_prop": 0.6214953271028038,
"repo_name": "google-research/look-back-when-surprised",
"id": "245f3a237ebdf07a88177c7a4fc00ca8a... |
# -*- coding: iso-8859-1 -*-
#
"""
@ 2009 by Uche ogbuji <uche@ogbuji.net>
This file is part of the open source Akara project,
provided under the Apache 2.0 license.
See the files LICENSE and NOTICE for details.
Project home, documentation, distributions: http://wiki.xml3k.org/Akara
Module name:: moinrest
= Define... | {
"content_hash": "63eda265f886e8bbaa30debae2e1c66e",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 204,
"avg_line_length": 44.221130221130224,
"alnum_prop": 0.6473219246582954,
"repo_name": "uogbuji/akara",
"id": "106b5f2941aa141f9ce4925a0566a3d0b6c7cb2e",
"size": "3599... |
from django.urls import reverse
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class UntappdAccount(ProviderAccount):
def get_profile_url(self):
return self.account... | {
"content_hash": "48ad1b006e1d6b4e99eae42956363209",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 30.557692307692307,
"alnum_prop": 0.6431718061674009,
"repo_name": "pztrick/django-allauth",
"id": "260d0ce82820abc9dbfff24f3142c82ad32d885c",
"size"... |
import re, sys, os, tempfile, subprocess, logging
CONFIGLINERE=re.compile("[ \t]*([a-z0-9_-]+)[ \t]*[=][ \t]*([.0-9-]+)(.*)", re.IGNORECASE)
USAGE='''USAGE:
configtool <FILE> set <key> <val>
configtool <FILE> get <key>
configtool <FILE> search <regexp>
configtool <FILE> list
configtool <FILE> print
'''
clas... | {
"content_hash": "c27f5fd6ce9eeb66b782913f286503e7",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 90,
"avg_line_length": 25.65277777777778,
"alnum_prop": 0.565511640498105,
"repo_name": "petabricks/petabricks",
"id": "a2ce4fd646a46a3cd2945121306f027c6d1c57ae",
"size": ... |
__author__ = 'Xiaocheng Tang and Ted Ralphs'
__maintainer__ = 'Ted Ralphs'
__email__ = 'ted@lehigh.edu'
__version_ = '1.0.0'
__url__ = 'https://github.com/tkralphs/GoogleDriveScripts'
# Last modified 2/17/2016 Ted Ralphs
# Visit this URL to download client secret file
# https://console.developers.g... | {
"content_hash": "e0246b51a59ccb7476de301e0c8e1c0a",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 80,
"avg_line_length": 45.36363636363637,
"alnum_prop": 0.5253114925503181,
"repo_name": "tkralphs/GoogleDriveScripts",
"id": "88b5ba2de15eb1655297ace5fa03c976e453f870",
"... |
from __future__ import absolute_import, unicode_literals
import csv
import json
import os
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry, MultiPolygon
from django.core.management.base import BaseCommand
from scuole.states.models import Commissioner, State
class Command(BaseComman... | {
"content_hash": "905a96798edf593bcd99e11ede63808a",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 62,
"avg_line_length": 27.02469135802469,
"alnum_prop": 0.5746916400182732,
"repo_name": "texastribune/scuole",
"id": "a1de8058c24d47b3d8da78a1e49ad8a5cabcd65a",
"size": "2... |
import sahara.plugins.mapr.base.base_cluster_context as bc
import sahara.plugins.mapr.services.yarn.yarn as yarn
class Context(bc.BaseClusterContext):
def __init__(self, cluster, version_handler, added=None, removed=None):
super(Context, self).__init__(cluster, version_handler, added, removed)
sel... | {
"content_hash": "4517a6e9a05d1b33db37499f59420d43",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 39.08,
"alnum_prop": 0.6064483111566018,
"repo_name": "crobby/sahara",
"id": "4af1f37d678672cb21b95c39a877d028192187b0",
"size": "2544",
"binary": ... |
"""
Contains the user interface in the Universe class
"""
from galaxy.web.base.controller import *
from galaxy.model.orm import *
from galaxy import util
import logging, os, string
from random import choice
log = logging.getLogger( __name__ )
require_login_template = """
<h1>Welcome to Galaxy</h1>
<p>
This insta... | {
"content_hash": "ddf5bab412872dbe9fb77f9ec7ac25cb",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 194,
"avg_line_length": 56.14601769911504,
"alnum_prop": 0.5731736149420759,
"repo_name": "dbcls/dbcls-galaxy",
"id": "3b62573fb0d0dcffd047c7c4e296a4c9fdd8dadb",
"size": "... |
import webbrowser
from oauth2client.client import OAuth2WebServerFlow, FlowExchangeError
from oauth2client.keyring_storage import Storage
from cactus.deployment.gcs import CACTUS_CLIENT_ID, CACTUS_CLIENT_SECRET, CACTUS_REQUIRED_SCOPE, LOCAL_REDIRECT_URI
from cactus.exceptions import InvalidCredentials
class GCSCred... | {
"content_hash": "5375857c84b02aa2b5f35b677218cb52",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 119,
"avg_line_length": 37.38297872340426,
"alnum_prop": 0.6585088218554354,
"repo_name": "dreadatour/Cactus",
"id": "833e7a0e7bb02c632a1d0f49c1d502a59e3a0214",
"size": "17... |
import unittest
import sys
sys.path.append('LeetCode/_001_050')
sys.path.append('LeetCode.Test')
from _024_SwapNodesInPairs import Solution
import TestHelper, AssertHelper
class Test_024_SwapNodesInPairs(unittest.TestCase):
def test_swapPairs(self):
link = TestHelper.generateLinkList([1, 2, 3, 4])
... | {
"content_hash": "8727f5b449b3d72e2e87d9fc95a0e630",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 57,
"avg_line_length": 28.72093023255814,
"alnum_prop": 0.6591093117408907,
"repo_name": "BigEgg/LeetCode",
"id": "50f43ab8f031b2dd9e0f1fa5b54304f6b07c929f",
"size": "1235"... |
from django.test import RequestFactory, TestCase
from feder.teryt.factories import JSTFactory
from teryt_tree.rest_framework_ext.viewsets import JednostkaAdministracyjnaViewSet
class TerytViewSetTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.jst = JSTFactory()
def ... | {
"content_hash": "d3ed6cd72a9ff2bd0a14a534b2252225",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 82,
"avg_line_length": 37.09090909090909,
"alnum_prop": 0.696078431372549,
"repo_name": "watchdogpolska/feder",
"id": "79c3cf15c6d154918973d555c337a96f678dda72",
"size": "8... |
"""
API v1.0 Command and Control (C2) direct access routes:
Enter direct access mode: /c2/instrument/<string:reference_designator>/direct_access/start
Execute direct access command /c2/instrument/<string:reference_designator>/direct_access/execute
Exit direct access mode: /c2/ins... | {
"content_hash": "8815827e96cb8e81632c6afb78e8367f",
"timestamp": "",
"source": "github",
"line_count": 1068,
"max_line_length": 175,
"avg_line_length": 42.52996254681648,
"alnum_prop": 0.532825503060191,
"repo_name": "Bobfrat/ooi-ui-services",
"id": "9f5a207ac092e8a9c4269d0855fc9dfca502c082",
"siz... |
"""General audio exception class for exceptions thrown in the audio module."""
# ---------------------------------------------------------------------------
# AudioException class
# ---------------------------------------------------------------------------
class AudioException(Exception):
"""Exception returne... | {
"content_hash": "a27510fe8cea1ee49b63c69736497c3e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 78,
"avg_line_length": 43.125,
"alnum_prop": 0.40869565217391307,
"repo_name": "missionpinball/mpf-mc",
"id": "aee908513877bb39e0f9375de1e418c82ce908ab",
"size": "345",
"b... |
from __future__ import unicode_literals
from __future__ import absolute_import
from requests.exceptions import ConnectionError, SSLError
import logging
import os
import re
import yaml
import six
from ..project import Project
from ..service import ConfigError
from .docopt_command import DocoptCommand
from .utils import... | {
"content_hash": "8985d0c9dbe92060c3789ce3864473b6",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 116,
"avg_line_length": 36.707142857142856,
"alnum_prop": 0.5958357657131738,
"repo_name": "czchen/debian-docker-compose",
"id": "67b77f31b57026b2a2c22800f139b59ddfbf9bb0",
... |
from __future__ import print_function
import argparse
import numpy as np
import neuroglancer
import neuroglancer.cli
from example import add_example_layers
if __name__ == '__main__':
ap = argparse.ArgumentParser()
neuroglancer.cli.add_server_arguments(ap)
args = ap.parse_args()
neuroglancer.cli.han... | {
"content_hash": "e03f19fce9973f36af6f1fb7d2155998",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 28.12,
"alnum_prop": 0.7155049786628734,
"repo_name": "google/neuroglancer",
"id": "c536036b156d40542542db4399ef4d00ec665d6d",
"size": "703",
"bina... |
'''
Analysis class unit test
'''
import sys
sys.path.append('../src/')
import unittest
from data import Data
from account import Account
class AnalysisTest(unittest.TestCase):
def test_get_suggestion(self):
# suggestion function test here
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "85ea7f3a197bea5910c296e6f0f357e4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 20,
"alnum_prop": 0.69,
"repo_name": "ryanshim/cpsc362coinbaseTradingBot",
"id": "fdc6e4edbe8d5bc3d9b4710bf8b3cbac4257c6fe",
"size": "300",
"binary... |
"""Certbot main entry point."""
# pylint: disable=too-many-lines
from contextlib import contextmanager
import functools
import logging.handlers
import sys
from typing import Generator
from typing import IO
from typing import Iterable
from typing import List
from typing import Optional
from typing import Tuple
from typ... | {
"content_hash": "3a98b4efafee9f811631e2a3616ab8cd",
"timestamp": "",
"source": "github",
"line_count": 1569,
"max_line_length": 100,
"avg_line_length": 37.26449968132569,
"alnum_prop": 0.6641410686187316,
"repo_name": "stweil/letsencrypt",
"id": "cda08e1b7f01d0a288108a2e0feda12c6b16cb61",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0005_remove_account_token_exp_time'),
]
operations = [
migrations.AddField(
model_name='account',
name='token_up_... | {
"content_hash": "f56863e6dbfc02e92a49f0051af683ce",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.6071428571428571,
"repo_name": "hyperwd/hwcram",
"id": "e174702cf1614f5d553e849aad308160d0ccd38f",
"size": "497",... |
__version__=''' $Id: renderPM.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__="""Render drawing objects in common bitmap formats
Usage::
from reportlab.graphics import renderPM
renderPM.drawToFile(drawing,filename,fmt='GIF',configPIL={....})
Other functions let you create a PM drawing as string or i... | {
"content_hash": "ea36fda010ad22a60d2ae2e5652caef3",
"timestamp": "",
"source": "github",
"line_count": 743,
"max_line_length": 133,
"avg_line_length": 36.738896366083445,
"alnum_prop": 0.5439059237278822,
"repo_name": "nickpack/reportlab",
"id": "b82779953dded5989079269e666d0afa28f5e511",
"size": ... |
from .vscl import McAfeeVSCL
from ..interface import AntivirusPluginInterface
from irma.common.plugins import PluginMetaClass, PlatformDependency
from irma.common.base.utils import IrmaProbeType
class McAfeeVSCLPlugin(AntivirusPluginInterface, metaclass=PluginMetaClass):
# =================
# plugin metada... | {
"content_hash": "2ede695d50207813e68f336241ddcaa4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 29.06896551724138,
"alnum_prop": 0.6215895610913404,
"repo_name": "quarkslab/irma",
"id": "55bbbccaa544c55a10a9a8ac77ca0a2483ea53fe",
"size": "1368",... |
import json
import os
import subprocess
from .logger import Logger
log = Logger()
class TmuxException(Exception):
pass
class Tmux(object):
"""
Tmux controller
"""
def command(self, cmd, formats=None, many=False):
"""
Send custom Tmux command and return rich information
... | {
"content_hash": "85be68aa063f09f6e30a06dcd5b1309a",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 78,
"avg_line_length": 32.32905982905983,
"alnum_prop": 0.5187045604758758,
"repo_name": "rafi/mx",
"id": "c79e81276927f487ebf2186d1d648872297dedc5",
"size": "7589",
"bi... |
import concurrent.futures
import urllib.request
URLS = ['http://www.foxnews.com/',
'http://www.cnn.com/',
'http://europe.wsj.com/',
'http://www.bbc.co.uk/',
'http://dstcontrols.com/']
# Retrieve a single page and report the URL and contents
def load_url(url, timeout):
with urllib.r... | {
"content_hash": "ba1ed911373b7bf8d1de583b6dc94b31",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 38.53846153846154,
"alnum_prop": 0.6407185628742516,
"repo_name": "dstcontrols/osisoftpy",
"id": "8124d21c246aea0fe79f62265f89508bc6328e3e",
"size": ... |
r'''
Creating the needed environments for creating the pre-compiled distribution on Windows:
See:
build_tools\pydevd_release_process.txt
for building binaries/release process.
'''
from __future__ import unicode_literals
import os
import subprocess
import sys
miniconda32_envs = os.getenv('MINICONDA32_ENVS', r'C:\... | {
"content_hash": "4b4e04f216ca830a3e310825eacdbfad",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 155,
"avg_line_length": 32.51724137931034,
"alnum_prop": 0.6687875574407918,
"repo_name": "leafclick/intellij-community",
"id": "73b265a97544ad68a9db1cb46178c61abf8d7279",
... |
import datetime
from dogpile.cache import make_region
#: Expiration time for show caching
SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=3).total_seconds()
#: Expiration time for episode caching
EPISODE_EXPIRATION_TIME = datetime.timedelta(days=3).total_seconds()
#: Expiration time for scraper searches
REFINER_EXP... | {
"content_hash": "59be1cf6b2e1406fed19d23ad7441a9f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 69,
"avg_line_length": 26.933333333333334,
"alnum_prop": 0.7846534653465347,
"repo_name": "fernandog/subliminal",
"id": "244ba9531d2bf035b7dff7261e4ff5cefa6d1c09",
"size": ... |
import json
from rest_framework.response import Response
from rest_framework.views import APIView
from cigar_example.restapi import urls
from rest_framework_docs.docs import DocumentationGenerator
class ApiDocumentation(APIView):
"""
Gets the documentation for the API endpoints
"""
def get(self, *args... | {
"content_hash": "3d8bfc321da733f9f3333203aace47e2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 66,
"avg_line_length": 26.176470588235293,
"alnum_prop": 0.7438202247191011,
"repo_name": "marcgibbons/django-rest-framework-docs",
"id": "220effb02d5ea85b81cbc9695aee846a250... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.