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 dash_bio as dashbio from .base import * representation_options = [ {"label": "backbone", "value": "backbone"}, {"label": "ball+stick", "value": "ball+stick"}, {"label": "cartoon", "value": "cartoon"}, {"label": "hyperball", "value": "hyperball"}, {"label": "licorice", "value": "licorice"},...
/rostspace-0.1.1-py3-none-any.whl/src/visualization/pdb.py
0.591133
0.185892
pdb.py
pypi
# ROT2Prog This is a python interface to the [Alfa ROT2Prog Controller](http://alfaradio.ca/docs/Manuals/RAS/Alfa_ROT2Prog_Controller-28March2019-Master.pdf). The ROT2Prog is an electronic controller used for turning rotators. The Controller may be connected to one Azimuth and Elevation rotator and operates with direc...
/rot2prog-0.0.9.tar.gz/rot2prog-0.0.9/README.md
0.871557
0.972072
README.md
pypi
import struct from typing import Callable, Dict import minimalmodbus import cachetools.func from loguru import logger as log def bits_to_dict(value, structure_class: Callable): cs = structure_class() struct.pack_into( cs.pack_format, cs, 0, value ) fields = [item[0] fo...
/rotary_controller_python-0.1.6-py3-none-any.whl/rotary_controller_python/utils/bitfields.py
0.700485
0.288908
bitfields.py
pypi
from inspect import isfunction import numpy as np import tensorflow as tf from tensorflow.keras import layers # helper functions #The three functions of rearrange, irearrange and repeat have been written # due to the incompatibility of the einops library with tensorflow 2.x. def rearrange(x, r=2): b = tf.shape...
/rotary-embedding-tensorflow-0.1.1.tar.gz/rotary-embedding-tensorflow-0.1.1/rotary_embedding_tensorflow/rotary_embedding_tensorflow.py
0.761627
0.703779
rotary_embedding_tensorflow.py
pypi
from math import pi, log import torch from torch import nn, einsum from einops import rearrange, repeat # helper functions def exists(val): return val is not None def broadcat(tensors, dim = -1): num_tensors = len(tensors) shape_lens = set(list(map(lambda t: len(t.shape), tensors))) assert len(shap...
/rotary_embedding_torch-0.2.7-py3-none-any.whl/rotary_embedding_torch/rotary_embedding_torch.py
0.89526
0.691797
rotary_embedding_torch.py
pypi
# Standard library modules. import collections import datetime import fnmatch import functools import logging import os import re # External dependencies. from dateutil.relativedelta import relativedelta from executor import execute from humanfriendly import format_path, parse_path, Timer from humanfriendly.text impor...
/rotate-backups-s3-0.3.tar.gz/rotate-backups-s3-0.3/rotate_backups_s3/__init__.py
0.748628
0.187356
__init__.py
pypi
from Xlib import display from Xlib.ext import randr from typing import List, Tuple # Create an X display and get the root window + its resources d = display.Display() root = d.screen().root res = root.xrandr_get_screen_resources() class Display: def __init__(self, output_id, crtc_id): self._output_id = ...
/rotate-screen-0.1.5.tar.gz/rotate-screen-0.1.5/rotatescreen/display_linux.py
0.828211
0.281347
display_linux.py
pypi
from typing import Dict, List, Tuple import win32api import win32con class Display: def __init__(self, hMonitor): self.hMonitor = hMonitor def __repr__(self): return f"<'{self.device_description[0]}' object>" def rotate_to(self, degrees: int) -> None: if degrees == 90: ...
/rotate-screen-0.1.5.tar.gz/rotate-screen-0.1.5/rotatescreen/display.py
0.875999
0.363788
display.py
pypi
__all__ = ['NotFittedError', 'ChangedBehaviorWarning', 'ConvergenceWarning', 'DataConversionWarning', 'DataDimensionalityWarning', 'EfficiencyWarning', 'FitFailedWarning', 'NonBLASDotWarning', 'UndefinedMetricWarning'] class NotFi...
/rotation_forest-0.4-py3-none-any.whl/rotation_forest/_exceptions.py
0.893397
0.553083
_exceptions.py
pypi
import numpy as np from sklearn.tree import DecisionTreeClassifier from sklearn.tree._tree import DTYPE from sklearn.ensemble._forest import ForestClassifier from sklearn.utils import resample, gen_batches, check_random_state from sklearn.decomposition import PCA def random_feature_subsets(array, batch_size, random_...
/rotation_forest-0.4-py3-none-any.whl/rotation_forest/rotation_forest.py
0.898053
0.429609
rotation_forest.py
pypi
from typing import List, Union import numpy as np import pandas as pd from sklearn.metrics import accuracy_score from RotationTree import RotationTree class RotationForest: """Forest with RotationTree as base estimator. Algorithm: Building n_estimator of RotationTree. Args: n_estimators (in...
/rotation-random-forest-0.1.1.tar.gz/rotation-random-forest-0.1.1/rotation_random_forest/RotationRandomForest.py
0.94795
0.73782
RotationRandomForest.py
pypi
from typing import Iterable, List import numpy as np import pandas as pd from sklearn.decomposition import PCA from sklearn.tree import DecisionTreeClassifier class RotationTree: """Base estimator for RotaionForest. Algorithm: Split feature set into k features subsets. For every subset select a boot...
/rotation-random-forest-0.1.1.tar.gz/rotation-random-forest-0.1.1/rotation_random_forest/RotationTree.py
0.954932
0.795896
RotationTree.py
pypi
from copy import deepcopy from math import sqrt from torch import Tensor from torch.nn.modules import Linear from rotational_update.layers.base import Rotatable from rotational_update.layers.functions.static import RotationalLinearFunctionByInsertingGrad from rotational_update.layers.functions.static import Rotationa...
/rotational_update-0.0.18-py3-none-any.whl/rotational_update/layers/static.py
0.824356
0.566438
static.py
pypi
import torch from torch.autograd import Function from torch.nn.functional import linear from torch import Tensor class RotationalLinearFunction(Function): @staticmethod def forward(ctx, *args) -> Tensor: x, w, b, learn_left, learn_right = args learn_l = torch.as_tensor(learn_left).requires_gra...
/rotational_update-0.0.18-py3-none-any.whl/rotational_update/layers/functions/static.py
0.822546
0.794425
static.py
pypi
Rotest ------ .. image:: https://img.shields.io/pypi/v/rotest.svg :alt: PyPI :target: https://pypi.org/project/rotest/ .. image:: https://img.shields.io/pypi/pyversions/rotest.svg :alt: PyPI - Python Version :target: https://pypi.org/project/rotest/ .. image:: https://github.com/gregoil/rotest/workfl...
/rotest-8.3.1.tar.gz/rotest-8.3.1/README.rst
0.862901
0.683525
README.rst
pypi
import os import pandas as pd from ncs.data.downloader import download_and_extract def data_folder(): """ Retrieves the path to the data folder. The data folder is in the user's home directory on Linux (i.e. /home/username/rotman_ncs_data/ncs_data) and on Windows (i.e. C:\\Users\\username\\AppData\...
/rotman_ncs-0.1.0a7-py3-none-any.whl/ncs/data/__init__.py
0.659186
0.334916
__init__.py
pypi
from ..data import load_stock_returns_on_calls, load_call_statements from .config import default_role_weights, default_section_weights, default_statement_type_weights, default_holding_period import pandas as pd from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split from s...
/rotman_ncs-0.1.0a7-py3-none-any.whl/ncs/model/train.py
0.885631
0.370339
train.py
pypi
from .config import default_role_weights, default_section_weights, default_statement_type_weights from ..data import load_call_statements import pandas as pd import os import pickle import warnings warnings.filterwarnings('ignore') cur_dir = os.path.dirname(os.path.realpath(__file__)) call_statement_data = load_call...
/rotman_ncs-0.1.0a7-py3-none-any.whl/ncs/model/inference.py
0.684159
0.156911
inference.py
pypi
import hashlib from typing import * from pathlib import Path from enum import Enum from rich.progress import track from typer import Argument, Option from .app import app class InvalidHashAlgoException(Exception): def __init__(self, hash_name: str): super().__init__(f"{hash_name} is not supported") cl...
/modules/common/hash.py
0.745306
0.253249
hash.py
pypi
import sys import types import typing # [ Imports:Third Party ] import din # [ Exports ] __all__ = ( 'Coro', 'RecordedCoro', 'Yielded', 'Returned', 'Raised', 'OutputType', 'ThrowableType', 'WrappableObjType', 'WrappableFuncType', ) def __dir__() -> typing.Tuple[str, ...]: # pra...
/rototiller-0.3.0-py3-none-any.whl/rototiller.py
0.649467
0.254477
rototiller.py
pypi
from sklearn.decomposition import PCA import matplotlib.pyplot as plt import seaborn as sns import numpy as np def plot_rots(rots_res, fdr=0.05, type=None): # Check for plot type if type is not None: if type not in ["volcano", "heatmap", "ma", "reproducibility", "pvalue", "pca"]: raise ValueError("Plot...
/rots-py-1.2.2.tar.gz/rots-py-1.2.2/src/rotspy/plot_rots.py
0.70477
0.516108
plot_rots.py
pypi
import numpy as np from numba import njit, jit import pandas as pd from tqdm import tqdm import warnings from optim_cy import optim @jit(nopython=True, error_model='numpy') def bootstrapSamples(B, labels, paired): samples = np.zeros((B, len(labels))) for i in range(B): for label in np.unique(labels): ...
/rots-py-1.2.2.tar.gz/rots-py-1.2.2/src/rotspy/helpers.py
0.439266
0.563018
helpers.py
pypi
import argparse import math import sys from argparse import ArgumentParser import matplotlib as mpl import matplotlib.colors as colors import matplotlib.pyplot as plt import numpy as np import rotsim2d.dressedleaf as dl import rotsim2d.pathways as pw import rotsim2d.visual as vis from asteval import Interpreter from m...
/rotsim2d_apps-0.3.2.tar.gz/rotsim2d_apps-0.3.2/rotsim2d_apps/peak_picker.py
0.546738
0.215536
peak_picker.py
pypi
from pathlib import Path import string import sys from argparse import ArgumentParser from pprint import pprint from typing import List, Sequence import rotsim2d.dressedleaf as dl import rotsim2d.pathways as pw import rotsim2d.propagate as prop import toml from asteval import Interpreter class HelpfulParser(Argument...
/rotsim2d_apps-0.3.2.tar.gz/rotsim2d_apps-0.3.2/rotsim2d_apps/rotsim2d_calc.py
0.446495
0.213367
rotsim2d_calc.py
pypi
import sys import matplotlib as mpl import numpy as np import PyQt5 import rotsim2d.dressedleaf as dl import rotsim2d.pathways as pw import rotsim2d.symbolic.functions as sym from PyQt5 import Qt, QtCore, QtGui, QtWidgets from .AngleWidget import Ui_AngleWidget from .PolarizationsUI import Ui_MainWindow class Model...
/rotsim2d_apps-0.3.2.tar.gz/rotsim2d_apps-0.3.2/rotsim2d_apps/polarizations/main.py
0.402744
0.15863
main.py
pypi
import matplotlib import matplotlib.cm as cm import matplotlib.colors as clrs import numpy as np from matplotlib.backends.backend_qt5agg import \ NavigationToolbar2QT as NavigationToolbar from matplotlib.colorbar import Colorbar from matplotlib.widgets import MultiCursor from PyQt5 import QtWidgets from ..MplCanva...
/rotsim2d_apps-0.3.2.tar.gz/rotsim2d_apps-0.3.2/rotsim2d_apps/polarizations/PolarizationWidget.py
0.728748
0.399343
PolarizationWidget.py
pypi
import click from rotten_tomatoes_client import MovieBrowsingQuery from data import BrowseStreamingMovieCategory, BrowseMovieInTheaterCategory, MovieService, MovieGenre, BrowseSortBy from data.services import RottenTomatoesMoviesBrowser from tables.builders import BrowseMovieTableBuilder from tables.rows.builders impo...
/rotten_tomatoes_cli-0.0.3.tar.gz/rotten_tomatoes_cli-0.0.3/scripts/movies.py
0.433022
0.180865
movies.py
pypi
from data import TvShowSearchResult, MovieSearchResult, BrowseTvShowResult, BrowseMovieResult class TvShowSearchResultsParser: def __init__(self): pass def parse(self, tv_show_results): return [ TvShowSearchResult(name=tv_show_result["title"], start_...
/rotten_tomatoes_cli-0.0.3.tar.gz/rotten_tomatoes_cli-0.0.3/data/parsers.py
0.688468
0.190442
parsers.py
pypi
from textwrap import wrap from termcolor import colored from tables.utilities import RottenTomatoesScoreFormatter, MpaaRatingFormatter, convert_to_ascii, clean_html, formatted_header class MovieSearchRowBuilder: def __init__(self): self.rating_formatter = RottenTomatoesScoreFormatter() def build(s...
/rotten_tomatoes_cli-0.0.3.tar.gz/rotten_tomatoes_cli-0.0.3/tables/rows/builders.py
0.753013
0.312658
builders.py
pypi
![tests](https://github.com/preritdas/rottentomatoes-python/actions/workflows/pytest.yml/badge.svg) ![pypi](https://github.com/preritdas/rottentomatoes-python/actions/workflows/python-publish.yml/badge.svg) [![PyPI version](https://badge.fury.io/py/rottentomatoes-python.svg)](https://badge.fury.io/py/rottentomatoes-pyt...
/rottentomatoes-python-0.6.2.tar.gz/rottentomatoes-python-0.6.2/README.md
0.470493
0.938801
README.md
pypi
from pydantic import ConfigDict, BaseModel, Field class MovieQuery(BaseModel): """Job request, querying for a movie.""" name: str = Field(..., title="Name of the movie you're searching for.") # Model configuration model_config = ConfigDict(json_schema_extra={"example": {"name": "top gun"}}) class M...
/rottentomatoes-python-0.6.2.tar.gz/rottentomatoes-python-0.6.2/api/models.py
0.871229
0.397441
models.py
pypi
import requests import re from typing import List from . import utils from .exceptions import LookupError class SearchListing: """A search listing from the Rotten Tomatoes search page.""" def __init__(self, has_tomatometer: bool, is_movie: bool, url: str) -> None: self.has_tomatometer = has_tomatome...
/rottentomatoes-python-0.6.2.tar.gz/rottentomatoes-python-0.6.2/rottentomatoes/search.py
0.877975
0.271475
search.py
pypi
from bs4 import BeautifulSoup # Non-local imports import json import requests # interact with RT website from typing import List # Project modules from .exceptions import * from . import search from . import utils def _movie_url(movie_name: str) -> str: """Generates a target url on the Rotten Tomatoes website ...
/rottentomatoes-python-0.6.2.tar.gz/rottentomatoes-python-0.6.2/rottentomatoes/standalone.py
0.871639
0.478712
standalone.py
pypi
from . import standalone class Movie: """ Accepts the name of a movie and automatically fetches all attributes. Raises `exceptions.LookupError` if the movie is not found on Rotten Tomatoes. """ def __init__(self, movie_title: str = "", force_url: str = "") -> None: if not movie_title and n...
/rottentomatoes-python-0.6.2.tar.gz/rottentomatoes-python-0.6.2/rottentomatoes/movie.py
0.838481
0.405802
movie.py
pypi
from __future__ import absolute_import import six import rouge_chinese.rouge_score as rouge_score import io import os import re class FilesRouge: def __init__(self, *args, **kwargs): """See the `Rouge` class for args """ self.rouge = Rouge(*args, **kwargs) def _check_files(self, hyp_p...
/rouge_chinese-1.0.3.tar.gz/rouge_chinese-1.0.3/rouge_chinese/rouge.py
0.746878
0.355467
rouge.py
pypi
import os import re import shutil import subprocess import sys from glob import glob from tempfile import mkdtemp from typing import Dict, List, Optional from rouge_metric import perl_cmd if sys.version_info < (3,): def makedirs(name, mode=0o777, exist_ok=False): if not os.path.isdir(name): os...
/rouge_metric-1.0.1-py3-none-any.whl/rouge_metric/perl_rouge.py
0.593609
0.42483
perl_rouge.py
pypi
import os import subprocess from typing import List, Optional HERE = os.path.dirname(__file__) ROUGE_HOME = os.path.join(HERE, 'RELEASE-1.5.5') ROUGE_EXEC = os.path.join(ROUGE_HOME, 'ROUGE-1.5.5.pl') ROUGE_DATA_HOME = os.path.join(ROUGE_HOME, 'data') ROUGE_DB = os.path.join(ROUGE_DATA_HOME, 'WordNet-2.0.exc.db') ROUGE...
/rouge_metric-1.0.1-py3-none-any.whl/rouge_metric/perl_cmd.py
0.695441
0.269902
perl_cmd.py
pypi
from __future__ import division import collections import itertools from typing import (List, Dict, Callable, Tuple, Iterable, Set, Counter, Union, Optional) NGramsType = Counter[Tuple[str]] ScoreType = Dict[str, float] RougeType = Dict[str, Dict[str, float]] try: from math import isclose exc...
/rouge_metric-1.0.1-py3-none-any.whl/rouge_metric/py_rouge.py
0.82485
0.340636
py_rouge.py
pypi
from __future__ import absolute_import import six import rouge_mongolian.rouge_score as rouge_score import io import os import re class FilesRouge: def __init__(self, *args, **kwargs): """See the `Rouge` class for args """ self.rouge = Rouge(*args, **kwargs) def _check_files(self, hyp_...
/rouge_mongolian-1.0.2-py3-none-any.whl/rouge_mongolian/rouge.py
0.747892
0.402686
rouge.py
pypi
from collections import defaultdict import logging def filter_graphalignments(file_name, min_mapq=50): f = open(file_name) alignments = defaultdict(list) # read id to list of alignments for i, line in enumerate(f): if i % 1000000 == 0: logging.info("Read %d lines" % i) l = li...
/rough_graph_mapper-0.0.4-py3-none-any.whl/rough_graph_mapper/filter_graphalignments.py
0.422505
0.223695
filter_graphalignments.py
pypi
import os from .util import split_sam_by_chromosomes, run_bwa_mem, run_hybrid_between_bwa_and_minimap from multiprocessing import Process import logging from .sam_to_graph_aligner import SamToGraphAligner logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s') def map_single_chromoso...
/rough_graph_mapper-0.0.4-py3-none-any.whl/rough_graph_mapper/linear_to_graph_mapper.py
0.450359
0.151875
linear_to_graph_mapper.py
pypi
import ctypes import numpy as np from .dlpack import _c_str_dltensor, DLManagedTensor, DLTensor ctypes.pythonapi.PyCapsule_IsValid.restype = ctypes.c_int ctypes.pythonapi.PyCapsule_IsValid.argtypes = [ctypes.py_object, ctypes.c_char_p] ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p ctypes.pythonapi.P...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/dlpack/apps/numpy_dlpack/dlpack/to_numpy.py
0.847527
0.353289
to_numpy.py
pypi
import ctypes _c_str_dltensor = b"dltensor" class DLDeviceType(ctypes.c_int): """The enum that encodes the type of the device where DLTensor memory is allocated. """ kDLCPU = 1 kDLCUDA = 2 kDLCUDAHost = 3 kDLOpenCL = 4 kDLVulkan = 7 kDLMetal = 8 kDLVPI = 9 kDLROCM = 10 ...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/dlpack/apps/numpy_dlpack/dlpack/dlpack.py
0.794106
0.367242
dlpack.py
pypi
from typing import Callable import numpy as np import ctypes from .dlpack import DLManagedTensor, DLDevice, DLDataType, _c_str_dltensor ctypes.pythonapi.PyMem_RawMalloc.restype = ctypes.c_void_p ctypes.pythonapi.PyMem_RawFree.argtypes = [ctypes.c_void_p] ctypes.pythonapi.PyCapsule_New.restype=ctypes.py_object ctype...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/dlpack/apps/numpy_dlpack/dlpack/from_numpy.py
0.877948
0.382228
from_numpy.py
pypi
from collections import namedtuple import os import re CPP_SEP = '/' Include = namedtuple('Include', ['path', 'line_no']) ''' Represents a file path ''' class Path(list): def __init__(self, *args): super().__init__() if (len(args) > 0 and type(args[0]) is list): for p in args[0]: ...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/csv-parser/single_header.py
0.413596
0.152631
single_header.py
pypi
# Vince's CSV Parser [![Build Status](https://travis-ci.com/vincentlaucsb/csv-parser.svg?branch=master)](https://travis-ci.com/vincentlaucsb/csv-parser) * [Motivation](#motivation) * [Documentation](#documentation) * [Integration](#integration) * [C++ Version](#c-version) * [Single Header](#single-header) ...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/csv-parser/README.md
0.638046
0.873161
README.md
pypi
.. figure:: https://github.com/pybind/pybind11/raw/master/docs/pybind11-logo.png :alt: pybind11 logo **pybind11 — Seamless operability between C++11 and Python** |Latest Documentation Status| |Stable Documentation Status| |Gitter chat| |GitHub Discussions| |CI| |Build status| |Repology| |PyPI package| |Conda-forg...
/RoughPy-0.0.1.tar.gz/RoughPy-0.0.1/external/pybind11/README.rst
0.921996
0.731562
README.rst
pypi
import typing as t import urllib.parse import functools import horseman.parsers import horseman.types import horseman.http import horseman.meta from dataclasses import dataclass from roughrider.routing.meta import Route class Request(horseman.meta.Overhead): __slots__ = ( '_content_type', '_cooki...
/roughrider.application-0.3.1.tar.gz/roughrider.application-0.3.1/src/roughrider/application/request.py
0.58676
0.160694
request.py
pypi
from typing import Optional, Iterable, NamedTuple, Literal, Tuple, Iterator Header = Tuple[str, str] Headers = Iterator[Header] HTTPVerb = Literal[ "GET", "HEAD", "PUT", "DELETE", "PATCH", "POST", "OPTIONS"] class CORSPolicy(NamedTuple): origin: str = "*" methods: Optional[Iterable[HTTPVerb]] = None ...
/roughrider.cors-0.1.tar.gz/roughrider.cors-0.1/src/roughrider/cors/policy.py
0.798815
0.167423
policy.py
pypi
from frozendict import frozendict from typing import cast, Optional, Union, Any, Mapping, List, NoReturn, Iterable, Tuple, Dict Pairs = Iterable[Tuple[str, Any]] class FormData(Dict[str, List[Any]]): def __init__(self, data: Optional[Union['FormData', Dict, Pairs]] = None): if data is not None: ...
/roughrider.routing-0.2.1.tar.gz/roughrider.routing-0.2.1/src/horseman/src/horseman/datastructures.py
0.910433
0.309389
datastructures.py
pypi
import sys from abc import ABC, abstractmethod from typing import TypeVar from horseman.response import Response from horseman.http import HTTPError from horseman.types import ( WSGICallable, Environ, StartResponse, ExceptionInfo) Data = TypeVar('Data') class Overhead(ABC): """WSGI Environ Overhead aka Requ...
/roughrider.routing-0.2.1.tar.gz/roughrider.routing-0.2.1/src/horseman/src/horseman/meta.py
0.588298
0.252096
meta.py
pypi
try: from typing import Iterable, BinaryIO, Type, ClassVar from pathlib import Path from fs.base import FS from roughrider.storage.meta import FileInfo, Storage, ChecksumAlgorithm class PyFSStorage(Storage): fs: FS checksum_algorithm: ChecksumAlgorithm def __init__(self, ...
/roughrider.storage-0.1.tar.gz/roughrider.storage-0.1/src/roughrider/storage/pyfs.py
0.58439
0.221414
pyfs.py
pypi
import enum import hashlib from abc import ABC, abstractmethod from functools import partial from pathlib import Path from typing import Optional, BinaryIO, Mapping, Iterable, Tuple from typing_extensions import TypedDict ChecksumAlgorithm = enum.Enum( 'Algorithm', { name: partial(hashlib.new, name) ...
/roughrider.storage-0.1.tar.gz/roughrider.storage-0.1/src/roughrider/storage/meta.py
0.848925
0.264765
meta.py
pypi
from typing import Iterable, BinaryIO from pathlib import Path from roughrider.storage.meta import FileInfo, Storage, ChecksumAlgorithm class FilesystemStorage(Storage): checksum_algorithm: ChecksumAlgorithm def __init__(self, name: str, root: Path, algorithm='md5'): self.name = name self.ro...
/roughrider.storage-0.1.tar.gz/roughrider.storage-0.1/src/roughrider/storage/fs.py
0.763572
0.3043
fs.py
pypi
import copy import logging import pandas as pd from pandas import DataFrame, Series class RoughSetSI: """Class RoughSet to model an Information System SI = (X, A). DT = f(X, A, y), where: X - objects of universe, A - attributes describing objects of X, """ def __init__(self, X: DataFr...
/roughsets-base-1.0.1.2.tar.gz/roughsets-base-1.0.1.2/src/roughsets_base/roughset_si.py
0.80969
0.632928
roughset_si.py
pypi
import copy import logging import pandas as pd from pandas import DataFrame, Series from roughsets_base.roughset_si import RoughSetSI class RoughSetDT(RoughSetSI): """Class RoughSet to model a decision table (DT). DT = f(X, A, y), where: X - objects of universe, A - attributes describing objec...
/roughsets-base-1.0.1.2.tar.gz/roughsets-base-1.0.1.2/src/roughsets_base/roughset_dt.py
0.814533
0.561636
roughset_dt.py
pypi
roughviz is a python visualization library for creating sketchy/hand-drawn styled charts. ### Available Charts <ul> <li>Bar (<code>roughviz.bar</code>) </li> <li>Horizontal Bar (<code>roughviz.barh</code>) </li> <li>Pie (<code>roughviz.pie</code>) </li> <li>Donut (<code>roughviz.donut</code>) </li> </ul> ###...
/roughviz-4.0.0.tar.gz/roughviz-4.0.0/README.md
0.553747
0.882782
README.md
pypi
import pandas as pd from sklearn.model_selection import train_test_split from time import time def prepare_data_for_training( df: pd.core.frame.DataFrame, target: str, index_column: str = None, validation_test_size: float = 0.2, verbose: bool = False, ): """takes input data and setting index, ...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/builder/data_prep.py
0.763924
0.566348
data_prep.py
pypi
import numpy as np from collections import namedtuple from sklearn.metrics import classification_report, confusion_matrix Doc = namedtuple( 'Doc', [ "version", "type", "algo", "param", "cv", ] ) def compress_regression_results(l, true_condition=lambda x: x >= 0.6...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/builder/utils.py
0.494873
0.36311
utils.py
pypi
import os from typing import Union import random import pandas as pd from tqdm import tqdm import matplotlib.pyplot as plt from roulette.builder.data_prep import prepare_data_for_training from roulette.builder.save_load_model import load_model from roulette.builder.utils import is_regression_metric, is_binary_classif...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/builder/builder.py
0.837852
0.297142
builder.py
pypi
import random from time import time from collections import namedtuple import numpy as np from roulette.evaluation.simulation_data import ExperimentData, Score from roulette.evaluation.utils import validate_multiple_lists_length from roulette.evaluation.metrics import WD from roulette.evaluation.constants import Expe...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/evaluation/experiment.py
0.867429
0.548432
experiment.py
pypi
import scipy as sp import numpy as np from sklearn.metrics import mean_absolute_error, mean_squared_error, roc_auc_score from roulette.evaluation.constants import MetricsConstants from roulette.evaluation.utils import close_enough,\ validate_multiple_lists_length,\ samples_to_bin_numbers,\ is_binary MSE = ...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/evaluation/metrics.py
0.898066
0.677247
metrics.py
pypi
import json import numpy as np from roulette.evaluation.utils import parse_ndarray_as_float_list from roulette.evaluation.experiment import Experiment from roulette.evaluation.simulation_data import Metrics from roulette.evaluation.metrics import discriminability, certainty from roulette.evaluation.plotting.hist impo...
/roulette_ml-0.1.1-py3-none-any.whl/roulette/evaluation/monte_carlo.py
0.878027
0.559591
monte_carlo.py
pypi
import random from enum import Enum class Color( Enum ) : Green = 0 Red = 1 Black = 2 class Slot: def __init__(self, color, number): self.color = None self.number = number class Wheel: def __init__(self, size=36, number_of_reds=18, number_of_blacks=18, number_of_greens=2): ...
/roulette_simulator-1.0.0-py3-none-any.whl/model/roulette_wheel.py
0.473414
0.305257
roulette_wheel.py
pypi
import random import time import locale import sys import argparse from tabulate import tabulate from .vars.numbers import * from .vars.bets import * from .utils import config # Currency locale locale.setlocale(locale.LC_ALL, '') def showBank(): """ Show current bank """ global currentBank ...
/roulette-1.5.tar.gz/roulette-1.5/src/play.py
0.518302
0.275209
play.py
pypi
from .util import _carb from .util import _fat from .util import _sod_pot from .util import parse_quantity from .util import round_increment def calories(quantity: "int|str") -> str: """Round a calories quantity. Args: quantity (int|str): The quantity to be rounded. Returns: str: The rou...
/round-nutrition-1.1.0.tar.gz/round-nutrition-1.1.0/round_nutrition/general.py
0.906145
0.514217
general.py
pypi
from .util import _vmo def calcium(quantity: "int|str") -> str: """Round a calcium quantity. Args: quantity (int|str): The quantity to be rounded. Returns: str: The rounded calcium quantity. """ return _vmo(quantity, 10, "mg") def potassium(quantity: "int|str") -> str: """R...
/round-nutrition-1.1.0.tar.gz/round-nutrition-1.1.0/round_nutrition/mineral.py
0.960119
0.534187
mineral.py
pypi
from .util import _vmo def vitamin_c(quantity: "int|str"): """Round a vitamin C quantity. Args: quantity (int|str): The quantity to be rounded. Returns: str: The rounded vitamin C quantity. """ return _vmo(quantity, 1, "mg") vit_c = vitamin_c def vitamin_e(quantity: "int|str"...
/round-nutrition-1.1.0.tar.gz/round-nutrition-1.1.0/round_nutrition/vitamin.py
0.930577
0.576244
vitamin.py
pypi
from round_robin_tournament.participant import Participant class Match: """ A match represents a single match in a tournament, between 2 participants. It adds empty participants as placeholders for the winner and loser, so they can be accessed as individual object pointers. """ def __init__(sel...
/round_robin_tournament-1.0.0.tar.gz/round_robin_tournament-1.0.0/round_robin_tournament/match.py
0.679604
0.33674
match.py
pypi
import math import itertools from round_robin_tournament.match import Match from round_robin_tournament.participant import Participant class Tournament: """ This is a round-robin tournament where each match is between 2 competitors. It takes in a list of competitors, which can be strings or any type of Py...
/round_robin_tournament-1.0.0.tar.gz/round_robin_tournament-1.0.0/round_robin_tournament/tournament.py
0.578924
0.409723
tournament.py
pypi
def numbers_rndwitherr(value, error, errdig=2): """Returns rounded floating points for `value` and `error`. This function duplicates how numbers are round internally. It is available if you want rounded numbers rather than formatted and properly truncated strings. Be aware that because of the way float...
/round_using_error-1.2.0-py3-none-any.whl/round_using_error/round_using_error.py
0.924133
0.9455
round_using_error.py
pypi
# Move a file in the safest way possible:: # >>> from RoundBox.core.files.move import file_move_safe # >>> file_move_safe("/tmp/old_file", "/tmp/new_file") import errno import os from shutil import copystat from RoundBox.core.files import locks __all__ = ["file_move_safe"] def _samefile(src, dst): # M...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/files/move.py
0.425963
0.204719
move.py
pypi
# Portable file locking utilities. # Based partially on an example by Jonathan Feignberg in the Python # Cookbook [1] (licensed under the Python Software License) and a ctypes port by # Anatoly Techtonik for Roundup [2] (license [3]). # [1] https://code.activestate.com/recipes/65203/ # [2] https://sourceforge.net/p/ro...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/files/locks.py
0.68616
0.269374
locks.py
pypi
# Levels DEBUG = 10 INFO = 20 WARNING = 30 ERROR = 40 CRITICAL = 50 class CheckMessage: """ """ def __init__(self, level, msg: str, hint: str = None, obj=None, _id=None): """ :param level: The severity of the message. Use one of the predefined values: DEBUG, INFO, WARNING, ERROR, ...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/checks/messages.py
0.662469
0.299912
messages.py
pypi
import logging from dataclasses import dataclass from datetime import date, datetime from typing import Final, TypedDict from RoundBox.core.hass.helpers.typing import StateType from RoundBox.utils.backports.strenum.enum import StrEnum logger: Final = logging.getLogger(__name__) class ExtraOptions(TypedDict): "...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/hass/components/sensor/__init__.py
0.910754
0.203391
__init__.py
pypi
import argparse import os import sys from argparse import ArgumentParser, HelpFormatter from io import TextIOBase from RoundBox.const import __version__ from RoundBox.core import checks from RoundBox.core.cliparser.color import color_style, no_style ALL_CHECKS = "__all__" class CommandError(Exception): """ ...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/cliparser/base.py
0.608361
0.155431
base.py
pypi
import os import sys from imp import find_module from typing import Optional # NOQA from RoundBox.apps import apps _jobs = None def noneimplementation(meth): """ :param meth: :return: """ return None class JobError(Exception): pass class BaseJob: help = "undefined job description....
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/core/cliparser/jobs.py
0.439026
0.152442
jobs.py
pypi
import functools import inspect @functools.lru_cache(maxsize=512) def _get_func_parameters(func, remove_first): parameters = tuple(inspect.signature(func).parameters.values()) if remove_first: parameters = parameters[1:] return parameters def _get_callable_parameters(meth_or_func): is_metho...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/inspect.py
0.561335
0.258935
inspect.py
pypi
import re from collections.abc import Callable, Iterable, KeysView, Mapping from datetime import datetime from typing import Any, TypeVar import slugify as unicode_slug from .dt import as_local _T = TypeVar("_T") _U = TypeVar("_U") RE_SANITIZE_FILENAME = re.compile(r"(~|\.\.|/|\\)") RE_SANITIZE_PATH = re.compile(r...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/__init__.py
0.777933
0.162746
__init__.py
pypi
# Copyright (c) Django Software Foundation and individual contributors. # All rights reserved. # https://github.com/home-assistant/core/blob/dev/LICENSE.md import asyncio import threading from collections.abc import Callable, Coroutine from datetime import datetime, timedelta from functools import wraps from typing i...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/throttle.py
0.939203
0.234757
throttle.py
pypi
import logging from typing import IO, Any, Literal, Mapping, Optional # Type aliases used in function signatures. EscapeCodes = Mapping[str, str] LogColors = Mapping[str, str] SecondaryLogColors = Mapping[str, LogColors] # The default colors to use for the debug levels default_log_colors = { "DEBUG": "light_blue...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/log/color.py
0.880303
0.328516
color.py
pypi
import logging import time from hashlib import md5 from RoundBox.conf.project_settings import settings from RoundBox.core.cache import cache class RequireDebugFalse(logging.Filter): def filter(self, records): return not settings.DEBUG class RequireDebugTrue(logging.Filter): def filter(self, record...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/log/filters.py
0.675872
0.193929
filters.py
pypi
import logging import os from pprint import pformat from typing import IO, Any, Literal, Mapping, Optional from RoundBox.core.cliparser.color import color_style from RoundBox.utils.log.filters import PasswordMaskingFilter from . import themes from .color import ( ColoredRecord, EscapeCodes, LogColors, ...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/utils/log/formatter.py
0.86306
0.166981
formatter.py
pypi
# Multi-consumer multi-producer dispatching mechanism # Originally based on pydispatch (BSD) https://pypi.org/project/PyDispatcher/2.0.1/ # See license.txt for original license. # Modified for Growatt Monitor purpose import logging import threading import weakref from RoundBox.utils.inspect import func_accepts_kwarg...
/RoundBox-2022.4.21b0-py3-none-any.whl/RoundBox/dispatch/dispatcher.py
0.824321
0.172921
dispatcher.py
pypi
class Calculator: # Define Calculator class. # # All calculations made by class is rounded with 8 symbols precision. # Calculator memory is controled by Memory class. # # This class has methods to do perform: # I. Calculations: # Addition, substraction, multiplication, # ...
/rounded_calculate-0.1.1-py3-none-any.whl/rounded_calculate/calculator.py
0.80871
0.358353
calculator.py
pypi
# Rounders The `rounders` package extends the functionality provided by Python's built-in [`round`](https://docs.python.org/3/library/functions.html#round) function. It aims to provide a more complete and consistent collection of decimal rounding functionality than is provided by the Python core and standard library. ...
/rounders-0.1.0.tar.gz/rounders-0.1.0/README.md
0.943932
0.963575
README.md
pypi
import os import re from collections import defaultdict from typing import Dict, Generator, List, Optional, TextIO, Tuple, Union class INI: """ Class for parsing INI files. Current Restrictions: - key/value pairs must be separated by = - keys may not begin or end with whitespace - values wil...
/roundtripini-0.3.0.tar.gz/roundtripini-0.3.0/roundtripini.py
0.773644
0.373476
roundtripini.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 ...
/roung_distributions-0.2.tar.gz/roung_distributions-0.2/roung_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
[![Python CI](https://github.com/rouskinlab/rouskinhf/actions/workflows/CI.yml/badge.svg)](https://github.com/rouskinlab/rouskinhf/actions/workflows/CI.yml) [![Publish distributions 📦 to PyPI](https://github.com/rouskinlab/rouskinhf/actions/workflows/release.yml/badge.svg)](https://github.com/rouskinlab/rouskinhf/acti...
/rouskinhf-0.2.6.tar.gz/rouskinhf-0.2.6/README.md
0.740456
0.936168
README.md
pypi
from __future__ import annotations from typing import Any, Sequence import numpy as np from sklearn.cluster import AgglomerativeClustering from sklearn.metrics import silhouette_score class ClusteringHelper: """ A helper class to perform clustering of items based on a pre-computed distance matrix. T...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/clustering.py
0.960888
0.610831
clustering.py
pypi
from __future__ import annotations from typing import List import random from enum import Enum from operator import itemgetter import numpy as np from rdkit import Chem, DataStructs from rdkit.Chem import AllChem from apted import Config as BaseAptedConfig from scipy.spatial.distance import jaccard as jaccard_dist fr...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/ted/utils.py
0.908316
0.339472
utils.py
pypi
from __future__ import annotations import itertools import math from copy import deepcopy from typing import List, Union, Iterable, Tuple, Callable, Optional from logging import getLogger import numpy as np from apted import APTED as Apted from route_distances.ted.utils import ( TreeContent, AptedConfig, ...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/ted/reactiontree.py
0.90958
0.366817
reactiontree.py
pypi
from typing import Dict, Any, Set, List, Tuple import numpy as np from route_distances.utils.type_utils import StrDict def calc_depth(tree_dict: StrDict, depth: int = 0) -> int: """ Calculate the depth of a route, recursively :param tree_dict: the route :param depth: the current depth, don't specif...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/utils/routes.py
0.937351
0.673312
routes.py
pypi
import argparse import torch from pytorch_lightning import Trainer, seed_everything from pytorch_lightning.loggers import TensorBoardLogger, CSVLogger from pytorch_lightning.callbacks import ModelCheckpoint import route_distances.lstm.defaults as defaults from route_distances.lstm.data import TreeDataModule from rout...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/tools/train_lstm_model.py
0.766992
0.285098
train_lstm_model.py
pypi
from __future__ import annotations import argparse import warnings import time import math from typing import List import pandas as pd from tqdm import tqdm import route_distances.lstm.defaults as defaults from route_distances.route_distances import route_distances_calculator from route_distances.clustering import Cl...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/tools/cluster_aizynth_output.py
0.727492
0.311047
cluster_aizynth_output.py
pypi
import argparse import pickle import pandas as pd import numpy as np from tqdm import tqdm import route_distances.lstm.defaults as defaults from route_distances.lstm.features import preprocess_reaction_tree def _get_args(): parser = argparse.ArgumentParser( "Tool to prepare output from AiZynthFinder for...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/tools/prepare_aizynthfinder_output.py
0.480966
0.196248
prepare_aizynthfinder_output.py
pypi
import pickle import random import multiprocessing from typing import List, Tuple, Set, Union from pytorch_lightning import LightningDataModule from torch.utils.data import Dataset, DataLoader import route_distances.lstm.defaults as defaults from route_distances.lstm.utils import collate_batch _PairType = Tuple[Unio...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/lstm/data.py
0.826011
0.355523
data.py
pypi
import numpy as np from rdkit import Chem, DataStructs from rdkit.Chem import AllChem from treelstm import calculate_evaluation_orders import route_distances.lstm.defaults as defaults from route_distances.lstm.utils import ( add_node_index, gather_adjacency_list, gather_node_attributes, ) from route_dista...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/lstm/features.py
0.726814
0.514156
features.py
pypi
from typing import Dict, List, Any from collections import defaultdict import torch from route_distances.utils.type_utils import StrDict def accumulate_stats(stats: List[Dict[str, float]]) -> Dict[str, float]: """Accumulate statistics from a list of statistics""" accum: StrDict = defaultdict(float) for ...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/lstm/utils.py
0.945538
0.75101
utils.py
pypi
from typing import List, Tuple import torch import pytorch_lightning as lightning from treelstm import TreeLSTM as TreeLSTMBase from torchmetrics import MeanAbsoluteError, R2Score import route_distances.lstm.defaults as defaults from route_distances.lstm.utils import accumulate_stats from route_distances.utils.type_u...
/route-distances-1.1.0.tar.gz/route-distances-1.1.0/route_distances/lstm/models.py
0.954974
0.521288
models.py
pypi