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
from sqlalchemy import create_engine import numpy as np def get_engine(dbms:str, username:str, password:str, host:str, port:int, database:str): """ Parameter ---------- dbms : {"mysql", "postgres"} """ assert dbms in ["mysql", "postgresql"], "available dbms values are mysql and postgresql on...
/sa_package-0.0.80-py3-none-any.whl/sa_package/mydatabase/__init__.py
0.497315
0.353261
__init__.py
pypi
import typing as t import more_itertools import sqlalchemy as sa from sqlalchemy import ColumnElement from sqlalchemy.exc import NoResultFound from sqlalchemy.orm import DeclarativeBase, Session, joinedload __all__ = ['BaseRepository'] T = t.TypeVar('T', bound=DeclarativeBase) class BaseRepository(t.Generic[T]): ...
/sa_repository-1.1.0.tar.gz/sa_repository-1.1.0/sa_repository/base.py
0.466603
0.195287
base.py
pypi
from __future__ import print_function import time from datetime import datetime from elasticsearch import Elasticsearch, __version__ as es_client_version class ESQuery(object): def __init__(self, es_hosts, index_prefix, timestamp_field, index_time_format='%Y.%m.%d', es_user='', es_passwd=''): self.clie...
/sa_tools_core-0.6.0-py3-none-any.whl/sa_tools_core/libs/es.py
0.675872
0.285167
es.py
pypi
from collections import deque class Sa2SeedKey: register: int carry_flag: int = 0 instruction_tape: bytearray instruction_pointer: int = 0 for_pointers: deque = deque() for_iterations: deque = deque() def __init__(self, instruction_tape, seed): self.instruction_tape = instruction_tape self.regis...
/sa2-seed-key-0.0.1.tar.gz/sa2-seed-key-0.0.1/sa2_seed_key/sa2_seed_key.py
0.425844
0.261794
sa2_seed_key.py
pypi
# Saa > _Making Time Speak!_ 🎙️ Translating time into human-friendly spoken expressions ![Saa OpenJourny](watch.png) **Saa** allows you to effortlessly translate time into human-friendly spoken expressions. The word `saa` means `hour` in Swahili, and this package aims to humanify time expression across languages. It...
/saa-0.0.5.tar.gz/saa-0.0.5/README.md
0.747708
0.864996
README.md
pypi
from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.events import UserUtteranceReverted from rasa_sdk.executor import CollectingDispatcher from pprint import pprint import logging import json class ActionHelloWorld(Action): def name(self) -> Text: return "action_he...
/saai-0.3.0-py3-none-any.whl/bots/genesis/actions/actions.py
0.699665
0.207415
actions.py
pypi
from typing import Text, Any, Dict, List from sagas.nlu.inspector_common import Inspector, Context import logging logger = logging.getLogger(__name__) # 代码整理自notebook: procs-rasa-entity-iob.ipynb def get_entities(sents:Text): from saai.tool import rasa_nlu_parse result = rasa_nlu_parse(sents, 'http://localhos...
/saai-0.3.0-py3-none-any.whl/bots/agent_dispatcher/inspectors/cust_entity_inspector.py
0.494629
0.220437
cust_entity_inspector.py
pypi
``` import pyrata.re as pyrata_re data = [{'pos': 'PRP', 'raw': 'It'}, {'pos': 'VBZ', 'raw': 'is'}, {'pos': 'JJ', 'raw': 'fast'}, {'pos': 'JJ', 'raw': 'easy'}, {'pos': 'CC', 'raw': 'and'}, {'pos': 'JJ', 'raw': 'funny'}, {'pos': 'TO', 'raw': 'to'}, {'pos': 'VB', 'raw': 'write'}, {'pos...
/saai-0.3.0-py3-none-any.whl/notebook/procs-pyrata.ipynb
0.622804
0.804905
procs-pyrata.ipynb
pypi
``` import sagas sagas.print_rs([('tom',5)], ['name','age']) from rasa.nlu import config conf=config.load('saai/sample_configs/config_crf_custom_features.yml') # conf.for_component('DucklingHTTPExtractor') conf.component_names conf.language # print(conf.get('DucklingHTTPExtractor')) from rasa.nlu.training_data imp...
/saai-0.3.0-py3-none-any.whl/notebook/procs-tokenizers.ipynb
0.519765
0.176423
procs-tokenizers.ipynb
pypi
``` from rasa.utils.endpoints import ClientResponseError, EndpointConfig from rasa.core.agent import Agent from rasa.core.interpreter import RasaNLUInterpreter from rasa.model import get_model, get_latest_model # preq: $ start actions bot='saya' endpoint = EndpointConfig("http://localhost:5055/webhook") bot_locs={'s...
/saai-0.3.0-py3-none-any.whl/notebook/procs-bots-saya.ipynb
0.426799
0.665645
procs-bots-saya.ipynb
pypi
``` from flair.data import Sentence from flair.models import SequenceTagger # make a sentence sentence = Sentence('I love Berlin .') # load the NER tagger # download from: https://s3.eu-central-1.amazonaws.com//alan-nlp/resources/models-v0.4/NER-conll03-english/en-ner-conll03-v0.4.pt # tagger = SequenceTagger.load('n...
/saai-0.3.0-py3-none-any.whl/notebook/procs-flair.ipynb
0.483648
0.163179
procs-flair.ipynb
pypi
from datetime import date, datetime, timedelta import sys import pandas as pd # https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes class Holidays: @classmethod def to_datetime(self, datestr:str) -> datetime: """ Convert date strings like "20210506" to datetime ...
/saaltfiish_boilerplate-0.1.3.tar.gz/saaltfiish_boilerplate-0.1.3/saaltfiish_boilerplate/holidays.py
0.655557
0.284977
holidays.py
pypi
from ..._private._utilities import * from ... import Event from copy import deepcopy SIMPLE_CHANGE_INDICATOR = lambda x, y: x != y class DataStore(ABC): @abstractmethod def get_value(self, key: str) -> Optional[Any]: raise NotImplementedError() @abstractmethod def set_value(self, key: str, ...
/saba-pipeline-1.0.2.tar.gz/saba-pipeline-1.0.2/src/sabapipeline/config/_private/_store.py
0.753648
0.258367
_store.py
pypi
.. include:: references.txt Saba: Sherpa-Astropy Bridge =========================== The Saba package provides a bridge between the convenient model definition language provided in the `astropy.modeling` package and the powerful fitting capabilities of the Sherpa_ modeling and fitting package. In particular, Sherpa h...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/docs/index.rst
0.945889
0.777807
index.rst
pypi
.. include:: references.txt Usage details ============== Now that you have the basics let's move on to some more complex usage of the fitter interface. First a quick preamble to do some imports and create our |SherpaFitter| object. .. code-block:: ipython from astropy.modeling.fitting import SherpaFitter sf...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/docs/examples_complex.rst
0.923256
0.69383
examples_complex.rst
pypi
from astropy.modeling.fitting import SherpaFitter from astropy.modeling.models import Gaussian1D, Gaussian2D import numpy as np import matplotlib.pyplot as plt sfitter = SherpaFitter(statistic='chi2', optimizer='levmar', estmethod='confidence') sfitter.est_config['max_rstat'] = 4 np.random.seed(0x1337) true = Gaussi...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/docs/gen_plots.py
0.569613
0.645762
gen_plots.py
pypi
``` from astropy.modeling.core import Fittable1DModel from sherpa.utils import interpolate from sherpa.astro.utils import rmf_fold from astropy.modeling.models import Gaussian1D,Gaussian2D import numpy as n %pylab inline gmodel = Gaussian1D(mean=30,amplitude=10,stddev=5) x_in = np.linspace(1,100,200) y_in = gmodel(x_i...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/docs/.ipynb_checkpoints/Untitled-checkpoint.ipynb
0.608478
0.470128
Untitled-checkpoint.ipynb
pypi
# Do not remove the following comment; it is used by # astropy_helpers.version_helpers to determine the beginning of the code in # this module # BEGIN import locale import os import subprocess import warnings def _decode_stdio(stream): try: stdio_encoding = locale.getdefaultlocale()[1] or 'utf-8' ex...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/astropy_helpers/astropy_helpers/git_helpers.py
0.55447
0.156105
git_helpers.py
pypi
import inspect import sys import re import os from warnings import warn from sphinx.ext.autosummary.generate import find_autosummary_in_docstring def find_mod_objs(modname, onlylocals=False): """ Returns all the public attributes of a module referenced by name. .. note:: The returned list *not* incl...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/astropy_helpers/astropy_helpers/sphinx/ext/utils.py
0.435421
0.27197
utils.py
pypi
# Implementation note: # The 'automodapi' directive is not actually implemented as a docutils # directive. Instead, this extension searches for the 'automodapi' text in # all sphinx documents, and replaces it where necessary from a template built # into this extension. This is necessary because automodsumm (and autosum...
/saba-0.1.1a0.tar.gz/saba-0.1.1a0/astropy_helpers/astropy_helpers/sphinx/ext/automodapi.py
0.526586
0.176069
automodapi.py
pypi
# Example PyPI (Python Package Index) Package & Tutorial / Instruction / Workflow for 2021 [![PyPI package](https://img.shields.io/badge/pip%20install-example--pypi--package-brightgreen)](https://pypi.org/project/example-pypi-package/) [![version number](https://img.shields.io/pypi/v/example-pypi-package?color=green&l...
/sababa-0.0.3.tar.gz/sababa-0.0.3/README-original.md
0.499268
0.926769
README-original.md
pypi
import os import numpy as np import pandas as pd import xarray as xr from .io import COL_GID from .io import COL_MID from .io import COL_QSIM __all__ = ['fdc', 'sfdc', 'precalc_sfdcs'] def fdc(flows: np.array, steps: int = 101, col_name: str = 'Q') -> pd.DataFrame: """ Compute flow duration curve (exceedan...
/saber_hbc-0.9.0-py3-none-any.whl/saber/fdc.py
0.69285
0.617037
fdc.py
pypi
import glob import logging import math import os from collections.abc import Iterable import joblib import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy as np import pandas as pd from kneed import KneeLocator from natsort import natsorted from sklearn.cluster import MiniBatchKMeans from sklearn.metr...
/saber_hbc-0.9.0-py3-none-any.whl/saber/cluster.py
0.811788
0.363506
cluster.py
pypi
import logging import os import contextily as cx import geopandas as gpd import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd from .io import COL_ASN_REASON from .io import COL_CID from .io import COL_GID from .io import COL_MID from .io import get_dir from .io import read_g...
/saber_hbc-0.9.0-py3-none-any.whl/saber/gis.py
0.785555
0.343713
gis.py
pypi
<p align="center"> <img src="img/saber_logo.png", style="height:150px"> </p> <h1 align="center"> Saber </h1> <p align="center"> <a href="https://travis-ci.org/BaderLab/saber"> <img src="https://travis-ci.org/BaderLab/saber.svg?branch=master" alt="Travis CI"> </a> <a href="https://www.codacy.com...
/saber-0.1.0.tar.gz/saber-0.1.0/README.md
0.663887
0.920074
README.md
pypi
# Quick Start If your goal is simply to use Saber to annotate biomedical text, then you can either use the [web-service](#web-service) or a [pre-trained model](#pre-trained-models). ## Web-service To use Saber as a **local** web-service, run ``` (saber) $ python -m saber.cli.app ``` or, if you prefer, you can pull...
/saber-0.1.0.tar.gz/saber-0.1.0/docs/quick_start.md
0.793586
0.859899
quick_start.md
pypi
# Guide to the Saber API You can interact with Saber as a web-service (explained in [Quick start](https://baderlab.github.io/saber/quick_start/)), command line tool, python package, or via the Juypter notebooks. If you created a virtual environment, _remember to activate it first_. ### Command line tool Currently, t...
/saber-0.1.0.tar.gz/saber-0.1.0/docs/guide_to_saber_api.md
0.742422
0.902266
guide_to_saber_api.md
pypi
# Move your playlists to Beat Saber! `pip3 install saberio-rewind` [![Typing SVG](https://readme-typing-svg.demolab.com?font=Fira+Code&pause=1000&color=EF6DF7&width=435&lines=Bookmark+and+Syncsaber!;Download+Songs+via+CLI!;pip+install+me!;Oh+It's+this+song!;Continue+on...+Beat+Saber!;Replay+your+favorites...;+and+S...
/saberio-rewind-1.0.3.post1.tar.gz/saberio-rewind-1.0.3.post1/README.md
0.637369
0.783802
README.md
pypi
import cv2 import os import wget import pandas as pd from PIL import Image from sabhi_utils.image_utils.utils import load_image from pathlib import Path def initialize_face_detector(detector_backend): home = str(Path.home()) output_dir = os.path.join( home, '.sabhi_utils/weights/' ) ...
/sabhi_utils-2.0.8-py3-none-any.whl/sabhi_utils/face_utility.py
0.545044
0.199444
face_utility.py
pypi
import cv2 import numpy as np import imutils from sabhi_utils.image_utils.utils import load_image class TemplateMatching: def __init__( self, method=cv2.TM_CCOEFF_NORMED, matching_threshold=0.75, scales=np.linspace(0.2, 1.0, 20)[::-1], debug=False ): self._met...
/sabhi_utils-2.0.8-py3-none-any.whl/sabhi_utils/image_utils/template_matching.py
0.526343
0.199776
template_matching.py
pypi
import numpy as np from sabhi_utils.image_utils.processors import Closer from sabhi_utils.image_utils.processors import EdgeDetector from sabhi_utils.image_utils.processors import Opener from collections import defaultdict import itertools import cv2 import time from sklearn.cluster import KMeans class HoughLineCorn...
/sabhi_utils-2.0.8-py3-none-any.whl/sabhi_utils/image_utils/hough_line_corner_detector.py
0.802942
0.409634
hough_line_corner_detector.py
pypi
from collections import Counter import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import (calinski_harabasz_score, davies_bouldin_score, pairwise_distances, silhouette_score) def convertion_to_array(emb): """Converte a matriz de embeddings para um array numpy ...
/sabia-utils-0.2.0.tar.gz/sabia-utils-0.2.0/sabia_utils/evaluate.py
0.834238
0.628806
evaluate.py
pypi
import matplotlib.pyplot as plt import numpy as np class EvaluateExperiments: def __init__(self, metrics): """ Construtor EvaluateExperiments. :param metrics: As métricas de avaliação dos clusters. :type metrics: list """ self.metrics = metrics self.inertia...
/sabia-utils-0.2.0.tar.gz/sabia-utils-0.2.0/sabia_utils/evaluateExperiments.py
0.79999
0.577674
evaluateExperiments.py
pypi
import datetime import difflib import pytz class Sablier(object): """Date, time and timezone for the rest of us.""" def __init__(self, date=None, time=datetime.time(0), timezone=None): self.date = date self.time = time self.timezone = pytz.timezone(disambiguate(timezone)) if timezone...
/sablier-0.2.2.tar.gz/sablier-0.2.2/sablier.py
0.745676
0.41745
sablier.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 ...
/saboohi_dsnd-0.1.tar.gz/saboohi_dsnd-0.1/saboohi_dsnd/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
# SABRmetrics <div> <a href="https://github.com/JacobLee23/SABRmetrics/blob/master/LICENSE" target="_blank"> <img src="https://img.shields.io/github/license/JacobLee23/SABRmetrics" alt="LICENSE"> </a> <img src="https://img.shields.io/pypi/pyversions/SABRmetrics" alt="PyPI - Python Version"> <a href="https:...
/sabrmetrics-0.5.3.tar.gz/sabrmetrics-0.5.3/README.md
0.41478
0.914977
README.md
pypi
# SACAD ## Smart Automatic Cover Art Downloader [![PyPI version](https://img.shields.io/pypi/v/sacad.svg?style=flat)](https://pypi.python.org/pypi/sacad/) [![AUR version](https://img.shields.io/aur/version/sacad.svg?style=flat)](https://aur.archlinux.org/packages/sacad/) [![Tests status](https://github.com/desbma/sac...
/sacad-2.7.5.tar.gz/sacad-2.7.5/README.md
0.903586
0.749592
README.md
pypi
from serial import Serial from thermocouples_reference import thermocouples class InvalidChannel(Exception): pass class InvalidOption(Exception): pass class SACADA(object): """SACADA boards Python interface Right now it just implements support for SACADA Mini using SCPI over USB-CDC. The p...
/sacada-python-0.0.7.tar.gz/sacada-python-0.0.7/sacada/SACADA.py
0.800848
0.224757
SACADA.py
pypi
# Creating a SACC file with the library In this example we will make a Sacc data file using simulated data from CCL, the Core Cosmology Library. ``` pylab inline import sacc import pyccl as ccl import datetime import time ``` # Getting input data We will make some fake window ranges and data vectors from theory p...
/sacc-0.12.tar.gz/sacc-0.12/examples/Create_Sacc.ipynb
0.672117
0.934873
Create_Sacc.ipynb
pypi
# SACC file for CMB and LSS data This example shows how to use the different functionality in SACC to write data from LSS-like and CMB-like experiments. ``` import sacc import pyccl as ccl import numpy as np import matplotlib.pyplot as plt ``` ## Generate the data We will first use CCL to generate some data. This wil...
/sacc-0.12.tar.gz/sacc-0.12/examples/CMB_LSS_write.ipynb
0.583085
0.966379
CMB_LSS_write.ipynb
pypi
# Reading a SACC file with CMB and LSS data This example shows how to read LSS and CMB-like data from a SACC file. You should run the `CMB_LSS_write` notebook before this one in order to have some data to read! ``` import sacc import numpy as np import matplotlib.pyplot as plt ``` ## Reading the data This is as simpl...
/sacc-0.12.tar.gz/sacc-0.12/examples/CMB_LSS_read.ipynb
0.463201
0.975693
CMB_LSS_read.ipynb
pypi
# SACC with clusters The default SACC scripts in the directory above show how one can make a SACC object for a 3x2 point analysis. The constructor for a SACC object has additional fields for handling clusters. This notebook details how one can use those fields to create/load/split a SACC that has cluster information. ...
/sacc-0.12.tar.gz/sacc-0.12/examples/SACC_for_clusters.ipynb
0.513912
0.92421
SACC_for_clusters.ipynb
pypi
``` import sacc import numpy as np import matplotlib.pyplot as plt ``` # Read SACC files This notebook illustrates how to read and interpret data from a SACC file. We will read the BK15 data we wrote into SACC format in SACC_write.ipynb (so run that notebook first!). Reading the file is as simple as: ``` # First, ...
/sacc-0.12.tar.gz/sacc-0.12/examples/SACC_read.ipynb
0.406744
0.974749
SACC_read.ipynb
pypi
================ saccademodel-py ================ A least-squares optimal offline method to find saccadic reaction time and saccade duration from tracked gaze points. You have tracked the gaze points of the following event sequence: 1. A person looks at point (A). An image appears at (B). 2. The person reacts to the...
/saccademodel-0.1.0.tar.gz/saccademodel-0.1.0/README.rst
0.89358
0.717198
README.rst
pypi
import numpy as np import os import joblib import logging class Perceptron: # constructor def __init__(self,eta:float=None, epochs:int=None): self.weights = np.random.random(3) * 1e-4 #small random weights training = (eta is not None) and (epochs is not None) if training: ...
/sachin_pkg-Sachinsen1295-0.0.3.tar.gz/sachin_pkg-Sachinsen1295-0.0.3/src/sachin/perceptron.py
0.557604
0.253081
perceptron.py
pypi
import re from functools import lru_cache from .tokenizer_base import BaseTokenizer def _normalize_general_and_western(sent: str) -> str: # language-independent (general) part # strip end-of-line hyphenation and join lines sent = re.sub(r"\n-", "", sent) # join lines sent = re.sub(r"\n", " ",...
/sacrebleu_macrof-2.0.1-py3-none-any.whl/sacrebleu/tokenizers/tokenizer_ter.py
0.685844
0.385895
tokenizer_ter.py
pypi
from typing import List, Sequence, Optional, Dict from collections import Counter from ..utils import sum_of_lists from .base import Score, Signature, Metric from .helpers import extract_all_char_ngrams, extract_word_ngrams class CHRFSignature(Signature): """A convenience class to represent the reproducibility ...
/sacrebleu_macrof-2.0.1-py3-none-any.whl/sacrebleu/metrics/chrf.py
0.961416
0.396652
chrf.py
pypi
from collections import Counter from typing import List, Tuple def extract_all_word_ngrams(line: str, min_order: int, max_order: int) -> Tuple[Counter, int]: """Extracts all ngrams (min_order <= n <= max_order) from a sentence. :param line: A string sentence. :param min_order: Minimum n-gram order. ...
/sacrebleu_macrof-2.0.1-py3-none-any.whl/sacrebleu/metrics/helpers.py
0.93117
0.624007
helpers.py
pypi
import math import logging from importlib import import_module from typing import List, Sequence, Optional, Dict, Any from ..utils import my_log, sum_of_lists from .base import Score, Signature, Metric from .helpers import extract_all_word_ngrams sacrelogger = logging.getLogger('sacrebleu') # The default for the m...
/sacrebleu_macrof-2.0.1-py3-none-any.whl/sacrebleu/metrics/bleu.py
0.902037
0.236527
bleu.py
pypi
from __future__ import print_function import os import sys import numpy as np from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils import to_categorical from keras.layers import Dense, Input, Flatten from keras.layers import Conv1D, MaxPooling1D, Embedd...
/sacred-nbextension-0.1.0.tar.gz/sacred-nbextension-0.1.0/deep-dostoewskiy/pretrained_word_embeddings.py
0.555676
0.291226
pretrained_word_embeddings.py
pypi
# In[1]: '''Train a simple deep CNN on the CIFAR10 small images dataset. GPU run command with Theano backend (with TensorFlow, the GPU is automatically used): THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatx=float32 python cifar10_cnn.py It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs...
/sacred-nbextension-0.1.0.tar.gz/sacred-nbextension-0.1.0/deep-dostoewskiy/Untitled2.py
0.90808
0.590838
Untitled2.py
pypi
# In[2]: """VGG16 model for Keras. # Reference - [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556) """ from __future__ import print_function from __future__ import absolute_import import warnings from keras.models import Model from keras.layers import Flatten,...
/sacred-nbextension-0.1.0.tar.gz/sacred-nbextension-0.1.0/deep-dostoewskiy/Untitled3.py
0.952673
0.727431
Untitled3.py
pypi
# In[8]: '''Trains a simple convnet on the MNIST dataset. Gets to 99.25% test accuracy after 12 epochs (there is still a lot of margin for parameter tuning). 16 seconds per epoch on a GRID K520 GPU. ''' from __future__ import print_function import keras from keras.datasets import mnist from keras.models import Seque...
/sacred-nbextension-0.1.0.tar.gz/sacred-nbextension-0.1.0/deep-dostoewskiy/keras-mnis.py
0.873201
0.637115
keras-mnis.py
pypi
# sacred-tui ![travis-ci](https://api.travis-ci.org/justaboredkid/sacred-tui.svg?branch=development) ASCII art import and terminal graphics made simple. Let's say you want something like this in your script: ``` _____________________________,----,__ |==============================<| /___\ ____,------...
/sacred_tui-0.2.1.tar.gz/sacred_tui-0.2.1/README.md
0.802633
0.716677
README.md
pypi
try: # Python3 from itertools import zip_longest except ImportError: # Python2 from itertools import izip_longest as zip_longest from xml.sax.saxutils import escape, unescape from joblib import Parallel, delayed from tqdm import tqdm class CJKChars(object): """ An object that enumerates the code ...
/sacremoses_xt-0.0.44-py3-none-any.whl/sacremoses/util.py
0.671578
0.365825
util.py
pypi
import re import regex from six import text_type from itertools import chain class MosesPunctNormalizer: """ This is a Python port of the Moses punctuation normalizer from https://github.com/moses-smt/mosesdecoder/blob/master/scripts/tokenizer/normalize-punctuation.perl """ EXTRA_WHITESPACE = [...
/sacremoses_xt-0.0.44-py3-none-any.whl/sacremoses/normalize.py
0.567337
0.407216
normalize.py
pypi
import os import pkgutil class Perluniprops: """ This class is used to read lists of characters from the Perl Unicode Properties (see http://perldoc.perl.org/perluniprops.html). The files in the perluniprop.zip are extracted using the Unicode::Tussle module from http://search.cpan.org/~bdfoy/Unic...
/sacremoses_xt-0.0.44-py3-none-any.whl/sacremoses/corpus.py
0.599602
0.330958
corpus.py
pypi
import os from functools import partial # gbk <-> big5 mappings from Mafan + Jianfan # https://github.com/hermanschaaf/mafan # https://code.google.com/archive/p/python-jianfan/ simplified_chinese = gbk = u"\u9515\u7691\u853c\u788d\u7231\u55f3\u5ad2\u7477\u66a7\u972d\u8c19\u94f5\u9e4c\u80ae\u8884\u5965\u5aaa\u9a9c\u9...
/sacremoses_xt-0.0.44-py3-none-any.whl/sacremoses/chinese.py
0.436982
0.150216
chinese.py
pypi
import re from six import text_type from sacremoses.corpus import Perluniprops from sacremoses.corpus import NonbreakingPrefixes from sacremoses.util import is_cjk perluniprops = Perluniprops() nonbreaking_prefixes = NonbreakingPrefixes() class MosesSentTokenizer(object): """ This is a Python port of the ...
/sacremoses_xt-0.0.44-py3-none-any.whl/sacremoses/sent_tokenize.py
0.488527
0.167797
sent_tokenize.py
pypi
# Sacremoses [![Build Status](https://travis-ci.org/alvations/sacremoses.svg?branch=master)](https://travis-ci.org/alvations/sacremoses) [![Build status](https://ci.appveyor.com/api/projects/status/bwgmj4axw9pdk1oq?svg=true)](https://ci.appveyor.com/project/alvations/sacremoses) # License MIT License. # Install ``...
/sacremoses-0.0.53.tar.gz/sacremoses-0.0.53/README.md
0.556882
0.727564
README.md
pypi
import datetime import time from .interfaces import ITimeZone from zope.interface import implementer from zope.component import queryUtility ZERO = datetime.timedelta(seconds=0) def is_dst(dt): """Return True or False depending of tm_isdst value Convert dt in timestamp, and get time object with this time...
/sact.epoch-1.3.0.tar.gz/sact.epoch-1.3.0/src/sact/epoch/timezone.py
0.82108
0.395426
timezone.py
pypi
import datetime from typing import Any, Dict, List, Optional, Union import httpx from ...client import Client from ...models.get_object_consumption_response_200_item import GetObjectConsumptionResponse200Item from ...types import UNSET, Response, Unset def _get_kwargs( *, client: Client, o_eic: str, ...
/sadales-tikls-m2m-1.0.0.tar.gz/sadales-tikls-m2m-1.0.0/sadales_tikls_m2m_api_client/api/default/get_object_consumption.py
0.81841
0.231093
get_object_consumption.py
pypi
from typing import Any, Dict, List, Type, TypeVar import attr from ..models.error_invalid_params_item import ErrorInvalidParamsItem T = TypeVar("T", bound="Error") @attr.s(auto_attribs=True) class Error: """ """ title: str invalid_params: List[ErrorInvalidParamsItem] additional_properties: Dict[st...
/sadales-tikls-m2m-1.0.0.tar.gz/sadales-tikls-m2m-1.0.0/sadales_tikls_m2m_api_client/models/error.py
0.749912
0.192748
error.py
pypi
<!-- markdownlint-disable --> <h2 align="center" style="font-family:verdana;font-size:150%"> <b>S</b>equencing <b>A</b>nalysis and <b>D</b>ata Library for <b>I</b>mmunoinformatics <b>E</b>xploration</h2> <div align="center"> <img src="https://sadiestaticcrm.s3.us-west-2.amazonaws.com/Sadie.svg" alt="SADIE" style="ma...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/README.md
0.458349
0.725746
README.md
pypi
import re from functools import lru_cache from typing import Any, List, Optional, Set, Union from uuid import UUID, uuid4 from Bio.Seq import Seq from pandas._libs.missing import NAType from pydantic import BaseModel, validator @lru_cache(maxsize=1) def get_nt_validator_regex() -> Any: return re.compile(r"^[ACNT...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/receptor/rearrangment.py
0.897936
0.481027
rearrangment.py
pypi
scheme_numbering = { "imgt": { "heavy": { "imgt": { "fwr1_aa_start": 1, "fwr1_aa_end": 26, "cdr1_aa_start": 27, "cdr1_aa_end": 38, "fwr2_aa_start": 39, "fwr2_aa_end": 55, "cdr2_aa_star...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/numbering/scheme_numbering.py
0.411466
0.393094
scheme_numbering.py
pypi
from __future__ import annotations import logging import re from typing import Any, Iterable, List, Optional, Union import numpy as np import numpy.typing as npt import pandas as pd from Levenshtein import distance as lev_distance from sklearn.cluster import AgglomerativeClustering from sklearn.metrics import pairwis...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/cluster/cluster.py
0.907975
0.422147
cluster.py
pypi
import logging from ast import literal_eval import pandas as pd from numpy import nan from sadie.numbering.scheme_numbering import scheme_numbering from .constants import NUMBERING_RESULTS logger = logging.getLogger("NUMBERING") class NumberingResults(pd.DataFrame): def __init__(self, *args, scheme="", region...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/renumbering/result.py
0.863809
0.290713
result.py
pypi
from collections import UserString from typing import Callable, Generator from pydantic.fields import ModelField # TODO: go through and see which are viable to use; tests need to be fixed first in test_g3 to handle this SPECIES = { "rhesus": "macaque", "homo_sapiens": "human", "mus": "mouse", "rattus_...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/typing/species.py
0.401336
0.403802
species.py
pypi
from __future__ import annotations import warnings from pathlib import Path from typing import Optional, Set from sadie.airr.igblast.igblast import ensure_prefix_to # package/module level from sadie.reference import YamlRef class GermlineData: """ The germline data paths are extremely cumbersome to workwit...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/airr/igblast/germline.py
0.850903
0.210219
germline.py
pypi
import datetime from typing import Dict, List, Union from Bio.Seq import Seq from Bio.SeqFeature import FeatureLocation, SeqFeature from Bio.SeqRecord import SeqRecord # Qualifier Dictionary example_qualifiers_dict = { "gene": "gene", "latin": "latin", "organism": "species", "functional": "functional"...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/airr/airrtable/genbank.py
0.827932
0.335052
genbank.py
pypi
from typing import Any, Dict IGBLAST_AIRR: Dict[Any, str] = { "sequence_id": "object", "sequence": "object", "locus": "object", "stop_codon": "object", "vj_in_frame": "object", "v_frameshift": "object", "productive": "object", "rev_comp": "object", "complete_vdj": "object", "seq...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/airr/airrtable/constants.py
0.723895
0.350644
constants.py
pypi
from __future__ import annotations from pathlib import Path from typing import Any, Dict, List, Set, Type import pandas as pd from yaml import load try: from yaml import CLoader, Loader cload: Type[CLoader] | Type[Loader] = CLoader except ImportError: from yaml import Loader cload = Loader class ...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/reference/yaml.py
0.926959
0.325923
yaml.py
pypi
from typing import Dict, List from pydantic import BaseModel, validator class Species(BaseModel): """What species to retrieve""" species: str class Source(BaseModel): """What database to retrieve""" source: str class GeneEntry(BaseModel): """V,D or J Gene Entry with validation""" speci...
/sadie_antibody-1.0.2.tar.gz/sadie_antibody-1.0.2/src/sadie/reference/models.py
0.90957
0.45302
models.py
pypi
from collections import deque from unittest.mock import Mock class MockTmpFile(object): _fn = None def __init__(self, suffix = None, prefix = None, dir = None, remove = False): if suffix is None: suffix = '.mock' if prefix is None: prefix = __name__ if dir is None: dir = '/tmp' self._fn = '/'.join...
/sadm-0.21.tar.gz/sadm-0.21/tlib/_sadmtest/mock/utils/sh.py
0.461988
0.172939
sh.py
pypi
import matplotlib.pyplot as plt import numpy as np import .plotHelper as pH try: plt.style.use('scientific_grid_no_space') except: pass # ------------------------------------------------------------------------- # Modular plotting functions # ---------------------------------------------------------------------...
/sadtools-0.0.2-py3-none-any.whl/analysis/plotting.py
0.76856
0.63324
plotting.py
pypi
import numpy as np from scipy.interpolate import splrep, splev import math # ------------------------------------------------------------------------- # Grid functions # ------------------------------------------------------------------------- def create_grid(x_range, y_range, num_x_points=50, num_y_points=50): # U...
/sadtools-0.0.2-py3-none-any.whl/utilities/numerics.py
0.709824
0.517205
numerics.py
pypi
import numpy as np import utilities as util import astropy.units as u # ------------------------------------------------------------------------- # Derived Units # ------------------------------------------------------------------------- cm3 = u.cm**3 dm3 = u.dm**3 m3 = u.m**3 g_cm3 = (u.g / cm3) molar = u.mol / dm3 ...
/sadtools-0.0.2-py3-none-any.whl/utilities/chemistryUtilities.py
0.803868
0.427994
chemistryUtilities.py
pypi
from argparse import ArgumentParser, BooleanOptionalAction, Namespace from os.path import expanduser from sys import stdout from uuid import UUID from .cli import CLI from .version import VERSION def parse_args() -> Namespace: parser = ArgumentParser( prog="Safari Bookmarks CLI", description="A u...
/safari_bookmarks_cli-0.2.0-py3-none-any.whl/safaribookmarks/main.py
0.490968
0.228641
main.py
pypi
from contextlib import contextmanager import plistlib from typing import Generator, IO, Optional import uuid from .helpers import load, dump from .models import WebBookmarkType, WebBookmarkTypeList, WebBookmarkTypeLeaf, WebBookmarkTypeProxy DEFAULT_LIST_FORMAT = "{prefix: <{depth}}{title: <50}{type: <6}{id: <38}{url}"...
/safari_bookmarks_cli-0.2.0-py3-none-any.whl/safaribookmarks/cli.py
0.708313
0.185947
cli.py
pypi
import abc from typing import Tuple, Union import numpy as np import scipy.integrate import scipy.spatial from pydantic import BaseModel class BaseEntityValidator(BaseModel): """ Validator for BaseEntity's config member. Parameters ---------- name : str Name of entity """ name: s...
/safe-autonomy-dynamics-1.0.1.tar.gz/safe-autonomy-dynamics-1.0.1/safe_autonomy_dynamics/base_models.py
0.933089
0.511961
base_models.py
pypi
import abc from typing import Tuple import numpy as np from safe_autonomy_dynamics.base_models import BaseEntity, BaseEntityValidator, BaseLinearODESolverDynamics M_DEFAULT = 1 DAMPING_DEFAULT = 0 class BaseIntegratorValidator(BaseEntityValidator): """ Validator for Integrator kwargs. Parameters -...
/safe-autonomy-dynamics-1.0.1.tar.gz/safe-autonomy-dynamics-1.0.1/safe_autonomy_dynamics/integrators.py
0.934939
0.381853
integrators.py
pypi
import math from typing import Union import numpy as np from scipy.spatial.transform import Rotation from safe_autonomy_dynamics.base_models import BaseEntityValidator, BaseODESolverDynamics, BaseRotationEntity from safe_autonomy_dynamics.cwh import M_DEFAULT, N_DEFAULT, generate_cwh_matrices INERTIA_DEFAULT = 0.057...
/safe-autonomy-dynamics-1.0.1.tar.gz/safe-autonomy-dynamics-1.0.1/safe_autonomy_dynamics/cwh/rotational_model.py
0.922124
0.54056
rotational_model.py
pypi
from typing import Union import numpy as np from scipy.spatial.transform import Rotation from safe_autonomy_dynamics.base_models import BaseEntityValidator, BaseODESolverDynamics, BaseRotationEntity from safe_autonomy_dynamics.cwh import generate_cwh_matrices from safe_autonomy_dynamics.utils import number_list_to_np...
/safe-autonomy-dynamics-1.0.1.tar.gz/safe-autonomy-dynamics-1.0.1/safe_autonomy_dynamics/cwh/sixdof_model.py
0.935678
0.568775
sixdof_model.py
pypi
from typing import Tuple import numpy as np from scipy.spatial.transform import Rotation from safe_autonomy_dynamics.base_models import BaseEntity, BaseEntityValidator, BaseLinearODESolverDynamics M_DEFAULT = 12 N_DEFAULT = 0.001027 class CWHSpacecraftValidator(BaseEntityValidator): """ Validator for CWHSp...
/safe-autonomy-dynamics-1.0.1.tar.gz/safe-autonomy-dynamics-1.0.1/safe_autonomy_dynamics/cwh/point_model.py
0.961043
0.643413
point_model.py
pypi
__title__ = 'safe-cast' __version__ = '0.3.4' __version_info__ = tuple(__version__.split('.')) __author__ = 'jefft@tune.com' __license__ = 'MIT License' __copyright__ = 'Copyright 2018 TUNE, Inc.' import numpy def safe_cast(val, to_type, default=None): """Safely cast a value to type, and if failed, returned de...
/safe_cast-0.3.4-py3-none-any.whl/safe_cast/__init__.py
0.858021
0.354964
__init__.py
pypi
[![PyPI version](https://badge.fury.io/py/safe-cli.svg)](https://badge.fury.io/py/safe-cli) [![Build Status](https://github.com/gnosis/safe-cli/actions/workflows/python.yml/badge.svg)](https://github.com/gnosis/safe-cli/actions/workflows/python.yml) [![Coverage Status](https://coveralls.io/repos/github/gnosis/safe-cli/...
/safe_cli-0.7.1.tar.gz/safe_cli-0.7.1/README.md
0.432063
0.942507
README.md
pypi
from prompt_toolkit.formatted_text import HTML SAFE_ARGUMENT_COLOR = "em" SAFE_EMPTY_ARGUMENT_COLOR = "ansimagenta" safe_commands_arguments = { "add_delegate": "<address> <label> <signer-address>", "add_owner": "<address> [--threshold <int>]", "approve_hash": "<safe-tx-hash> <address>", "balances": "...
/safe_cli-0.7.1.tar.gz/safe_cli-0.7.1/safe_cli/safe_completer_constants.py
0.4436
0.252565
safe_completer_constants.py
pypi
from typing import Optional from hexbytes import HexBytes from prompt_toolkit import HTML, print_formatted_text from gnosis.eth.constants import NULL_ADDRESS from gnosis.safe import InvalidInternalTx, SafeOperation, SafeTx from safe_cli.utils import yes_or_no_question from .safe_operator import SafeOperator, SafeSe...
/safe_cli-0.7.1.tar.gz/safe_cli-0.7.1/safe_cli/operators/safe_relay_operator.py
0.8874
0.162979
safe_relay_operator.py
pypi
from typing import TypedDict from urllib.parse import urljoin import requests from eth_typing import ChecksumAddress, HexStr from gnosis.eth.ethereum_client import EthereumNetwork from gnosis.safe import SafeTx from gnosis.safe.signatures import signature_split from .base_api import BaseAPI, BaseAPIException class...
/safe_cli-0.7.1.tar.gz/safe_cli-0.7.1/safe_cli/api/relay_service_api.py
0.741206
0.225204
relay_service_api.py
pypi
import time from typing import Any, Dict, List, Optional, Tuple from urllib.parse import urljoin import requests from eth_account.signers.local import LocalAccount from hexbytes import HexBytes from web3 import Web3 from gnosis.eth.ethereum_client import EthereumNetwork from gnosis.safe import SafeTx from .base_api ...
/safe_cli-0.7.1.tar.gz/safe_cli-0.7.1/safe_cli/api/transaction_service_api.py
0.718693
0.277791
transaction_service_api.py
pypi
Undefined = object() def safe_cmp(a, b, _nan_is_eq=False): """ Python 2 compatible ``cmp`` function. See also: https://github.com/python/cpython/blob/2.7/Objects/object.c#L768 Note: the ``_nan_is_eq`` argument is required to ensure that sorting is consistent (ie, where ``nan`` does not mo...
/safe_cmp-0.1.1.tar.gz/safe_cmp-0.1.1/safe_cmp/safe_cmp.py
0.80406
0.423339
safe_cmp.py
pypi
from safeds.data.tabular.containers import Table from safeds.exceptions import UnknownColumnNameError class ExampleTable(Table): """ A `Table` with descriptions for its columns. Parameters ---------- table : Table The table. column_descriptions : dict[str, str] A dictionary ma...
/safe_ds_examples-0.15.0.tar.gz/safe_ds_examples-0.15.0/src/safeds_examples/tabular/containers/_example_table.py
0.910404
0.546315
_example_table.py
pypi
from pathlib import Path from safeds.data.tabular.containers import Table from safeds_examples.tabular.containers import ExampleTable _path = Path(__file__).parent / "data" / "house_sales.csv" def load_house_sales() -> ExampleTable: """ Load the "House Sales" dataset. Returns ------- ExampleTa...
/safe_ds_examples-0.15.0.tar.gz/safe_ds_examples-0.15.0/src/safeds_examples/tabular/_house_sales/_house_sales.py
0.855097
0.49762
_house_sales.py
pypi
from __future__ import annotations import copy import io import warnings from pathlib import Path from typing import Any, BinaryIO import numpy as np import PIL from PIL import ImageEnhance, ImageFilter, ImageOps from PIL.Image import Image as PillowImage from PIL.Image import open as open_image from skimage.util imp...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/image/containers/_image.py
0.951431
0.563678
_image.py
pypi
from __future__ import annotations import copy import functools import io import warnings from pathlib import Path from typing import TYPE_CHECKING, Any, TypeVar import Levenshtein import matplotlib.pyplot as plt import numpy as np import openpyxl import pandas as pd import seaborn as sns from pandas import DataFrame...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/tabular/containers/_table.py
0.863794
0.346154
_table.py
pypi
from __future__ import annotations import copy from typing import TYPE_CHECKING from safeds.data.tabular.containers import Column, Row, Table from safeds.exceptions import ( ColumnIsTargetError, IllegalSchemaModificationError, UnknownColumnNameError, ) if TYPE_CHECKING: from collections.abc import Ca...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/tabular/containers/_tagged_table.py
0.932974
0.430088
_tagged_table.py
pypi
from __future__ import annotations import copy import functools from collections.abc import Callable, Mapping from typing import TYPE_CHECKING, Any import pandas as pd from safeds.data.tabular.typing import ColumnType, Schema from safeds.exceptions import UnknownColumnNameError if TYPE_CHECKING: from collection...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/tabular/containers/_row.py
0.94353
0.529993
_row.py
pypi
from __future__ import annotations import copy import io from collections.abc import Sequence from numbers import Number from typing import TYPE_CHECKING, Any, TypeVar, overload import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from safeds.data.image.containers import Image...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/tabular/containers/_column.py
0.947442
0.426262
_column.py
pypi
from __future__ import annotations from sklearn.preprocessing import KBinsDiscretizer as sk_KBinsDiscretizer from safeds.data.tabular.containers import Table from safeds.data.tabular.transformation._table_transformer import TableTransformer from safeds.exceptions import ( ClosedBound, NonNumericColumnError, ...
/safe_ds-0.15.0.tar.gz/safe_ds-0.15.0/src/safeds/data/tabular/transformation/_discretizer.py
0.962027
0.522811
_discretizer.py
pypi