text
stringlengths
0
1.05M
meta
dict
# A CAN bus node (or Board unit) class Node(object): """An NODE on the CAN bus. """ def __init__(self, name, comment, dbc_specifics=None): self._name = name self._comment = comment self._dbc = dbc_specifics @property def ...
{ "repo_name": "eerimoq/cantools", "path": "cantools/database/can/node.py", "copies": "1", "size": "1088", "license": "mit", "hash": 3054141994942228500, "line_mean": 18.7818181818, "line_max": 77, "alpha_frac": 0.5064338235, "autogenerated": false, "ratio": 4.152671755725191, "config_test": fal...
# A CAN message. import binascii from copy import deepcopy from ..utils import format_or from ..utils import start_bit from ..utils import encode_data from ..utils import decode_data from ..utils import create_encode_decode_formats from ..errors import Error from ..errors import EncodeError from ..errors import Decod...
{ "repo_name": "eerimoq/cantools", "path": "cantools/database/can/message.py", "copies": "1", "size": "18762", "license": "mit", "hash": 7071173031594177000, "line_mean": 29.8078817734, "line_max": 110, "alpha_frac": 0.5115126319, "autogenerated": false, "ratio": 4.671812749003984, "config_test"...
"""ac_annotator URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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') Cla...
{ "repo_name": "AudioCommons/ac-annotator", "path": "ac_annotator/urls.py", "copies": "1", "size": "1258", "license": "apache-2.0", "hash": -1239458855955330600, "line_mean": 38.3125, "line_max": 86, "alpha_frac": 0.700317965, "autogenerated": false, "ratio": 3.5041782729805013, "config_test": f...
# A CAN signal. class Decimal(object): """Holds the same values as :attr:`~cantools.database.can.Signal.scale`, :attr:`~cantools.database.can.Signal.offset`, :attr:`~cantools.database.can.Signal.minimum` and :attr:`~cantools.database.can.Signal.maximum`, but as ``decimal.Decimal`` instead of ``...
{ "repo_name": "eerimoq/cantools", "path": "cantools/database/can/signal.py", "copies": "1", "size": "11610", "license": "mit", "hash": 6895642284732940000, "line_mean": 23.9677419355, "line_max": 101, "alpha_frac": 0.5148148148, "autogenerated": false, "ratio": 4.371234939759036, "config_test":...
# A Canvas fork to include dkim signing. from django.core.mail.backends.base import BaseEmailBackend from django.conf import settings import dkim import threading from boto.ses import SESConnection __version__ = '0.1' __author__ = 'Harry Marr' class SESBackend(BaseEmailBackend): """A Django Email backend tha...
{ "repo_name": "canvasnetworks/canvas", "path": "common/django_ses/__init__.py", "copies": "2", "size": "3303", "license": "bsd-3-clause", "hash": -4958418020549362000, "line_mean": 31.067961165, "line_max": 155, "alpha_frac": 0.5464729034, "autogenerated": false, "ratio": 4.3981358189081226, "c...
'''A capitalization action for the Manipulate plugin for Coda''' import cp_actions as cp from titlecase import titlecase from sentencecase import sentencecase def act(controller, bundle, options): ''' Required action method Set desired capitalization with 'to_case' option ''' context = c...
{ "repo_name": "bobthecow/ManipulateCoda", "path": "src/Support/Scripts/Capitalize.py", "copies": "1", "size": "1462", "license": "mit", "hash": -5602839621924567000, "line_mean": 33.023255814, "line_max": 95, "alpha_frac": 0.633378933, "autogenerated": false, "ratio": 3.8072916666666665, "confi...
# Acars data access # Thanks to Rich Mamrosh @ NOAA for pointing the availability of this data out to me import re import netCDF4 import gzip import io import tempfile import os import numpy as np from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtCore import pyqtSignal, pyqtSlot from datetime import datetime fro...
{ "repo_name": "cwebster2/pyMeteo", "path": "pymeteo/data/acars.py", "copies": "1", "size": "4859", "license": "bsd-3-clause", "hash": 3369926280863791600, "line_mean": 32.7430555556, "line_max": 91, "alpha_frac": 0.5361185429, "autogenerated": false, "ratio": 3.5415451895043732, "config_test": ...
"""A caseless dictionary implementation.""" try: from collections import MutableMapping except ImportError: from intessa.vendor.abcoll import MutableMapping class CaselessDictionary(MutableMapping): """ A dictionary-like object which ignores but preserves the case of strings. Example:: ...
{ "repo_name": "pombredanne/intessa", "path": "lib/intessa/utils/caseless_dict.py", "copies": "1", "size": "2389", "license": "unlicense", "hash": -1534013194152289800, "line_mean": 22.4215686275, "line_max": 79, "alpha_frac": 0.5801590624, "autogenerated": false, "ratio": 3.955298013245033, "co...
# A catering company has hired you to help with organizing and preparing # customer's orders. You are given a list of each customer's desired items, and # must write a program that will count the number of each items needed for the # chefs to prepare. The items that a customer can order are: salad, hamburger, # and wat...
{ "repo_name": "emyarod/OSS", "path": "1_intro/6.00.1x/Week 2/Problem Set 1/Problem 3 - Counting and Grouping.py", "copies": "1", "size": "1417", "license": "mit", "hash": 7652619145319307000, "line_mean": 43.3125, "line_max": 79, "alpha_frac": 0.7297106563, "autogenerated": false, "ratio": 3.3419...
"""accelerations for LCP algorithms""" import numpy as np import math from itertools import izip def crossing(x, y): return ( (-xi / (yi - xi)) if (xi - yi != 0) else 1 for xi, yi in izip(x, y) ) def max_step(x, y): """maximum step from x to y remaining positive""" alpha = 1.0 index = 0 ...
{ "repo_name": "maxime-tournier/lcpy", "path": "accel.py", "copies": "1", "size": "15125", "license": "mit", "hash": -6596934823762542000, "line_mean": 20.6690544413, "line_max": 96, "alpha_frac": 0.368661157, "autogenerated": false, "ratio": 3.17885666246322, "config_test": false, "has_no_key...
# acceleration sine sweep signal generation import matplotlib.pyplot as plt from math import sin, cos, pi # acc_sweep: generate constant magnitude acceleration sine sweep signal # --------------------------------------------------------------------- # step - signal time step # stop - duration of the signal # lofq - lo...
{ "repo_name": "tkoziara/parmec", "path": "python/acc_sweep.py", "copies": "1", "size": "3817", "license": "mit", "hash": 3254415513083997000, "line_mean": 28.1374045802, "line_max": 117, "alpha_frac": 0.5459785172, "autogenerated": false, "ratio": 2.9226646248085757, "config_test": false, "ha...
"""Accelerator class.""" import numpy as _np import mathphys as _mp import trackcpp as _trackcpp from . import elements as _elements from .utils import interactive as _interactive class AcceleratorException(Exception): """.""" @_interactive class Accelerator(object): """.""" __isfrozen = False # th...
{ "repo_name": "lnls-fac/pyaccel", "path": "pyaccel/accelerator.py", "copies": "1", "size": "12654", "license": "mit", "hash": 2412383838153128400, "line_mean": 34.15, "line_max": 77, "alpha_frac": 0.554844318, "autogenerated": false, "ratio": 3.864996945632254, "config_test": false, "has_no_k...
"""Accelerator for npm, the Node.js package manager.""" # Standard library modules. import codecs import contextlib import hashlib import json import os import re import time # External dependencies. from chardet import detect from executor import ExternalCommandFailed, quote from humanfriendly import Timer, format_...
{ "repo_name": "xolox/python-npm-accel", "path": "npm_accel/__init__.py", "copies": "1", "size": "28516", "license": "mit", "hash": 8073024971832775000, "line_mean": 43.6259780908, "line_max": 114, "alpha_frac": 0.6177584514, "autogenerated": false, "ratio": 4.272059925093633, "config_test": fal...
""" Usage: npm-accel [OPTIONS] [DIRECTORY] The npm-accel program is a wrapper for npm (the Node.js package manager) that optimizes one specific use case: Building a `node_modules' directory from a `package.json' file as quickly as possible. It works on the assumption that you build `node_modules' directories more fr...
{ "repo_name": "xolox/python-npm-accel", "path": "npm_accel/cli.py", "copies": "1", "size": "6539", "license": "mit", "hash": 2291959065914274300, "line_mean": 32.192893401, "line_max": 116, "alpha_frac": 0.6193607585, "autogenerated": false, "ratio": 4.246103896103896, "config_test": false, "...
"""Sphinx documentation configuration for the `npm-accel` project.""" import os import sys # Add the npm-accel source distribution's root directory to the module path. sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # Sphinx extension modul...
{ "repo_name": "xolox/python-npm-accel", "path": "docs/conf.py", "copies": "1", "size": "2616", "license": "mit", "hash": -5083647663765442000, "line_mean": 30.1428571429, "line_max": 81, "alpha_frac": 0.7025993884, "autogenerated": false, "ratio": 3.6383866481223923, "config_test": false, "ha...
"""Test suite for the `npm-accel` package.""" # Standard library modules. import json import logging import os import string # External dependencies. from executor import execute from executor.contexts import create_context from humanfriendly import Timer from humanfriendly.text import random_string from humanfriend...
{ "repo_name": "xolox/python-npm-accel", "path": "npm_accel/tests.py", "copies": "1", "size": "12595", "license": "mit", "hash": 6648589455252716000, "line_mean": 51.6987447699, "line_max": 120, "alpha_frac": 0.6367606193, "autogenerated": false, "ratio": 4.4631467044649185, "config_test": true,...
""" :py:mod:`pip_accel.exceptions` - Exceptions for structured error handling ========================================================================= This module defines named exceptions raised by pip-accel when it encounters error conditions that: 1. Already require structured handling inside pip-accel 2. May req...
{ "repo_name": "theyoprst/pip-accel", "path": "pip_accel/exceptions.py", "copies": "1", "size": "4145", "license": "mit", "hash": 7120511161194587000, "line_mean": 36.6818181818, "line_max": 230, "alpha_frac": 0.738721351, "autogenerated": false, "ratio": 4.414270500532481, "config_test": false,...
""" :py:mod:`pip_accel.cli` - Command line interface for the ``pip-accel`` program ============================================================================== """ # Standard library modules. import logging import os import sys import textwrap # Modules included in our package. from pip_accel import PipAccelerator...
{ "repo_name": "theyoprst/pip-accel", "path": "pip_accel/cli.py", "copies": "1", "size": "2876", "license": "mit", "hash": 2904229933859374600, "line_mean": 35.4050632911, "line_max": 86, "alpha_frac": 0.6599443672, "autogenerated": false, "ratio": 4.132183908045977, "config_test": false, "has...
""" Configuration handling for `pip-accel`. This module defines the :class:`Config` class which is used throughout the pip accelerator. At runtime an instance of :class:`Config` is created and passed down like this: .. digraph:: config_dependency_injection node [fontsize=10, shape=rect] PipAccelerator -> Bin...
{ "repo_name": "paylogic/pip-accel", "path": "pip_accel/config.py", "copies": "2", "size": "20109", "license": "mit", "hash": 4932323489949895000, "line_mean": 39.7064777328, "line_max": 106, "alpha_frac": 0.6129593714, "autogenerated": false, "ratio": 4.421503957783641, "config_test": true, "...
"""Operating system detection and Python version compatibility.""" # Standard library modules. import sys # Inform static code analysis tools about our intention to expose the # following variables. This avoids 'imported but unused' warnings. __all__ = ( 'WINDOWS', 'StringIO', 'configparser', 'pathna...
{ "repo_name": "paylogic/pip-accel", "path": "pip_accel/compat.py", "copies": "2", "size": "1136", "license": "mit", "hash": 183284327751627330, "line_mean": 26.0476190476, "line_max": 69, "alpha_frac": 0.7112676056, "autogenerated": false, "ratio": 4.115942028985507, "config_test": false, "ha...
"""Sphinx documentation configuration for the `pip-accel` project.""" import os import sys # Add the pip_accel source distribution's root directory to the module path. sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # Sphinx extension modul...
{ "repo_name": "paylogic/pip-accel", "path": "docs/conf.py", "copies": "2", "size": "2702", "license": "mit", "hash": 6101289734364999000, "line_mean": 30.7882352941, "line_max": 80, "alpha_frac": 0.7042931162, "autogenerated": false, "ratio": 3.7115384615384617, "config_test": false, "has_no_...
""" :py:mod:`pip_accel.caches.local` - Local cache backend ====================================================== This module implements the local cache backend which stores distribution archives on the local file system. This is a very simple cache backend, all it does is create directories and write local files. Th...
{ "repo_name": "theyoprst/pip-accel", "path": "pip_accel/caches/local.py", "copies": "1", "size": "3310", "license": "mit", "hash": 3173175662906059000, "line_mean": 41.4358974359, "line_max": 95, "alpha_frac": 0.6821752266, "autogenerated": false, "ratio": 4.401595744680851, "config_test": fals...
"""Command line interface for the ``pip-accel`` program.""" # Standard library modules. import logging import os import sys import textwrap # Modules included in our package. from pip_accel import PipAccelerator from pip_accel.config import Config from pip_accel.exceptions import NothingToDoError from pip_accel.util...
{ "repo_name": "matysek/pip-accel", "path": "pip_accel/cli.py", "copies": "1", "size": "2775", "license": "mit", "hash": 2146154739715034600, "line_mean": 34.5769230769, "line_max": 86, "alpha_frac": 0.6792792793, "autogenerated": false, "ratio": 4.092920353982301, "config_test": false, "has_n...
""" Configuration handling for `pip-accel`. This module defines the :class:`Config` class which is used throughout the pip accelerator. At runtime an instance of :class:`Config` is created and passed down like this: .. digraph:: config_dependency_injection node [fontsize=10, shape=rect] PipAccelerator -> Bin...
{ "repo_name": "matysek/pip-accel", "path": "pip_accel/config.py", "copies": "1", "size": "17658", "license": "mit", "hash": -7091750949034735000, "line_mean": 39.6866359447, "line_max": 106, "alpha_frac": 0.6184165817, "autogenerated": false, "ratio": 4.430005017561465, "config_test": true, "...
""" Simple wrapper for pip and pkg_resources `Requirement` objects. After downloading the specified requirement(s) pip reports a "requirement set" to pip-accel. In the past pip-accel would summarize this requirement set into a list of tuples, where each tuple would contain a requirement's project name, version and so...
{ "repo_name": "matysek/pip-accel", "path": "pip_accel/req.py", "copies": "1", "size": "10512", "license": "mit", "hash": -5130399135741146000, "line_mean": 40.7142857143, "line_max": 104, "alpha_frac": 0.6678082192, "autogenerated": false, "ratio": 4.618629173989455, "config_test": true, "has...
""" Support for multiple cache backends. This module defines an abstract base class (:class:`AbstractCacheBackend`) to be inherited by custom cache backends in order to easily integrate them in pip-accel. The cache backends included in pip-accel are built on top of the same mechanism. Additionally this module define...
{ "repo_name": "paylogic/pip-accel", "path": "pip_accel/caches/__init__.py", "copies": "2", "size": "8411", "license": "mit", "hash": -1321300969949617400, "line_mean": 38.8625592417, "line_max": 106, "alpha_frac": 0.6465343003, "autogenerated": false, "ratio": 4.867476851851852, "config_test": ...
"""Sphinx documentation configuration for the `pip-accel` project.""" import os import sys import types # Add the pip_accel source distribution's root directory to the module path. sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # Sphinx ex...
{ "repo_name": "matysek/pip-accel", "path": "docs/conf.py", "copies": "1", "size": "3432", "license": "mit", "hash": 5277408366384524000, "line_mean": 32.3203883495, "line_max": 80, "alpha_frac": 0.6861888112, "autogenerated": false, "ratio": 3.7880794701986753, "config_test": false, "has_no_k...
""" Top level functionality of `pip-accel`. The Python module :mod:`pip_accel` defines the classes that implement the top level functionality of the pip accelerator. Instead of using the ``pip-accel`` command you can also use the pip accelerator as a Python module, in this case you'll probably want to start by taking...
{ "repo_name": "matysek/pip-accel", "path": "pip_accel/__init__.py", "copies": "1", "size": "34535", "license": "mit", "hash": 2595270987934753000, "line_mean": 48.0553977273, "line_max": 116, "alpha_frac": 0.6527870277, "autogenerated": false, "ratio": 4.688433342383926, "config_test": true, ...
""" :py:mod:`pip_accel.caches.s3` - Amazon S3 cache backend ======================================================= This module implements a cache backend that stores distribution archives in a user defined `Amazon S3 <http://aws.amazon.com/s3/>`_ bucket. To enable this backend you need to define the configuration op...
{ "repo_name": "theyoprst/pip-accel", "path": "pip_accel/caches/s3.py", "copies": "1", "size": "15890", "license": "mit", "hash": -2081011666149970400, "line_mean": 47.0060422961, "line_max": 123, "alpha_frac": 0.6451856514, "autogenerated": false, "ratio": 4.373795761078998, "config_test": true...
""" Amazon S3 cache backend. This module implements a cache backend that stores distribution archives in a user defined `Amazon S3 <http://aws.amazon.com/s3/>`_ bucket. To enable this backend you need to define the configuration option :attr:`~.Config.s3_cache_bucket` and configure your Amazon S3 API credentials (see...
{ "repo_name": "matysek/pip-accel", "path": "pip_accel/caches/s3.py", "copies": "1", "size": "15862", "license": "mit", "hash": -4707493154543464000, "line_mean": 46.7771084337, "line_max": 120, "alpha_frac": 0.6451267179, "autogenerated": false, "ratio": 4.418384401114206, "config_test": true, ...
# Accelerator hundler for adxl345 import smbus import time bus = smbus.SMBus(1) address = 0x1D xyz_adr = [0x32, 0x34, 0x36] bus.write_byte_data(address, 0x2D, 0x08) bus.write_byte_data(address, 0x2E, 0x70) #Enable interrupt bus.write_byte_data(address, 0x2A, 0x07) #Enable all axies bus.write_byte_data(address,...
{ "repo_name": "DiamondOhana/jphacks", "path": "python_main/sonilab/accelerator.py", "copies": "2", "size": "1555", "license": "mit", "hash": -3534044089015495000, "line_mean": 23.6825396825, "line_max": 75, "alpha_frac": 0.6154340836, "autogenerated": false, "ratio": 2.520259319286872, "config_...
"""Accelerator module.""" import numpy as _np import pyaccel as _pyaccel from . import lattice as _lattice default_cavity_on = False default_radiation_on = False default_vchamber_on = False def create_accelerator(optics_mode=_lattice.default_optics_mode, simplified=False): """Create acce...
{ "repo_name": "lnls-fac/sirius", "path": "pymodels/SI_V24_04/accelerator.py", "copies": "1", "size": "1026", "license": "mit", "hash": -3239328597780136400, "line_mean": 29.1764705882, "line_max": 70, "alpha_frac": 0.656920078, "autogenerated": false, "ratio": 3.363934426229508, "config_test": ...
# Accelerometer Grapher and Fall Dector - Hugh O'Brien March 2009 # #This is a script for PyS60 that opens a bluetooth serial connection #to a pre-programmed SHIMMER sensor, The SHIMMER provides accelerometer #data in the form "1111 1111 1111" where '1111' will be in the range #of 0 -> 4400. The three values repre...
{ "repo_name": "hughobrien/shimmer-nokia-fall-detection", "path": "MovementGrapher.py", "copies": "1", "size": "6767", "license": "mit", "hash": -3011709792132006400, "line_mean": 36.2429378531, "line_max": 75, "alpha_frac": 0.6485887395, "autogenerated": false, "ratio": 3.5747490755414684, "con...
"""Accept a name as a parameter, calculate its word score, and report whether the score is prime.""" import sys def main(): """Where the magic happens.""" score = 0 alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'...
{ "repo_name": "jessemillar/pythonista", "path": "Desktop/prime_name.py", "copies": "1", "size": "1777", "license": "mit", "hash": 3010768539352706000, "line_mean": 56.3225806452, "line_max": 830, "alpha_frac": 0.5312324142, "autogenerated": false, "ratio": 2.391655450874832, "config_test": fals...
#accept an array of bytes, an offset in that array, and how many bytes starting at that offset to convert to the opposite endian def conv_endian(bytes, offset, numbytes): sum = 0 for n in range(0,numbytes): if offset+n < len(bytes): sum += bytes[offset+n]*(256**n) else: sum = -1 return sum #accepts a n...
{ "repo_name": "delMar43/wcmodtoolsources", "path": "WC1_clone/camp/camp_block_expander.py", "copies": "1", "size": "4627", "license": "mit", "hash": 2561581256046139400, "line_mean": 20.8301886792, "line_max": 128, "alpha_frac": 0.6029824941, "autogenerated": false, "ratio": 2.6546184738955825, ...
"""Acceptance test utils""" import functools import logging import time import traceback import pika.compat def retry_assertion(timeout_sec, retry_interval_sec=0.1): """Creates a decorator that retries the decorated function or method only upon `AssertionError` exception at the given retry interval not t...
{ "repo_name": "pika/pika", "path": "tests/misc/test_utils.py", "copies": "1", "size": "2615", "license": "bsd-3-clause", "hash": -8222856616435301000, "line_mean": 34.3378378378, "line_max": 87, "alpha_frac": 0.5736137667, "autogenerated": false, "ratio": 5.009578544061303, "config_test": false...
"""Acceptance test utils""" import functools import logging import time import traceback def retry_assertion(timeout_sec, retry_interval_sec=0.1): """Creates a decorator that retries the decorated function or method only upon `AssertionError` exception at the given retry interval not to exceed the overal...
{ "repo_name": "zixiliuyue/pika", "path": "tests/acceptance/test_utils.py", "copies": "4", "size": "2574", "license": "bsd-3-clause", "hash": 435286367165771900, "line_mean": 34.2602739726, "line_max": 87, "alpha_frac": 0.5695415695, "autogenerated": false, "ratio": 5.086956521739131, "config_te...
"""Accept a text file and do the fizzbuzz upon it. Your program should accept a file as its first argument. The file contains multiple separated lines; each line contains 3 numbers that are space delimited. The first number is the first divider (X), the second number is the second divider (Y), and the third number is ...
{ "repo_name": "joelstanner/codeeval", "path": "python_solutions/fizz_buzz/codeeval_fizzbuzz.py", "copies": "1", "size": "1333", "license": "mit", "hash": -7208140637637672000, "line_mean": 22.8035714286, "line_max": 65, "alpha_frac": 0.5723930983, "autogenerated": false, "ratio": 3.65205479452054...
"""Accept incoming log message.""" import logging.handlers import select from multilog import IS_PYTHON2 if IS_PYTHON2: import SocketServer as socketserver else: import socketserver from .handlers import LogHandler DEFAULT_HOST = 'localhost' DEFAULT_PORT = logging.handlers.DEFAULT_TCP_LOGGING_PORT class L...
{ "repo_name": "humangeo/multilog", "path": "multilog/receivers.py", "copies": "1", "size": "1194", "license": "mit", "hash": -8163029092508410000, "line_mean": 26.7674418605, "line_max": 90, "alpha_frac": 0.6440536013, "autogenerated": false, "ratio": 4.160278745644599, "config_test": false, ...
# Accept in gym/101190H # Wrong Answer in uvalive 7777 def idx( x ): return x + 32768 def main(): text = [] while True: try: text.append(input().strip()) except EOFError: break endflag = [i for i in range(len(text)) if text[i][-2:] != '||'] beginfg = [0] + [_ + 1 for _ in endflag[:-1...
{ "repo_name": "polossk/CodeArchive", "path": "UVALive/uvalive7777.py", "copies": "1", "size": "1830", "license": "mit", "hash": 3295977871882723000, "line_mean": 31.6964285714, "line_max": 85, "alpha_frac": 0.4202185792, "autogenerated": false, "ratio": 3.080808080808081, "config_test": false, ...
"""Acceptor class for Paxos Calendar.""" import pickle import socket import time from Calendar import Calendar class Acceptor(object): """ Acceptor class. maxPrepare: The maximum proposal number this Acceptor has encountered; initialized at -1 so a node can have id = 0. accNum...
{ "repo_name": "nickmarton/Paxos-Distributed-Calendar", "path": "Classes/Acceptor.py", "copies": "1", "size": "5073", "license": "mit", "hash": 8515194687834986000, "line_mean": 35.2357142857, "line_max": 114, "alpha_frac": 0.5649517051, "autogenerated": false, "ratio": 3.805701425356339, "confi...
# Accepts a filename containing numeric values in each line of which the statistics need to be calculated. # Alternately as second argument, the bucket size can also be passed. import sys import numpy as np fileName = sys.argv[1] # find median of bucket splits of data buckets = 5 if len(sys.argv) == 3: # Assuming...
{ "repo_name": "kunalghosh/T-61.5060-Algorithmic-Methods-of-Data-Mining", "path": "source/approximate/mean_of_medians.py", "copies": "1", "size": "1131", "license": "mit", "hash": 1139873434777670100, "line_mean": 38, "line_max": 106, "alpha_frac": 0.7170645447, "autogenerated": false, "ratio": 3....
''' Accepts a polygon shapefile in WGS84 and finds the UTM zone ''' # modified code from https://pcjericks.github.io/py-gdalogr-cookbook/ # vector_layers.html from osgeo import ogr import math import argparse PARSER = argparse.ArgumentParser() PARSER.add_argument("filename", help="the path to the input shapefile") AR...
{ "repo_name": "jbranigan/geo-scripts-python", "path": "latlng2utm/detect-utm-zone.py", "copies": "1", "size": "1945", "license": "mit", "hash": 7280076488567632000, "line_mean": 30.8852459016, "line_max": 82, "alpha_frac": 0.6575835476, "autogenerated": false, "ratio": 3.274410774410774, "confi...
"""Accepts or declines project invitation""" from baseCmd import * from baseResponse import * class updateProjectInvitationCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """id of the project to join""" """Required""" self.projectid = None self.t...
{ "repo_name": "MissionCriticalCloud/marvin", "path": "marvin/cloudstackAPI/updateProjectInvitation.py", "copies": "1", "size": "1206", "license": "apache-2.0", "hash": 1945406101304615000, "line_mean": 31.5945945946, "line_max": 102, "alpha_frac": 0.6144278607, "autogenerated": false, "ratio": 4....
#Accepts X and y and returns a list of training x and a test x and a training y and a validate y def folds(x_one,x_two,size): ####hhhhhmmmmmmmmmm train_x = [] train_y = [] predict_x = [] validate_y = [] cut_index_one = int(len(x_one)/float(size)) cut_index_two = int(len(x_two)/float(size)) ...
{ "repo_name": "dssg/wikienergy", "path": "proto/SVM/fold.py", "copies": "1", "size": "1529", "license": "mit", "hash": -2258415620281786000, "line_mean": 45.3333333333, "line_max": 96, "alpha_frac": 0.6265533028, "autogenerated": false, "ratio": 2.7109929078014185, "config_test": false, "has_...
#Accept walls and understand unpassable terrain #Easily recalcuate map from bad_numbers import * import pathfinding import bad_numbers import numpy import maps import cProfile import generate_dijkstra_map as fast_gen def create_dijkstra_map(center,source_map,targets): #Calculate the maximum size of the of the map by...
{ "repo_name": "flags/Reactor-3", "path": "dijkstra.py", "copies": "1", "size": "4711", "license": "mit", "hash": 2226683458924064500, "line_mean": 25.615819209, "line_max": 82, "alpha_frac": 0.5881978349, "autogenerated": false, "ratio": 2.4321115126484254, "config_test": false, "has_no_keywo...
""" Access ADCs vias SysFS interface """ import glob import os class ADC(object): def __init__(self, num, repeat=8, source='iio'): """Initalize the ADC for reading via a sysfs source""" if not (0 <= num <= 6): raise ValueError('ADC num must be 0-6') self.num = num self...
{ "repo_name": "jschornick/pybbb", "path": "bbb/adc.py", "copies": "1", "size": "1938", "license": "mit", "hash": -6349788903319857000, "line_mean": 30.2580645161, "line_max": 90, "alpha_frac": 0.536119711, "autogenerated": false, "ratio": 3.915151515151515, "config_test": false, "has_no_keywo...
"""Access ADCs vias SysFS interface.""" import glob import os class ADC(object): def __init__(self, num, repeat=8, source='iio'): """Initalize the ADC for reading via a sysfs source""" if not (0 <= num <= 6): raise ValueError('ADC num must be 0-6') self.num = num self...
{ "repo_name": "IEEERobotics/pybbb", "path": "bbb/adc.py", "copies": "1", "size": "1947", "license": "mit", "hash": 2193016655191696000, "line_mean": 30.4032258065, "line_max": 90, "alpha_frac": 0.5336414997, "autogenerated": false, "ratio": 3.9175050301810863, "config_test": false, "has_no_ke...
"""Access an ARP cache.""" class Error(Exception): """Base error class for arp module.""" pass class MACNotFound(Error): """No MAC address is associated with this address.""" pass # Path to the ARP cache file under the /proc filesystem. _ARP_FILENAME = '/proc/net/arp' class ArpCache(object): ...
{ "repo_name": "m-lab/collectd-mlab", "path": "site-packages/mlab/disco/arp.py", "copies": "2", "size": "1498", "license": "apache-2.0", "hash": -6205099673732982000, "line_mean": 27.2641509434, "line_max": 79, "alpha_frac": 0.5527369826, "autogenerated": false, "ratio": 3.754385964912281, "conf...
""" Access and control log capturing. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import re from contextlib import contextmanager import py import six import pytest from _pytest.compat import dummy_context_manager from _pytest.config...
{ "repo_name": "lmregus/Portfolio", "path": "python/design_patterns/env/lib/python3.7/site-packages/_pytest/logging.py", "copies": "1", "size": "22795", "license": "mit", "hash": 494967049537021900, "line_mean": 33.4335347432, "line_max": 118, "alpha_frac": 0.5983329678, "autogenerated": false, "r...
""" Access and control log capturing. """ import logging import re from contextlib import contextmanager from io import StringIO from typing import AbstractSet from typing import Dict from typing import Generator from typing import List from typing import Mapping from typing import Optional import pytest from _pytest ...
{ "repo_name": "markshao/pytest", "path": "src/_pytest/logging.py", "copies": "2", "size": "28189", "license": "mit", "hash": -8362641723993197000, "line_mean": 34.8182973316, "line_max": 118, "alpha_frac": 0.6015467026, "autogenerated": false, "ratio": 4.1687370600414075, "config_test": true, ...
"""Access and manage a Google Tag Manager account.""" import argparse import sys import httplib2 from apiclient.discovery import build from oauth2client import client from oauth2client import file from oauth2client import tools def printThis(statement): print statement def GetService(api_name, api_version, scope...
{ "repo_name": "vlee90/python-gtm-scripts", "path": "triggers.py", "copies": "1", "size": "13135", "license": "apache-2.0", "hash": 3606298544060551000, "line_mean": 29.691588785, "line_max": 87, "alpha_frac": 0.6738484964, "autogenerated": false, "ratio": 3.839520608009354, "config_test": false...
"""Access and/or modify INI files * Compatiable with ConfigParser * Preserves order of sections & options * Preserves comments/blank lines/etc * More conveninet access to data Example: >>> from StringIO import StringIO >>> sio = StringIO('''# configure foo-application ... [foo] ... bar1 = qualia ...
{ "repo_name": "m00dawg/holland", "path": "plugins/holland.backup.mysqldump/holland/backup/mysqldump/util/ini.py", "copies": "1", "size": "20347", "license": "bsd-3-clause", "hash": 2260486351616587500, "line_mean": 31.0930599369, "line_max": 83, "alpha_frac": 0.5350665946, "autogenerated": false, ...
# Access and save reviews from the Goodreads API from goodreads import client import pandas as pd from dateutil.parser import parse import time import pickle from my_settings import api_key, api_secret, username # loading private information gc = client.GoodreadsClient(api_key, api_secret) gc.authenticate() user = ...
{ "repo_name": "dr-rodriguez/Exploring-Goodreads", "path": "api_load.py", "copies": "1", "size": "3006", "license": "mit", "hash": 5200624348503774000, "line_mean": 31.3225806452, "line_max": 113, "alpha_frac": 0.5755156354, "autogenerated": false, "ratio": 3.8737113402061856, "config_test": fal...
""" Access backend for storing permissions in using SQLAlchemy """ from sqlalchemy import (engine_from_config, Column, String, Text, Boolean, Table, ForeignKey) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, backref from sqlalchemy import orm # p...
{ "repo_name": "rubikloud/pypicloud", "path": "pypicloud/access/sql.py", "copies": "1", "size": "11461", "license": "mit", "hash": 8204297972364384000, "line_mean": 32.808259587, "line_max": 86, "alpha_frac": 0.5838059506, "autogenerated": false, "ratio": 4.226032448377581, "config_test": false,...
""" Access backend for storing permissions in using SQLAlchemy """ from sqlalchemy import (engine_from_config, Column, Text, Boolean, Table, ForeignKey) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, backref from sqlalchemy import orm # pylint: d...
{ "repo_name": "johnswanson/pypicloud", "path": "pypicloud/access/sql.py", "copies": "2", "size": "11261", "license": "mit", "hash": 1601103574331413200, "line_mean": 32.6149253731, "line_max": 89, "alpha_frac": 0.5822751088, "autogenerated": false, "ratio": 4.236644093303235, "config_test": fal...
""" Access backend for storing permissions in using SQLAlchemy """ import zope.sqlalchemy from sqlalchemy import ( Boolean, Column, ForeignKey, String, Table, Text, engine_from_config, orm, ) from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.ext.declarative import declarative_ba...
{ "repo_name": "stevearc/pypicloud", "path": "pypicloud/access/sql.py", "copies": "1", "size": "11243", "license": "mit", "hash": 3451530162464525300, "line_mean": 29.5516304348, "line_max": 88, "alpha_frac": 0.5934359157, "autogenerated": false, "ratio": 4.08687749909124, "config_test": false, ...
""" Support for the Microsoft Access database. .. note:: The Access dialect is **non-functional as of SQLAlchemy 0.6**, pending development efforts to bring it up-to-date. """ from sqlalchemy import sql, schema, types, exc, pool from sqlalchemy.sql import compiler, expression from sqlalchemy.engine import...
{ "repo_name": "aurofable/medhack-server", "path": "venv/lib/python2.7/site-packages/sqlalchemy/dialects/access/base.py", "copies": "2", "size": "16060", "license": "mit", "hash": 6579272445243638000, "line_mean": 34.6097560976, "line_max": 84, "alpha_frac": 0.5509339975, "autogenerated": false, "...
""" Support for the Microsoft Access database. This dialect is *not* ported to SQLAlchemy 0.6 or 0.7. This dialect is *not* tested on SQLAlchemy 0.6 or 0.7. """ from sqlalchemy import sql, schema, types, exc, pool from sqlalchemy.sql import compiler, expression from sqlalchemy.engine import default, base, reflecti...
{ "repo_name": "awagnon/maraschino", "path": "lib/sqlalchemy/dialects/access/base.py", "copies": "37", "size": "16036", "license": "mit", "hash": 4990536608219460000, "line_mean": 34.6355555556, "line_max": 84, "alpha_frac": 0.5509478673, "autogenerated": false, "ratio": 4.310752688172043, "conf...
""" Support for the Microsoft Access database. """ from sqlalchemy import sql, schema, types, exc, pool from sqlalchemy.sql import compiler, expression from sqlalchemy.engine import default, base, reflection from sqlalchemy import processors class AcNumeric(types.Numeric): def get_col_spec(self): return...
{ "repo_name": "luzfcb/sqlalchemy-access", "path": "sqlalchemy_access/base.py", "copies": "1", "size": "8541", "license": "mit", "hash": 9214732004954154000, "line_mean": 30.8694029851, "line_max": 84, "alpha_frac": 0.5967685283, "autogenerated": false, "ratio": 3.9985955056179776, "config_test"...
"""Access BlueZ Media Player functionality""" import dbus # python-bluezero imports from bluezero import constants from bluezero import dbus_tools from bluezero import tools logger = tools.create_module_logger(__name__) class MediaPlayerError(Exception): """Custom exception""" pass def _find_player_path(d...
{ "repo_name": "ukBaz/python-bluezero", "path": "bluezero/media_player.py", "copies": "1", "size": "5679", "license": "mit", "hash": 9015436617573692000, "line_mean": 30.2032967033, "line_max": 78, "alpha_frac": 0.6207078711, "autogenerated": false, "ratio": 4.024805102763997, "config_test": fal...
"""Access classess and identity for partitions. Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ # import os from sqlalchemy.orm import lazyload, noload from sqlalchemy.orm.exc import NoResultFound from six import iter...
{ "repo_name": "CivicKnowledge/ambry", "path": "ambry/bundle/partitions.py", "copies": "1", "size": "8776", "license": "bsd-2-clause", "hash": 7292074365437424000, "line_mean": 31.2647058824, "line_max": 115, "alpha_frac": 0.5704193254, "autogenerated": false, "ratio": 4.106691623771643, "config...
"""Access classess and identity for partitions. Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import os from identity import PartitionIdentity, PartitionNameQuery, PartitionName, PartialPartitionName, NameQuery from s...
{ "repo_name": "kball/ambry", "path": "ambry/partitions.py", "copies": "1", "size": "23693", "license": "bsd-2-clause", "hash": 8105364617519946000, "line_mean": 31.5453296703, "line_max": 149, "alpha_frac": 0.5462372853, "autogenerated": false, "ratio": 4.366568374493181, "config_test": false, ...
# Access control import xpath import base64 import random import time import urllib.parse import jwt import sys import urllib.request, urllib.parse, urllib.error from .vars import * from .capability import * from .checker import * from .consistency import * from .issuer import * _igorSelfToken = IgorAccessToken() _ac...
{ "repo_name": "cwi-dis/igor", "path": "igor/access/__init__.py", "copies": "1", "size": "31781", "license": "mit", "hash": 6476340921704707000, "line_mean": 44.86002886, "line_max": 157, "alpha_frac": 0.6278908782, "autogenerated": false, "ratio": 4.319244359880402, "config_test": false, "has...
"""Access control policy.""" from balrog import exceptions class Policy(object): """Controls the access of a certain actor to a certain action on a resource.""" def __init__(self, roles, get_identity, get_role): """Create and configure access control. :param roles: All roles of this access...
{ "repo_name": "paylogic/balrog", "path": "balrog/policy.py", "copies": "1", "size": "3434", "license": "mit", "hash": 2316811641338594000, "line_mean": 36.7362637363, "line_max": 97, "alpha_frac": 0.6191030868, "autogenerated": false, "ratio": 4.603217158176943, "config_test": false, "has_no_...
"""Access control role.""" from balrog import exceptions class Role(object): """Role, a set of permissions that identity can have access to.""" def __init__(self, name, permissions): """Create a role. :param name: Unique role name within one policy. :param permissions: Permissions ...
{ "repo_name": "paylogic/balrog", "path": "balrog/role.py", "copies": "1", "size": "1849", "license": "mit", "hash": 2544271925420795000, "line_mean": 32.0178571429, "line_max": 102, "alpha_frac": 0.6192536506, "autogenerated": false, "ratio": 5.107734806629834, "config_test": false, "has_no_k...
"""Access control tools""" from tracked_model import serializer from tracked_model.defs import TrackToken, ActionType, Field def create_track_token(request): """Returns ``TrackToken``. ``TrackToken' contains request and user making changes. It can be passed to ``TrackedModel.save`` instead of ``request`...
{ "repo_name": "ojake/django-tracked-model", "path": "tracked_model/control.py", "copies": "1", "size": "4797", "license": "mit", "hash": -806515202863928600, "line_mean": 35.9, "line_max": 74, "alpha_frac": 0.6060037523, "autogenerated": false, "ratio": 4.135344827586207, "config_test": false, ...
"""Access data from json files as documents (paragraph level dicts)""" # ---[ list ]------------------------------------------------------------------- import os def list_data_files(): """iterate over paths of all data files""" for dirpath,_,filenames in os.walk('data'): filenames = [f for f in filenames if f.en...
{ "repo_name": "mobarski/sandbox", "path": "covid19/data_old.py", "copies": "2", "size": "3014", "license": "mit", "hash": -3332769433119698400, "line_mean": 25.9107142857, "line_max": 80, "alpha_frac": 0.5690112807, "autogenerated": false, "ratio": 2.9694581280788177, "config_test": false, "h...
"""Access Galaxy NGLIMS functionality via the standard API. """ from six.moves import urllib import json import time class GalaxyApiAccess: """Simple front end for accessing Galaxy's REST API. """ def __init__(self, galaxy_url, api_key): self._base_url = galaxy_url self._key = api_key ...
{ "repo_name": "vladsaveliev/bcbio-nextgen", "path": "bcbio/galaxy/api.py", "copies": "4", "size": "2858", "license": "mit", "hash": -623586393996913900, "line_mean": 33.8536585366, "line_max": 95, "alpha_frac": 0.5521343597, "autogenerated": false, "ratio": 3.9529737206085755, "config_test": fa...
"""Access Galaxy NGLIMS functionality via the standard API. """ import urllib import urllib2 import json import time class GalaxyApiAccess: """Simple front end for accessing Galaxy's REST API. """ def __init__(self, galaxy_url, api_key): self._base_url = galaxy_url self._key = api_key ...
{ "repo_name": "mjafin/bcbio-nextgen", "path": "bcbio/galaxy/api.py", "copies": "10", "size": "2835", "license": "mit", "hash": -1893774085017352200, "line_mean": 33.156626506, "line_max": 95, "alpha_frac": 0.5495590829, "autogenerated": false, "ratio": 3.9320388349514563, "config_test": false, ...
access_geom = True import os from PyQt5.QtCore import QVariant lyr = iface.activeLayer() if lyr is None: raise Exception('select layer in TOC') feat_cnt = 0 feats = lyr.selectedFeatures() if lyr.selectedFeatureCount() > 0 else lyr.getFeatures() for feat in feats: feat_cnt+=1 #print('fid:', feat.id()) ...
{ "repo_name": "BergWerkGIS/gis-file-info", "path": "QGIS/iterate-features.py", "copies": "2", "size": "1061", "license": "mit", "hash": -7794351535738653000, "line_mean": 29.3142857143, "line_max": 87, "alpha_frac": 0.6098020735, "autogenerated": false, "ratio": 3.5966101694915253, "config_test...
""" Access GPIO pins via SysFS interface """ import os class GPIO(object): def __init__(self, num): if not (2 <= num <= 117): raise ValueError('GPIO num must be in 2-117') self.sysfs = '/sys/class/gpio/gpio' + str(num) self.value_path = self.sysfs + "/value" self.direct...
{ "repo_name": "jschornick/pybbb", "path": "bbb/gpio.py", "copies": "1", "size": "1184", "license": "mit", "hash": 8313038470929995000, "line_mean": 27.1904761905, "line_max": 76, "alpha_frac": 0.5371621622, "autogenerated": false, "ratio": 3.226158038147139, "config_test": false, "has_no_keyw...
""" Access GPIO pins via SysFS interface """ import os import time class GPIO(object): def __init__(self, num, base_dir='/sys/class/gpio/gpio'): if not (2 <= num <= 117): raise ValueError('GPIO num must be in 2-117') self.num = num self.sysfs = base_dir + str(self.num) ...
{ "repo_name": "IEEERobotics/pybbb", "path": "bbb/gpio.py", "copies": "1", "size": "1691", "license": "mit", "hash": -5477589735185206000, "line_mean": 28.1551724138, "line_max": 78, "alpha_frac": 0.5292726198, "autogenerated": false, "ratio": 3.5450733752620547, "config_test": false, "has_no_...
'''Accessing ArcObjects via python and comtypes. ...most definitely a work in progess... Requirements: Pathed comtypes module, https://github.com/enthought/comtypes/pull/75 Adapted from Mark Cederholm's "Using ArcObjects in Python": http://www.pierssen.com/arcgis/misc.htm Also see: http://gis.stackexcha...
{ "repo_name": "DougFirErickson/arcplus", "path": "arcplus/ao/ao.py", "copies": "1", "size": "19731", "license": "mit", "hash": 5043446295871753000, "line_mean": 33.9221238938, "line_max": 97, "alpha_frac": 0.6930211343, "autogenerated": false, "ratio": 3.3278799122954967, "config_test": false, ...
"""Accessing data in a consistent manner""" __author__ = 'thorwhalen' import ut.pfile.name as pfile_name # from ut.khan_utils.encoding import to_unicode_or_bust from ut.serialize.local import Local from ut.serialize.s3 import S3 class DataAccessor(object): LOCATION_LOCAL = 'LOCAL' LOCATION_S3 = 'S3' d...
{ "repo_name": "thorwhalen/ut", "path": "serialize/data_accessor.py", "copies": "1", "size": "5471", "license": "mit", "hash": 4638621652976052000, "line_mean": 33.6265822785, "line_max": 158, "alpha_frac": 0.5850849936, "autogenerated": false, "ratio": 3.839298245614035, "config_test": false, ...
# Accessing test statistics # # Examples of using The Grinder statistics API with standard # statistics. from net.grinder.script.Grinder import grinder from net.grinder.script import Test from net.grinder.plugin.http import HTTPRequest class TestRunner: def __call__(self): request = HTTPRequest(url = "ht...
{ "repo_name": "NineWoranop/loadtesting-kpi", "path": "loadtesting/ThirdPartyTools/grinder-3.11/examples/statistics.py", "copies": "1", "size": "2669", "license": "apache-2.0", "hash": -5700283163081334000, "line_mean": 35.5616438356, "line_max": 75, "alpha_frac": 0.6286998876, "autogenerated": fals...
"""Accessing the files.""" import io import mimetypes import os import zipfile from enum import Enum from flask import Blueprint, current_app, render_template, send_file, Response from sacredboard.app.data import NotFoundError, DataStorage files = Blueprint("files", __name__) class _FileType(Enum): ARTIFACT = ...
{ "repo_name": "chovanecm/sacredboard", "path": "sacredboard/app/webapi/files.py", "copies": "1", "size": "3711", "license": "mit", "hash": 8379502704148305000, "line_mean": 27.9921875, "line_max": 115, "alpha_frac": 0.6308272703, "autogenerated": false, "ratio": 3.4682242990654206, "config_test...
ACCESS_KEY_ID = "####" SECRET_KEY = "#+##/##" ASSOC_TAG = "##-##" import bottlenose from lxml import objectify from amazon.api import AmazonAPI import amazon_scraper import json from pprint import pprint from textblob import TextBlob from nltk import sent_tokenize amazon = AmazonAPI(ACCESS_KEY_ID, SECRET_KEY, ASSOC_T...
{ "repo_name": "PramodShenoy/AmazoNLP", "path": "bottle.py", "copies": "1", "size": "1978", "license": "mit", "hash": -2395205723540919300, "line_mean": 23.1219512195, "line_max": 80, "alpha_frac": 0.6905965622, "autogenerated": false, "ratio": 2.758716875871688, "config_test": false, "has_no_...
"""Access keys and certificates stored in database""" from pisces.spkilib import sexp, spki, database from pisces import pwcrypt import os import string import cPickle import types def getPrincipal(obj): if isinstance(obj, spki.Hash): return obj return obj.getPrincipal() def checkType(pos, obj, *typ...
{ "repo_name": "danieljohnlewis/pisces", "path": "pisces/spkilib/keystore.py", "copies": "1", "size": "7582", "license": "mit", "hash": -8149377914887268000, "line_mean": 30.4605809129, "line_max": 71, "alpha_frac": 0.5911369032, "autogenerated": false, "ratio": 4.03083466241361, "config_test": ...
"""Access_key types file.""" from pyramid.view import view_config from pyramid.security import ( Allow, Deny, Authenticated, Everyone, ) from pyramid.settings import asbool from .base import ( Item, DELETED, ONLY_ADMIN_VIEW, ) from ..authentication import ( generate_password, genera...
{ "repo_name": "4dn-dcic/fourfront", "path": "src/encoded/types/access_key.py", "copies": "2", "size": "4511", "license": "mit", "hash": 4536885216042693600, "line_mean": 28.8741721854, "line_max": 85, "alpha_frac": 0.6360008867, "autogenerated": false, "ratio": 3.8654670094258785, "config_test"...
#accessLogProcessing module import argparse import pandas as pd import re def get_command_line_arguments(): parser = argparse.ArgumentParser(description='Parse Jive\'s Apache Access logs, and print out aggregated data from them.') parser.add_argument('input_log_files', metavar='files', nargs='+', action = 'st...
{ "repo_name": "danielharada/Apache-Access-Log-Tools", "path": "apacheAccessLogAggregator.py", "copies": "1", "size": "5540", "license": "mit", "hash": 658797506835919200, "line_mean": 40.3432835821, "line_max": 256, "alpha_frac": 0.6332129964, "autogenerated": false, "ratio": 3.5467349551856593, ...
"""Access log tailer and associated helpers.""" import logging import os import re import time class SimpleTailer(object): """A simple file tailer supporting basic log rotation detection.""" def __init__(self, filename, rotation_check_idle_time_s=30, rotati...
{ "repo_name": "swfrench/nginx-access-tailer", "path": "nginx_access_tailer/nginx_access_log_tailer.py", "copies": "1", "size": "5862", "license": "bsd-3-clause", "hash": -6209718050913097000, "line_mean": 37.5657894737, "line_max": 82, "alpha_frac": 0.5569771409, "autogenerated": false, "ratio": ...
"""Access Muonlab II hardware. Contents -------- :class:`MuonlabII` Access Muonlab II hardware. """ from array import array import random import time from pysparc.ftdi_chip import FtdiChip from pysparc.util import map_setting DESCRIPTION = "USB <-> Serial" LIFETIME_SCALE = 6.25 COINCIDENCE_TIMEDELTA_SCALE =...
{ "repo_name": "CosmicLaserShow/CosmicLaserShow", "path": "pysparc/pysparc/muonlab/muonlab_ii.py", "copies": "2", "size": "8000", "license": "mit", "hash": -5377863381279140000, "line_mean": 29.0751879699, "line_max": 77, "alpha_frac": 0.568125, "autogenerated": false, "ratio": 3.992015968063872, ...
"""Access objects for the file system within a bundle and for filesystem caches used by the download processes and the library. Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import os import io from ambry.orm import F...
{ "repo_name": "kball/ambry", "path": "ambry/filesystem.py", "copies": "1", "size": "22133", "license": "bsd-2-clause", "hash": -177954941764191780, "line_mean": 30.7546628407, "line_max": 128, "alpha_frac": 0.523471739, "autogenerated": false, "ratio": 4.286848731357738, "config_test": true, ...
""" Accessor for creating progress records, which show the history of the building of a bundle. Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import os import platform from ambry.orm import Process from six impor...
{ "repo_name": "CivicKnowledge/ambry", "path": "ambry/bundle/process.py", "copies": "1", "size": "13647", "license": "bsd-2-clause", "hash": 2063807387936982800, "line_mean": 30.3004587156, "line_max": 105, "alpha_frac": 0.5602696563, "autogenerated": false, "ratio": 4.192626728110599, "config_t...
# Accessor functions for control properties from Controls import * import struct # These needn't go through this module, but are here for completeness def SetControlData_Handle(control, part, selector, data): control.SetControlData_Handle(part, selector, data) def GetControlData_Handle(control, part, selector): ...
{ "repo_name": "MalloyPower/parsing-python", "path": "front-end/testsuite-python-lib/Python-2.6/Lib/plat-mac/Carbon/ControlAccessor.py", "copies": "81", "size": "1873", "license": "mit", "hash": 1165284151252792800, "line_mean": 32.4464285714, "line_max": 85, "alpha_frac": 0.6951414842, "autogenerat...
"""Accessors for Amber TI datasets. """ from os.path import dirname, join from glob import glob from .. import Bunch def load_bace_improper(): """Load Amber Bace improper solvated vdw example Returns ------- data: Bunch Dictionary-like object, the interesting attributes are: - 'd...
{ "repo_name": "alchemistry/alchemtest", "path": "src/alchemtest/amber/access.py", "copies": "1", "size": "3102", "license": "bsd-3-clause", "hash": 4152233049004272600, "line_mean": 27.7222222222, "line_max": 110, "alpha_frac": 0.5876853643, "autogenerated": false, "ratio": 3.3680781758957656, ...
"""Accessors for Gromacs datasets. """ from os.path import dirname, join from glob import glob from .. import Bunch def load_benzene(): """Load the Gromacs benzene dataset. Returns ------- data : Bunch Dictionary-like object, the interesting attributes are: - 'data' : the data file...
{ "repo_name": "alchemistry/alchemtest", "path": "src/alchemtest/gmx/access.py", "copies": "1", "size": "5479", "license": "bsd-3-clause", "hash": -8964200016877289000, "line_mean": 26.9540816327, "line_max": 125, "alpha_frac": 0.6114254426, "autogenerated": false, "ratio": 3.6141160949868074, "...
"""Accessors for NAMD FEP datasets. """ from os.path import dirname, join from glob import glob from .. import Bunch def load_tyr2ala(): """Load the NAMD tyrosine to alanine mutation dataset. Returns ------- data : Bunch Dictionary-like object, the interesting attributes are: - 'da...
{ "repo_name": "alchemistry/alchemtest", "path": "src/alchemtest/namd/access.py", "copies": "1", "size": "1352", "license": "bsd-3-clause", "hash": -4586040539015673000, "line_mean": 24.5094339623, "line_max": 89, "alpha_frac": 0.6072485207, "autogenerated": false, "ratio": 3.440203562340967, "c...
"""Access point for the HomematicIP Cloud component.""" import asyncio import logging from homeassistant import config_entries from homeassistant.core import callback from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import ( COMPONENTS, HMIPC_AUTHTOKEN, HMIPC_HAPID, HMIPC_NAME,...
{ "repo_name": "aronsky/home-assistant", "path": "homeassistant/components/homematicip_cloud/hap.py", "copies": "2", "size": "8951", "license": "apache-2.0", "hash": -776444036433894000, "line_mean": 34.1019607843, "line_max": 79, "alpha_frac": 0.597028265, "autogenerated": false, "ratio": 4.42024...
"""Access point for the HomematicIP Cloud component.""" import asyncio import logging from homematicip.aio.auth import AsyncAuth from homematicip.aio.home import AsyncHome from homematicip.base.base_connection import HmipConnectionError from homematicip.base.enums import EventType from homeassistant.config_entries im...
{ "repo_name": "Teagan42/home-assistant", "path": "homeassistant/components/homematicip_cloud/hap.py", "copies": "1", "size": "9004", "license": "apache-2.0", "hash": -6684912212817594000, "line_mean": 35.4534412955, "line_max": 84, "alpha_frac": 0.6075077743, "autogenerated": false, "ratio": 4.33...
"""Access points with isi_sdk.NamespaceApi.""" import urllib3 import isi_sdk_8_1_1 as isi_sdk import test_constants urllib3.disable_warnings() def main(): # configure username and password configuration = isi_sdk.Configuration() configuration.username = test_constants.USERNAME configuration.passwor...
{ "repo_name": "Isilon/isilon_sdk", "path": "tests/test_access_points.py", "copies": "1", "size": "2097", "license": "mit", "hash": 3561238929823196000, "line_mean": 30.2985074627, "line_max": 78, "alpha_frac": 0.6533142585, "autogenerated": false, "ratio": 3.744642857142857, "config_test": true...
""" Access PWM devices via SysFS interface """ class PWM(object): def __init__(self, num): if not (1 <= num <= 7): raise ValueError('PWM num must be 1-7') self.num = num self.sysfs = '/sys/class/pwm/pwm' + str(num) with open(self.sysfs + '/duty_ns', 'r') as f: ...
{ "repo_name": "jschornick/pybbb", "path": "bbb/pwm.py", "copies": "1", "size": "1424", "license": "mit", "hash": -9027898577892919000, "line_mean": 29.9565217391, "line_max": 90, "alpha_frac": 0.5, "autogenerated": false, "ratio": 3.109170305676856, "config_test": false, "has_no_keywords": fa...
""" Access PWM devices via SysFS interface """ class PWM(object): def __init__(self, num, base_dir='/sys/class/pwm/pwm'): if not (1 <= num <= 7): raise ValueError('PWM num must be 1-7') self.num = num self.sysfs = base_dir + str(self.num) with open(self.sysfs + '/duty_...
{ "repo_name": "IEEERobotics/pybbb", "path": "bbb/pwm.py", "copies": "1", "size": "1889", "license": "mit", "hash": -2952998767444767000, "line_mean": 29.9672131148, "line_max": 74, "alpha_frac": 0.5071466384, "autogenerated": false, "ratio": 3.1747899159663864, "config_test": false, "has_no_k...
from sqlalchemy import sql, schema, types, exceptions, pool from sqlalchemy.sql import compiler, expression from sqlalchemy.engine import default, base class AcNumeric(types.Numeric): def result_processor(self, dialect): return None def bind_processor(self, dialect): def process(value): ...
{ "repo_name": "santisiri/popego", "path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.3-py2.5.egg/sqlalchemy/databases/access.py", "copies": "2", "size": "15448", "license": "bsd-3-clause", "hash": -6805307869279271000, "line_mean": 34.9255813953, "line_max": 137, "alpha_frac": 0.57...
""" Support for the Microsoft Access database. This dialect is *not* ported to SQLAlchemy 0.6. This dialect is *not* tested on SQLAlchemy 0.6. """ from sqlalchemy import sql, schema, types, exc, pool from sqlalchemy.sql import compiler, expression from sqlalchemy.engine import default, base from sqlalchemy import ...
{ "repo_name": "obeattie/sqlalchemy", "path": "lib/sqlalchemy/dialects/access/base.py", "copies": "1", "size": "15155", "license": "mit", "hash": -197028102134500640, "line_mean": 35.3429256595, "line_max": 130, "alpha_frac": 0.5813922798, "autogenerated": false, "ratio": 4.132806108535588, "con...
""" Support for Microsoft Access via pyodbc. pyodbc is available at: http://pypi.python.org/pypi/pyodbc/ Connecting ^^^^^^^^^^ Examples of pyodbc connection string URLs: * ``mssql+pyodbc://mydsn`` - connects using the specified DSN named ``mydsn``. """ from .base import AccessExecutionContext, AccessDialec...
{ "repo_name": "luzfcb/sqlalchemy-access", "path": "sqlalchemy_access/pyodbc.py", "copies": "1", "size": "3203", "license": "mit", "hash": -6761128357402641000, "line_mean": 28.3853211009, "line_max": 84, "alpha_frac": 0.5482360287, "autogenerated": false, "ratio": 4.039092055485498, "config_tes...
"""Access Rules Classes.""" from fmcapi.api_objects.apiclasstemplate import APIClassTemplate from fmcapi.api_objects.policy_services.accesspolicies import AccessPolicies from fmcapi.api_objects.policy_services.intrusionpolicies import IntrusionPolicies from fmcapi.api_objects.object_services.variablesets import Variab...
{ "repo_name": "daxm/fmcapi", "path": "fmcapi/api_objects/policy_services/accessrules.py", "copies": "1", "size": "63397", "license": "bsd-3-clause", "hash": 6600217757393744000, "line_mean": 42.0393754243, "line_max": 113, "alpha_frac": 0.476315914, "autogenerated": false, "ratio": 4.956375576577...
_accessstrings = {0: "", 1: "readonly", 2: "executeonly", 3: "noaccess"} class ps_object(object): literal = 1 access = 0 value = None def __init__(self, value): self.value = value self.type = self.__class__.__name__[3:] + "type" def __repr__(self): return "<%s %s>" % (self.__class__.__name__[3:], repr(s...
{ "repo_name": "google/material-design-icons", "path": "update/venv/lib/python3.9/site-packages/fontTools/misc/psOperators.py", "copies": "5", "size": "12810", "license": "apache-2.0", "hash": -5815410608739100000, "line_mean": 22.8547486034, "line_max": 99, "alpha_frac": 0.6371584699, "autogenerate...
""" Access the cluster. Easy to use functions to make use of the cluster facilities. This checks the available slots on the requested queue, creates the scripts to submit, submits the jobs, and cleans up afterwards. Example usage:: >>> import qsub >>> qsub.submit_job('touch /data/hisp...
{ "repo_name": "XENON1T/cax", "path": "cax/qsub.py", "copies": "1", "size": "3490", "license": "isc", "hash": 5392750664664035000, "line_mean": 26.4803149606, "line_max": 90, "alpha_frac": 0.5739255014, "autogenerated": false, "ratio": 4.276960784313726, "config_test": false, "has_no_keywords"...