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 logging from pathlib import Path from typing import Any, Dict, List, Optional, Text from rich.console import Console from ruth.constants import TEXT from ruth.nlu.featurizers.sparse_featurizers.constants import ( CLASS_FEATURIZER_UNIQUE_NAME, ) from ruth.nlu.featurizers.sparse_featurizers.sparse_featurizer ...
/ruth_python-0.0.8-py3-none-any.whl/ruth/nlu/featurizers/sparse_featurizers/tfidf_vector_featurizer.py
0.832645
0.279872
tfidf_vector_featurizer.py
pypi
import os import random import uuid from time import time from urllib import request import requests import torch import torch.nn.functional as F import progressbar import torchaudio from ruth_tts_transformer.models.classifier import AudioMiniEncoderWithClassifierHead from ruth_tts_transformer.models.diffusion_decoder...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/parser.py
0.522202
0.203985
parser.py
pypi
import torch import torch.nn as nn from ruth_tts_transformer.models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock class ResBlock(nn.Module): def __init__( self, channels, dropout, out_channels=None, use_conv=False, use_scale_shif...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/classifier.py
0.946014
0.277954
classifier.py
pypi
import math import random from abc import abstractmethod import torch import torch.nn as nn import torch.nn.functional as F from torch import autocast from ruth_tts_transformer.models.arch_util import normalization, AttentionBlock def is_latent(t): return t.dtype == torch.float def is_sequence(t): return ...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/diffusion_decoder.py
0.945883
0.615001
diffusion_decoder.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from ruth_tts_transformer.models.arch_util import AttentionBlock from ruth_tts_transformer.models.xtransformers import ContinuousTransformerWrapper, Encoder def exists(val): return val is not None def masked_mean(t, mas...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/cvvp.py
0.947015
0.367185
cvvp.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F MAX_WAV_VALUE = 32768.0 class KernelPredictor(torch.nn.Module): ''' Kernel predictor for the location-variable convolutions''' def __init__( self, cond_channels, conv_in_channels, conv_out_chann...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/vocoder.py
0.954774
0.386185
vocoder.py
pypi
from functools import partial import torch import torch.nn.functional as F from einops import rearrange from rotary_embedding_torch import RotaryEmbedding, broadcat from torch import nn # helpers def exists(val): return val is not None def default(val, d): return val if exists(val) else d def cast_tupl...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/transformer.py
0.946076
0.456591
transformer.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from ruth_tts_transformer.models.arch_util import CheckpointedXTransformerEncoder from ruth_tts_transformer.models.transformer import Transformer from ruth_tts_transformer.models.xtransformers import Encoder def exists(val): ...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/clvp.py
0.888795
0.320143
clvp.py
pypi
import os import functools import math import torch import torch.nn as nn import torch.nn.functional as F import torchaudio from ruth_tts_transformer.models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias def zero_module(module): """ Zero out the parameters of a module and return it. ...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/arch_util.py
0.924099
0.537648
arch_util.py
pypi
import functools import torch import torch.nn as nn import torch.nn.functional as F from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions from transformers.utils.model_parallel_utils import get_device_map, assert_device...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/models/autoregressive.py
0.948894
0.386069
autoregressive.py
pypi
import os import subprocess from glob import glob import librosa import torch import torchaudio import numpy as np from scipy.io.wavfile import read from ruth_tts_transformer.utils.stft import STFT BUILTIN_VOICES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../voices') if not os.path.isdir(BUILTI...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/utils/audio.py
0.652906
0.293019
audio.py
pypi
import re import torch import torchaudio from transformers import Wav2Vec2ForCTC, Wav2Vec2FeatureExtractor, Wav2Vec2CTCTokenizer, Wav2Vec2Processor from ruth_tts_transformer.utils.audio import load_audio def max_alignment(s1, s2, skip_character='~', record=None): """ A clever function that aligns s1 to s2 a...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/utils/wav2vec_alignment.py
0.679072
0.424412
wav2vec_alignment.py
pypi
import os import re import inflect import torch from tokenizers import Tokenizer # Regular expression matching whitespace: from unidecode import unidecode _whitespace_re = re.compile(r'\s+') # List of (regular expression, replacement) pairs for abbreviations: _abbreviations = [(re.compile('\\b%s\\.' % x[0], re.IG...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/utils/tokenizer.py
0.50708
0.308503
tokenizer.py
pypi
import re def split_and_recombine_text(text, desired_length=200, max_length=300): """Split text it into chunks of a desired length trying to keep sentences intact.""" # normalize text, remove redundant whitespace and convert non-ascii quotes to ascii text = re.sub(r'\n\n+', '\n', text) text = re.sub(r...
/ruth_text_to_speech-0.0.39-py3-none-any.whl/ruth_tts_transformer/utils/text.py
0.419767
0.425725
text.py
pypi
import os import random import uuid from urllib import request import torch import torch.nn.functional as F import progressbar import torchaudio from ruth_tts_transformer.ruth_tts.models.classifier import AudioMiniEncoderWithClassifierHead from ruth_tts_transformer.ruth_tts.models.cvvp import CVVP from ruth_tts_trans...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/api.py
0.506591
0.218357
api.py
pypi
import torch import torch.nn as nn from torch.utils.checkpoint import checkpoint from ruth_tts_transformer.ruth_tts.models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock class ResBlock(nn.Module): def __init__( self, channels, dropout, out_channe...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/classifier.py
0.953008
0.292523
classifier.py
pypi
import math import random from abc import abstractmethod import torch import torch.nn as nn import torch.nn.functional as F from torch import autocast from ruth_tts_transformer.ruth_tts.models.arch_util import normalization, AttentionBlock def is_latent(t): return t.dtype == torch.float def is_sequence(t): ...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/diffusion_decoder.py
0.93441
0.634628
diffusion_decoder.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from torch.utils.checkpoint import checkpoint from ruth_tts_transformer.ruth_tts.models.arch_util import AttentionBlock from ruth_tts_transformer.ruth_tts.models.xtransformers import ContinuousTransformerWrapper, Encoder def ...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/cvvp.py
0.938166
0.377311
cvvp.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F MAX_WAV_VALUE = 32768.0 class KernelPredictor(torch.nn.Module): ''' Kernel predictor for the location-variable convolutions''' def __init__( self, cond_channels, conv_in_channels, conv_out_chann...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/vocoder.py
0.954774
0.386185
vocoder.py
pypi
from functools import partial import torch import torch.nn.functional as F from einops import rearrange from rotary_embedding_torch import RotaryEmbedding, broadcat from torch import nn # helpers def exists(val): return val is not None def default(val, d): return val if exists(val) else d def cast_tupl...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/transformer.py
0.946076
0.456591
transformer.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from ruth_tts_transformer.ruth_tts.models.arch_util import CheckpointedXTransformerEncoder from ruth_tts_transformer.ruth_tts.models.transformer import Transformer from ruth_tts_transformer.ruth_tts.models.xtransformers import ...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/clvp.py
0.888263
0.32146
clvp.py
pypi
import functools import math import torch import torch.nn as nn import torch.nn.functional as F import torchaudio from ruth_tts_transformer.ruth_tts.models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias def zero_module(module): """ Zero out the parameters of a module and return it. ...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/arch_util.py
0.956497
0.597461
arch_util.py
pypi
import functools import torch import torch.nn as nn import torch.nn.functional as F from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions from transformers.utils.model_parallel_utils import get_device_map, assert_device...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/models/autoregressive.py
0.937667
0.354796
autoregressive.py
pypi
import os from glob import glob import librosa import torch import torchaudio import numpy as np from scipy.io.wavfile import read from ruth_tts_transformer.ruth_tts.utils.stft import STFT def load_wav_to_torch(full_path): sampling_rate, data = read(full_path) if data.dtype == np.int32: norm_fix = 2...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/audio.py
0.774669
0.403009
audio.py
pypi
import re import torch import torchaudio from transformers import Wav2Vec2ForCTC, Wav2Vec2FeatureExtractor, Wav2Vec2CTCTokenizer, Wav2Vec2Processor from ruth_tts_transformer.ruth_tts.utils.audio import load_audio def max_alignment(s1, s2, skip_character='~', record={}): """ A clever function that aligns s1 ...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/wav2vec_alignment.py
0.680135
0.430506
wav2vec_alignment.py
pypi
import json import re import inflect import requests import torch from tokenizers import Tokenizer # Regular expression matching whitespace: from unidecode import unidecode _whitespace_re = re.compile(r'\s+') # List of (regular expression, replacement) pairs for abbreviations: _abbreviations = [(re.compile('\\b%s\\...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/tokenizer.py
0.543106
0.305956
tokenizer.py
pypi
import re def split_and_recombine_text(text, desired_length=200, max_length=300): """Split text it into chunks of a desired length trying to keep sentences intact.""" # normalize text, remove redundant whitespace and convert non-ascii quotes to ascii text = re.sub(r'\n\n+', '\n', text) text = re.sub(r...
/ruth-tts-converter-python-0.0.2.tar.gz/ruth-tts-converter-python-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/text.py
0.455199
0.376337
text.py
pypi
import os import random import uuid from urllib import request import torch import torch.nn.functional as F import progressbar import torchaudio from ruth_tts_transformer.ruth_tts.models.classifier import AudioMiniEncoderWithClassifierHead from ruth_tts_transformer.ruth_tts.models.cvvp import CVVP from ruth_tts_trans...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/api.py
0.506591
0.218357
api.py
pypi
import torch import torch.nn as nn from torch.utils.checkpoint import checkpoint from ruth_tts_transformer.ruth_tts.models.arch_util import Upsample, Downsample, normalization, zero_module, AttentionBlock class ResBlock(nn.Module): def __init__( self, channels, dropout, out_channe...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/classifier.py
0.953008
0.292523
classifier.py
pypi
import math import random from abc import abstractmethod import torch import torch.nn as nn import torch.nn.functional as F from torch import autocast from ruth_tts_transformer.ruth_tts.models.arch_util import normalization, AttentionBlock def is_latent(t): return t.dtype == torch.float def is_sequence(t): ...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/diffusion_decoder.py
0.93441
0.634628
diffusion_decoder.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from torch.utils.checkpoint import checkpoint from ruth_tts_transformer.ruth_tts.models.arch_util import AttentionBlock from ruth_tts_transformer.ruth_tts.models.xtransformers import ContinuousTransformerWrapper, Encoder def ...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/cvvp.py
0.938166
0.377311
cvvp.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F MAX_WAV_VALUE = 32768.0 class KernelPredictor(torch.nn.Module): ''' Kernel predictor for the location-variable convolutions''' def __init__( self, cond_channels, conv_in_channels, conv_out_chann...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/vocoder.py
0.954774
0.386185
vocoder.py
pypi
from functools import partial import torch import torch.nn.functional as F from einops import rearrange from rotary_embedding_torch import RotaryEmbedding, broadcat from torch import nn # helpers def exists(val): return val is not None def default(val, d): return val if exists(val) else d def cast_tupl...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/transformer.py
0.946076
0.456591
transformer.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum from ruth_tts_transformer.ruth_tts.models.arch_util import CheckpointedXTransformerEncoder from ruth_tts_transformer.ruth_tts.models.transformer import Transformer from ruth_tts_transformer.ruth_tts.models.xtransformers import ...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/clvp.py
0.888263
0.32146
clvp.py
pypi
import functools import math import torch import torch.nn as nn import torch.nn.functional as F import torchaudio from ruth_tts_transformer.ruth_tts.models.xtransformers import ContinuousTransformerWrapper, RelativePositionBias def zero_module(module): """ Zero out the parameters of a module and return it. ...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/arch_util.py
0.956497
0.597461
arch_util.py
pypi
import functools import torch import torch.nn as nn import torch.nn.functional as F from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions from transformers.utils.model_parallel_utils import get_device_map, assert_device...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/models/autoregressive.py
0.937667
0.354796
autoregressive.py
pypi
import os from glob import glob import librosa import torch import torchaudio import numpy as np from scipy.io.wavfile import read from ruth_tts_transformer.ruth_tts.utils.stft import STFT def load_wav_to_torch(full_path): sampling_rate, data = read(full_path) if data.dtype == np.int32: norm_fix = 2...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/audio.py
0.774669
0.403009
audio.py
pypi
import re import torch import torchaudio from transformers import Wav2Vec2ForCTC, Wav2Vec2FeatureExtractor, Wav2Vec2CTCTokenizer, Wav2Vec2Processor from ruth_tts_transformer.ruth_tts.utils.audio import load_audio def max_alignment(s1, s2, skip_character='~', record={}): """ A clever function that aligns s1 ...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/wav2vec_alignment.py
0.680135
0.430506
wav2vec_alignment.py
pypi
import json import re import inflect import requests import torch from tokenizers import Tokenizer # Regular expression matching whitespace: from unidecode import unidecode _whitespace_re = re.compile(r'\s+') # List of (regular expression, replacement) pairs for abbreviations: _abbreviations = [(re.compile('\\b%s\\...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/tokenizer.py
0.543106
0.305956
tokenizer.py
pypi
import re def split_and_recombine_text(text, desired_length=200, max_length=300): """Split text it into chunks of a desired length trying to keep sentences intact.""" # normalize text, remove redundant whitespace and convert non-ascii quotes to ascii text = re.sub(r'\n\n+', '\n', text) text = re.sub(r...
/ruth-tts-converter-0.0.2.tar.gz/ruth-tts-converter-0.0.2/src/ruth_tts_transformer/ruth_tts/utils/text.py
0.455199
0.376337
text.py
pypi
from .enums import Url from .exceptions import ServerException from typing import Union from requests import Session # More about API: http://api.rutracker.org/v1/docs/ class ApiProvider(object): """This class provides access to some official methods of the Rutracker API""" def __init__(self, session: Sessi...
/rutracker-api-0.22.92.tar.gz/rutracker-api-0.22.92/rutracker_api/api_provider.py
0.83772
0.191177
api_provider.py
pypi
from .utils import format_size, generate_magnet from datetime import datetime from .enums import Url class Torrent(object): """Stores data about the torrent""" def __init__( self, author=None, category=None, downloads=None, host=None, leeches=None, regi...
/rutracker-api-0.22.92.tar.gz/rutracker-api-0.22.92/rutracker_api/torrent.py
0.732018
0.166574
torrent.py
pypi
from __future__ import division import math import logging import struct log = logging.getLogger(__name__) class Df5Decoder(object): """ Decodes data from RuuviTag with Data Format 5 Protocol specification: https://github.com/ruuvi/ruuvi-sensor-protocols """ def _get_temperature(self, data)...
/ruuvi_decoders-0.2.0.tar.gz/ruuvi_decoders-0.2.0/ruuvi_decoders/df5_decoder.py
0.830009
0.541712
df5_decoder.py
pypi
from __future__ import division import base64 import logging log = logging.getLogger(__name__) class UrlDecoder(object): """ Decodes data from RuuviTag url Protocol specification: https://github.com/ruuvi/ruuvi-sensor-protocols Decoder operations are ported from: https://github.com/ruuvi/se...
/ruuvi_decoders-0.2.0.tar.gz/ruuvi_decoders-0.2.0/ruuvi_decoders/url_decoder.py
0.841858
0.322313
url_decoder.py
pypi
from typing import Dict, Tuple from aiohttp.client import ClientSession import aiohttp from result import Ok, Err, Result from ruuvi_decoders import get_decoder from ruuvi_gateway_client.types import SensorData, SensorPayload, ParsedDatas, Payload from ruuvi_gateway_client.parser import parse_session_cookie, parse_pas...
/ruuvi_gateway_client-0.1.0-py3-none-any.whl/ruuvi_gateway_client/gateway.py
0.579638
0.217545
gateway.py
pypi
import argparse import logging import json from concurrent.futures import Future import asyncio from aiohttp import ClientSession, TCPConnector from typing import Callable, Dict, List, Union async def handle_queue( args: argparse.Namespace, queue, future: Future, verify_ssl=True, api_key: Union[s...
/ruuvi_lapio-0.3.1.tar.gz/ruuvi_lapio-0.3.1/ruuvi_lapio/main.py
0.528533
0.155848
main.py
pypi
import time import random from typing import Callable, List, Union from ruuvitag_sensor.ruuvi import MacAndSensorData, RunFlag class MockSensor: def __init__(self): # Generate random mac address self.mac = "".join(random.choice("0123456789ABCDEF") for _ in range(12)).lower() self.battery ...
/ruuvi_lapio-0.3.1.tar.gz/ruuvi_lapio-0.3.1/ruuvi_lapio/mock_sensor.py
0.796372
0.276633
mock_sensor.py
pypi
from __future__ import annotations import math import struct class DataFormat5Decoder: def __init__(self, raw_data: bytes) -> None: if len(raw_data) < 24: raise ValueError("Data must be at least 24 bytes long for data format 5") self.data: tuple[int, ...] = struct.unpack(">BhHHhhhHBH6...
/ruuvitag_ble-0.1.2.tar.gz/ruuvitag_ble-0.1.2/src/ruuvitag_ble/df5_decoder.py
0.90673
0.451629
df5_decoder.py
pypi
import logging import time from multiprocessing import Manager from multiprocessing.managers import ListProxy from typing import AsyncGenerator, Callable, Dict, Generator, List, Optional from warnings import warn from ruuvitag_sensor.adapters import get_ble_adapter, is_async_adapter from ruuvitag_sensor.data_formats i...
/ruuvitag_sensor-2.1.0-py3-none-any.whl/ruuvitag_sensor/ruuvi.py
0.832747
0.343617
ruuvi.py
pypi
import time from concurrent.futures import ProcessPoolExecutor from datetime import datetime from multiprocessing import Manager from multiprocessing.managers import DictProxy from queue import Queue from threading import Thread from typing import List from reactivex import Subject from ruuvitag_sensor.ruuvi import R...
/ruuvitag_sensor-2.1.0-py3-none-any.whl/ruuvitag_sensor/ruuvi_rx.py
0.7011
0.158826
ruuvi_rx.py
pypi
import os import logging from ruv_dl.date_utils import parse_date from ruv_dl.constants import DATE_FORMAT logger = logging.getLogger(__name__) class Episode: def __init__(self, data): self.data = data or {} self.id = self.data.get('id', None) @property def number(self): return ...
/ruv-dl-0.5.4.tar.gz/ruv-dl-0.5.4/ruv_dl/data.py
0.467818
0.182098
data.py
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 (float) representing ...
/rv_distributions-1.0.tar.gz/rv_distributions-1.0/rv_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
from decimal import Decimal from .rv_api import RVapi from .objetos.recarga import Recarga class Transacao5(RVapi): def execute( self, compra: int, produto: str, ddd: str, fone: str, codigo_assinante: str = None, valor: Decimal ...
/rv-schubert-sdk-1.1.0.tar.gz/rv-schubert-sdk-1.1.0/rv_schubert_sdk/resources/transacao_5.py
0.489992
0.249973
transacao_5.py
pypi
class ErroRV(Exception): def __init__(self, message): Exception.__init__(self, message) class FoneIncompletoInvalido(ErroRV): def __init__(self, *args): ErroRV.__init__(self, "Fone Incompleto / Invalido [Codigo 1]") class LimiteCreditoInsuficiente(ErroRV): def __init__(self, *args): ...
/rv-schubert-sdk-1.1.0.tar.gz/rv-schubert-sdk-1.1.0/rv_schubert_sdk/resources/exceptions.py
0.512937
0.210837
exceptions.py
pypi
# Robotics, Vision & Control: 3rd edition in Python (2023) [![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/master/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python) [![QUT Centre for Robotics Open Source](https://github.com/qcr/q...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/README.md
0.458591
0.934275
README.md
pypi
## vectorial sensor data from collections import namedtuple import numpy as np from numpy.core.shape_base import block from scipy.integrate import odeint from spatialmath.base import unitvec from spatialmath import UnitQuaternion import matplotlib.pyplot as plt def IMU(): # accelerometer g0 = unitvec( [0, 0...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/examples/imu_data.py
0.889361
0.66296
imu_data.py
pypi
import numpy as np from math import pi, sqrt, inf quadrotor = {} quadrotor["nrotors"] = 4 # 4 rotors quadrotor["g"] = 9.81 # g Gravity quadrotor["rho"] = 1.184 # rho Density of air quadrotor["muv"] = 1.5e-5 # muv Viscosity of air # Airframe quadrotor["M"] = 4 # M Mass Ixx = 0.082 Iyy = 0.082 Izz = 0....
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/models/quad_model.py
0.568895
0.408985
quad_model.py
pypi
# run with command line -a switch to show animation import numpy as np import math import roboticstoolbox as rtb import bdsim # parameters for the path look_ahead = 5 speed = 1 dt = 0.1 tacc = 1 x0 = [2, 2, 0] # create the path path = np.array([[10, 10], [10, 60], [80, 80], [50, 10]]) robot_traj = rtb.mstraj(path[1...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/models/drivepursuit.py
0.454956
0.504272
drivepursuit.py
pypi
# run with command line -a switch to show animation from math import pi, sqrt, atan, atan2 import bdsim sim = bdsim.BDSim(animation=True) bd = sim.blockdiagram() # parameters xg = [5, 5, pi / 2] Krho = bd.GAIN(1, name="Krho") Kalpha = bd.GAIN(5, name="Kalpha") Kbeta = bd.GAIN(-2, name="Kbeta") xg = [5, 5, pi / 2] x...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/models/driveconfig.py
0.534855
0.474083
driveconfig.py
pypi
import numpy as np import bdsim def SEA(obstacle_pos=0.8, block=False, graphics=False): sim = bdsim.BDSim(name="SEA", graphics=graphics) bd = sim.blockdiagram() m1 = 0.5 m2 = 1 LQR = np.c_[169.9563, 62.9010, -19.9563, 71.1092].T print(LQR) Ks = 5 force_lim = 2 # define the block...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/models/SEA.py
0.563858
0.364636
SEA.py
pypi
import numpy as np from scipy import linalg import bdsim from roboticstoolbox import models import spatialmath.base as smb from spatialmath import SE3 # equation numbers are with reference to: # A Unified Approach for Motion and Force Control of Robot Manipulators: The # Operational Space Formulation, Khatib, IEEE J...
/rvc3python-0.9.0.tar.gz/rvc3python-0.9.0/RVC3/models/opspace.py
0.74512
0.487856
opspace.py
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 (float) representing ...
/rvd_distributions-0.1.tar.gz/rvd_distributions-0.1/rvd_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
from typing import List, Tuple from rvid.networknumbers.client import ExampleIntsClient from rvid.seq.basic import RIDMaker from rvid.seq.common import RIDType, epoch_ms2rid, epoch_ms_now class RIDMakerProxy(RIDMaker): def __init__(self) -> None: super().__init__() self.client = ExampleIntsClient...
/rvid.seq-0.2.0-py3-none-any.whl/rvid/netseq/client.py
0.664758
0.427755
client.py
pypi
from logging import getLogger from typing import Callable, Dict, Sequence from rvid.networknumbers.request import RequestForNumbers from rvid.networknumbers.server import NumberRequestTCPHandler from rvid.seq.common import epoch_ms_now log = getLogger(__name__) class TranchKeeper: """ TODO: Split out generi...
/rvid.seq-0.2.0-py3-none-any.whl/rvid/netseq/server.py
0.758958
0.167049
server.py
pypi
import re import time from typing import NewType _allowed_letters = "A-HJ-NP-Y0-9*#" # No India or Oscar RID_REGEXP = re.compile( "^([%s]{3})-([%s]{3})-([%s]{3})$" % ((_allowed_letters,) * 3), re.IGNORECASE ) BASE35_CHARS = "0123456789ABCDEFGH*JKLMN#PQRSTUVWXY" RIDType = NewType("RIDType", str) # String like ABC...
/rvid.seq-0.2.0-py3-none-any.whl/rvid/seq/common.py
0.711431
0.20266
common.py
pypi
import os import shutil from dataclasses import dataclass, field from logging import getLogger from pathlib import Path from typing import List, Optional, Pattern, Union log = getLogger(__name__) @dataclass class ExternalResources: """ Represent one or more external file that is referenced from a tex-file. ...
/rvid.tex_runner-0.2.0-py3-none-any.whl/rvid/tex_runner/external_resources.py
0.84759
0.266333
external_resources.py
pypi
## `rvlib` Anyone who has used [`Distributions.jl`](https://github.com/JuliaStats/Distributions.jl) will tell you how nice the interface is relative to the "exotic" (the most polite word we can think of) interface to distributions exposed by [scipy.stats](http://docs.scipy.org/doc/scipy-0.17.1/reference/stats.html). `...
/rvlib-0.0.6.tar.gz/rvlib-0.0.6/README.md
0.476336
0.969179
README.md
pypi
.. image:: https://img.shields.io/pypi/v/rvmath.svg :target: https://pypi.python.org/pypi/rvmath :alt: Latest Version .. image:: https://img.shields.io/pypi/l/rvmath.svg :target: https://pypi.python.org/pypi/rvmath :alt: License .. image:: https://img.shields.io/pypi/pyversions/rvmath.svg :target:...
/rvmath-0.1.tar.gz/rvmath-0.1/README.rst
0.944177
0.752013
README.rst
pypi
from PIL import Image, ImageDraw, ImageFont from io import BytesIO from base64 import b64encode from requests import get class ImageToASCII: def __init__(self, image_path, source='local', font_path=None, font_size=15, charset=list('#Wo- ')): if source == 'array': self.image = Image.fromarray(im...
/rvmendillo_image_to_ascii-1.6.4-py3-none-any.whl/rvmendillo_image_to_ascii/__init__.py
0.551815
0.184915
__init__.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F class Similarity(nn.Module): def __init__(self, encoder, config): super(Similarity, self).__init__() self.config = config self.encoder = encoder self.hidden_similarity_size = config.hidden_similarity_size se...
/rvnn-0.0.1.tar.gz/rvnn-0.0.1/pytree/models/similarity/modeling_similarity.py
0.924858
0.346458
modeling_similarity.py
pypi
import nltk from tqdm.auto import tqdm import numpy as np class GloveTokenizer: def __init__(self, glove_file_path, vocab_size=None): self.glove_file_path = glove_file_path vocab, self.embeddings_arr = self._read_embedding_file(glove_file_path, vocab_size) self.unk_token_id = 1 se...
/rvnn-0.0.1.tar.gz/rvnn-0.0.1/pytree/data/glove_tokenizer.py
0.773986
0.272817
glove_tokenizer.py
pypi
import re def prepare_input_from_constituency_tree(constituency_tree): cons_tree = ConsTree([]) tree = cons_tree.read_tree(constituency_tree[5:-1]) tree.close_unaries() tree.left_markovize(dummy_annotation="") const = cons_tree.linearize_parse_tree(str(tree)) clean_const = re.sub(r'\(([^ ]+) '...
/rvnn-0.0.1.tar.gz/rvnn-0.0.1/pytree/data/constituency_tree.py
0.630002
0.308542
constituency_tree.py
pypi
import warnings import numpy as np from matplotlib.cm import get_cmap from matplotlib.colors import LinearSegmentedColormap def gray_scale_to_color_ramp(gray_scale, colormap, min_colormap_cut=None, max_colormap_cut=None, alpha=False, output_8bit=True): """ Turns normalized gray ...
/rvt_py-2.2.1.tar.gz/rvt_py-2.2.1/rvt/blend_func.py
0.900004
0.532972
blend_func.py
pypi
import requests import pandas as pd class rw_api_tools: def __init__(self): """constructor for this class""" self.data = "None yet" def get_rw_datasets(provider=None): url = "https://api.resourcewatch.org/v1/dataset?sort=slug,-provider,userId&status=saved&includes=metadata,voc...
/rw_api1-1.0.3-py3-none-any.whl/rw_api_tools/rw_api_tools.py
0.401219
0.21213
rw_api_tools.py
pypi
import os from pathlib import Path from dependence.function_write import * from dependence.function_read import * from dependence.control_folder_exist import * __all__ = [ "file_rw", ] def file_rw(file_path, data=None, mode='read', sep=',', file_extension='csv', parent_directory=None, serie=False, ...
/rw_dataframe_data_io-0.1.4.tar.gz/rw_dataframe_data_io-0.1.4/utils/DataIO.py
0.571049
0.276324
DataIO.py
pypi
# rw-dynamicworld-cd A repository holding code and example notebooks for change detection methods and post-classificaiton processing for the Dynamic World Land Cover product. Dynamic World is a joint iniative between the World Resources Institute, Natioanl Geographic Society, Google, and Impact Observatory. The Dynamic...
/rw-dynamicworld-cd-0.0.1.tar.gz/rw-dynamicworld-cd-0.0.1/README.md
0.89112
0.992547
README.md
pypi
import os import ee import numpy as np import pandas as pd import random import itertools def pretty_print_confusion_matrix_binary(confusion_list): """ Function to print a confusion matrix list Args: confusion_list (List): a list of confusion matrix values, can be taken from ee.ConfusionMatrix().g...
/rw-dynamicworld-cd-0.0.1.tar.gz/rw-dynamicworld-cd-0.0.1/wri_change_detection/gee_classifier.py
0.803637
0.595287
gee_classifier.py
pypi
import os import ee import numpy as np import pandas as pd import random import json import calendar import time #Image bands must be ordered by increasing years def getYearStackIC(image, band_names, band_indices=[-1,0,1]): """ Function takes an image with bands for each time period (e.g. annual) and returns ...
/rw-dynamicworld-cd-0.0.1.tar.gz/rw-dynamicworld-cd-0.0.1/wri_change_detection/preprocessing.py
0.759047
0.545165
preprocessing.py
pypi
import pandas import matplotlib.pyplot as plt import numpy as np import argparse import seaborn as sns import os import json import math from matplotlib.ticker import LogFormatterSciNotation parser = argparse.ArgumentParser() parser.add_argument("csv", type=str, help="Data to plot", nargs="*") parser.add_argument("--o...
/rw_noise-0.1.2.tar.gz/rw_noise-0.1.2/evaluation/plot_results.py
0.4206
0.395076
plot_results.py
pypi
from __future__ import absolute_import from .generic import * class ScipyStorable(Storable): def __init__(self, python_type, key=None, handlers=[]): Storable.__init__(self, python_type, key, handlers) self.deprivatize = True class ScipySpatialStorable(ScipyStorable): @property def defaul...
/rwa-python-0.9.3.tar.gz/rwa-python-0.9.3/rwa/scipy.py
0.41941
0.217691
scipy.py
pypi
import os import glob import logging from typing import List import numpy as np import matplotlib.pyplot as plt __all__ = ('write_bp_to_disk', 'write_it_to_disk', 'plot_bp') logger = logging.getLogger(__name__) def write_bp_to_disk(result_dir: str, filename: str, bplist: List[float]) -> None: ...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/io.py
0.807271
0.276094
io.py
pypi
from typing import Callable, Union from ..net import Lightpath, Network from .routing import dijkstra, yen from .wlassignment import vertex_coloring, first_fit, random_fit from .ga import GeneticAlgorithm __all__ = ( 'dijkstra_vertex_coloring', 'dijkstra_first_fit', 'yen_vertex_coloring', 'yen_first_f...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/rwa.py
0.924135
0.635534
rwa.py
pypi
import logging from typing import List, Tuple, Union from .pop import Population from .env import evaluate, select, cross, mutate from ...net import Network __all__ = ( 'GeneticAlgorithm', ) logger = logging.getLogger(__name__) class GeneticAlgorithm(object): """Genetic algorithm Chromosomes are encod...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/ga/ga.py
0.895271
0.593521
ga.py
pypi
from __future__ import annotations import copy import logging from typing import List, Set, Union import numpy as np from .chromo import Chromosome __all__ = ( 'Population', ) logger = logging.getLogger(__name__) class Population(object): """Class to store a collection of Chromosome objects Populati...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/ga/pop.py
0.842831
0.45048
pop.py
pypi
import logging from itertools import count from typing import List import numpy as np __all__ = ( 'Fitness', 'Chromosome' ) logger = logging.getLogger(__name__) np.set_printoptions(precision=2) class Fitness(object): """Fitness 'namedtuple'-like object Easy to handle ready-to-use properties such a...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/ga/chromo.py
0.920272
0.440168
chromo.py
pypi
import logging import numpy as np from .utils import gof from .chromo import Chromosome, Fitness from .pop import Population from ...net import Network __all__ = ( 'evaluate', 'select', 'cross', 'mutate', ) logger = logging.getLogger(__name__) def evaluate(net: Network, chromosome: Chromosome) -> F...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/ga/env.py
0.685739
0.566798
env.py
pypi
from itertools import count from typing import Union import numpy as np import networkx as nx # FIXME https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles from ...net import Network, Lightpath def vertex_coloring(net: Network, lightpath: Lightpath) -> Union[int, None]: """Vertex coloring algor...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/rwa/wlassignment/vcolor.py
0.541651
0.535281
vcolor.py
pypi
from typing import Dict, List, Tuple from collections import OrderedDict from . import Network class RedeNacionalPesquisa(Network): """Rede (Brasileira) Nacional de Pesquisa (Rede Ipê / RNP)""" def __init__(self, ch_n): self._name = 'rnp' self._fullname = u'Rede Nacional de Pesquisas (Rede I...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/net/rnp.py
0.791338
0.428712
rnp.py
pypi
__author__ = 'Cassio Batista' import logging from itertools import count from operator import itemgetter from typing import Iterable, List, Tuple import numpy as np import matplotlib.pyplot as plt __all__ = ( 'Lightpath', 'AdjacencyMatrix', 'WavelengthAvailabilityMatrix', 'TrafficMatrix', 'Networ...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/net/net.py
0.900825
0.617686
net.py
pypi
from typing import Dict, List, Tuple from collections import OrderedDict from . import Network class Italian(Network): """Italian Network""" def __init__(self, ch_n): self._name = 'italian' self._fullname = u'Italian' self._s = 0 # FIXME self._d = 12 super().__init__...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/net/italian.py
0.49292
0.437884
italian.py
pypi
from typing import Dict, List, Tuple from collections import OrderedDict from . import Network class AdvancedResearchProjectsAgency(Network): """U.S. Advanced Research Projects Agency (ARPANET)""" def __init__(self, ch_n): self._name = 'arpa' self._fullname = u'Advanced Research Projects Age...
/rwa_wdm-0.2.3.tar.gz/rwa_wdm-0.2.3/rwa_wdm/net/arpa.py
0.496094
0.39712
arpa.py
pypi
<p align="center"> <img width="350px" src="docs/img/rware.png" align="center" alt="Multi-Robot Warehouse (RWARE)" /> <p align="center">A multi-agent reinforcement learning environment</p> </p> [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/co...
/rware-1.0.3.tar.gz/rware-1.0.3/README.md
0.755637
0.971293
README.md
pypi
import math from typing import Dict, Optional from rweb_datatable.html import Node from rweb_datatable.models import Table, TableContext, SortColumn, Dataset, Column, Pagination, PaginationPage from rweb_datatable.utils import url, make_table_section_id def get_table_context_from_args(table: Table, args: dict, extra...
/rweb_datatable-0.1.18.tar.gz/rweb_datatable-0.1.18/rweb_datatable/__init__.py
0.733547
0.255646
__init__.py
pypi
from dataclasses import dataclass, field from typing import Union, Callable, Any, Optional, Dict, List StringOrCallable = Union[None, str, Callable[..., str]] @dataclass class Column: id: str title: str is_sortable: bool = field(default=True) render_header: StringOrCallable = field(default=None) ...
/rweb_datatable-0.1.18.tar.gz/rweb_datatable-0.1.18/rweb_datatable/models.py
0.861902
0.310812
models.py
pypi
from copy import copy from typing import Union, Callable, Optional from rweb_datatable.html import Node from rweb_datatable.models import Column, Table, Dataset, TableContext, Pagination from rweb_datatable.utils import url, make_table_section_id def render_table_section( data: Dataset, table: Table, context: Ta...
/rweb_datatable-0.1.18.tar.gz/rweb_datatable-0.1.18/rweb_datatable/renderers/htmx.py
0.640861
0.267381
htmx.py
pypi
import abc import builtins import datetime import enum import typing import jsii import jsii.compat import publication from ._jsii import * import aws_cdk.aws_ec2 import aws_cdk.aws_iam import aws_cdk.aws_lambda import aws_cdk.aws_logs import aws_cdk.aws_sqs import aws_cdk.core class GolangFunction(aws_cdk.aws_lam...
/rwilinski.aws-lambda-golang-0.1.1.tar.gz/rwilinski.aws-lambda-golang-0.1.1/src/rwilinski/aws-lambda-golang/__init__.py
0.622459
0.18352
__init__.py
pypi
# rwkv.cpp This is a port of [BlinkDL/RWKV-LM](https://github.com/BlinkDL/RWKV-LM) to [ggerganov/ggml](https://github.com/ggerganov/ggml). Besides the usual **FP32**, it supports **FP16** and **quantized INT4** inference on CPU. This project is **CPU only**. RWKV is a novel large language model architecture, [with t...
/rwkv_cpp_python-0.0.1.tar.gz/rwkv_cpp_python-0.0.1/README.md
0.414188
0.940134
README.md
pypi
import argparse import os import pathlib import time import sampling import tokenizers import rwkv_cpp_model import rwkv_cpp_shared_library # ======================================== Script settings ======================================== prompt: str = """# rwkv.cpp This is a port of [BlinkDL/RWKV-LM](https://git...
/rwkv_cpp_python-0.0.1.tar.gz/rwkv_cpp_python-0.0.1/rwkv/generate_completions.py
0.558809
0.403097
generate_completions.py
pypi
import os import sys import argparse import pathlib import sampling import tokenizers import rwkv_cpp_model import rwkv_cpp_shared_library # ======================================== Script settings ======================================== # Copied from https://github.com/ggerganov/llama.cpp/blob/6e7801d08d81c931a542...
/rwkv_cpp_python-0.0.1.tar.gz/rwkv_cpp_python-0.0.1/rwkv/chat_with_bot.py
0.467575
0.267193
chat_with_bot.py
pypi
import os import time import pathlib import argparse import tokenizers import torch import rwkv_cpp_model import rwkv_cpp_shared_library from typing import List def parse_args(): parser = argparse.ArgumentParser(description='Measure perplexity and per-token latency of an RWKV model on a given text file') pars...
/rwkv_cpp_python-0.0.1.tar.gz/rwkv_cpp_python-0.0.1/rwkv/measure_pexplexity.py
0.809878
0.321966
measure_pexplexity.py
pypi