text stringlengths 0 1.05M | meta dict |
|---|---|
from awsutils.exceptions.aws import AWSException
class S3Exception(AWSException):
def __str__(self):
return "%s[%s]: %s"%(self.awsresponse['Error']['Code'], self.httpstatus, self.awsresponse['Error']['Message'])
class AccessDenied(S3Exception):
#Access Denied
HTTP_STATUS = 403
class AccountProbl... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/exceptions/s3.py",
"copies": "1",
"size": "11037",
"license": "mit",
"hash": 5001665218221263000,
"line_mean": 32.4484848485,
"line_max": 124,
"alpha_frac": 0.753284407,
"autogenerated": false,
"ratio": 4.10449981405727,
"config_test": false,
... |
from awsutils.exceptions.aws import AWSException
class SDBException(AWSException):
pass
class AccessFailure(SDBException):
#Access to the resource is denied
HTTP_STATUS = 403
class AttributeDoesNotExist(SDBException):
#Attribute does not exist
HTTP_STATUS = 404
class AuthFailure(SDBException):... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/exceptions/sdb.py",
"copies": "1",
"size": "7213",
"license": "mit",
"hash": -5346215912072394000,
"line_mean": 32.3981481481,
"line_max": 107,
"alpha_frac": 0.7180091501,
"autogenerated": false,
"ratio": 4.147786083956297,
"config_test": false,... |
from awsutils.exceptions.aws import AWSException
class SQSException(AWSException):
pass
class AccessDenied(SQSException):
#Access to the resource is denied
HTTP_STATUS = 403
class AuthFailure(SQSException):
#A value used for authentication could not be validated, such as Signature
HTTP_STATUS = ... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/exceptions/sqs.py",
"copies": "1",
"size": "4052",
"license": "mit",
"hash": -2069498206480526300,
"line_mean": 33.0588235294,
"line_max": 107,
"alpha_frac": 0.7376604146,
"autogenerated": false,
"ratio": 4.225234619395203,
"config_test": false,... |
from awsutils.awsclient import AWSClient
from awsutils.utils.auth import SIGNATURE_V2
import awsutils.exceptions.sqs
from awsutils.exceptions.aws import extractExceptionsFromModule2Dicitonary
class IAMClient(AWSClient):
def __init__(self, access_key, secret_key):
#IAM has only one endpoint
#IAM ca... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/iamclient.py",
"copies": "1",
"size": "1733",
"license": "mit",
"hash": 6881417794793472000,
"line_mean": 45.8648648649,
"line_max": 120,
"alpha_frac": 0.6451240623,
"autogenerated": false,
"ratio": 4.145933014354067,
"config_test": false,
"ha... |
import os, hashlib, logging
from awsutils.s3.object import S3Object
from awsutils.utils.wrappers import SimpleWindowedFileObjectReadWrapper, SimpleMd5FileObjectWriteWrapper
from awsutils.exceptions.aws import AWSPartialReception, IntegrityCheckException, UserInputException
class S3Bucket():
def __init__(self, nam... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/s3/bucket.py",
"copies": "1",
"size": "14159",
"license": "mit",
"hash": -4818747995694132000,
"line_mean": 45.1205211726,
"line_max": 124,
"alpha_frac": 0.566494809,
"autogenerated": false,
"ratio": 4.630150425114454,
"config_test": false,
"h... |
import time, io, socket, tempfile, logging
import http.client
import xml.sax
try:
from select import poll as select_poll
from select import POLLIN as select_POLLIN
except ImportError: # Doesn't exist on OSX and other platforms
from select import select
select_poll = False
from awsutils.utils.xmlhan... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/awsclient.py",
"copies": "1",
"size": "14196",
"license": "mit",
"hash": -9175842377915959000,
"line_mean": 44.6463022508,
"line_max": 124,
"alpha_frac": 0.5220484644,
"autogenerated": false,
"ratio": 4.967109867039888,
"config_test": false,
"... |
import binascii, base64, json, hashlib, time
from awsutils.exceptions.aws import UserInputException, IntegrityCheckException, extractExceptionsFromModule2Dicitonary
from awsutils.awsclient import AWSClient
from awsutils.utils.auth import SIGNATURE_S3_REST
import awsutils.exceptions.s3
from awsutils.utils.auth import u... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/s3client.py",
"copies": "1",
"size": "27069",
"license": "mit",
"hash": -6111020762929860000,
"line_mean": 53.5745967742,
"line_max": 123,
"alpha_frac": 0.5859839669,
"autogenerated": false,
"ratio": 3.9995567375886525,
"config_test": false,
"... |
from awsutils.s3client import S3Client
from awsutils.s3.bucket import S3Bucket
class S3Service:
def __init__(self, s3client):
"""
@param s3client: the s3client to be used for communication
@type s3client: S3Client
"""
self.s3client = s3client
def getBucket(self, name):... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/s3/service.py",
"copies": "1",
"size": "1202",
"license": "mit",
"hash": -9143069111524944000,
"line_mean": 28.3170731707,
"line_max": 111,
"alpha_frac": 0.5865224626,
"autogenerated": false,
"ratio": 3.8774193548387097,
"config_test": false,
... |
import hashlib, time
import awsutils.exceptions.sqs
from awsutils.exceptions.aws import UserInputException, IntegrityCheckException, extractExceptionsFromModule2Dicitonary
from awsutils.utils.auth import urlquote
from awsutils.awsclient import AWSClient
from awsutils.iamclient import IAMClient
from awsutils.utils.auth... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/sqsclient.py",
"copies": "1",
"size": "21664",
"license": "mit",
"hash": -1733620268032434200,
"line_mean": 48.3507972665,
"line_max": 128,
"alpha_frac": 0.6003508124,
"autogenerated": false,
"ratio": 4.235386119257087,
"config_test": false,
"... |
import time
from awsutils.exceptions.aws import UserInputException
class SQSMessage:
def __init__(self, messageBody=None, queue=None):
self.messageBody = messageBody
self.receiptHandle = None
self.queue = None
def getBody(self):
return self.messageBody
def setBody(self, ... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/sqs/message.py",
"copies": "1",
"size": "1549",
"license": "mit",
"hash": -1632423533953449500,
"line_mean": 35.880952381,
"line_max": 110,
"alpha_frac": 0.6991607489,
"autogenerated": false,
"ratio": 4.141711229946524,
"config_test": false,
"... |
import time, logging
from awsutils.exceptions.aws import UserInputException
from awsutils.sqs.message import SQSMessage
class SQSQueue:
COOLDOWN_BETWEEN_RECEIVEMESSAGES = 1
def __init__(self, qName, sqsclient, loadAttributes=True):
"""
@param qName: the SQS queue name
@type qName: st... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/sqs/queue.py",
"copies": "1",
"size": "6252",
"license": "mit",
"hash": -6133323573348225000,
"line_mean": 37.5925925926,
"line_max": 109,
"alpha_frac": 0.5668586052,
"autogenerated": false,
"ratio": 4.861586314152411,
"config_test": false,
"h... |
from awsutils.exceptions.sqs import AWS_SimpleQueueService_NonExistentQueue
from awsutils.sqs.queue import SQSQueue
class SQSService:
def __init__(self, sqsclient):
"""
@param sqsclient: the s3client to be used for communication
@type sqsclient: SQSClient
"""
self.sqsclien... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/sqs/service.py",
"copies": "1",
"size": "1411",
"license": "mit",
"hash": -6140420616909543000,
"line_mean": 38.2222222222,
"line_max": 105,
"alpha_frac": 0.6917080085,
"autogenerated": false,
"ratio": 3.9858757062146895,
"config_test": false,
... |
import time, functools, xml
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.gen
import tornado.httpclient
from awsutils.utils.xmlhandler import AWSXMLHandler
from awsutils.exceptions.aws import AWSStatusException, AWSDataException
import awsutils.utils.auth as auth
class AWSClient:... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/tornado/awsclient.py",
"copies": "1",
"size": "4956",
"license": "mit",
"hash": 9065309104024084000,
"line_mean": 39.3008130081,
"line_max": 129,
"alpha_frac": 0.610976594,
"autogenerated": false,
"ratio": 4.493200362647325,
"config_test": false... |
import functools, collections
from types import MethodType
import tornado.gen
from awsutils.tornado.awsclient import AWSClient
from awsutils.exceptions.aws import UserInputException, extractExceptionsFromModule2Dicitonary
import awsutils.exceptions.sdb
from awsutils.utils.auth import SIGNATURE_V2
import awsutils.sdbcl... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/tornado/sdbclient.py",
"copies": "1",
"size": "14871",
"license": "mit",
"hash": -3385836461174824400,
"line_mean": 45.6206896552,
"line_max": 120,
"alpha_frac": 0.597538834,
"autogenerated": false,
"ratio": 4.424576019041952,
"config_test": tru... |
import functools
from types import MethodType
import tornado.gen
from awsutils.tornado.awsclient import AWSClient
from awsutils.exceptions.aws import UserInputException, extractExceptionsFromModule2Dicitonary
import awsutils.exceptions.s3
from awsutils.utils.auth import SIGNATURE_S3_REST
from awsutils.utils.auth impor... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/tornado/s3client.py",
"copies": "1",
"size": "5978",
"license": "mit",
"hash": -4200391321585894400,
"line_mean": 42.6423357664,
"line_max": 120,
"alpha_frac": 0.612746738,
"autogenerated": false,
"ratio": 3.8919270833333335,
"config_test": fals... |
import functools
from types import MethodType
import tornado.gen
from awsutils.tornado.awsclient import AWSClient
from awsutils.iamclient import IAMClient
from awsutils.exceptions.aws import UserInputException, extractExceptionsFromModule2Dicitonary
import awsutils.exceptions.sqs
from awsutils.utils.auth import SIGNAT... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/tornado/sqsclient.py",
"copies": "1",
"size": "6050",
"license": "mit",
"hash": 4811059775016240000,
"line_mean": 49.0082644628,
"line_max": 122,
"alpha_frac": 0.6401652893,
"autogenerated": false,
"ratio": 4.183955739972338,
"config_test": fals... |
import time, hmac, hashlib, base64
QUERIES_OF_INTEREST = {'acl', 'cors', 'defaultObjectAcl', 'location', 'logging',
'partNumber', 'policy', 'requestPayment', 'torrent',
'versioning', 'versionId', 'versions', 'website',
'uploads', 'uploadId', 'respon... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/utils/auth.py",
"copies": "1",
"size": "10599",
"license": "mit",
"hash": 1523639718106979800,
"line_mean": 39.1515151515,
"line_max": 117,
"alpha_frac": 0.6010000943,
"autogenerated": false,
"ratio": 3.5940996948118005,
"config_test": false,
... |
import os, io, hashlib
class SimpleMd5FileObjectWriteWrapper:
def __init__(self, obj):
self.obj = obj
self.reset()
def write(self, data):
self.md5.update(data)
self.obj.write(data)
def tell(self):
self.obj.tell()
def seek(self, offset, whence=io.SEEK_SET):
... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/utils/wrappers.py",
"copies": "1",
"size": "3224",
"license": "mit",
"hash": 8943798234968223000,
"line_mean": 27.5309734513,
"line_max": 78,
"alpha_frac": 0.5403225806,
"autogenerated": false,
"ratio": 3.76196032672112,
"config_test": false,
... |
from xml.sax import ContentHandler
class AWSXMLHandler(ContentHandler):
def __init__(self):
self.xml = None
self.stack = [None]
ContentHandler.__init__(self)
def reset(self):
self.xml = None
self.stack = [None]
def getdict(self):
return self.xml
def s... | {
"repo_name": "sanyi/awsutils",
"path": "awsutils/utils/xmlhandler.py",
"copies": "1",
"size": "1859",
"license": "mit",
"hash": -5808928805759809000,
"line_mean": 29,
"line_max": 75,
"alpha_frac": 0.5513717052,
"autogenerated": false,
"ratio": 4.140311804008909,
"config_test": false,
"has_no... |
"""awu URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based v... | {
"repo_name": "hwang3419/awu",
"path": "awu/awu/urls.py",
"copies": "1",
"size": "1426",
"license": "mit",
"hash": -7124407465229120000,
"line_mean": 34.65,
"line_max": 77,
"alpha_frac": 0.7208976157,
"autogenerated": false,
"ratio": 3.4444444444444446,
"config_test": false,
"has_no_keywords"... |
# awx.main.utils.reload
from awx.main.utils import reload
def test_produce_supervisor_command(mocker):
communicate_mock = mocker.MagicMock(return_value=('Everything is fine', ''))
mock_process = mocker.MagicMock()
mock_process.communicate = communicate_mock
Popen_mock = mocker.MagicMock(return_value=m... | {
"repo_name": "snahelou/awx",
"path": "awx/main/tests/unit/utils/test_reload.py",
"copies": "1",
"size": "2012",
"license": "apache-2.0",
"hash": -9179549071842164000,
"line_mean": 45.7906976744,
"line_max": 107,
"alpha_frac": 0.6833996024,
"autogenerated": false,
"ratio": 3.753731343283582,
"c... |
# AWX
from awx.main.models import (
WorkflowJobTemplateNode,
WorkflowJobTemplate,
)
from awx.main.models.jobs import JobTemplate
def do_init_workflow(job_template_success, job_template_fail, job_template_never, jts_parallel):
wfjt, created = WorkflowJobTemplate.objects.get_or_create(name="parallel workflo... | {
"repo_name": "wwitzel3/awx",
"path": "awx/main/tests/manual/workflows/parallel.py",
"copies": "4",
"size": "1770",
"license": "apache-2.0",
"hash": -3588515273763045000,
"line_mean": 35.875,
"line_max": 135,
"alpha_frac": 0.713559322,
"autogenerated": false,
"ratio": 3.2899628252788102,
"confi... |
""" A wxPython based color gradient editor for vtkLookupTables and
color transfer functions.
This code is distributed under the conditions of the BSD license.
Based on a Tk version of this widget by Gerald Knizia <cgk.d@gmx.net>
Ported to wxPython by Pete Schmitt <schmitt@colorado.edu>
Cleaned up and enhanced for use... | {
"repo_name": "liulion/mayavi",
"path": "tvtk/util/wx_gradient_editor.py",
"copies": "2",
"size": "20806",
"license": "bsd-3-clause",
"hash": -4709667739632684000,
"line_mean": 38.7820267686,
"line_max": 96,
"alpha_frac": 0.5350860329,
"autogenerated": false,
"ratio": 4.111857707509881,
"config... |
# AWX settings file
import os
def get_secret():
if os.path.exists("/etc/tower/SECRET_KEY"):
return file('/etc/tower/SECRET_KEY', 'rb').read().strip()
return os.getenv("SECRET_KEY", "privateawx"),
ADMINS = ()
STATIC_ROOT = '/var/lib/awx/public/static'
PROJECTS_ROOT = '/var/lib/awx/projects'
JOBOU... | {
"repo_name": "snahelou/awx",
"path": "installer/image_build/files/settings.py",
"copies": "1",
"size": "3933",
"license": "apache-2.0",
"hash": -2332050514809554000,
"line_mean": 34.4324324324,
"line_max": 115,
"alpha_frac": 0.6231884058,
"autogenerated": false,
"ratio": 3.402249134948097,
"co... |
# AWX settings file
import os
def get_secret():
if os.path.exists("/etc/tower/SECRET_KEY"):
return open('/etc/tower/SECRET_KEY', 'rb').read().strip()
ADMINS = ()
STATIC_ROOT = '/var/lib/awx/public/static'
PROJECTS_ROOT = '/var/lib/awx/projects'
AWX_ANSIBLE_COLLECTIONS_PATHS = '/var/lib/awx/vendor/aw... | {
"repo_name": "GoogleCloudPlatform/sap-deployment-automation",
"path": "third_party/github.com/ansible/awx/installer/roles/image_build/files/settings.py",
"copies": "1",
"size": "2976",
"license": "apache-2.0",
"hash": -4023351216367805000,
"line_mean": 32.4382022472,
"line_max": 87,
"alpha_frac": 0.... |
, ax2, ax3) import numpy as np
import wave
import struct
import pyaudio
from scipy.signal import welch, butter, lfilter, savgol_filter
import os as os
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
CHUNK_SIZE = 4096
RATE = 44100
FORMAT = pyau... | {
"repo_name": "oesst/Sound_Analytics",
"path": "evaluation/compare_ITD_ILD_multiple_files.py",
"copies": "1",
"size": "9494",
"license": "mit",
"hash": -2790418059273267700,
"line_mean": 32.5477031802,
"line_max": 131,
"alpha_frac": 0.6441963345,
"autogenerated": false,
"ratio": 2.714898484415213... |
"""Axe-core accessibility analysis collectors."""
from collections.abc import Collection
from typing import Any
from base_collectors import JSONFileSourceCollector
from collector_utilities.functions import md5_hash, match_string_or_regular_expression
from source_model import Entities, Entity, SourceResponses
class ... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/src/source_collectors/axe_core/accessibility.py",
"copies": "1",
"size": "3831",
"license": "apache-2.0",
"hash": -4726967919153413000,
"line_mean": 46.8875,
"line_max": 120,
"alpha_frac": 0.5920125294,
"autogenerated": false,
"rati... |
"""Axe CSV accessibility collector."""
import csv
import re
from io import StringIO
from base_collectors import CSVFileSourceCollector
from collector_utilities.functions import md5_hash
from source_model import Entities, Entity, SourceResponses
class AxeCSVAccessibility(CSVFileSourceCollector):
"""Collector cla... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/src/source_collectors/axe_csv/accessibility.py",
"copies": "1",
"size": "1699",
"license": "apache-2.0",
"hash": -5442778316211710000,
"line_mean": 39.4523809524,
"line_max": 115,
"alpha_frac": 0.6115361978,
"autogenerated": false,
... |
//Axel --- Api de prueba que funciona con zip codes.
import datetime
import json
import urllib.request
def time_converter(time):
converted_time = datetime.datetime.fromtimestamp(
int(time)
).strftime('%I:%M %p')
return converted_time
def url_builder(city_id):
user_api = '57fe... | {
"repo_name": "grupoprog3/proyecto_final",
"path": "prueba_de_Api_con_zip_code_Axel.py",
"copies": "1",
"size": "2817",
"license": "apache-2.0",
"hash": 1919966564412436700,
"line_mean": 36.0675675676,
"line_max": 154,
"alpha_frac": 0.5807596734,
"autogenerated": false,
"ratio": 3.318021201413427... |
import sys
from threading import Thread, RLock
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty
class Event(object):
"""
Event object inspired by C# events. Handlers can be registered and
unregistered using += and -= operators. Execution and re... | {
"repo_name": "axel-events/axel",
"path": "axel/axel.py",
"copies": "2",
"size": "15096",
"license": "mit",
"hash": -7391939415585112000,
"line_mean": 36.6086956522,
"line_max": 108,
"alpha_frac": 0.4985426603,
"autogenerated": false,
"ratio": 4.630674846625767,
"config_test": false,
"has_no_... |
"""Axe sources."""
from ..meta.entity import Color
from ..meta.source import Source
from ..parameters import access_parameters, MultipleChoiceParameter, MultipleChoiceWithAdditionParameter
ALL_AXE_CORE_METRICS = ["accessibility", "source_up_to_dateness", "source_version"]
IMPACT = MultipleChoiceParameter(
name... | {
"repo_name": "ICTU/quality-time",
"path": "components/server/src/data_model/sources/axe.py",
"copies": "1",
"size": "6746",
"license": "apache-2.0",
"hash": 6021162100679647000,
"line_mean": 35.2688172043,
"line_max": 110,
"alpha_frac": 0.4909576045,
"autogenerated": false,
"ratio": 4.5797691785... |
# axes.py
from pymol.cgo import *
from pymol import cmd
from pymol.vfont import plain
# create the axes object, draw axes with cylinders coloured red, green,
#blue for X, Y and Z
def drawAxes():
obj = [
CYLINDER, 0., 0., 0., 10., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.,
CYLINDER, 0., 0., 0., 0., 10., 0.,... | {
"repo_name": "julianheinrich/viewpoints",
"path": "axes.py",
"copies": "1",
"size": "1087",
"license": "mit",
"hash": -3036677380008920600,
"line_mean": 31.9393939394,
"line_max": 109,
"alpha_frac": 0.5436982521,
"autogenerated": false,
"ratio": 1.9981617647058822,
"config_test": false,
"has... |
"""AXI Memory Mapped Slave Model."""
from ..abshdl.module import HDLModule, HDLModuleParameter
from ..abshdl.port import HDLModulePort
from ..abshdl.expr import HDLExpression
from ..abshdl.signal import HDLSignal
from ..abshdl.comment import HDLComment, make_comment
from ..abshdl.assign import HDLAssignment
from ..abs... | {
"repo_name": "brunosmmm/hdltools",
"path": "hdltools/hdllib/aximm.py",
"copies": "1",
"size": "11283",
"license": "mit",
"hash": 8452050441337429000,
"line_mean": 28.7704485488,
"line_max": 80,
"alpha_frac": 0.5604006027,
"autogenerated": false,
"ratio": 2.9841311822269243,
"config_test": fals... |
axioms = {
'ax-1': '( ph -> ( ps -> ph ) )',
'ax-2': '( ( ph -> ( ps -> ch ) ) -> ( ( ph -> ps ) -> ( ph -> ch ) ) )',
'ax-3': '( ( -. ph -> -. ps ) -> ( ps -> ph ) )',
'ax-mp': {
'e': ['ph', '( ph -> ps )'],
'a': 'ps',
},
'ax-4': '( A. x ph -> ph )',
'ax-5': '( A. x ( ph -> ... | {
"repo_name": "sorear/metamath-turing-machines",
"path": "zfgen.py",
"copies": "1",
"size": "4083",
"license": "mit",
"hash": 1531750277535227100,
"line_mean": 33.6016949153,
"line_max": 171,
"alpha_frac": 0.3962772471,
"autogenerated": false,
"ratio": 2.407429245283019,
"config_test": false,
... |
# axis3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import copy
from matplotlib import lines as mlines, ... | {
"repo_name": "louisLouL/pair_trading",
"path": "capstone_env/lib/python3.6/site-packages/mpl_toolkits/mplot3d/axis3d.py",
"copies": "2",
"size": "18762",
"license": "mit",
"hash": 9018689328625524000,
"line_mean": 37.8447204969,
"line_max": 86,
"alpha_frac": 0.536030274,
"autogenerated": false,
... |
"""Axis binary sensor platform tests."""
from homeassistant.components.axis.const import DOMAIN as AXIS_DOMAIN
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
DOMAIN as BINARY_SENSOR_DOMAIN,
)
from homeassistant.setup import async_setup_component
from .test_device import NAME, setup_... | {
"repo_name": "pschmitt/home-assistant",
"path": "tests/components/axis/test_binary_sensor.py",
"copies": "6",
"size": "2044",
"license": "apache-2.0",
"hash": -8893880815474514000,
"line_mean": 28.6231884058,
"line_max": 73,
"alpha_frac": 0.6516634051,
"autogenerated": false,
"ratio": 3.58596491... |
"""Axis binary sensor platform tests."""
from unittest.mock import Mock
from homeassistant import config_entries
from homeassistant.components import axis
from homeassistant.setup import async_setup_component
import homeassistant.components.binary_sensor as binary_sensor
EVENTS = [
{
"operation": "Initi... | {
"repo_name": "fbradyirl/home-assistant",
"path": "tests/components/axis/test_binary_sensor.py",
"copies": "1",
"size": "3046",
"license": "apache-2.0",
"hash": 7344144833813007000,
"line_mean": 26.9449541284,
"line_max": 86,
"alpha_frac": 0.6467498359,
"autogenerated": false,
"ratio": 3.52546296... |
"""Axis camera platform tests."""
from homeassistant.components import camera
from homeassistant.components.axis.const import (
CONF_STREAM_PROFILE,
DOMAIN as AXIS_DOMAIN,
)
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.const import STATE_IDLE
from homeassistant.setup i... | {
"repo_name": "soldag/home-assistant",
"path": "tests/components/axis/test_camera.py",
"copies": "5",
"size": "2718",
"license": "apache-2.0",
"hash": 1241333572200920000,
"line_mean": 32.975,
"line_max": 98,
"alpha_frac": 0.6887417219,
"autogenerated": false,
"ratio": 3.372208436724566,
"confi... |
"""Axis camera platform tests."""
from unittest.mock import Mock
from homeassistant import config_entries
from homeassistant.components import axis
from homeassistant.setup import async_setup_component
import homeassistant.components.camera as camera
ENTRY_CONFIG = {
axis.CONF_DEVICE: {
axis.config_flo... | {
"repo_name": "jamespcole/home-assistant",
"path": "tests/components/axis/test_camera.py",
"copies": "1",
"size": "2113",
"license": "apache-2.0",
"hash": 6679387577070548000,
"line_mean": 27.9452054795,
"line_max": 77,
"alpha_frac": 0.6706105064,
"autogenerated": false,
"ratio": 3.68760907504363... |
"""Axis camera platform tests."""
from unittest.mock import Mock
from homeassistant import config_entries
from homeassistant.components import axis
import homeassistant.components.camera as camera
from homeassistant.setup import async_setup_component
ENTRY_CONFIG = {
axis.CONF_DEVICE: {
axis.config_flow.... | {
"repo_name": "leppa/home-assistant",
"path": "tests/components/axis/test_camera.py",
"copies": "1",
"size": "2197",
"license": "apache-2.0",
"hash": -5240876228288944000,
"line_mean": 26.8101265823,
"line_max": 79,
"alpha_frac": 0.6631770596,
"autogenerated": false,
"ratio": 3.686241610738255,
... |
"""Axis class and associated."""
# --- import --------------------------------------------------------------------------------------
import re
import numexpr
import operator
import functools
import numpy as np
from .. import exceptions as wt_exceptions
from .. import kit as wt_kit
from .. import units as wt_units... | {
"repo_name": "wright-group/WrightTools",
"path": "WrightTools/data/_axis.py",
"copies": "1",
"size": "6659",
"license": "mit",
"hash": -9165828915238299000,
"line_mean": 30.1168224299,
"line_max": 99,
"alpha_frac": 0.540621715,
"autogenerated": false,
"ratio": 4.2576726342711,
"config_test": f... |
"""Axis network device abstraction."""
import asyncio
import async_timeout
from homeassistant.const import (
CONF_DEVICE, CONF_HOST, CONF_MAC, CONF_NAME, CONF_PASSWORD, CONF_PORT,
CONF_USERNAME)
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant... | {
"repo_name": "jabesq/home-assistant",
"path": "homeassistant/components/axis/device.py",
"copies": "2",
"size": "7563",
"license": "apache-2.0",
"hash": -8974238957853105000,
"line_mean": 32.0262008734,
"line_max": 78,
"alpha_frac": 0.6189342853,
"autogenerated": false,
"ratio": 4.33161512027491... |
"""Axis network device abstraction."""
import asyncio
import async_timeout
import axis
from axis.configuration import Configuration
from axis.errors import Unauthorized
from axis.event_stream import OPERATION_INITIALIZED
from axis.mqtt import mqtt_json_to_event
from axis.streammanager import SIGNAL_PLAYING, STATE_STO... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/axis/device.py",
"copies": "1",
"size": "10402",
"license": "apache-2.0",
"hash": -7902852732754401000,
"line_mean": 31.3043478261,
"line_max": 90,
"alpha_frac": 0.6220919054,
"autogenerated": false,
"ratio": 4.36508602601... |
"""Axis network device abstraction."""
import asyncio
import async_timeout
import axis
from axis.streammanager import SIGNAL_PLAYING
from homeassistant.const import (
CONF_DEVICE,
CONF_HOST,
CONF_MAC,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
)
from homeassistant.core import cal... | {
"repo_name": "leppa/home-assistant",
"path": "homeassistant/components/axis/device.py",
"copies": "1",
"size": "7537",
"license": "apache-2.0",
"hash": 7143236128262481000,
"line_mean": 30.6680672269,
"line_max": 87,
"alpha_frac": 0.6184158153,
"autogenerated": false,
"ratio": 4.287258248009101,... |
"""Axis network device abstraction."""
import asyncio
import async_timeout
import axis
from axis.streammanager import SIGNAL_PLAYING
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
)
from homeassistant.core import callback
from homeassistant.except... | {
"repo_name": "Teagan42/home-assistant",
"path": "homeassistant/components/axis/device.py",
"copies": "2",
"size": "7651",
"license": "apache-2.0",
"hash": 6530516866699059000,
"line_mean": 30.8791666667,
"line_max": 86,
"alpha_frac": 0.6150829957,
"autogenerated": false,
"ratio": 4.3250423968343... |
"""Axis."""
# --- import --------------------------------------------------------------------------------------
import numpy as np
# --- define --------------------------------------------------------------------------------------
__all__ = ['Axis']
# --- class ------------------------------------------------... | {
"repo_name": "wright-group/WrightSim",
"path": "WrightSim/experiment/_axis.py",
"copies": "1",
"size": "1271",
"license": "mit",
"hash": -2925836630146921500,
"line_mean": 27.2444444444,
"line_max": 99,
"alpha_frac": 0.4453186467,
"autogenerated": false,
"ratio": 4.588447653429603,
"config_tes... |
"""Axis switch platform tests."""
from copy import deepcopy
from unittest.mock import AsyncMock, patch
from homeassistant.components.axis.const import DOMAIN as AXIS_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
... | {
"repo_name": "sander76/home-assistant",
"path": "tests/components/axis/test_switch.py",
"copies": "5",
"size": "4458",
"license": "apache-2.0",
"hash": -8896739964963353000,
"line_mean": 29.3265306122,
"line_max": 75,
"alpha_frac": 0.6489457156,
"autogenerated": false,
"ratio": 3.339325842696629... |
"""Axis transform for spherical Mercator projection in matplotlib."""
__author__ = "Eric Jansen"
__email__ = "eric@xyrion.org"
import numpy as np
from matplotlib.ticker import AutoLocator
from matplotlib.transforms import Transform
from matplotlib.scale import ScaleBase
from .ticker import DegreeFormatter
class Mer... | {
"repo_name": "ej81/mercator",
"path": "mercator/scale.py",
"copies": "1",
"size": "2832",
"license": "bsd-2-clause",
"hash": 7595920577684060000,
"line_mean": 31.1818181818,
"line_max": 85,
"alpha_frac": 0.6101694915,
"autogenerated": false,
"ratio": 4.034188034188034,
"config_test": false,
... |
"""Axis Vapix parameter management.
https://www.axis.com/vapix-library/#/subjects/t10037719/section/t10036014
Lists Brand, Image, Ports, Properties, PTZ, Stream profiles.
"""
import asyncio
from typing import Any, Callable, Dict, Optional, Union
from .api import APIItem, APIItems
from .stream_profiles import Stream... | {
"repo_name": "Kane610/axis",
"path": "axis/param_cgi.py",
"copies": "1",
"size": "17352",
"license": "mit",
"hash": 9066073676115322000,
"line_mean": 29.9839285714,
"line_max": 99,
"alpha_frac": 0.5599100916,
"autogenerated": false,
"ratio": 4.148971783835486,
"config_test": false,
"has_no_k... |
"""Axis Vapix port management.
https://www.axis.com/vapix-library/#/subjects/t10037719/section/t10074527
I/O port API. Digital input and output ports.
General purpose I/O service API. Extends I/O port API with support for
supervised I/Os and relay connectors.
Virtual input API.
"""
from typing import Callable
fr... | {
"repo_name": "Kane610/axis",
"path": "axis/port_cgi.py",
"copies": "1",
"size": "3658",
"license": "mit",
"hash": 3697270124666034700,
"line_mean": 28.264,
"line_max": 75,
"alpha_frac": 0.6038819027,
"autogenerated": false,
"ratio": 3.899786780383795,
"config_test": false,
"has_no_keywords":... |
"""Axis Vapix user management.
https://www.axis.com/vapix-library/#/subjects/t10037719/section/t10036044
user: The user account name (1-14 characters), a non-existing user
account name. Valid characters are a-z, A-Z and 0-9.
pwd: The unencrypted password (1-64 characters) for the account.
ASCII characters fro... | {
"repo_name": "Kane610/axis",
"path": "axis/pwdgrp_cgi.py",
"copies": "1",
"size": "4055",
"license": "mit",
"hash": 8474602846664147000,
"line_mean": 26.3986486486,
"line_max": 88,
"alpha_frac": 0.5753390875,
"autogenerated": false,
"ratio": 3.6531531531531534,
"config_test": false,
"has_no_... |
# axod_compn.py
"""
axod_compn.py - axod component.
allows to get input values from other components
modifies input file with new values
executes axod code
input values: input_filename = input filename
use as: Axod_Compn(input_filename=' ')
... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/OpenMDAO-Framework-dev/contrib/axod/axod_compn.py",
"copies": "1",
"size": "5901",
"license": "mit",
"hash": -5325451641121297000,
"line_mean": 29.2615384615,
"line_max": 83,
"alpha_frac": 0.5463480766,
"autogenerated": false,
"ratio":... |
"""`AxonMapModel`, `AxonMapSpatial` [Beyeler2019]_"""
import os
import numpy as np
import pickle
from scipy.spatial import cKDTree
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from ..utils import parfor, Watson2014Transform
from ..utils.constants import ZORDER
from ..implants import Prosthe... | {
"repo_name": "mbeyeler/pulse2percept",
"path": "pulse2percept/models/beyeler2019.py",
"copies": "1",
"size": "37181",
"license": "bsd-3-clause",
"hash": -4891510375843707000,
"line_mean": 43.5815347722,
"line_max": 80,
"alpha_frac": 0.5801619107,
"autogenerated": false,
"ratio": 3.89942317776612... |
"""`AxonMapModel`, `AxonMapSpatial` [Beyeler2019]_"""
import os
import numpy as np
import pickle
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from ..utils import parfor, Grid2D, Watson2014Transform
from ..implants import ProsthesisSystem, ElectrodeArray
from ..stimuli import Stimulus
from .... | {
"repo_name": "uwescience/pulse2percept",
"path": "pulse2percept/models/beyeler2019.py",
"copies": "1",
"size": "30890",
"license": "bsd-3-clause",
"hash": -3048550338551631000,
"line_mean": 43.898255814,
"line_max": 79,
"alpha_frac": 0.5657494335,
"autogenerated": false,
"ratio": 3.8211281543790... |
"""AXScript Client Framework
This module provides a core framework for an ActiveX Scripting client.
Derived classes actually implement the AX Client itself, including the
scoping rules, etc.
There are classes defined for the engine itself, and for ScriptItems
"""
import sys
from win32com.axscript import axscr... | {
"repo_name": "SublimeText/Pywin32",
"path": "lib/x32/win32comext/axscript/client/framework.py",
"copies": "5",
"size": "36794",
"license": "bsd-3-clause",
"hash": 5615254680472800000,
"line_mean": 35.1079489696,
"line_max": 193,
"alpha_frac": 0.7334076208,
"autogenerated": false,
"ratio": 3.2349... |
"""AXScript Client Framework
This module provides a core framework for an ActiveX Scripting client.
Derived classes actually implement the AX Client itself, including the
scoping rules, etc.
There are classes defined for the engine itself, and for ScriptItems
"""
import sys
from win32com.axscript imp... | {
"repo_name": "zhanqxun/cv_fish",
"path": "win32comext/axscript/client/framework.py",
"copies": "1",
"size": "37789",
"license": "apache-2.0",
"hash": 374715024174110460,
"line_mean": 35.1208251473,
"line_max": 193,
"alpha_frac": 0.7146788748,
"autogenerated": false,
"ratio": 3.3156971132754234,
... |
from struct import *
import AxysCalendar
from Transactions import *
class CLIFile(object):
'Axys Client File Object'
def __init__(self, aFile, loadSettings = True):
self.__file = aFile
self.labels = {}
self.transactions = []
self.__labelOffset = 15
self.... | {
"repo_name": "JoelBondurant/RandomCodeSamples",
"path": "python/CLI.py",
"copies": "1",
"size": "3123",
"license": "apache-2.0",
"hash": 1993741393497812000,
"line_mean": 32.3406593407,
"line_max": 71,
"alpha_frac": 0.48831252,
"autogenerated": false,
"ratio": 4.22027027027027,
"config_test": ... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import re
import os
from glob import glob
import numpy as np
# Find all indices of labels with class cls
def find(labels,cls):
return np.array(range(len(labels)))[labels == cls]
# Raw load text file
def load(fname):
data = []
labels = []
for line in open(fname).rea... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/utils.py",
"copies": "1",
"size": "2570",
"license": "mit",
"hash": -7909857325993324000,
"line_mean": 27.5555555556,
"line_max": 66,
"alpha_frac": 0.5459143969,
"autogenerated": false,
"ratio": 3.3463541666666665,
"config_test": false,
... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import re
import os
from glob import glob
import numpy as np
# Reading in batches
# repeatable random shuffling
# Data & labels must be numpy arrays: to handle filenames
# pass in a vector of indices as data, and extract
# from list of filenames in calling code.
class batcher:
... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "cifar100/utils.py",
"copies": "1",
"size": "2295",
"license": "mit",
"hash": -1449673299615215000,
"line_mean": 29.6,
"line_max": 66,
"alpha_frac": 0.5350762527,
"autogenerated": false,
"ratio": 3.3849557522123894,
"config_test": false,
"has_no_k... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import sys
import time
import tensorflow as tf
import numpy as np
import cifar100 as cf
import trainer as tr
import model as md
import utils as ut
from params import *
# Load dataset
tset,vset = cf.get_tval()
# Restore any saved weights
saved = ut.ckpter(WTS_DIR + 'iter_... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "cifar100/train_val.py",
"copies": "1",
"size": "3256",
"license": "mit",
"hash": -7021909249277810000,
"line_mean": 28.0714285714,
"line_max": 74,
"alpha_frac": 0.5730958231,
"autogenerated": false,
"ratio": 3.112810707456979,
"config_test": false,... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import sys
import time
import tensorflow as tf
import numpy as np
import loader as ldr
import trainer as tr
import model as md
import utils as ut
# Config options here
LIST='data/train.txt'
WTS_DIR='wts/'
KEEPLAST = 2
SAVE_FREQ=1000
DISP_FREQ=10
BSZ=32
WEIGHT_DECAY=0.
LR = 0.001
... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/train.py",
"copies": "1",
"size": "2885",
"license": "mit",
"hash": -2905638605692889600,
"line_mean": 24.7589285714,
"line_max": 74,
"alpha_frac": 0.6097053726,
"autogenerated": false,
"ratio": 3.0400421496311907,
"config_test": false,
... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import sys
import time
import tensorflow as tf
import numpy as np
import loader as ldr
import trainer as tr
import model as md
import utils as ut
VAL='data/val.txt'
SCALES=[256,512]
if len(sys.argv) != 2:
exit('Call with path to model.npz file.')
imgs, lbls = ut.load(V... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/val.py",
"copies": "1",
"size": "1763",
"license": "mit",
"hash": 3538019261559943700,
"line_mean": 23.4861111111,
"line_max": 76,
"alpha_frac": 0.5621100397,
"autogenerated": false,
"ratio": 2.8208,
"config_test": false,
"has_no_keyword... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import tensorflow as tf
import numpy as np
class model:
def conv(self,inp,ksz,name,stride=1,padding='SAME',ifrelu=True):
ksz = [ksz[0],ksz[0],ksz[1],ksz[2]]
# xavier init
sq = np.sqrt(3.0 / np.float32(ksz[0]*ksz[1]*ksz[2]))
w = tf.Variable(tf.ran... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "cifar100/model.py",
"copies": "1",
"size": "2937",
"license": "mit",
"hash": 6449251671565835000,
"line_mean": 31.2747252747,
"line_max": 85,
"alpha_frac": 0.5056179775,
"autogenerated": false,
"ratio": 3.188925081433225,
"config_test": false,
"h... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import tensorflow as tf
import numpy as np
class trainload:
def __init__(self,bsz,scales=[256,512]):
self.names = []
# Create placeholders
for i in range(bsz):
self.names.append(tf.placeholder(tf.string))
batch = []
sizes = t... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/loader.py",
"copies": "1",
"size": "2157",
"license": "mit",
"hash": -1379027346553783800,
"line_mean": 33.2380952381,
"line_max": 92,
"alpha_frac": 0.5521557719,
"autogenerated": false,
"ratio": 3.130624092888244,
"config_test": false,
... |
# Ayan Chakrabarti <ayanc@ttic.edu>
import tensorflow as tf
import numpy as np
class train:
def __init__(self,model,labels,lr,mom,wd):
self.loss = tf.reduce_mean(
tf.nn.sparse_softmax_cross_entropy_with_logits(
model.out,labels))
if wd > 0.:
# Define L2 weig... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/trainer.py",
"copies": "2",
"size": "1440",
"license": "mit",
"hash": -3639854488832324000,
"line_mean": 35,
"line_max": 69,
"alpha_frac": 0.5388888889,
"autogenerated": false,
"ratio": 3.759791122715405,
"config_test": false,
"has_no_ke... |
# Ayan Chakrabarti <ayanc@ttic.edu>
# This is a version of trainer that supports averaging gradients
# across multiple batches. See train_avg.py for usage.
import tensorflow as tf
import numpy as np
class train:
def __init__(self,model,labels,lr,mom,wd):
self.loss = tf.reduce_mean(
tf.nn.spar... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/trainer_avg.py",
"copies": "1",
"size": "1921",
"license": "mit",
"hash": 7099693717636879000,
"line_mean": 33.3035714286,
"line_max": 69,
"alpha_frac": 0.5481520042,
"autogenerated": false,
"ratio": 3.6660305343511452,
"config_test": fals... |
# Ayan Chakrabarti <ayanc@ttic.edu>
# This version of the training script allows you to achieve an
# effective batch size (BSZ below) larger than what could fit in GPU
# memory. Select AVG_IT to be a factor of BSZ, such that BSZ/AVG_IT
# fits on your GPU.
#
# All iteration accounting (displayed, checkpoint name, etc.)... | {
"repo_name": "ayanc/tf-boilerplate",
"path": "imagenet/train_avg.py",
"copies": "1",
"size": "3557",
"license": "mit",
"hash": -4596489853909971000,
"line_mean": 25.7443609023,
"line_max": 74,
"alpha_frac": 0.6080967107,
"autogenerated": false,
"ratio": 3.0957354221061792,
"config_test": false... |
# A Yapps2 parser that handles your typical IRC style command/message input
# but includes arguments in the command parsing so. Next step is to build the
# command system and have this create them on the fly.
#
# Copyright (C) Zed A. Shaw, licensed under the GPL 3 for the Utu project ( http://www.savingtheinternetwith... | {
"repo_name": "zedshaw/zapps",
"path": "examples/command.py",
"copies": "1",
"size": "2571",
"license": "mit",
"hash": 817016375811967100,
"line_mean": 27.8876404494,
"line_max": 118,
"alpha_frac": 0.5060287826,
"autogenerated": false,
"ratio": 3.7532846715328465,
"config_test": false,
"has_n... |
"""A Yarrow-160 cryptographic pseudorandom number generator for Unix
This implemenation is based on a design described in the following paper:
John Kelsey, Bruce Schneier, and Niels Ferguson. "Yarrow-160: Notes on
the Design and Analysis of the Yarrow Cryptographic Pseudorandom
Number Generator." http://www.counter... | {
"repo_name": "danieljohnlewis/pisces",
"path": "pisces/yarrow.py",
"copies": "1",
"size": "12943",
"license": "mit",
"hash": -2490801179387021000,
"line_mean": 32.3582474227,
"line_max": 74,
"alpha_frac": 0.6455999382,
"autogenerated": false,
"ratio": 3.849791790600833,
"config_test": false,
... |
"""A Yelp-powered Restaurant Recommendation Program"""
from abstractions import *
from data import ALL_RESTAURANTS, CATEGORIES, USER_FILES, load_user_file
from ucb import main, trace, interact
from utils import distance, mean, zip, enumerate, sample
from visualize import draw_map
##################################
# ... | {
"repo_name": "tavaresdong/courses-notes",
"path": "ucb_cs61A/projects/maps/recommend.py",
"copies": "3",
"size": "8368",
"license": "mit",
"hash": 6491812474457484000,
"line_mean": 34.3080168776,
"line_max": 106,
"alpha_frac": 0.6263145315,
"autogenerated": false,
"ratio": 3.6766256590509667,
... |
"""A Yelp-powered Restaurant Recommendation Program"""
from abstractions import *
#from data import ALL_RESTAURANTS, CATEGORIES, USER_FILES, load_user_file
from utils import distance, mean, zip, enumerate, sample, key_of_min_value
##################################
# Phase 2: Unsupervised Learning #
################... | {
"repo_name": "FalsePsyche/Uni_pythonprog",
"path": "Homework02/recomend.py",
"copies": "1",
"size": "6858",
"license": "unlicense",
"hash": -8352703253911598000,
"line_mean": 36.0756756757,
"line_max": 156,
"alpha_frac": 0.6201516477,
"autogenerated": false,
"ratio": 3.575599582898853,
"config... |
"""A Yelp-powered Restaurant Recommendation Program"""
from abstractions import *
from utils import distance, mean, zip, enumerate, sample
from visualize import draw_map
from data import RESTAURANTS, CATEGORIES, USER_FILES, load_user_file
from ucb import main, trace, interact
def find_closest(location, centroids):
... | {
"repo_name": "ajponte/yelpML",
"path": "maps/recommend.py",
"copies": "1",
"size": "6559",
"license": "mit",
"hash": 2052977104796597200,
"line_mean": 36.9132947977,
"line_max": 79,
"alpha_frac": 0.6412562891,
"autogenerated": false,
"ratio": 3.6786315199102635,
"config_test": false,
"has_no... |
"""A zigzag path, a sequence of points."""
import collections
from .defuzz import Defuzzer
from .euclid import collinear, Point, Line, Segment, Bounds, EmptyBounds
from .postulates import adjacent_pairs, triples
class Path:
def __init__(self, points):
self.points = tuple(points)
def __repr__(self):... | {
"repo_name": "nedbat/zellij",
"path": "zellij/path.py",
"copies": "1",
"size": "8958",
"license": "apache-2.0",
"hash": 7515690101937234000,
"line_mean": 28.0844155844,
"line_max": 99,
"alpha_frac": 0.5563741907,
"autogenerated": false,
"ratio": 3.6743232157506154,
"config_test": false,
"has... |
"azkms secret module"
import os
import logging
import base64
from urllib.parse import urlparse
from azure.keyvault.keys.crypto import CryptographyClient, EncryptionAlgorithm
from azure.keyvault.keys import KeyClient
from azure.identity import DefaultAzureCredential
from kapitan.refs.base64 import Base64Ref, Base64Ref... | {
"repo_name": "ademariag/kapitan",
"path": "kapitan/refs/secrets/azkms.py",
"copies": "2",
"size": "5869",
"license": "apache-2.0",
"hash": -1587316319497135000,
"line_mean": 31.9719101124,
"line_max": 110,
"alpha_frac": 0.5973760436,
"autogenerated": false,
"ratio": 3.944220430107527,
"config_... |
"""A ZMQ-based subclass of InteractiveShell.
This code is meant to ease the refactoring of the base InteractiveShell into
something with a cleaner architecture for 2-process use, without actually
breaking InteractiveShell itself. So we're doing something a bit ugly, where
we subclass and override what we want to fix.... | {
"repo_name": "fzheng/codejam",
"path": "lib/python2.7/site-packages/ipykernel/zmqshell.py",
"copies": "3",
"size": "18642",
"license": "mit",
"hash": -5107896426964703000,
"line_mean": 36.284,
"line_max": 114,
"alpha_frac": 0.6219289776,
"autogenerated": false,
"ratio": 4.298362923679963,
"con... |
"""A Zombie Apocalypse simulator sample with scipy library."""
import multiprocessing
import os
import StringIO
import urllib
import jinja2
import webapp2
import zombie_apocalypse
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.auto... | {
"repo_name": "GoogleCloudPlatform/appengine-scipy-zombie-apocalypse-python",
"path": "main.py",
"copies": "1",
"size": "3167",
"license": "apache-2.0",
"hash": 7054693034487519000,
"line_mean": 30.67,
"line_max": 74,
"alpha_frac": 0.6640353647,
"autogenerated": false,
"ratio": 4.129074315514994,... |
# A zoom band.
import cabb_scheduler.errors
class zoom:
def __init__(self, parent):
self.__parent = parent
self.__details = { 'channel': 1, 'enabled': False, 'group': -1 }
def isEnabled(self):
return self.__details['enabled']
def enable(self):
self.__details['enabled'] = T... | {
"repo_name": "ste616/cabb-schedule-api",
"path": "python/cabb_scheduler/zoom.py",
"copies": "1",
"size": "2063",
"license": "mit",
"hash": -7009122840891048000,
"line_mean": 33.3833333333,
"line_max": 133,
"alpha_frac": 0.5758603975,
"autogenerated": false,
"ratio": 4.101391650099403,
"config_... |
"""Azorult Tracker feeds"""
from datetime import timedelta
import logging
import pandas as pd
import numpy as np
from core.feed import Feed
from core.observables import AutonomousSystem, Ip, Hostname, Url
from core.errors import ObservableValidationError
class AzorutTracker(Feed):
"""Azorult Tracker"""
defau... | {
"repo_name": "yeti-platform/yeti",
"path": "plugins/feeds/public/azorult-tracker.py",
"copies": "1",
"size": "3094",
"license": "apache-2.0",
"hash": 3317196105166778400,
"line_mean": 29.3333333333,
"line_max": 73,
"alpha_frac": 0.5342598578,
"autogenerated": false,
"ratio": 3.891823899371069,
... |
"""Azure Devops Server issues collector."""
from typing import Final
import aiohttp
from base_collectors import SourceCollector
from collector_utilities.type import URL, Value
from source_model import Entities, Entity, SourceMeasurement, SourceResponses
class AzureDevopsIssues(SourceCollector):
"""Collector to... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/src/source_collectors/azure_devops/issues.py",
"copies": "1",
"size": "2800",
"license": "apache-2.0",
"hash": -3148218397613221400,
"line_mean": 45.6666666667,
"line_max": 112,
"alpha_frac": 0.6425,
"autogenerated": false,
"ratio":... |
"""Azure Devops Server merge requests collector."""
from typing import cast
from collector_utilities.functions import match_string_or_regular_expression
from collector_utilities.type import URL, Value
from source_model import Entities, Entity, SourceResponses
from .base import AzureDevopsRepositoryBase
class Azure... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/src/source_collectors/azure_devops/merge_requests.py",
"copies": "1",
"size": "4426",
"license": "apache-2.0",
"hash": 2619583166143714300,
"line_mean": 51.0705882353,
"line_max": 118,
"alpha_frac": 0.6665160416,
"autogenerated": fals... |
"""Azure Devops Server up-to-dateness collector."""
from abc import ABC
from datetime import datetime
import aiohttp
from dateutil.parser import parse
from base_collectors import SourceCollector, SourceUpToDatenessCollector
from collector_utilities.type import URL, Response
from source_model import SourceMeasurement... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/src/source_collectors/azure_devops/source_up_to_dateness.py",
"copies": "1",
"size": "3165",
"license": "apache-2.0",
"hash": 5105033979561327000,
"line_mean": 47.6923076923,
"line_max": 115,
"alpha_frac": 0.7055292259,
"autogenerated... |
"""Azure errors module."""
import xml.etree.ElementTree as ET
class BaseAzureException(Exception):
"""
Base exception for the SDK.
"""
def __init__(self, *args, **kwargs):
self.response = kwargs.pop('response', None)
self.request = kwargs.pop('request', None)
super(BaseAzureExc... | {
"repo_name": "Work4Labs/azure-translator-python-sdk",
"path": "azure_translator/errors.py",
"copies": "1",
"size": "1288",
"license": "apache-2.0",
"hash": 7852581835630036000,
"line_mean": 25.2857142857,
"line_max": 71,
"alpha_frac": 0.5869565217,
"autogenerated": false,
"ratio": 4.250825082508... |
'''azurerm restfns - REST functions for azurerm'''
import platform
import pkg_resources # to get version
import requests
from .settings import json_acceptformat, json_only_acceptformat, xml_acceptformat, \
charset, dsversion_min, dsversion_max, xmsversion, ams_rest_endpoint
def get_user_agent():
'''User-Agent He... | {
"repo_name": "gbowerman/azurerm",
"path": "azurerm/restfns.py",
"copies": "1",
"size": "13099",
"license": "mit",
"hash": -3227399927091398700,
"line_mean": 36.8583815029,
"line_max": 96,
"alpha_frac": 0.6345522559,
"autogenerated": false,
"ratio": 4.108845671267252,
"config_test": false,
"h... |
'''azurerm - unit tests - keyvault'''
# to run tests: python -m unittest keyvault_test.py
import sys
import unittest
from haikunator import Haikunator
import json
import azurerm
import time
class TestAzurermPy(unittest.TestCase):
def setUp(self):
# Load Azure app defaults
try:
with o... | {
"repo_name": "gbowerman/azurerm",
"path": "test/keyvault_test.py",
"copies": "1",
"size": "4281",
"license": "mit",
"hash": 117446457156265980,
"line_mean": 41.3861386139,
"line_max": 114,
"alpha_frac": 0.6323288951,
"autogenerated": false,
"ratio": 3.8463611859838274,
"config_test": true,
"... |
# azurerm unit tests - network
# to run tests: python -m unittest network_test.py
import sys
import unittest
from haikunator import Haikunator
import json
import azurerm
import time
class TestAzurermPy(unittest.TestCase):
def setUp(self):
# Load Azure app defaults
try:
with open('azur... | {
"repo_name": "gbowerman/azurerm",
"path": "test/network_test.py",
"copies": "1",
"size": "8701",
"license": "mit",
"hash": 6499278187382344000,
"line_mean": 41.443902439,
"line_max": 103,
"alpha_frac": 0.6271692909,
"autogenerated": false,
"ratio": 3.6978325541861454,
"config_test": true,
"h... |
# azurerm - unit tests - storage
# to run tests: python -m unittest storage_test.py
import sys
import unittest
from haikunator import Haikunator
import json
import azurerm
import time
class TestAzurermPy(unittest.TestCase):
def setUp(self):
# Load Azure app defaults
try:
with open('a... | {
"repo_name": "gbowerman/azurerm",
"path": "test/storage_test.py",
"copies": "1",
"size": "3691",
"license": "mit",
"hash": -7924925669366141000,
"line_mean": 37.8526315789,
"line_max": 102,
"alpha_frac": 0.6551070171,
"autogenerated": false,
"ratio": 4.069459757442117,
"config_test": true,
"... |
"""Azure Service Bus Message Queue transport module for kombu.
Note that the Shared Access Policy used to connect to Azure Service Bus
requires Manage, Send and Listen claims since the broker will create new
queues and delete old queues as required.
Notes when using with Celery if you are experiencing issues with pr... | {
"repo_name": "celery/kombu",
"path": "kombu/transport/azureservicebus.py",
"copies": "1",
"size": "16239",
"license": "bsd-3-clause",
"hash": -3077952691223796700,
"line_mean": 35.4921348315,
"line_max": 94,
"alpha_frac": 0.6230679229,
"autogenerated": false,
"ratio": 3.981122824221623,
"confi... |
"""Azure Service Bus Message Queue transport.
The transport can be enabled by setting the CELERY_BROKER_URL to:
```
azureservicebus://{SAS policy name}:{SAS key}@{Service Bus Namespace}
```
Note that the Shared Access Policy used to connect to Azure Service Bus
requires Manage, Send and Listen claims since the broke... | {
"repo_name": "cloudera/hue",
"path": "desktop/core/ext-py/kombu-4.3.0/kombu/transport/azureservicebus.py",
"copies": "2",
"size": "4916",
"license": "apache-2.0",
"hash": 3266378559134832600,
"line_mean": 30.7161290323,
"line_max": 78,
"alpha_frac": 0.646460537,
"autogenerated": false,
"ratio": ... |
"""Azure Storage Queues transport module for kombu.
More information about Azure Storage Queues:
https://azure.microsoft.com/en-us/services/storage/queues/
Features
========
* Type: Virtual
* Supports Direct: *Unreviewed*
* Supports Topic: *Unreviewed*
* Supports Fanout: *Unreviewed*
* Supports Priority: *Unreviewed*... | {
"repo_name": "celery/kombu",
"path": "kombu/transport/azurestoragequeues.py",
"copies": "2",
"size": "4846",
"license": "bsd-3-clause",
"hash": 4490080509693527600,
"line_mean": 28.3696969697,
"line_max": 77,
"alpha_frac": 0.6308295501,
"autogenerated": false,
"ratio": 3.9559183673469387,
"con... |
"""Azure Storage Queues transport.
The transport can be enabled by setting the CELERY_BROKER_URL to:
```
azurestoragequeues://:{Storage Account Access Key}@{Storage Account Name}
```
Note that if the access key for the storage account contains a slash, it will
have to be regenerated before it can be used in the conn... | {
"repo_name": "urbn/kombu",
"path": "kombu/transport/azurestoragequeues.py",
"copies": "4",
"size": "4676",
"license": "bsd-3-clause",
"hash": 5455850295836980000,
"line_mean": 30.1733333333,
"line_max": 77,
"alpha_frac": 0.6319503849,
"autogenerated": false,
"ratio": 3.9761904761904763,
"confi... |
# AZURE TRANSLATOR DEMO
# this demo is minimal
# here you can see cooked things with voice change based on language
# https://github.com/MyRobotLab/inmoov/blob/develop/InMoov/services/G_Translator.py
#voice service
mouth=Runtime.createAndStart("mouth", "MarySpeech")
#azure service
AzureTranslator=Runtime.createAndS... | {
"repo_name": "MyRobotLab/myrobotlab",
"path": "src/main/resources/resource/AzureTranslator/AzureTranslator.py",
"copies": "2",
"size": "3645",
"license": "apache-2.0",
"hash": 5985359893655384000,
"line_mean": 24.8368794326,
"line_max": 113,
"alpha_frac": 0.6354652759,
"autogenerated": false,
"r... |
"""Azure Translator module."""
import json
import requests
from .errors import (
AzureApiError, AzureApiBadFormatError,
AzureCannotGetTokenError, AzureApiTimeoutError
)
class Translator(object):
"""
Translator class, connects to Azure Translator API:
http://docs.microsofttranslator.com/text-... | {
"repo_name": "Work4Labs/azure-translator-python-sdk",
"path": "azure_translator/__init__.py",
"copies": "1",
"size": "3102",
"license": "apache-2.0",
"hash": -8442889062749787000,
"line_mean": 32.7173913043,
"line_max": 103,
"alpha_frac": 0.5496453901,
"autogenerated": false,
"ratio": 4.60237388... |
# Azure will execute first file.
# sys.path.append is required by Azure Web Jobs. It requires that all packages are provided to it in zip file.
# env\Lib\site-packages is virtual env path in Windows
import sys
sys.path.append("env\Lib\site-packages")
import logging
import logging.config
from datetime import datetime
... | {
"repo_name": "ttu/cubesensors-iot-azure",
"path": "src/python_checker/checker.py",
"copies": "1",
"size": "1550",
"license": "apache-2.0",
"hash": 5241333966022089000,
"line_mean": 31.3125,
"line_max": 110,
"alpha_frac": 0.655483871,
"autogenerated": false,
"ratio": 3.506787330316742,
"config_... |
"""B10 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | {
"repo_name": "xn1990/B10",
"path": "B10/urls.py",
"copies": "1",
"size": "1565",
"license": "mit",
"hash": 2277525439074363000,
"line_mean": 36.2619047619,
"line_max": 85,
"alpha_frac": 0.7015974441,
"autogenerated": false,
"ratio": 3.424507658643326,
"config_test": false,
"has_no_keywords":... |
"""B2Note Api level authentication methods and integration with oauth providers
oauth providers provided by loginpass supported
Google provider explicitly added
B2Access provider implementation compatible with loginpass imported
"""
from eve.auth import TokenAuth
from flask import request,jsonify
# class implementing... | {
"repo_name": "EUDAT-B2NOTE/b2note",
"path": "b2note_api/b2note_auth.py",
"copies": "1",
"size": "9002",
"license": "mit",
"hash": -5064353656931768000,
"line_mean": 41.8666666667,
"line_max": 128,
"alpha_frac": 0.6336369696,
"autogenerated": false,
"ratio": 3.9105125977410946,
"config_test": f... |
"""B2Note Api - main application to set and execute the server with REST Api for B2Note
Provides REST Api via Python Eve framework
Adds Swagger extension to be compliant with OpenApi
Integrates Oauth2 and selected providers (google,b2access) which might be used by client (b2note_app webcomponent)
# 04/06/2019 - new E... | {
"repo_name": "EUDAT-B2NOTE/b2note",
"path": "b2note_api/b2note_api.py",
"copies": "1",
"size": "2566",
"license": "mit",
"hash": 7535760172099447000,
"line_mean": 36.7352941176,
"line_max": 118,
"alpha_frac": 0.7498051442,
"autogenerated": false,
"ratio": 3.740524781341108,
"config_test": fals... |
# ========================== B3 ===============================================
# This function determines the extrinsic clustering quality b-cubed measure
# using a set of known labels for a data set, and cluster assignmnets of
# each data point stored as either vector or cell arrays where each
# cell/row represets ... | {
"repo_name": "m-wiesner/BCUBED",
"path": "B3score/b3.py",
"copies": "1",
"size": "6228",
"license": "apache-2.0",
"hash": -8613508441152266000,
"line_mean": 38.417721519,
"line_max": 92,
"alpha_frac": 0.6477199743,
"autogenerated": false,
"ratio": 3.332263242375602,
"config_test": false,
"ha... |
b = [5,6,7,8,1,2,3,4]
def binarySearch(k, l, h, a):
mid = (l+h)/2
if a[mid] == k:
return "Found key at", mid
if l > h:
return "Not Found"
if k < a[mid]:
return binarySearch(k, l, mid-1, a)
else:
return binarySearch(k, mid+1, h, a)
def find_pivot(l, h, a):
if l > h:
return -1
if l == h:
return l
m... | {
"repo_name": "Venkat1729/python",
"path": "Searchings/rotatedArraySearch.py",
"copies": "2",
"size": "1298",
"license": "mit",
"hash": 7348034323648577000,
"line_mean": 19.28125,
"line_max": 61,
"alpha_frac": 0.5893682589,
"autogenerated": false,
"ratio": 2.17056856187291,
"config_test": false... |
# b58.py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
__b58base = len(__b58chars)
b58chars = __b58chars
long = int
_bchr = lambda x: bytes([x])
_bord = lambda x: x
def b58encode(v):
""" encode v, whic... | {
"repo_name": "chaeplin/dashmnb",
"path": "dashlib/dash_b58.py",
"copies": "1",
"size": "1615",
"license": "mit",
"hash": 7939606387882712000,
"line_mean": 22.4057971014,
"line_max": 73,
"alpha_frac": 0.5492260062,
"autogenerated": false,
"ratio": 3.2171314741035855,
"config_test": false,
"ha... |
B64_CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
def base64_encode(data: bytes) -> bytes:
"""Encodes data according to RFC4648.
The data is first transformed to binary and appended with binary digits so that its
length becomes a multiple of 6, then each 6 binary digits wil... | {
"repo_name": "TheAlgorithms/Python",
"path": "ciphers/base64_encoding.py",
"copies": "1",
"size": "5015",
"license": "mit",
"hash": 3086730497318353400,
"line_mean": 34.3169014085,
"line_max": 88,
"alpha_frac": 0.6323030907,
"autogenerated": false,
"ratio": 3.7992424242424243,
"config_test": f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.