text stringlengths 4 1.02M | meta dict |
|---|---|
import handlers
from django.conf.urls.defaults import *
from treeio.core.api.auth import auth_engine
from treeio.core.api.doc import documentation_view
from treeio.core.api.resource import CsrfExemptResource
ad = { 'authentication': auth_engine }
#events resources
eventResource = CsrfExemptResource(handler = handlers... | {
"content_hash": "40fa1180b777ab449fbbe4e9e2ff791e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 90,
"avg_line_length": 31.68421052631579,
"alnum_prop": 0.7358803986710963,
"repo_name": "rogeriofalcone/treeio",
"id": "c70131190d386bb470e376512237454dc57ad9b4",
"size": ... |
import cPickle
import gzip
# Third-party libraries
import numpy as np
def load_data(pklsize):
"""Return a tuple containing ``(image_data, label_data)``
image_data contain array of tuple (image, size(width, height))"""
f = gzip.open('../data/cvl' + pklsize.__str__() + '.str.pkl.gz', 'rb')
images_data,... | {
"content_hash": "72992cb4abd4602ad8dd69fda51e9943",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 74,
"avg_line_length": 30.217391304347824,
"alnum_prop": 0.6503597122302158,
"repo_name": "avicorp/firstLook",
"id": "27ceb6ec120f5cd2eda0154db2c256014df27d57",
"size": "72... |
from timeit import Timer
# Implements a decorator for quick timing of functions.
# Note that this will not provide any return value.
def time_it(count):
def time_me_decorator(function):
def function_wrapper(*args, **kwargs):
t = Timer(lambda: function(*args, **kwargs))
time = t.tim... | {
"content_hash": "022fbf076c9a1b46707fc0f31d1c19e3",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 36.523809523809526,
"alnum_prop": 0.5436766623207301,
"repo_name": "bobbyluig/Eclipse",
"id": "c51caaac786017f00fa44737c505cf911c7db4c8",
"size": "76... |
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Simple volume rendering example.
reader = vtk.vtkSLCReader()
reader.SetFileName(VTK_DATA_ROOT + "/Data/sphere.slc")
# Create transfer functions for opacity and color
opacityTransferFunction = ... | {
"content_hash": "4138a6687a390966128d2f35c33037d8",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 34.91509433962264,
"alnum_prop": 0.6881923804377196,
"repo_name": "hlzz/dotfiles",
"id": "6b00ab049340f60d50cc7572754775464c12613a",
"size": "3724",... |
import os
os.environ['CQLENG_ALLOW_SCHEMA_MANAGEMENT'] = '1'
import logging
log = logging.getLogger()
log.setLevel('INFO')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandler(handler)
from uuid import uuid4
from cassandra.cqle... | {
"content_hash": "e7a3cf64874c7771dd5458d2803f7739",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 102,
"avg_line_length": 37.56603773584906,
"alnum_prop": 0.6828227021597187,
"repo_name": "datastax/python-driver",
"id": "35100471c778a2cad309fc8204c93529a1e90f61",
"size... |
import asyncio
from autobahn.asyncio.websocket import WebSocketClientProtocol, \
WebSocketClientFactory
import json
import random
class SlowSquareClientProtocol(WebSocketClientProtocol):
def onOpen(self):
x = 10. * random.random()
self.sendMessage(json.dumps(x).encode('utf8'))
print... | {
"content_hash": "7883ff4a7487345b9e8b74167e956050",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 65,
"avg_line_length": 26.72972972972973,
"alnum_prop": 0.641051567239636,
"repo_name": "tavendo/AutobahnPython",
"id": "89d56791cd94e405abf2f2537afd43e917d169fb",
"size": ... |
import unittest
import os
import sys
import subprocess
import re
class TestFlagsUseMkldnn(unittest.TestCase):
def setUp(self):
self._python_interp = sys.executable
self._python_interp += " check_flags_mkldnn_ops_on_off.py"
self.env = os.environ.copy()
self.env[str("DNNL_VERBOSE")]... | {
"content_hash": "668ae99b2814d29740d8f4860edf0fef",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 104,
"avg_line_length": 36.75247524752475,
"alnum_prop": 0.6042564655172413,
"repo_name": "luotao1/Paddle",
"id": "b59ce2ee71498f9595dc2c498e4325720a4f0765",
"size": "4323... |
import warnings
import numpy as np
import skrf
import pyvisa
from collections import OrderedDict
from collections.abc import Iterable
from . import abcvna
from . import keysight_pna_scpi
class PNA(abcvna.VNA):
"""
Class for modern Keysight/Agilent Performance Network Analyzers
"""
DEFAULT_VISA_ADDRE... | {
"content_hash": "9f960bcd30f95167d8493b284db8805e",
"timestamp": "",
"source": "github",
"line_count": 568,
"max_line_length": 119,
"avg_line_length": 37.306338028169016,
"alnum_prop": 0.5692307692307692,
"repo_name": "jhillairet/scikit-rf",
"id": "19920420c1e5e5a43f1fcf6c0bbf468e9e9ee778",
"size"... |
from magnum.api import hooks
# Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'magnum.api.controllers.root.RootController',
'modules': ['magnum.api'],
'debug': True,
'hooks': [
hooks.ContextHook(),
... | {
"content_hash": "9851ac2056554e145d17c5a620b91aea",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 61,
"avg_line_length": 19.142857142857142,
"alnum_prop": 0.6007462686567164,
"repo_name": "LaynePeng/magnum",
"id": "7b4c63f04cbdfb1c00cae4720077a8f4d57b3263",
"size": "110... |
__doc__="""
Align selected components, paths (and parts of paths) to the next metric line or guideline above.
"""
import GlyphsApp
Font = Glyphs.font
Doc = Glyphs.currentDocument
Master = Font.selectedFontMaster
allMetrics = [ Master.ascender, Master.capHeight, Master.xHeight, 0.0, Master.descender ] + [ g.y for g in... | {
"content_hash": "0d6c91b7c733fa0c9e162c38fd75f19c",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 144,
"avg_line_length": 27.229166666666668,
"alnum_prop": 0.7061973986228003,
"repo_name": "weiweihuanghuang/Glyphs-Scripts",
"id": "97c7e35bcb6fcd3bb47df99d0932f9b7572cdc8d"... |
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
import warnings
from google.api_core import gapic_v1, grpc_helpers, operations_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: i... | {
"content_hash": "569dfa0e7e4f7a5d9ed61ed13e6f76d6",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 106,
"avg_line_length": 45.12008281573499,
"alnum_prop": 0.6308906529619602,
"repo_name": "googleapis/python-assured-workloads",
"id": "ea872e6c1df958d22f7b57bde6bbfe0b00f18... |
"""Test Taint."""
import unittest
from triton import *
class TestTaint(unittest.TestCase):
"""Testing the taint engine."""
def test_known_issues(self):
"""Check tainting result after processing."""
Triton = TritonContext()
Triton.setArchitecture(ARCH.X86)
Triton.taintRegis... | {
"content_hash": "d2e5322ce219e3af8a5a2c20186cbb66",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 80,
"avg_line_length": 40.25854383358098,
"alnum_prop": 0.6895253561674172,
"repo_name": "JonathanSalwan/Triton",
"id": "5b29bf5b1c298f100e87dba80a75f4b446feba36",
"size":... |
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import sys
import os
import logging
import argparse
import multiprocessing
from logging.config import dictConfig
import numpy as np
from future.utils import raise_
from sqlalchemy import create_engine
from sqlalchemy.orm imp... | {
"content_hash": "cee58eaac8f817eced3999fcee31c014",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 120,
"avg_line_length": 43.98416886543536,
"alnum_prop": 0.5451709658068387,
"repo_name": "Midnighter/pyorganism",
"id": "3daf6b498854a19a70ac3ec189d0e1ea82114389",
"size"... |
from cgml.constants import SCHEMA_IDS as SID
from cgml.validators import validateSchema
def makeSchema(n_in=None,
n_out=None,
nLayers=1,
inputDropRate=2,
modelType=None,
costFunction=None,
activationFunction="tanh",
... | {
"content_hash": "0c0760cb03636a3887a4d81b033bdec1",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 86,
"avg_line_length": 30.982142857142858,
"alnum_prop": 0.515850144092219,
"repo_name": "terkkila/cgml",
"id": "3f2606b5c2a9ef11024cb1c59f7678d0fc7cabe4",
"size": "1736",
... |
"""ResNet50+ConvDet model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import joblib
from utils import util
from easydict import EasyDict as edict
import numpy as np
import tensorflow as tf
from nn_skeleton import ModelSkeleton
... | {
"content_hash": "85edf261f11b407b5b97f0809898e4ac",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 76,
"avg_line_length": 40.616766467065865,
"alnum_prop": 0.6072534276868642,
"repo_name": "BichenWuUCB/squeezeDet",
"id": "b64632d4f6dbee38682ee65cc4db0470fc35ecd2",
"size... |
"""
Utility class for network related operations.
"""
import sys
import uuid
if sys.platform == 'win32':
import wmi
from oslo_log import log as logging
from os_windows._i18n import _, _LE
from os_windows import exceptions
from os_windows.utils import constants
from os_windows.utils import jobutils
LOG = loggin... | {
"content_hash": "69afcb847b94bed9caa544175934b6db",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 42.1447963800905,
"alnum_prop": 0.5867511273351943,
"repo_name": "cloudbase/oslo.windows",
"id": "a9851f3432daea4f97e149fdf8ce962345d2005d",
"size":... |
from django.conf import settings
from PIL import Image
AVATAR_DEFAULT_SIZE = getattr(settings, 'AVATAR_DEFAULT_SIZE', 80)
AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (AVATAR_DEFAULT_SIZE,))
AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS)
AVATAR_STORAGE... | {
"content_hash": "61a078dd025cad5d5aeafc3f4429acf2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 107,
"avg_line_length": 70.61904761904762,
"alnum_prop": 0.7714093054619016,
"repo_name": "kkanahin/django-avatar",
"id": "71a3609d4ada95fc3fe022e8d34670353844565d",
"size"... |
"""
Test MiniMap
---------------
"""
import folium
from folium import plugins
from folium.utilities import normalize
def test_minimap():
m = folium.Map(location=(30, 20), zoom_start=4)
minimap = plugins.MiniMap()
m.add_child(minimap)
out = normalize(m._parent.render())
# Verify that a new mini... | {
"content_hash": "02c06f7ce57febb88969dea59874b9a1",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 56,
"avg_line_length": 23.285714285714285,
"alnum_prop": 0.6595092024539877,
"repo_name": "python-visualization/folium",
"id": "cdc3fa064997419808803eedc064e1f09c19508a",
"... |
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _, ugettext
from satchmo.newsletter.forms import NewsletterForm
def add_subscription(request, template="newsletter/subscribe_form.html",
result_template="newsletter/upda... | {
"content_hash": "2867f3687927ed65f2189d59a9882ad7",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 81,
"avg_line_length": 37.7962962962963,
"alnum_prop": 0.6805487506124449,
"repo_name": "sankroh/satchmo",
"id": "5e993b0abf7f21769d1041be6ed40932906e3d1a",
"size": "2041",... |
import unittest
from flake8.api.legacy import get_style_guide
class TestFlake8Compliance(unittest.TestCase):
def test_flake8(self):
style_guide = get_style_guide()
report = style_guide.check_files()
self.assertEqual(report.get_statistics('E'), [])
| {
"content_hash": "b0fccf75b9830cc275dc3baec21c28ba",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 30.88888888888889,
"alnum_prop": 0.697841726618705,
"repo_name": "EmilStenstrom/json-traverse",
"id": "3ca174d9f565e308b2f7e1023a25de4d1c90aa30",
"siz... |
import ipv6
import network_layer
import config
import mle
from enum import IntEnum
class CheckType(IntEnum):
CONTAIN = 0
NOT_CONTAIN = 1
OPTIONAL = 2
def check_address_query(command_msg, source_node, destination_address):
"""Verify source_node sent a properly formatted Address Query Request message ... | {
"content_hash": "e19b602b9448f18a8cdc342dda9c742e",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 178,
"avg_line_length": 51.73626373626374,
"alnum_prop": 0.7319456244689889,
"repo_name": "pvanhorn/openthread",
"id": "d29d1abd6d630985a5cddb02ec54f7dcdfd7bc2c",
"size": ... |
"""
This file contains grep processing.
"""
import re
import sys
import mysql.connector
from mysql.connector.constants import ClientFlag
from mysql.utilities.exception import EmptyResultError, FormatError
from mysql.utilities.common.format import print_list
from mysql.utilities.common.ip_parser import parse_connecti... | {
"content_hash": "c6f14916ec745babf3a582aa0f19148a",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 78,
"avg_line_length": 34.2265625,
"alnum_prop": 0.543026706231454,
"repo_name": "scavarda/mysql-dbcompare",
"id": "af3d4fca1cb91f66315455c06d709b9379e19cb2",
"size": "949... |
from __future__ import print_function, division
import numpy as np
import pandas as pd
import networkx as nx
from os.path import isdir, dirname, abspath
from os import getcwd
from inspect import currentframe, getfile, getsourcefile
from sys import getfilesystemencoding, stdout
from IPython.core.display import HTML, dis... | {
"content_hash": "f33da08144f8c68f2512a6085ab4d2ad",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 78,
"avg_line_length": 26.186700767263428,
"alnum_prop": 0.604160562554937,
"repo_name": "josemao/nilmtk",
"id": "378bb53fa80c9e40faf0bada0365f66b11d09348",
"size": "10239... |
from django.conf import settings
from rest_framework.reverse import reverse
from waldur_mastermind.common import utils as common_utils
from waldur_mastermind.support import views as support_views
def create_issue(offering_request):
if not settings.WALDUR_SUPPORT['ENABLED']:
return
user = offering_re... | {
"content_hash": "63b4e59babf700a7f7fb416d0740c011",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 98,
"avg_line_length": 40.193548387096776,
"alnum_prop": 0.6669341894060995,
"repo_name": "opennode/waldur-mastermind",
"id": "f74720fdde2f438a8c3b24a763b3944b4bd85994",
"s... |
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
import time
from decimal import Decimal
from itertools import product
import test_framework.messages
from test_framework.avatools import create_coinbase_stakes
from test_framework.key import ECKey
from test_framework.messages import NODE_... | {
"content_hash": "2e73315e7a8bec29f0c1c59bd869d967",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 108,
"avg_line_length": 43.04683195592286,
"alnum_prop": 0.5849865608601049,
"repo_name": "Bitcoin-ABC/bitcoin-abc",
"id": "e070d875f984a7418c4997a540ed767d782eb169",
"siz... |
from setuptools import setup, find_packages
setup(
name='struct_bench',
version='0.1',
author='androm3da',
author_email='foo@example.com',
packages=find_packages(),
url='http://example.com/',
license='MIT',
description='TBD',
long_description='''TBD''',
install_requires=[
... | {
"content_hash": "181bc1c6db570bdcc46f6e2c0e68f679",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 43,
"avg_line_length": 20.238095238095237,
"alnum_prop": 0.5294117647058824,
"repo_name": "androm3da/struct_bench",
"id": "9ca773482d6271168c06fe3c4c2e75c36aa19cae",
"size"... |
from os.path import join as pjoin, abspath, dirname, pardir
PROJ_ROOT = abspath(pjoin(dirname(__file__), pardir))
DATA_ROOT = pjoin(PROJ_ROOT, 'data')
THUMBNAIL_PREFIX = 'test/cache/'
THUMBNAIL_DEBUG = True
THUMBNAIL_LOG_HANDLER = {
'class': 'sorl.thumbnail.log.ThumbnailLogHandler',
'level': 'ERROR',
}
THUMBN... | {
"content_hash": "df86f9d59008679b7be1081ef731f3c7",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 60,
"avg_line_length": 26.558823529411764,
"alnum_prop": 0.6854928017718716,
"repo_name": "makinacorpus/sorl-thumbnail",
"id": "e8468cce56718127eb37cf1a5e96933af231a96d",
"... |
__all__ = ["__version__", "version_tuple"]
try:
from ._version import version as __version__, version_tuple
except ImportError: # pragma: no cover
# broken installation, we don't even try
# unknown only works because we do poor mans version compare
__version__ = "unknown"
version_tuple = (0, 0, "u... | {
"content_hash": "c7fdaba0371323e27e97c4ae307f02a2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 64,
"avg_line_length": 39.55555555555556,
"alnum_prop": 0.6601123595505618,
"repo_name": "pytest-dev/pytest",
"id": "8a406c5c7512bb928f1909cf1f43461cb3efb64c",
"size": "356"... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'License'
db.create_table(u'licenses_license', (
(u'id', self.gf('djan... | {
"content_hash": "5d95e9e223d928280b47127325c5dfbf",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 105,
"avg_line_length": 54.170212765957444,
"alnum_prop": 0.6076197957580518,
"repo_name": "seanbell/opensurfaces",
"id": "c1c002392bb17847098deffbc27235dbc2e8c835",
"size"... |
import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertEqual(s.split(), ... | {
"content_hash": "40892adccb6bc4f9db8fca3089a02044",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 67,
"avg_line_length": 25.85,
"alnum_prop": 0.6286266924564797,
"repo_name": "twareproj/tware",
"id": "0829d2065c4b854cc0936420641f47a6e3bf109c",
"size": "535",
"binary":... |
import datetime
import sys
import unittest
from django.contrib.admin import (
AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin,
RelatedOnlyFieldListFilter, SimpleListFilter, site,
)
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.auth.admin import UserAdmin
fr... | {
"content_hash": "a04383e763a4c11f516b66c34e568b9a",
"timestamp": "",
"source": "github",
"line_count": 1312,
"max_line_length": 119,
"avg_line_length": 43.019817073170735,
"alnum_prop": 0.6523510860706566,
"repo_name": "pexip/os-python-django",
"id": "75563bbaaf790af40d6e494a8d44f90be8b5d6bd",
"si... |
"""Starts testengine using the given modelpackage.
Usage: tema.runmodelpackage MODELPACK.zip|MODELPACKDIR [OPTIONS]
The modelpackage is extracted, configured, composed, and ran with testengine.
Run runmodelpackage.py -h for help.
"""
import sys, os, optparse, zipfile, urllib, re, shutil
from tema.packagereader.pack... | {
"content_hash": "73b1a3f4c0c817451819c6a04f44e425",
"timestamp": "",
"source": "github",
"line_count": 614,
"max_line_length": 138,
"avg_line_length": 36.258957654723126,
"alnum_prop": 0.6100256030184611,
"repo_name": "tema-tut/tema-tg",
"id": "4cb5764ef9b25d19e2842025b915c2b0348ad7d7",
"size": "2... |
from __future__ import annotations
from unittest.mock import MagicMock, patch
import pytest
from airflow.models import DAG, Connection
from airflow.providers.dbt.cloud.hooks.dbt import DbtCloudHook, DbtCloudJobRunException, DbtCloudJobRunStatus
from airflow.providers.dbt.cloud.operators.dbt import (
DbtCloudGetJ... | {
"content_hash": "0119ab14e3a8e6c2d6860e5e5d377da3",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 110,
"avg_line_length": 38.56417112299465,
"alnum_prop": 0.5973791860223254,
"repo_name": "cfei18/incubator-airflow",
"id": "11b155c1d8a873df821a799a90193c5f95e5b21c",
"si... |
import pymysql.cursors
from models.group import Group
from models.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = pymysql.connect(host=host,... | {
"content_hash": "18abda1487ee44dd3055da7a17b501d3",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 121,
"avg_line_length": 39.19565217391305,
"alnum_prop": 0.5862451469772602,
"repo_name": "rgurevych/python_for_testers",
"id": "2da6b50b55c874a6247293480daf700cfb096e64",
... |
try:
import requests
except Exception as e:
print("GeneratePublishReportPart1 depends on requests library. Install it with `pip install requests`")
sys.exit(1)
import argparse, cgi, re
from os.path import exists, isdir
from os import makedirs
metadataChecks = {
'https://vaadin.com/download/LATEST7': '^7\..*',
'ht... | {
"content_hash": "0ec5b6c5115e2ff3f5b6d782f4fcc690",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 188,
"avg_line_length": 43.86274509803921,
"alnum_prop": 0.7116674117121145,
"repo_name": "Darsstar/framework",
"id": "37b2f8e4090a808ca9063799b8eab33553d3920b",
"size": "... |
"""Netmiko Cisco WLC support."""
from typing import Any, Union, Sequence, Iterator, TextIO
import time
import re
import socket
from netmiko.exceptions import NetmikoAuthenticationException
from netmiko.base_connection import BaseConnection
class CiscoWlcSSH(BaseConnection):
"""Netmiko Cisco WLC support."""
... | {
"content_hash": "d659b51c7477ed4611890c515a5e59ab",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 88,
"avg_line_length": 33.815384615384616,
"alnum_prop": 0.5583484986351228,
"repo_name": "ktbyers/netmiko",
"id": "b4ece3b239a59bbf4cd7b8b0ff4e67f7ef2209c2",
"size": "879... |
"""
production server
"""
from app.main import create_app
from app.config import Config
app = create_app(Config) #flask app instance | {
"content_hash": "bbdb43817a4fa3b8239191c7f8f26eb7",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 44,
"avg_line_length": 16.75,
"alnum_prop": 0.753731343283582,
"repo_name": "rileymjohnson/fbla",
"id": "0c37a2323ff5b577aff8c558335e8337accbc11c",
"size": "134",
"binary"... |
"""questionnaire external id
Revision ID: cb2e353a154f
Revises: cd009f1475ff
Create Date: 2020-09-17 13:26:19.438307
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus
from rdr_servi... | {
"content_hash": "22d8cd8ff015fba1c9b93c2c34fb2d5f",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 125,
"avg_line_length": 33.62903225806452,
"alnum_prop": 0.7486810551558754,
"repo_name": "all-of-us/raw-data-repository",
"id": "10e9d84034b21c5dc8cac09c61ebcedde510a75f",
... |
"""The XFS format analyzer helper implementation."""
from dfvfs.analyzer import analyzer
from dfvfs.analyzer import analyzer_helper
from dfvfs.analyzer import specification
from dfvfs.lib import definitions
class XFSAnalyzerHelper(analyzer_helper.AnalyzerHelper):
"""XFS analyzer helper."""
FORMAT_CATEGORIES = f... | {
"content_hash": "397e21d4f29f290f2c29710be39ef244",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 76,
"avg_line_length": 28.21212121212121,
"alnum_prop": 0.7593984962406015,
"repo_name": "joachimmetz/dfvfs",
"id": "3c4ed9f8b2542c47b1f8a9b2f7f3f0985279bc05",
"size": "955... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_brea_tonnika.iff"
result.attribute_template_id = 9
result.stfName("theme_park_name","brea_tonnika")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "a8b2c15e513073c81280f99f5b613cdc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.7028753993610224,
"repo_name": "anhstudios/swganh",
"id": "50b18c19838416b99c22dccca13be463b29eee2d",
"size": "45... |
from __future__ import print_function
import m5
from m5.objects import *
from Caches import *
def config_cache(options, system):
if options.external_memory_system and (options.caches or options.l2cache):
print("External caches and internal caches are exclusive options.\n")
sys.exit(1)
if opti... | {
"content_hash": "6528433f3ee040d04ef5b1f2c8c156d3",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 79,
"avg_line_length": 41.2,
"alnum_prop": 0.5937395379979913,
"repo_name": "TUD-OS/gem5-dtu",
"id": "3fa3676b08dbf1f6a9f10a9395f4b6b833f97f3a",
"size": "8214",
"binary"... |
class Symbol(object):
def __init__(self, num, name):
pass
| {
"content_hash": "74fb63d01e3b7aaec5c938d43fd84d07",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 17.75,
"alnum_prop": 0.5492957746478874,
"repo_name": "lodevil/pyparser",
"id": "b52c870a370c9d7291720f19f7026d4cc271c706",
"size": "72",
"binary": ... |
from twisted.internet.defer import inlineCallbacks
from battlesnake.conf import settings
from battlesnake.core.inbound_command_handling.base import CommandError
from battlesnake.outbound_commands.think_fn_wrappers import btloadmech, \
btgetxcodevalue_ref, set_attrs, btdesignex
@inlineCallbacks
def load_ref_in_te... | {
"content_hash": "af96a0a629b434b167fec570706929b8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 37.892857142857146,
"alnum_prop": 0.7360980207351555,
"repo_name": "gtaylor/btmux_battlesnake",
"id": "e61daa5c6586721a745d34d08af9d86a238bc233",
"si... |
"""Performance test to make sure rule keys are unaffected by absolute paths.
The general algorithm is:
- Build all targets
- Rename directory being tested
- Build all targets, check to ensure everything pulls from dir cache
- Buck build all targets to verify no-op build works.
"""
import argparse
import re
im... | {
"content_hash": "853baf3ac5b859c4c77449acd3bdb8d0",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 93,
"avg_line_length": 33.18316831683168,
"alnum_prop": 0.5669103386543339,
"repo_name": "shs96c/buck",
"id": "bf482ea613a9597ba5565e23085ddfde9a38cc49",
"size": "13428",
... |
import pytest
import six
from jak import helpers
jakfile_content_1 = """
// Comment 1
{
// Comment 2
"password_file": "jakpassword",
// Comment 3
"files_to_encrypt": [ "env", "env2" ] // Inline-Comment 4
// "commented out line": 5
} // Comment 5 (seriously?)
// Comment 6
// Comment 7
"""
def test_remove_comments_fr... | {
"content_hash": "0d55c493bb39ea0081864d9047b68a2a",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 88,
"avg_line_length": 30.299065420560748,
"alnum_prop": 0.6582356570018507,
"repo_name": "dispel/jak",
"id": "07fc2f1dbee40ac3ceb924eb6fddb9fcda2c0d6e",
"size": "3267",
... |
import re
from typing import Dict, Sequence, Tuple
from unittest import TestCase, mock
from google.api_core.retry import Retry
from airflow import AirflowException
from airflow.providers.google.cloud.hooks.os_login import OSLoginHook
from tests.providers.google.cloud.utils.base_gcp_mock import (
mock_base_gcp_hoo... | {
"content_hash": "0c404a9ca933e2f8e1604730b3184f2a",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 107,
"avg_line_length": 36.358024691358025,
"alnum_prop": 0.6244482173174872,
"repo_name": "airbnb/airflow",
"id": "7e37569539b6378b4173e616e00b6461dfe571b5",
"size": "667... |
def join(*args):
"""
Join url paths together
"""
args_with_no_ws = filter(lambda arg: arg.strip(), args)
if not len(args_with_no_ws):
return ""
if len(args_with_no_ws) == 1:
return args_with_no_ws[0]
joined = '/'.join(path.strip('/') for path in args_with_no_ws)
last_... | {
"content_hash": "56d7486534baaff118f3566e0007ee12",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 21.55,
"alnum_prop": 0.5614849187935035,
"repo_name": "ryankanno/py-utilities",
"id": "13c49aa2cfa046a1a42d97e39c834bb815d50715",
"size": "479",
"b... |
"""
Tests for `kolibri.utils.cli` module.
"""
from __future__ import absolute_import
from __future__ import print_function
import logging
import os
import tempfile
import pytest
from django.db.utils import OperationalError
from mock import patch
import kolibri
from kolibri.plugins.utils import autoremove_unavailable... | {
"content_hash": "be380580f7f9366bfa7d866a028c7b26",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 96,
"avg_line_length": 32.684375,
"alnum_prop": 0.6795104694521464,
"repo_name": "mrpau/kolibri",
"id": "f70543b92bf5c3f32227c1e22d912116c437eda4",
"size": "10459",
"bin... |
from google.cloud import ids_v1
async def sample_get_endpoint():
# Create a client
client = ids_v1.IDSAsyncClient()
# Initialize request argument(s)
request = ids_v1.GetEndpointRequest(
name="name_value",
)
# Make the request
response = await client.get_endpoint(request=request)
... | {
"content_hash": "ced931904a6aa0feda499f516d49f2e8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 57,
"avg_line_length": 21.842105263157894,
"alnum_prop": 0.6795180722891566,
"repo_name": "googleapis/python-ids",
"id": "48b6685d0325d6b7f5c4c4af670801e7e2178dc8",
"size":... |
from msrest.serialization import Model
class ChaosContextMapItem(Model):
"""Describes an item in the ChaosContextMap in ChaosParameters.
.
:param key: The key for a ChaosContextMapItem.
:type key: str
:param value: The value for a ChaosContextMapItem.
:type value: str
"""
_validation... | {
"content_hash": "06961b9aa7021551209a9e3b5ba6ce58",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 67,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.564935064935065,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "435baa331bf12227f2dd481100ee6c5797b6f5f2",
... |
from __future__ import division
'''
FaceSync Class
==========================================
Class to sync videos by audio matching.
'''
__all__ = ['facesync']
__author__ = ["Jin Hyun Cheong"]
__license__ = "MIT"
import os
import numpy as np
import subprocess
import scipy.io.wavfile as wav
def _get_vid... | {
"content_hash": "371723d930c2311381b9176a5177bfed",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 222,
"avg_line_length": 45.34249084249084,
"alnum_prop": 0.5789069758048229,
"repo_name": "jcheong0428/facesync",
"id": "aeb2a5a898399bb9f6529176d71b1ef79b8b3352",
"size":... |
import os
import six
from django import VERSION
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
from django.utils.http import urlquote
from queued_storage.conf import settings
from queued_storage.utils import import_attr... | {
"content_hash": "94b55439e20217db7c6174d4c617faf0",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 122,
"avg_line_length": 35.20079522862823,
"alnum_prop": 0.6310855077374902,
"repo_name": "melfelr/django-queued-storage",
"id": "b926dd12a6f8d130b82fe55dc7d9c2a8972c3097",
... |
import types
from pyrepl import unicodedata_
from pyrepl import commands
from pyrepl import input
def _make_unctrl_map():
uc_map = {}
for c in map(unichr, range(256)):
if unicodedata_.category(c)[0] <> 'C':
uc_map[c] = c
for i in range(32):
c = unichr(i)
uc_map[c] = u'^'... | {
"content_hash": "d124c2c8c1095d43f9e8375028b1a562",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 78,
"avg_line_length": 32.121911037891266,
"alnum_prop": 0.5184121448353677,
"repo_name": "ArneBab/pypyjs",
"id": "677279bce29195c834a10aefc983fa306731f954",
"size": "2046... |
"""
Line Chart with Logarithmic Scale
---------------------------------
How to make a line chart on a `Logarithmic scale <https://en.wikipedia.org/wiki/Logarithmic_scale>`_.
"""
# category: line charts
import altair as alt
from vega_datasets import data
source = data.population()
alt.Chart(source).mark_line().encode(... | {
"content_hash": "7b165f11262a948cec0debae3dc04864",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 101,
"avg_line_length": 24.72222222222222,
"alnum_prop": 0.6202247191011236,
"repo_name": "jakevdp/altair",
"id": "b45fcd92ebd0a07a46e87a4afac896a85ea235d8",
"size": "445",... |
__author__ = 'cosven'
import os
import json
import hashlib
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtNetwork import *
from base.network_manger import NetworkManager
from base.logger import LOG
from base.common import write_json_into_file
from constants import DA... | {
"content_hash": "0313a8231ae30badd557afc236311097",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 90,
"avg_line_length": 33.995327102803735,
"alnum_prop": 0.580893470790378,
"repo_name": "baifenbenniao/FeelUOwn",
"id": "16603b166b2d275ec7ca16bb0955f4eff2159e5d",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Basket',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=... | {
"content_hash": "f821bb8923dc3e655994bb038bc001f9",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 195,
"avg_line_length": 45.532051282051285,
"alnum_prop": 0.5466000281571167,
"repo_name": "baffolobill/mb_test_1",
"id": "4230ece68b21c5bdf31ba98eb1add6a38e9f4175",
"size... |
from keras.models import Sequential
from keras.layers import Dense
import numpy
def handler(event, context):
# fix random seed for reproducibility
seed = 7
numpy.random.seed(seed)
# load pima indians dataset
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# split into input... | {
"content_hash": "54777d16a0e5cf635eacb94f46f9c863",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 85,
"avg_line_length": 34.206896551724135,
"alnum_prop": 0.6713709677419355,
"repo_name": "ryfeus/lambda-packs",
"id": "aa4644f4a803ae2176dfbed37f36f59d94eb51af",
"size": "... |
"""
Pygments LaTeX formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import unittest
import tempfile
from pygments.formatters import LatexFormatter
from pygments.lexers import PythonL... | {
"content_hash": "08b96551ad470ad11eb8814b62517950",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 75,
"avg_line_length": 28.41304347826087,
"alnum_prop": 0.5921958684009181,
"repo_name": "ceci/pygments-hack",
"id": "dc8231bebee476ad0c0f9d9294c8a98701576f72",
"size": "13... |
"""The tests for the WSDOT platform."""
from datetime import datetime, timedelta, timezone
import re
import homeassistant.components.wsdot.sensor as wsdot
from homeassistant.components.wsdot.sensor import (
ATTR_DESCRIPTION,
ATTR_TIME_UPDATED,
CONF_API_KEY,
CONF_ID,
CONF_NAME,
CONF_TRAVEL_TIMES... | {
"content_hash": "5770abc465121cd21b7cf0ded9bf3e6b",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 73,
"avg_line_length": 29.56896551724138,
"alnum_prop": 0.6647230320699709,
"repo_name": "adrienbrault/home-assistant",
"id": "bbb56efdedadc2c953eba625d3e13958496a9e8a",
"s... |
import sys
import unittest
from webkitpy.tool import mocktool
import chromium_gpu
import chromium_linux
import chromium_mac
import chromium_win
import dryrun
import factory
import google_chrome
import gtk
import mac
import qt
import test
import win
class FactoryTest(unittest.TestCase):
"""Test factory creates p... | {
"content_hash": "ef997b63d8e89b5b73852557011d1908",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 81,
"avg_line_length": 35.985915492957744,
"alnum_prop": 0.639334637964775,
"repo_name": "Xperia-Nicki/android_platform_sony_nicki",
"id": "e4a2cd43f885e5e0935804d9ad7515db1... |
import os
import ctypes
import time
import threading
import cv2
import numpy as np
from ikalog.utils import *
from ikalog.inputs import VideoInput
from ikalog.inputs.filters import WarpFilter, WarpCalibrationNotFound, WarpCalibrationUnacceptableSize
_ = Localization.gettext_translation('screencapture', fallback=True... | {
"content_hash": "eb04f53505dea4e4304b4d8bc75fb25a",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 102,
"avg_line_length": 28.88757396449704,
"alnum_prop": 0.5514133551823024,
"repo_name": "hasegaw/IkaLog",
"id": "e674ad369781401759ed1fac5e07b68d8946500c",
"size": "5654... |
"""Parser for Windows XML EventLog (EVTX) files."""
import pyevtx
from dfdatetime import filetime as dfdatetime_filetime
from plaso.containers import events
from plaso.lib import specification
from plaso.parsers import interface
from plaso.parsers import manager
class WinEvtxRecordEventData(events.EventData):
""... | {
"content_hash": "fc5d828fbca4a2f353fe9c007fe63f89",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 78,
"avg_line_length": 35.21611721611722,
"alnum_prop": 0.6922196796338673,
"repo_name": "log2timeline/plaso",
"id": "64dfbe8a208cc17cf6a2d33cb8b777edacc93616",
"size": "9... |
import chainer
import copy
class _MultiNodeOptimizer(object):
def __init__(self, actual_optimizer, communicator, zero_fill):
super(_MultiNodeOptimizer, self).__setattr__(
'communicator', communicator)
super(_MultiNodeOptimizer, self).__setattr__(
'actual_optimizer', actual... | {
"content_hash": "3d5c0f752ce45c341863f23fc7399484",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 79,
"avg_line_length": 40.857142857142854,
"alnum_prop": 0.5954814416352878,
"repo_name": "chainer/chainer",
"id": "68cde0a0c2d841fa02d252966c6a239dd0d4d762",
"size": "743... |
"""
Tests for metricsT.
"""
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import numpy as np
import deepchem as dc
from tensorflow.python.platform import googletest
from deepchem import... | {
"content_hash": "1cb16169f1229b94fb9d6431a0ae1884",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 33.513513513513516,
"alnum_prop": 0.6193548387096774,
"repo_name": "ktaneishi/deepchem",
"id": "0d355fd8e4b7472538837a399ab109b5dd69edad",
"size": "2... |
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append([os.path.abspath('../keystone'),
os.path... | {
"content_hash": "d1ac9649864afa485f49426ace520d25",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 79,
"avg_line_length": 32.91705069124424,
"alnum_prop": 0.6875262494750105,
"repo_name": "ntt-pf-lab/backup_keystone",
"id": "0fa9eb441041301c721ef54671c81c890886a8e5",
"s... |
from pkg_resources import require
require('numpy')
require('matplotlib')
import sys, os
import matplotlib as mpl
from pylab import *
if len(sys.argv) < 1:
print "### ERROR: not enough arguments. Please supply an input file ###"
fptr = open(sys.argv[1])
datafile=fptr.readline().strip()
dataset=fptr.readline().st... | {
"content_hash": "2304e5f0d814719b46db7d55f36741bc",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 113,
"avg_line_length": 27.21951219512195,
"alnum_prop": 0.6160394265232975,
"repo_name": "ulrikpedersen/benchpress",
"id": "d7b4b1449b55bb9b283b1cb40f73648fbab265ad",
"siz... |
"""
This script converts qcarchive json to cjson
It includes automatic bond detection, since qcarchive
json does not store bonds.
"""
import json
import click
from avogadro.core import Molecule
from avogadro.io import FileFormatManager
from openbabel import OBMol, OBConversion
# Copied from mongochemserver
def av... | {
"content_hash": "7d948b74d21fc36fef1b57aa7a5312b0",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 66,
"avg_line_length": 23.952380952380953,
"alnum_prop": 0.658051689860835,
"repo_name": "OpenChemistry/mongochemdeploy",
"id": "d9697872d292f168b99535d9f46ebbe287e99fd2",
... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
def settwopanel( height_ratios = [1.0,0.3],
width_ratios = [1.,0.] ,
padding = None,
setoffset = None,
figsize = None ):
"""
returns a figure and axes for a main panel and a lower panel for
showing differential info... | {
"content_hash": "3f8b683f57b22949e3b2f4a906cf91bc",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 92,
"avg_line_length": 21.25,
"alnum_prop": 0.6569659442724458,
"repo_name": "rbiswas4/FluctuationsInCosmology",
"id": "3a369fcbc9cf0d2ffe12ca00a991b854bc9b9a33",
"size": "... |
"""Build App Engine source package.
"""
import json
import optparse
import os
import shutil
import subprocess
import sys
#import requests
import test_file_herder
USAGE = """%prog src_path dest_path
Build the GAE source code package.
src_path Path to the source code root directory.
dest_path Path to the root ... | {
"content_hash": "a23008c4990b99d0ad6b870a5831b48f",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 80,
"avg_line_length": 30.524193548387096,
"alnum_prop": 0.6446499339498019,
"repo_name": "webrtc/apprtc",
"id": "05852fa3bbee7a95be2c25d5e0a20b8e1bd7d46a",
"size": "3804"... |
import numpy
from chainer import distributions
from chainer import testing
from chainer import utils
@testing.parameterize(*testing.product({
'shape': [(2, 3), ()],
'is_variable': [True, False],
'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestLogNormal(te... | {
"content_hash": "f98df3996233c8f01bdcee9dac7df181",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 74,
"avg_line_length": 29.25581395348837,
"alnum_prop": 0.615262321144674,
"repo_name": "ktnyt/chainer",
"id": "96ca79a07b6f9817828888eaff24e0461a36d3b5",
"size": "1258",
... |
from django.conf import settings
from django import http
from django.core.urlresolvers import resolve
class SmartAppendSlashMiddleware(object):
"""
"SmartAppendSlash" middleware for taking care of URL rewriting.
This middleware appends a missing slash, if:
* the SMART_APPEND_SLASH setting is True
... | {
"content_hash": "12cef92a1b699b4855701ea54a2e87b0",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 352,
"avg_line_length": 41.104166666666664,
"alnum_prop": 0.6188545362392296,
"repo_name": "hunch/hunch-sample-app",
"id": "47aa1027c48f6e15f2c98a191c686534b08288fd",
"size... |
from six.moves import range
import matplotlib.pyplot as plt
from striatum.storage import (
MemoryHistoryStorage,
MemoryModelStorage,
MemoryActionStorage,
Action,
)
from striatum.bandit import UCB1
from striatum import simulation
def main():
context_dimension = 5
action_storage = MemoryActionS... | {
"content_hash": "2dac3facec91ce0b3ad77b5af255c1ff",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 26.794871794871796,
"alnum_prop": 0.6564593301435406,
"repo_name": "ntucllab/striatum",
"id": "c3cbc221e7dbfb9003d559e03408239b1a0e6acf",
"size": "10... |
from __future__ import print_function
import sqlite3, zlib
import sys
#Implements https://github.com/mapbox/mbtiles-spec/blob/master/1.2/spec.md
class MBTiles(object):
def __init__(self, filename):
self.conn = sqlite3.connect(filename)
self.c = self.conn.cursor()
self.schemaReady = False
def __del__(self):
... | {
"content_hash": "089e748e7d568f08340bd8017a197b92",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 118,
"avg_line_length": 27.45925925925926,
"alnum_prop": 0.6725114647963313,
"repo_name": "TimSC/pyMbTiles",
"id": "4ffd84c8f70f9dc598c3c6f1449e9a486ba5e1f9",
"size": "370... |
import os
import shutil
import tempfile
import unittest
from profile_creators.history_profile_extender import HistoryProfileExtender
from telemetry import decorators
from telemetry.testing import options_for_unittests
import mock # pylint: disable=import-error
# Testing private method.
# pylint: disable=protected-... | {
"content_hash": "6dc349f1d337e8fb14e452d49ddabbb4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 36.578947368421055,
"alnum_prop": 0.7496402877697842,
"repo_name": "ltilve/ChromiumGStreamerBackend",
"id": "66de67fcff5611e7db4cde6f94014d6dc99fc19e",... |
from db_edu_util import all_pred
from string import ascii_lowercase, ascii_uppercase
def test_all_pred():
assert all_pred(lambda x: x > 0, [10, 20, 30, 40]) == True
assert all_pred(lambda x: x > 0, [0, 20, 30, 40]) == False
assert all_pred(lambda x: x > 0, [20, 30, 0, 40]) == False
assert all_pred(lam... | {
"content_hash": "2c46bc70e585e7d16af8620a332aa3c8",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 78,
"avg_line_length": 48.27272727272727,
"alnum_prop": 0.664783427495292,
"repo_name": "databricks-edu/build-tooling",
"id": "499eb789df1de71906888bf068ac6ae5bed94ec9",
"s... |
from __future__ import print_function
import json
import socket
import sys
import threading
try:
# Python 3
import socketserver
except ImportError:
# Python 2
import SocketServer as socketserver
thesocket = None
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
... | {
"content_hash": "a7b5ca4528c5f3b450e5f0b4d328dad2",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 77,
"avg_line_length": 30.511904761904763,
"alnum_prop": 0.5595005852516582,
"repo_name": "operepo/ope",
"id": "00fe8bfbca4f02e906716ce094df1cc47bc92520",
"size": "3106",
... |
import tensorflow as tf
from argparse import ArgumentParser
from src.model import CryptoNet
from src.config import *
def build_parser():
parser = ArgumentParser()
parser.add_argument('--msg-len', type=int,
dest='msg_len', help='message length',
metavar='MSG_LE... | {
"content_hash": "9a900b0f149ca93a76661c04391a7dda",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 98,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.5669409124906507,
"repo_name": "ankeshanand/neural-cryptography-tensorflow",
"id": "74c93a3865dd915752c858eaa5958ec... |
from test_framework.test_framework import DrivercoinTestFramework
from test_framework.util import *
def check_array_result(object_array, to_match, expected):
"""
Pass in array of JSON objects, a dictionary with key/value pairs
to match against, and another dictionary with expected key/value
pairs.
... | {
"content_hash": "c7dd3b8732f17ccde814d9be8f0633a9",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 113,
"avg_line_length": 39.69767441860465,
"alnum_prop": 0.6417691857059168,
"repo_name": "drivercoin/drivercoin",
"id": "36668fcbca65b200ac053dba862ca6caad79b123",
"size":... |
from anvil.components.configurators import base
class Configurator(base.Configurator):
DB_NAME = "quantum"
PLUGIN_CLASS = "quantum.plugins.UNKNOWN"
def __init__(self, installer, configs, adjusters):
super(Configurator, self).__init__(
installer, configs)
self.config_adjusters... | {
"content_hash": "3d801bcfa2180590e427c2012938dc04",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 29.65625,
"alnum_prop": 0.6174920969441517,
"repo_name": "toby82/anvil",
"id": "e32f74a361b7d2f2739b7db60f449d4739545ce5",
"size": "1626",
"binary"... |
from msrest.serialization import Model
class EffectiveNetworkSecurityGroup(Model):
"""Effective network security group.
:param network_security_group: The ID of network security group that is
applied.
:type network_security_group:
~azure.mgmt.network.v2017_10_01.models.SubResource
:param as... | {
"content_hash": "2d20801ed093bd30e78d0d0be4cb3f8f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 115,
"avg_line_length": 45.794117647058826,
"alnum_prop": 0.7026332691072575,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "8cb4f05b949389c391d0bcb40b0c05faed93951c"... |
import logging
from copy import deepcopy
import mock
import pytest
from . import common
log = logging.getLogger(__file__)
class _PSUtilSwapStatsMock(object):
def __init__(self, sin, sout):
self.sin = sin
self.sout = sout
ORIG_SWAP_IN = float(115332743168)
ORIG_SWAP_OUT = float(22920884224)
S... | {
"content_hash": "c6fdffbf10e42cf69b2d59c1764b8b2c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 119,
"avg_line_length": 24.825,
"alnum_prop": 0.7069486404833837,
"repo_name": "DataDog/integrations-core",
"id": "df1a6d922cf842f8bb60c5443c440ae2e58e22b4",
"size": "1103"... |
import datetime
import sys
import time
import warnings
sys.path[0:0] = [""]
from bson.objectid import ObjectId
from bson.py3compat import text_type
from bson.son import SON
from pymongo import CursorType, monitoring, InsertOne, UpdateOne, DeleteOne
from pymongo.command_cursor import CommandCursor
from pymongo.errors ... | {
"content_hash": "3288db97b12f3e340a50878b595d8997",
"timestamp": "",
"source": "github",
"line_count": 1312,
"max_line_length": 80,
"avg_line_length": 48.958079268292686,
"alnum_prop": 0.5982438933258606,
"repo_name": "aherlihy/mongo-python-driver",
"id": "ad3803168dd1d0922c79fec2549729c6c701a3e0",
... |
import zeit.cms.testing
import zeit.wysiwyg.testing
def test_suite():
return zeit.cms.testing.FunctionalDocFileSuite(
'html.txt',
'reference.txt',
package='zeit.wysiwyg',
layer=zeit.wysiwyg.testing.WYSIWYGLayer)
| {
"content_hash": "9c5d5f9e2c3ab5d7700e5a25c62b55d7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 51,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "ZeitOnline/zeit.wysiwyg",
"id": "e456c03393ab3675cc332ebd88e0af16924a4daf",
"size": "250",
"binary": false,
... |
import os, sys
# to read dependencies from ./lib direcroty
script_dir = os.path.dirname( os.path.realpath(__file__) )
sys.path.insert(0, script_dir + os.sep + "lib")
import logging, boto3, json, random
# setup log level to DEBUG
log = logging.getLogger()
log.setLevel(logging.DEBUG)
# initialize DynamoDB client
dynamo... | {
"content_hash": "07862bb7263201d6e22d6454739a5407",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 66,
"avg_line_length": 25.032258064516128,
"alnum_prop": 0.6752577319587629,
"repo_name": "akranga/mafia-serverless",
"id": "4ba78130bc897d371227dccb24dd695d3c3ab30d",
"siz... |
import unittest
import numpy as np
from tffm import TFFMClassifier
from scipy import sparse as sp
import tensorflow as tf
import pickle
class TestFM(unittest.TestCase):
def setUp(self):
# Reproducibility.
np.random.seed(0)
n_samples = 20
n_features = 10
self.X = np.rando... | {
"content_hash": "7599d085a82922b7f5562661cf2a3d2d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 96,
"avg_line_length": 35.95454545454545,
"alnum_prop": 0.5152970922882427,
"repo_name": "geffy/tffm",
"id": "4890a32f40a59f6b82af5165e5feb0f2e9076efa",
"size": "3955",
... |
from django.conf.urls import url
from . import views
# Author: AHDS
# Creation date: 2016-06-23
# Modified by:
# Last modified date:
urlpatterns = [
url(r'^(\w+)/details/(\d+)', views.get_query_details, name='get_query_details'),
url(r'^(?P<app_id>[\w\-]+)', views.get_task_manager, name='get_task_manager'),
... | {
"content_hash": "6afe23afdd0d797035342a02e1752e62",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 84,
"avg_line_length": 24.76923076923077,
"alnum_prop": 0.6490683229813664,
"repo_name": "ceos-seo/Data_Cube_v2",
"id": "2895caf273677f555c2676c5d5d7dcc72a8d2a96",
"size": ... |
import datetime
from lxml import etree
import requests
from requests.exceptions import HTTPError
from .base import Item, Storage
from .http import HTTP_STORAGE_PARAMETERS, USERAGENT, prepare_auth, \
prepare_client_cert, prepare_verify
from .. import exceptions, log, utils
from ..utils.compat import text_type, to... | {
"content_hash": "4f005e95685a7b42839051b7aa8e204c",
"timestamp": "",
"source": "github",
"line_count": 821,
"max_line_length": 79,
"avg_line_length": 34.364190012180266,
"alnum_prop": 0.5374827207315777,
"repo_name": "tribut/vdirsyncer",
"id": "a778b1b8e95af842b76c7291d51933d7a504e88c",
"size": "2... |
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '... | {
"content_hash": "7d8fd9a01f5a63a0cf7eeb9f4d07551c",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 31.036496350364963,
"alnum_prop": 0.6549858889934148,
"repo_name": "jamesroutley/formation",
"id": "76dd126a47de05a8abb0be74aa745e970e20b4d2",
"size... |
"""
Copyright 2015 Brocade Communications Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | {
"content_hash": "d7240477c4e6cfb62af31d312f89c727",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 46.11594202898551,
"alnum_prop": 0.5725958516656191,
"repo_name": "SivagnanamCiena/pynos",
"id": "b876d48abbca03a123a911c6ce585644a2fc5901",
"size": ... |
index = []
def add_to_index(index,keyword,url):
flag = 0
count = 0
for lists in index:
if(lists[0]==keyword):
flag = 1
index[count][1].append(url)
count += 1
count = 0
if(flag == 0):
index.append([keyword,[url]])
add_to_index(in... | {
"content_hash": "7148628a551ab534c3ec3bd9d42f803b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 110,
"avg_line_length": 24.976744186046513,
"alnum_prop": 0.5577281191806331,
"repo_name": "akshaynagpal/python_web_crawler",
"id": "21066fd83ac9c60443c569689ed2e99e620c04f2"... |
"""
Copyright (C) 2010-2013, Ryan Fan <ryan.fan@oracle.com>
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; either version 2 of the License, or
(at your option) any later version.
This program... | {
"content_hash": "0ce90fef0e5a7d76fee60dd5d0ebe338",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 37.233333333333334,
"alnum_prop": 0.7421665174574754,
"repo_name": "rfancn/wxgigo",
"id": "61fa7ba0520d79cc73edf9fd416d3330cdcbffa5",
"size": "1154",... |
from lib import action
import json
class ConsulAclListAction(action.ConsulBaseAction):
def run(self):
acl_list = self.consul.acl.list()
print json.dumps(acl_list)
| {
"content_hash": "d8907666b4cd0b48b397086989a35b1a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.6989247311827957,
"repo_name": "pearsontechnology/st2contrib",
"id": "e17f6cd18cac169cd577e12dceac29f8414b1a68",
"... |
import hashlib
import random
from django.core.mail import send_mail
from django.template.loader import render_to_string
from account.conf import settings
class AccountDefaultHookSet(object):
def send_invitation_email(self, to, ctx):
subject = render_to_string("account/email/invite_user_subject.txt", ct... | {
"content_hash": "08da7ae526041f8e35eac0b27d909771",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 87,
"avg_line_length": 36.885714285714286,
"alnum_prop": 0.668861347792409,
"repo_name": "GeoNode/geonode-user-accounts",
"id": "606eee73d4ab1fd413f8797d124aed63f570f542",
... |
"""
.. module:: colorsParser
:synopsis: Parse the colors.xml file and return a list of Color objects
grouped by color group.
.. moduleauthor:: Hazen Babcock
"""
import os
from xml.etree import ElementTree
class Color(object):
"""
Color information class.
"""
def __init__(self, col... | {
"content_hash": "63f59611f5fa177043d8c234f1e03f11",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 104,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6323805060918463,
"repo_name": "HazenBabcock/opensdraw",
"id": "12c141557d386bcda8fe067ac84448bd760f4b86",
"siz... |
from yapsy.IPlugin import IPlugin
from yapsy.PluginManager import PluginManager
from django.template import loader, Context
from django.db.models import Count
from server.models import *
from django.shortcuts import get_object_or_404
import server.utils as utils
class MunkiVersion(IPlugin):
def plugin_type(self):
... | {
"content_hash": "e24120845d5620d20d344c75fb399f9a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 270,
"avg_line_length": 42.79245283018868,
"alnum_prop": 0.6256613756613757,
"repo_name": "macjustice/sal",
"id": "65677d90312103adf292103d14bc4f4b1eec9cc9",
"size": "2268"... |
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import re... | {
"content_hash": "7d47d17d6bdb837965a0e6dfd0e3752d",
"timestamp": "",
"source": "github",
"line_count": 575,
"max_line_length": 107,
"avg_line_length": 39.469565217391306,
"alnum_prop": 0.6152015862524786,
"repo_name": "googleapis/python-talent",
"id": "e47f291a7f340af83a2cf1ddd36461e739c51f83",
"s... |
from __future__ import print_function
from builtins import range
from six.moves import cPickle as pickle
import numpy as np
import os
from scipy.misc import imread
import platform
def load_pickle(f):
version = platform.python_version_tuple()
if version[0] == '2':
return pickle.load(f)
elif versio... | {
"content_hash": "fececf64d9ea5ac7d05197fc473fb0b0",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 79,
"avg_line_length": 35.6025641025641,
"alnum_prop": 0.5852838794862562,
"repo_name": "miguelfrde/stanford-cs231n",
"id": "a0b6136de55ff318728ead6be81bcf715ad17f10",
"si... |
import pytest
import pandas as pd
import pandas.util.testing as tm
from pandas.util.testing import ensure_clean
from pandas.io.excel import ExcelFile
xlrd = pytest.importorskip("xlrd")
xlwt = pytest.importorskip("xlwt")
@pytest.fixture(autouse=True)
def skip_ods_files(read_ext):
if read_ext == ".ods":
... | {
"content_hash": "bcef9c596fc92cc3cd5ffcd9dc798225",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 87,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6585365853658537,
"repo_name": "toobaz/pandas",
"id": "c4d99c827318debc8199c44cb43db730637bf153",
"size": "1148",... |
from django.template.loader import render_to_string
from django.utils.translation import (
pgettext_lazy, ugettext, ugettext_lazy as _)
import jinja2
import six
from olympia import amo
from olympia.amo.templatetags.jinja_helpers import urlparams
from olympia.amo.urlresolvers import reverse
@jinja2.contextfuncti... | {
"content_hash": "2a28d3f987fc7c88df939235616e8407",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 79,
"avg_line_length": 34.99,
"alnum_prop": 0.6176050300085739,
"repo_name": "aviarypl/mozilla-l10n-addons-server",
"id": "007016a603d7f0acb0ffebf9b163e1b4f21f4596",
"size... |
from __future__ import print_function, division
import sys, numpy as np
from numpy import complex128, zeros
def sf2f_rf(ff, eps, w2f, wab2sf):
from pyscf.nao.m_lorentzian import lorentzian
""" Get a function F(w) from it's spectral function A(w) in case of response-like function/spectral function
ff -- frequ... | {
"content_hash": "a36818edab9920003cd09204c52480f3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 110,
"avg_line_length": 38.31578947368421,
"alnum_prop": 0.6964285714285714,
"repo_name": "gkc1000/pyscf",
"id": "9f8e3502cd12348e7bee7b712c234d3a99e9cb4d",
"size": "728",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.