code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
import multiprocessing from rpyc_mem.client import RemoteModule, RpycMem from rpyc_mem.connect import RpycMemConnect from rpyc_mem.errors import RpycMemError class RpycMemSession: """ ``RpycMemSession`` brings ``RpycMemConnect``, ``RemoteModule`` and ``RpycMem`` under one hood while enabling to create/m...
/rpyc_mem-1.0.1-py3-none-any.whl/rpyc_mem/session/rpyc_mem_session.py
0.800068
0.243806
rpyc_mem_session.py
pypi
import time import rpyc from rpyc_mem.errors import RpycMemConnError class RpycMemConnect: """ Wrapper around ``rpyc.connect`` to connect with ``RpycMemService``. ``RpycMemConnect`` does some basic error recovery and validations on behalf of the user. :param str hostname: RPyC memory service hostn...
/rpyc_mem-1.0.1-py3-none-any.whl/rpyc_mem/connect/rpyc_mem_connect.py
0.713232
0.210949
rpyc_mem_connect.py
pypi
import threading from importlib import import_module import rpyc from rpyc.utils.server import ThreadedServer from rpyc_mem.errors import RpycMemSvcError class RpycMemService(rpyc.Service): """ RPyC memory service provides functionality to create named and unnamed python objects on remote hosts (one wh...
/rpyc_mem-1.0.1-py3-none-any.whl/rpyc_mem/service/rpyc_mem_service.py
0.764012
0.238517
rpyc_mem_service.py
pypi
.. _theory: Theory of Operation =================== This is a short outline of the "Theory of Operation" of RPyC. It will introduce the main concepts and terminology that's required in order to understand the library's internals. Theory ------ The most fundamental concept of computer programming, which almost all op...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/site/docs/theory.rst
0.925179
0.863449
theory.rst
pypi
from rpyc.lib.compat import execute, is_py3k class Service(object): """The service base-class. Derive from this class to implement custom RPyC services: * The name of the class implementing the ``Foo`` service should match the pattern ``FooService`` (suffixed by the word 'Service') :: ...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/core/service.py
0.818845
0.169063
service.py
pypi
from rpyc.lib import safe_import from rpyc.lib.compat import Struct, BYTES_LITERAL zlib = safe_import("zlib") # * 64 bit length field? # * separate \n into a FlushingChannel subclass? # * add thread safety as a subclass? class Channel(object): """Channel implementation. Note: In order to avoid problems w...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/core/channel.py
0.718792
0.197212
channel.py
pypi
import time import threading from rpyc.lib.colls import WeakValueDict from rpyc.lib.compat import callable from rpyc.core.consts import HANDLE_BUFFITER, HANDLE_CALL from rpyc.core.netref import syncreq, asyncreq def buffiter(obj, chunk = 10, max_chunk = 1000, factor = 2): """Buffered iterator - reads the remote i...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/utils/helpers.py
0.778228
0.330687
helpers.py
pypi
import sys from rpyc.lib import safe_import ssl = safe_import("ssl") class AuthenticationError(Exception): """raised to signal a failed authentication attempt""" pass class SSLAuthenticator(object): """An implementation of the authenticator protocol for ``SSL``. The given socket is wrapped by ``ssl.w...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/utils/authenticators.py
0.430387
0.198724
authenticators.py
pypi
import socket import threading try: from thread import interrupt_main except ImportError: from _thread import interrupt_main from rpyc import Connection, Channel, SocketStream, TunneledSocketStream, PipeStream, VoidService from rpyc.utils.registry import UDPRegistryClient from rpyc.lib import safe_import ssl =...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/utils/factory.py
0.728265
0.209187
factory.py
pypi
import sys import os import inspect import rpyc from rpyc.lib.compat import pickle from rpyc import SlaveService from rpyc.utils import factory SERVER_FILE = os.path.join(os.path.dirname(rpyc.__file__), "scripts", "rpyc_classic.py") DEFAULT_SERVER_PORT = 18812 DEFAULT_SERVER_SSL_PORT = 18821 #======================...
/rpyc-op-3.2.1-openproximity.tar.gz/rpyc-op-3.2.1-openproximity/rpyc/utils/classic.py
0.65202
0.272109
classic.py
pypi
import argparse import io import logging import os import pickle import pickletools import re import struct import time import zlib from concurrent.futures import ThreadPoolExecutor from hashlib import sha256 from typing import Callable import plyvel import requests from ratelimit import limits, sleep_and_retry impor...
/rpycdec-0.1.1.tar.gz/rpycdec-0.1.1/rpycdec.py
0.584864
0.162214
rpycdec.py
pypi
from . import ast IDENT_CHAR = " " def indent(code: str, level: int = 1) -> str: return "".join( map( lambda x: f"{IDENT_CHAR * level}{x}", filter(lambda x: x.strip(), code.splitlines(keepends=True)), ) ) def get_code_properties(props: tuple | dict, newline: bool ...
/rpycdec-0.1.1.tar.gz/rpycdec-0.1.1/renpy/util.py
0.498535
0.294462
util.py
pypi
Introduction ============ `rq-dashboard` is a general purpose, lightweight, [Flask](https://flask.palletsprojects.com/)-based web front-end to monitor your [RQ](http://python-rq.org/) queues, jobs, and workers in realtime. [![Build Pull Request](https://github.com/Parallels/rq-dashboard/actions/workflows/pr.yaml/badg...
/rq-dashboard-0.6.7.tar.gz/rq-dashboard-0.6.7/README.md
0.703957
0.862988
README.md
pypi
# Python RQ Prometheus Exporter [![PyPI](https://img.shields.io/pypi/v/rq-exporter)](https://pypi.org/project/rq-exporter/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rq-exporter)](https://pypi.org/project/rq-exporter/) [![Libraries.io dependency status for latest release](https://img.shields.io/...
/rq-exporter-2.1.0.tar.gz/rq-exporter-2.1.0/README.md
0.525369
0.9463
README.md
pypi
from redis import Redis from redis.sentinel import Sentinel from rq import Queue, Worker from rq.job import JobStatus def get_redis_connection(host='localhost', port='6379', db='0', sentinel=None, sentinel_port='26379', sentinel_master=None, password=None, password_fi...
/rq-exporter-2.1.0.tar.gz/rq-exporter-2.1.0/rq_exporter/utils.py
0.859015
0.247839
utils.py
pypi
import os from datetime import datetime, timedelta from rq.queue import Queue from rq.worker import Worker from .queue import DeadLetterQueue try: import rq_scheduler except ImportError: rq_scheduler = None class RetryWorker(Worker): """Worker class that periodically retries jobs on the FailedQueue. ...
/rq-retry-0.3.0.tar.gz/rq-retry-0.3.0/rq_retry/worker.py
0.669637
0.408926
worker.py
pypi
from __future__ import (absolute_import, division, print_function, unicode_literals) import calendar import datetime import importlib import logging import numbers import sys from distutils.version import StrictVersion from redis.exceptions import ResponseError from .compat import as_text, i...
/rq27-1.7.0.tar.gz/rq27-1.7.0/rq/utils.py
0.584627
0.155655
utils.py
pypi
from __future__ import (absolute_import, division, print_function, unicode_literals) from contextlib import contextmanager from redis import Redis from .local import LocalStack, release_local class NoRedisConnectionException(Exception): pass @contextmanager def Connection(connection=N...
/rq27-1.7.0.tar.gz/rq27-1.7.0/rq/connections.py
0.682997
0.245825
connections.py
pypi
from __future__ import (absolute_import, division, print_function, unicode_literals) import signal class BaseTimeoutException(Exception): """Base exception for timeouts.""" pass class JobTimeoutException(BaseTimeoutException): """Raised when a job takes longer to complete than t...
/rq27-1.7.0.tar.gz/rq27-1.7.0/rq/timeouts.py
0.728072
0.1933
timeouts.py
pypi
import os import datetime import pandas as pd from rqalpha.data.data_proxy import DataProxy from rqalpha.utils.datetime_func import convert_int_to_datetime from rqalpha_data.datetime_utils import to_date_object from rqalpha_data.quant_utils import to_order_book_id class DataSource(DataProxy): """ 直接使用RQAlph...
/rqalpha-data-0.0.7.tar.gz/rqalpha-data-0.0.7/rqalpha_data/datasource.py
0.419648
0.237974
datasource.py
pypi
import numpy as np from rqalpha.const import SIDE, POSITION_EFFECT, ORDER_STATUS, COMMISSION_TYPE, MARGIN_TYPE from rqalpha.model.order import LimitOrder from ..utils import make_order_book_id, make_underlying_symbol, is_future, bytes2str from .pyctp import ApiStruct SIDE_REVERSE = { ApiStruct.D_Buy: SIDE.BUY,...
/rqalpha-mod-ctp-0.2.0.tar.gz/rqalpha-mod-ctp-0.2.0/rqalpha_mod_ctp/ctp/data_dict.py
0.411347
0.281758
data_dict.py
pypi
import six from rqalpha.model.position import Positions from rqalpha.model.position.future_position import FuturePosition from rqalpha.model.account.future_account import FutureAccount, margin_of from rqalpha.model.order import Order from rqalpha.const import SIDE, POSITION_EFFECT, ORDER_STATUS class DataCache(objec...
/rqalpha-mod-vnpy-0.9.30.tar.gz/rqalpha-mod-vnpy-0.9.30/rqalpha_mod_vnpy/ctp/data_cache.py
0.638723
0.153074
data_cache.py
pypi
# rqdb This is an unofficial python client for [rqlite](https://github.com/rqlite/rqlite), a lightweight distributed relational database based on SQLite. This client supports SQLite syntax, true parameterized queries, and a calling syntax reminiscent of DB API 2.0. Furthermore, this client has convenient asynchronou...
/rqdb-1.0.10.tar.gz/rqdb-1.0.10/README.md
0.531453
0.748076
README.md
pypi
# Funcat [![PyPI](https://img.shields.io/pypi/v/funcat.svg)](https://pypi.python.org/pypi/funcat) [![PythonVersion](https://img.shields.io/pypi/pyversions/funcat.svg)](https://pypi.python.org/pypi/funcat) [![License](https://img.shields.io/pypi/l/funcat.svg)](https://pypi.python.org/pypi/funcat) Funcat 将同花顺、通达信、文华财经等...
/rqfuncat-0.3.4.tar.gz/rqfuncat-0.3.4/README.md
0.525612
0.961606
README.md
pypi
from .api import ( OPEN, HIGH, LOW, CLOSE, VOLUME, VOL, ABS, MAX, HHV, LLV, REF, IF, SUM, STD, MA, EMA, SMA, AVEDEV, COUNT, MIN, AMOUNT, SQRT, ADVANCE, DECLINE, CAPITAL, DMA, INDEXO, INDEXH, INDEXL, INDEXC, INDEXV, ) def KDJ(N=9, M1=3, M2=3): ...
/rqfuncat-0.3.4.tar.gz/rqfuncat-0.3.4/funcat/indicators.py
0.47025
0.186576
indicators.py
pypi
from functools import reduce import numpy as np import talib from .context import ExecutionContext from .utils import FormulaException, rolling_window, handle_numpy_warning from .time_series import ( MarketDataSeries, NumericSeries, BoolSeries, fit_series, get_series, get_bars, ensure_tim...
/rqfuncat-0.3.4.tar.gz/rqfuncat-0.3.4/funcat/func.py
0.664105
0.435721
func.py
pypi
import numpy as np from .time_series import MarketDataSeries, MarketSeries, FinancialDataSeries, IndexDataSeries from .func import ( SumSeries, AbsSeries, StdSeries, SMASeries, MovingAverageSeries, WeightedMovingAverageSeries, ExponentialMovingAverageSeries, CrossOver, minimum, ...
/rqfuncat-0.3.4.tar.gz/rqfuncat-0.3.4/funcat/api.py
0.641198
0.342462
api.py
pypi
from funcat.data.backend import DataBackend from funcat.utils import get_str_date_from_int, get_int_date, FormulaException from functools import lru_cache class RQDataBackend(DataBackend): def __init__(self): import rqdatac self.rqdatac = rqdatac @staticmethod def convert_date_to_int(dt)...
/rqfuncat-0.3.4.tar.gz/rqfuncat-0.3.4/funcat/data/rqdata_data_backend.py
0.631026
0.268631
rqdata_data_backend.py
pypi
.. -*- coding: utf-8 -*- =================================================== Specification "Relations Query Language" (Hercules) =================================================== Introduction ============ Goals RQL --------- The goal is to have a language emphasizing the way of browsing relations. As such, attri...
/rql-0.40.1.tar.gz/rql-0.40.1/docs/specifications_en.rst
0.791257
0.826397
specifications_en.rst
pypi
# RQLAlchemy [![Build Status](https://travis-ci.org/pjwerneck/rqlalchemy.svg?branch=develop)](https://travis-ci.org/pjwerneck/rqlalchemy) Resource Query Language extension for SQLAlchemy ## Overview Resource Query Language (RQL) is a query language designed for use in URIs, with object-style data structures. rqlal...
/rqlalchemy-0.4.2.tar.gz/rqlalchemy-0.4.2/README.md
0.650578
0.852935
README.md
pypi
<h1 align="center"> <br> <a href="#"><img src="https://raw.githubusercontent.com/pranavgupta1234/rqmonitor/master/artifacts/rqmonitor.png" alt="RQ Monitor" height="300" width="300"></a> <br> </h1> <h3 align="center">RQ Monitor is Flask based more actionable and dynamic web frontend for monitoring your RQ.</h3> ...
/rqmonitor-1.0.6.tar.gz/rqmonitor-1.0.6/README.md
0.46393
0.805709
README.md
pypi
# Rqmts <p align="center"> <b>Rqmts - Generate requirements.txt file for any project by analysing package imports</b><br><br> <img alt="Rqmts logo" src="https://i.imgur.com/czbQOUj.png" width="400"><br> <b>Click <a href="https://youtube.com/">here</a> to see the demo.<br> Click <a href="https://github.com/0x48pi...
/rqmts-2.0.1.tar.gz/rqmts-2.0.1/README.md
0.472197
0.841174
README.md
pypi
r""" The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\o/'] ...
/rquest-2.28.2.tar.gz/rquest-2.28.2/requests/status_codes.py
0.846308
0.566258
status_codes.py
pypi
from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS``, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. ...
/rquest-2.28.2.tar.gz/rquest-2.28.2/requests/api.py
0.853486
0.411466
api.py
pypi
from collections import OrderedDict from .compat import Mapping, MutableMapping class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys ...
/rquest-2.28.2.tar.gz/rquest-2.28.2/requests/structures.py
0.926893
0.4231
structures.py
pypi
RQUGE🤗: Reference-Free Metric for Evaluating Question Generation by Answering the Question ================= [![made-with-python](https://img.shields.io/badge/Made%20with-Python-red.svg)](#python) [![arxiv](https://img.shields.io/badge/arXiv-2211.01482-b31b1b.svg)](https://arxiv.org/abs/2211.01482) [![PyPI version ber...
/rquge-0.3.tar.gz/rquge-0.3/README.md
0.459319
0.974386
README.md
pypi
from transformers import AutoModelForSequenceClassification, AutoTokenizer, T5Tokenizer, T5ForConditionalGeneration from typing import Dict, List, Set import re import string class RQUGE(object): def __init__(self, sp_scorer_path=None, qa_model_path=None, device='cpu'): self.device = device ## ini...
/rquge-0.3.tar.gz/rquge-0.3/rquge_score/scorer.py
0.739046
0.382949
scorer.py
pypi
import torch from rquge_score import RQUGE import argparse import os def main(): torch.multiprocessing.set_sharing_strategy("file_system") parser = argparse.ArgumentParser("Calculate RQUGE score") parser.add_argument( "--sp_scorer_path", type=str, default=None, help='path...
/rquge-0.3.tar.gz/rquge-0.3/rquge_score_cli/scorer_cli.py
0.488283
0.264435
scorer_cli.py
pypi
class General: DATABASE = 'rankset' DEFAULT_USER = 'root' DEFAULT_PASSWORD = 'password' HOST = 'host' DEFAULT_HOST = '127.0.0.1' class Keys: COLUMNS = 'columns' STATUS_CODE = 'status_code' DATA_TYPE = 'data_type_name' DATA = 'data' INFO = 'info' COUNTRIES = 'countries' ...
/rr-api-beta-4.11.tar.gz/rr-api-beta-4.11/api_utils/constants.py
0.54819
0.218649
constants.py
pypi
import re class BaseEntities: @staticmethod def countries(): return "select rc.wyscout_id as id, rc.rankset_name as name from rankset.countries as rc " \ "where rc.wyscout_id != 0 order by name asc;" @staticmethod def competitions(country_id: int): return f"select * fro...
/rr-api-beta-4.11.tar.gz/rr-api-beta-4.11/api_utils/query.py
0.44071
0.23762
query.py
pypi
from api_utils import Routs, Keys, base_model, FilterData, utils from api_utils.query import Players from fastapi import APIRouter import ast class PlayersModel(base_model.BaseModel): """ Initiate entities model """ pass router_players = APIRouter( prefix=f"/{Routs.PLAYERS}", tags=[Routs.PLA...
/rr-api-beta-4.11.tar.gz/rr-api-beta-4.11/router/players.py
0.670177
0.157169
players.py
pypi
class BaseEntities: @staticmethod def countries(): return "select * from wyscout.countries;" @staticmethod def competitions(country_id: int): return f"select * from wyscout.competitions where country_id = {country_id};" @staticmethod def teams(competition_id: int): retu...
/rr-api-1.0.tar.gz/rr-api-1.0/api_utils/query.py
0.552781
0.286544
query.py
pypi
import api_utils as au from fastapi import APIRouter class EntitiesModel(au.base_model.BaseModel): """ Initiate entities model """ pass router_entities = APIRouter( prefix=f"/{au.constants.Routs.ENTITIES}", tags=[au.constants.Routs.ENTITIES] ) @router_entities.get(path=f"/countries", summa...
/rr-api-1.0.tar.gz/rr-api-1.0/router/entities.py
0.625209
0.181626
entities.py
pypi
import api_utils as au from fastapi import APIRouter class PlayersModel(au.base_model.BaseModel): """ Initiate entities model """ pass router_players = APIRouter( prefix=f"/{au.constants.Routs.PLAYERS}", tags=[au.constants.Routs.PLAYERS] ) @router_players.get(path="/overview/{player_id}", ...
/rr-api-1.0.tar.gz/rr-api-1.0/router/players.py
0.617974
0.179567
players.py
pypi
class Get: @staticmethod def get_events(tour_id: int, season: str, main_table: str, team_id: int = None): if not team_id: return " SELECT a.event_id, a.tour_id, a.season, a.round, a.home_team_id, a.home_team_name, " \ " a.away_team_id, a.away_team_name, b.initial_favorite ...
/rr_batch_process-1.4-py3-none-any.whl/rr_batch/sql.py
0.538255
0.373476
sql.py
pypi
import logging import math from abc import ABCMeta, abstractmethod from time import sleep from rr_bot.bell import Bell from rr_bot.regression import calculate_regression MAX_CHANGES_IN_DATASET = 3.0 WEIGHT_REJECTION_THRESHOLD = 0.001 def inverse_lerp(a, b, c): """ Inverse function to `lerp`. Calculates t...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/rhythm.py
0.799011
0.480722
rhythm.py
pypi
import logging import argparse from rr_bot.rhythm import RegressionRhythm, WaitForUserRhythm from rr_bot.tower import RingingRoomTower from rr_bot.bot import Bot from rr_bot.page_parser import get_load_balancing_url from rr_bot.row_generation import RowGenerator, ComplibCompositionGenerator from rr_bot.row_generation ...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/main.py
0.583797
0.495361
main.py
pypi
class Bell: """ A class to encapsulate the idea of a bell. """ @classmethod def from_str(cls, bell_str: str): """ Generates a Bell object from a string representing that bell's name. This works according to the standard convention, so Bell.from_str('1') will represent the tr...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/bell.py
0.882428
0.810404
bell.py
pypi
import collections import logging from time import sleep from typing import Optional, Callable, Dict, List, Any import socketio from rr_bot.bell import Bell class RingingRoomTower: """ A class representing a tower, which will handle a single ringing-room session. """ logger_name = "TOWER" def __init__...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/tower.py
0.813313
0.206954
tower.py
pypi
import time from rr_bot import calls from rr_bot.row_generation import RowGenerator from rr_bot.bell import Bell from rr_bot.rhythm import Rhythm from rr_bot.tower import RingingRoomTower class Bot: """ A class to hold all the information that the bot will use to glue together the rhythm, row_gen and soc...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/bot.py
0.678114
0.320702
bot.py
pypi
from typing import Dict, List from rr_bot.bell import Bell from .helpers import convert_pn from .row_generator import RowGenerator class DixonoidsGenerator(RowGenerator): """ A class to generate rows of dixonoids. """ DixonsRules = { 0: ["x", "1"], 1: ["x", "2"], 2: ["x", "4"], ...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/row_generation/dixonoids_generator.py
0.866331
0.398465
dixonoids_generator.py
pypi
import logging from abc import ABCMeta, abstractmethod from typing import List from rr_bot.bell import Bell class RowGenerator(metaclass=ABCMeta): """ Abstract base class for behaviours common to all row generators. """ logger_name = "ROWGEN" def __init__(self, stage: int): self.stage = stage ...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/row_generation/row_generator.py
0.849628
0.253517
row_generator.py
pypi
from typing import List, Dict from rr_bot.bell import Bell from .helpers import convert_pn, convert_to_bell_string from .row_generator import RowGenerator class PlaceNotationGenerator(RowGenerator): """ A row generator to generate rows given a place notation. """ # Dict Lead Index: String PlaceNotation ...
/rr_bot-0.1.1-py3-none-any.whl/rr_bot/row_generation/place_notation_generator.py
0.900379
0.492066
place_notation_generator.py
pypi
class Channel(object): """ Packs tracks into ptc tracks >>> tracks = [ ... (1, 3, 0), ... (1, 1, 1), ... (4, 5, 2), ... (4, 4, 3), ... (0, 10, 4), ... ] >>> channel_model = Channel(tracks) >>> channel_model.pack_tracks() >>> for ptc, tree in enumerate...
/rr-graph-0.0.1.post14.tar.gz/rr-graph-0.0.1.post14/rr_graph/channel2.py
0.852445
0.509276
channel2.py
pypi
from collections import namedtuple class static_property(object): """ Descriptor (non-data) for building an attribute on-demand on first use. """ def __init__(self, factory): """ <factory> is called such: factory(instance) to build the attribute. """ self._attr_name ...
/rr-graph-0.0.1.post14.tar.gz/rr-graph-0.0.1.post14/rr_graph/__init__.py
0.76366
0.355188
__init__.py
pypi
from __future__ import print_function from collections import namedtuple from enum import Enum from .tracks import Track from . import channel2 from .utils import progressbar_utils class SwitchType(Enum): """Enumeration of allowed VPR switch type See: https://vtr-verilog-to-routing.readthedocs.io/en/latest/vp...
/rr-graph-0.0.1.post14.tar.gz/rr-graph-0.0.1.post14/rr_graph/graph2.py
0.850717
0.262269
graph2.py
pypi
import os.path import re from rr_graph import graph2 from rr_graph import tracks import gc import capnp import capnp.lib.capnp capnp.remove_import_hook() CAMEL_CASE_CAPITALS = re.compile('([A-Z]+)') ENUM_CACHE = {} def enum_from_string(enum_type, s): if s == 'uxsdInvalid': return None s = str(s)...
/rr-graph-0.0.1.post14.tar.gz/rr-graph-0.0.1.post14/rr_graph/capnp/graph2.py
0.483892
0.216012
graph2.py
pypi
import enum import io import pprint import sys from types import MappingProxyType def frozendict(*args, **kwargs): """Version of a dictionary which can't be changed.""" return MappingProxyType(dict(*args, **kwargs)) class MostlyReadOnly: """Object which is **mostly** read only. Can set if not already...
/rr-graph-0.0.1.post14.tar.gz/rr-graph-0.0.1.post14/rr_graph/utils/collections_extra.py
0.5083
0.202148
collections_extra.py
pypi
# rr-ml-config [![Offial repo](https://img.shields.io/badge/official%20repo-rr--ml--config--public-%23ff9626?logo=gitlab)](https://gitlab.com/reactivereality/public/rr-ml-config-public) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/valentingol/rr-ml-config-public/master) [![License](https://...
/rr-ml-config-1.11.1.tar.gz/rr-ml-config-1.11.1/README.md
0.525369
0.899828
README.md
pypi
from rr_psychology.by.common.constants import Keys class Get: @staticmethod def original_rank(main_data: dict, by_team_id: bool=False): if by_team_id: by_team_id = f" and ts.team_id = {main_data.get(Keys.TEAM_ID)}" return "select distinct ts.team_id, ts.team_name, " \ ...
/rr_psychology-2.3-py3-none-any.whl/by/common/sql.py
0.50952
0.311662
sql.py
pypi
from rr_psychology.by.common.constants import Keys class Get: @staticmethod def original_rank(main_data: dict, by_team_id: bool = False): if by_team_id: by_team_id = f" and ts.team_id = {main_data.get(Keys.TEAM_ID)}" return "select distinct ts.team_id, ts.team_name, " \ ...
/rr_psychology-2.3-py3-none-any.whl/rr/by/common/sql.py
0.520496
0.347468
sql.py
pypi
from rr_psychology.by.common.constants import Keys class Get: @staticmethod def original_rank(main_data: dict, by_team_id: bool = False): if by_team_id: by_team_id = f" and ts.team_id = {main_data.get(Keys.TEAM_ID)}" return "select distinct ts.team_id, ts.team_name, " \ ...
/rr_psychology-2.3-py3-none-any.whl/rr/common/sql.py
0.520496
0.347468
sql.py
pypi
import rr_psychology import pandas as pd from rr import my_sql class Pressure(my_sql.MySqlConnection): def __init__(self, main_data: dict, psy_games_df: pd.DataFrame = None): # initiate db instance super().__init__(database=rr_psychology.by.common.General.DATABASE) # objects - part 1 ...
/rr_psychology-2.3-py3-none-any.whl/rr_psychology/by/pressure.py
0.498535
0.151372
pressure.py
pypi
from rr_psychology.by.common.constants import Keys class Get: @staticmethod def original_rank(main_data: dict, by_team_id: bool = False): if by_team_id: by_team_id = f" and ts.team_id = {main_data.get(Keys.TEAM_ID)}" return "select distinct ts.team_id, ts.team_name, " \ ...
/rr_psychology-2.3-py3-none-any.whl/rr_psychology/by/common/sql.py
0.520496
0.347468
sql.py
pypi
from rr_psychology.by.common.constants import Keys class Get: @staticmethod def original_rank(main_data: dict, by_team_id: bool=False): if by_team_id: by_team_id = f" and ts.team_id = {main_data.get(Keys.TEAM_ID)}" return "select distinct ts.team_id, ts.team_name, " \ ...
/rr_psychology-2.3-py3-none-any.whl/common/sql.py
0.50952
0.311662
sql.py
pypi
from __future__ import absolute_import from itertools import izip_longest from collections import Iterable import pkgutil # Module-level variables __version__ = pkgutil.get_data(__name__, "VERSION").strip() _rtol = 1e-9 # default relative tolerance _atol = 1e-12 # default absolute tolerance def tolerance(x, y): ...
/rr.approx-0.1.2.zip/rr.approx-0.1.2/rr/approx/__init__.py
0.862714
0.478833
__init__.py
pypi
import asyncio from asyncio import Queue from datetime import datetime, timezone from typing import Callable, Dict, List from rraft import ( Config, ConfState, EntryRef, EntryType, LoggerRef, Logger, MemStorage, MessageRef, OverflowStrategy, InMemoryRawNode, ) channel: Queue = Q...
/rraft_py-0.2.14.tar.gz/rraft_py-0.2.14/example/single_mem_node/use_coroutine.py
0.61115
0.378861
use_coroutine.py
pypi
from datetime import datetime, timezone from queue import Queue, Empty as QueueEmptyException from threading import Thread from time import sleep from typing import Dict, List, Callable from rraft import ( Config, ConfState, EntryRef, EntryType, LoggerRef, Logger, MemStorage, MessageRef,...
/rraft_py-0.2.14.tar.gz/rraft_py-0.2.14/example/single_mem_node/use_threading.py
0.631935
0.316184
use_threading.py
pypi
import pytest from rraft import ( ConfState, Logger_Ref, MemStorage, Config, InMemoryRaft, default_logger, ) def new_storage(voters: int, learners: int) -> MemStorage: cc = ConfState.default() for i in range(1, voters + 1): cc.set_voters([*cc.get_voters(), i]) for i in rang...
/rraft_py-0.2.14.tar.gz/rraft_py-0.2.14/benches/suites/raft.py
0.438785
0.372791
raft.py
pypi
from typing import List, Optional from rraft import ( ConfChange, ConfChangeSingle, ConfChangeSingleRef, ConfChangeType, ConfChangeV2, ConfState, Config, Entry, EntryRef, HardState, Logger, LoggerRef, MemStorage, MemStorageRef, Message, MessageType, In...
/rraft_py-0.2.14.tar.gz/rraft_py-0.2.14/harness/utils.py
0.785144
0.394376
utils.py
pypi
import RPi.GPIO as GPIO import time class RRB3: MOTOR_DELAY = 0.2 RIGHT_PWM_PIN = 14 RIGHT_1_PIN = 10 RIGHT_2_PIN = 25 LEFT_PWM_PIN = 24 LEFT_1_PIN = 17 LEFT_2_PIN = 4 SW1_PIN = 11 SW2_PIN = 9 LED1_PIN = 8 LED2_PIN = 7 OC1_PIN = 22 OC2_PIN = 27 OC2_PIN_R1 = 2...
/rrb3-1.1.tar.gz/rrb3-1.1/rrb3.py
0.461745
0.242699
rrb3.py
pypi
import pandas as pd import numpy as np import rrcf from sklearn.preprocessing import StandardScaler class Outlier_Detector: def __init__(self, x: np.array, num_trees: int, num_samples_per_tree: int): self.x = x self.num_trees = num_trees self.num_samples_per_tree = num_samples_per_tree ...
/rrcf-outlier-detector-MA-0.1.0.tar.gz/rrcf-outlier-detector-MA-0.1.0/RRCF_Outlier_Detection/rrcf_outlier_detection.py
0.726717
0.504761
rrcf_outlier_detection.py
pypi
# rrcf 🌲🌲🌲 [![Build Status](https://travis-ci.org/kLabUM/rrcf.svg?branch=master)](https://travis-ci.org/kLabUM/rrcf) [![Coverage Status](https://coveralls.io/repos/github/kLabUM/rrcf/badge.svg?branch=master)](https://coveralls.io/github/kLabUM/rrcf?branch=master) [![Python 3.6](https://img.shields.io/badge/python-3....
/rrcf-0.4.4.tar.gz/rrcf-0.4.4/README.md
0.648021
0.968411
README.md
pypi
# rrgit `rrgit` is a command line utility to aid in the process of editing RepRapFirmware / Duet controller configuration files over a network connection. It is designed to be as git-like as possible in order to provide a familiar interface. Of course, however, the RepRapFirmware interface is far less extensive compar...
/rrgit-1.0.1.tar.gz/rrgit-1.0.1/README.md
0.478041
0.891102
README.md
pypi
class ActionDenso: def __init__(self, robot_object, robot_handle): self.robot_object = robot_object self.robot_handle = robot_handle def motor_on(self): command = "Motor" parameters = [1, 0] self.robot_object.robot_execute(self.robot_handle, command, parameters) def...
/rria_api_denso-0.1.1-py3-none-any.whl/rria_api_denso/action_denso.py
0.761804
0.482002
action_denso.py
pypi
from utils.bcapclient import BCAPClient class ConnectDenso: def __init__(self, ip_address, port=5007, timeout=2000): self.ip_address = ip_address self.port = port self.timeout = timeout self.parameters = None self.bcap_client = None self.controller_handle = None ...
/rria_api_denso-0.1.1-py3-none-any.whl/rria_api_denso/connect_denso.py
0.807726
0.173551
connect_denso.py
pypi
from time import sleep from rria_api_denso.action_denso import ActionDenso from rria_api_denso.connect_denso import ConnectDenso class RobotObject: def __init__(self, ip_address, robot_type): self.ip_address = ip_address self.robot_type = robot_type # This attribute is used to store the ...
/rria_api_denso-0.1.1-py3-none-any.whl/rria_api_denso/robot_object.py
0.819135
0.500122
robot_object.py
pypi
""" Software License Agreement (MIT License) @copyright Copyright (c) 2017 DENSO WAVE INCORPORATED Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitati...
/rria_api_denso-0.1.1-py3-none-any.whl/rria_api_denso/utils/bcapclient.py
0.728845
0.179297
bcapclient.py
pypi
""" Software License Agreement (MIT License) @copyright Copyright (c) 2017 DENSO WAVE INCORPORATED Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitati...
/rria_api_denso-0.1.1-py3-none-any.whl/rria_api_denso/utils/variant.py
0.608827
0.161684
variant.py
pypi
from rria_api.ned.connect_ned import ConnectNed from rria_api.ned.action_ned import ActionNed from rria_api.gen3.connect_gen3 import ConnectGen3 from rria_api.gen3.action_gen3 import ActionGen3 from rria_api.robot_enum import RobotEnum from time import sleep class RobotObject: def __init__(self, ip_address, robot...
/rria_api-1.0.9.tar.gz/rria_api-1.0.9/rria_api/robot_object.py
0.841403
0.437793
robot_object.py
pypi
from kortex_api.autogen.messages import Base_pb2 import threading import time TIMEOUT_DURATION = 10 # Classe de movimentação adaptada dos exemplos disponibilizados pela API. # Essa classe é a única (até agora) que tem contato direto com a base (CPU) do Gen3 class Gen3Api: @staticmethod def check_for_end_or_a...
/rria_api-1.0.9.tar.gz/rria_api-1.0.9/rria_api/gen3/api_gen3/gen3_api.py
0.657098
0.216446
gen3_api.py
pypi
import os import datetime import typing from dataclasses import dataclass from redis import Redis @dataclass class Tier: name: str per_minute: int per_hour: int per_day: int @dataclass class DailyUsage: date: datetime.date calls: int class RateLimitExceeded(Exception): pass def _get_...
/rrl-0.3.1.tar.gz/rrl-0.3.1/rrl.py
0.499268
0.238484
rrl.py
pypi
import numpy as np def _matern32(x, y, sigmas, corr_len): """ Generates a Matern (nu=3/2) covariance matrix that assumes x/y has the same correlation length C_ij = \sigma_i \sigma_j (1 + sqrt(3) r_ij / l) exp(-sqrt(3) r_ij / l) Args: x (np.array): 1-D array of x coordinates y (np.ar...
/rrlfe-0.0.12.tar.gz/rrlfe-0.0.12/modules/covars.py
0.879419
0.906901
covars.py
pypi
# This makes plots showing the effective temperature retrievals based on synthetic spectra # produced by R.W. # Created from parent restacking_scraped_data.ipynb 2021 March 17 by E.S. import pandas as pd from astropy.io.fits import getdata import matplotlib import matplotlib.pyplot as plt import numpy as np import o...
/rrlfe-0.0.12.tar.gz/rrlfe-0.0.12/modules/teff_retrieval.py
0.659624
0.444505
teff_retrieval.py
pypi
import numpy as np from rrlpy.rrl.constants import Ry, k_B, h, m_e, e, c def fnnp_app(n, dn): """ Eq. (1) Menzel (1969) Parameters ---------- n : int Principal quantum number. dn : int Jump between principal quantum numbers. Returns ------- fnnp : float f...
/rrl/core.py
0.935398
0.689482
core.py
pypi
# RRnlp This library provides (easy!) access to a suite of models for extracting key data from abstracts of randomized controlled trials (RCTs). In particular, `rrnlp` features lightweight variants of the models defined in Trialstreamer (https://trialstreamer.robotreviewer.net/; https://academic.oup.com/jamia/articl...
/rrnlp-1.0.3.tar.gz/rrnlp-1.0.3/README.md
0.448426
0.926437
README.md
pypi
import math import matplotlib.pyplot as plt from .Generaldistribution import Distribution class Gaussian(Distribution): """ Gaussian distribution class for calculating and visualizing a Gaussian distribution. Attributes: mean (float) representing the mean value of the distribution stdev (...
/rrp_distributions-0.2.tar.gz/rrp_distributions-0.2/rrp_distributions/Gaussiandistribution.py
0.903086
0.903507
Gaussiandistribution.py
pypi
import math import matplotlib.pyplot as plt from .Generaldistribution import Distribution class Binomial(Distribution): """ Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution st...
/rrp_distributions-0.2.tar.gz/rrp_distributions-0.2/rrp_distributions/Binomialdistribution.py
0.907873
0.835584
Binomialdistribution.py
pypi
import pickle from pathlib import Path import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.patches import Polygon from matplotlib.collections import PatchCollection from matplotlib.ticker import MaxNLocator from rrt_ml.algorithms.sl import * from rrt_ml.utilities.configs import...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/runner/run_sl.py
0.653238
0.491822
run_sl.py
pypi
import time from ctypes import windll import gym import pybullet as p import pybullet_data as pd from PIL import Image from numpy.random import Generator from rrt_ml.utilities.configs import * from rrt_ml.utilities.formulas import * from rrt_ml.utilities.hints import * from rrt_ml.utilities.maps import * from rrt_ml....
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/environments/car_navigation_bullet_env.py
0.781664
0.252378
car_navigation_bullet_env.py
pypi
import torch as t from numpy.random import Generator from rich.progress import track from torch.optim import Adam from torch.utils.data import DataLoader, Dataset from rrt_ml.algorithms.base import * from rrt_ml.utilities.datasets import * from rrt_ml.utilities.formulas import * from rrt_ml.utilities.infos import * fr...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/algorithms/sl.py
0.855127
0.348756
sl.py
pypi
from abc import ABC from pathlib import Path import matplotlib import numpy as np import torch as t import yaml from joblib import load, dump from rich.console import Console from torch.nn import Module from torch.optim import Adam from torch.utils.tensorboard import SummaryWriter from rrt_ml.utilities.configs import...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/algorithms/base.py
0.78691
0.175397
base.py
pypi
import time from multiprocessing import cpu_count import matplotlib.ticker as ticker import mrl import pandas as pd import pybullet as p import seaborn as sns from matplotlib import pyplot as plt from mrl.algorithms.continuous_off_policy import ActorPolicy, DDPG from mrl.configs.continuous_off_policy import protoge_co...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/algorithms/rl.py
0.710628
0.209551
rl.py
pypi
import pickle import matplotlib.pyplot as plt import numpy as np from gekko import GEKKO from scipy import signal from rrt_ml.environments.car_navigation_bullet_env import * from rrt_ml.utilities.configs import * from rrt_ml.utilities.misc import * cfg = MasterConfig() cfg.env.general.stats = True cfg.env.general.g...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/experiments/others/kinematic_model_fit.py
0.458591
0.301761
kinematic_model_fit.py
pypi
import math import matplotlib.pyplot as plt import numpy as np show_animation = True class Path: """ Path data container """ def __init__(self): # course segment length (negative value is backward segment) self.lengths = [] # course segment type char ("S": straight, "L": le...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/python_robotics_reeds_shepp.py
0.65202
0.486758
python_robotics_reeds_shepp.py
pypi
import mrl from mrl.utils.misc import AttrDict import numpy as np from copy import deepcopy import time class StandardTrain(mrl.Module): def __init__(self): super().__init__('train', required_agent_modules = ['env', 'policy', 'optimize'], locals=locals()) def _setup(self): assert hasattr(self.config, 'opt...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/mrl/modules/train.py
0.463687
0.359983
train.py
pypi
import mrl import numpy as np # temporary fix for dumb tensorflow / tensorboard error. https://github.com/pytorch/pytorch/issues/30966 try: import tensorflow as tf import tensorboard as tb tf.io.gfile = tb.compat.tensorflow_stub.io.gfile except: import tensorboard as tb from torch.utils.tensorboard import Sum...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/mrl/modules/logging.py
0.654895
0.306397
logging.py
pypi
import mrl import torch, torch.nn as nn, torch.nn.functional as F import numpy as np import os from mrl.replays.online_her_buffer import OnlineHERBuffer class GoalSuccessPredictor(mrl.Module): """Predicts success using a learned discriminator""" def __init__(self, batch_size = 50, history_length = 200, optimize_e...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/mrl/modules/success_prediction.py
0.887455
0.385924
success_prediction.py
pypi
import mrl import numpy as np import torch, torch.nn.functional as F import os class GoalEnvReward(mrl.Module): def __init__(self): """Wraps environment's compute reward function""" super().__init__( 'goal_reward', required_agent_modules=['env'], locals=locals()) def _setup(self): assert self....
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/mrl/modules/goal_reward.py
0.847826
0.449876
goal_reward.py
pypi
import mrl import pickle import os import numpy as np import torch class RunningMeanStd(object): # https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm def __init__(self, epsilon=1e-4, shape=()): self.mean = np.zeros(shape, 'float64') self.var = np.ones(shape, 'float64') ...
/rrt_ml-0.0.8-py3-none-any.whl/rrt_ml/deps/libraries/mrl/modules/normalizer.py
0.815453
0.173323
normalizer.py
pypi