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 collections try: from collections import MutableSequence except Exception: from collections.abc import MutableSequence from copy import deepcopy import decimal try: from sanic.exceptions import abort except Exception: from sanic.exceptions import SanicException as abort from sanic.exceptions impo...
/sanic-restful-api-0.2.0.tar.gz/sanic-restful-api-0.2.0/sanic_restful_api/reqparse.py
0.76533
0.296132
reqparse.py
pypi
from calendar import timegm from decimal import Decimal as MyDecimal, ROUND_HALF_EVEN from email.utils import formatdate import six from sanic_restful_api import marshal __all__ = ["String", "FormattedString", "DateTime", "Float", "Integer", "Arbitrary", "Nested", "List", "Raw", "Boolean", "Fixed...
/sanic-restful-api-0.2.0.tar.gz/sanic-restful-api-0.2.0/sanic_restful_api/fields.py
0.834643
0.206814
fields.py
pypi
from collections import OrderedDict from functools import wraps from sanic_restful import Resource from sanic_restful.util import unpack def marshal(data, fields, envelope=None): """Takes raw data (in the form of a dict, list, object) and a dict of fields to output and filters the data based on those fields....
/sanic-restful-0.1.1.tar.gz/sanic-restful-0.1.1/sanic_restful/marshal.py
0.901704
0.665451
marshal.py
pypi
from collections import OrderedDict from functools import wraps from sanic import Blueprint, Sanic from sanic.exceptions import ServerError from sanic.response import BaseHTTPResponse, text from sanic_restful.exceptions import NotAcceptable from sanic_restful.output import output_json from sanic_restful.util import un...
/sanic-restful-0.1.1.tar.gz/sanic-restful-0.1.1/sanic_restful/api.py
0.804329
0.177811
api.py
pypi
from calendar import timegm from decimal import Decimal as MyDecimal, ROUND_HALF_EVEN from email.utils import formatdate from sanic_restful.marshal import marshal __all__ = ["String", "FormattedString", "DateTime", "Float", "Integer", "Arbitrary", "Nested", "List", "Raw", "Boolean", "Fixed", "Pr...
/sanic-restful-0.1.1.tar.gz/sanic-restful-0.1.1/sanic_restful/fields.py
0.85132
0.235284
fields.py
pypi
import inspect import warnings from collections import namedtuple from sanic.constants import HTTP_METHODS from .errors import abort from .marshalling import marshal, marshal_with from .model import Model, OrderedModel, SchemaModel from .reqparse import RequestParser from .utils import merge from ._http import HTTPStat...
/sanic-restplus-0.6.4.tar.gz/sanic-restplus-0.6.4/sanic_restplus/namespace.py
0.83346
0.184694
namespace.py
pypi
import inspect from asyncio import iscoroutinefunction from sanic.views import HTTPMethodView from sanic.response import BaseHTTPResponse from sanic.constants import HTTP_METHODS from .model import ModelBase from .utils import unpack, best_match_accept_mimetype class MethodViewExt(HTTPMethodView): methods = Non...
/sanic-restplus-0.6.4.tar.gz/sanic-restplus-0.6.4/sanic_restplus/resource.py
0.554953
0.195844
resource.py
pypi
from enum import IntEnum class HTTPStatus(IntEnum): """HTTP status codes and reason phrases Status codes from the following RFCs are all observed: * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616 * RFC 6585: Additional HTTP Status Codes * RFC 3229: Delta encoding in...
/sanic-restplus-0.6.4.tar.gz/sanic-restplus-0.6.4/sanic_restplus/_http.py
0.803135
0.243086
_http.py
pypi
import logging import re from collections import OrderedDict from inspect import isclass from .errors import RestError log = logging.getLogger(__name__) LEXER = re.compile(r'\{|\}|\,|[\w_:\-\*]+') class MaskError(RestError): '''Raised when an error occurs on mask''' pass class ParseError(MaskError): ...
/sanic-restplus-0.6.4.tar.gz/sanic-restplus-0.6.4/sanic_restplus/mask.py
0.678433
0.348257
mask.py
pypi
import re import fnmatch import inspect from calendar import timegm from datetime import date, datetime from decimal import Decimal, ROUND_HALF_EVEN from email.utils import formatdate from functools import lru_cache from urllib.parse import urlparse, urlunparse from .inputs import date_from_iso8601, datetime_from_i...
/sanic-restplus-0.6.4.tar.gz/sanic-restplus-0.6.4/sanic_restplus/fields.py
0.78838
0.155078
fields.py
pypi
# Sanic Routing ## Background Beginning in v21.3, Sanic makes use of this new AST-style router in two use cases: 1. Routing paths; and 2. Routing signals. Therefore, this package comes with a `BaseRouter` that needs to be subclassed in order to be used for its specific needs. Most Sanic users should never need to...
/sanic-routing-23.6.0.tar.gz/sanic-routing-23.6.0/README.md
0.47025
0.818229
README.md
pypi
import re import typing as t from types import SimpleNamespace from warnings import warn from .exceptions import InvalidUsage, ParameterNameConflicts from .patterns import ParamInfo from .utils import Immutable, parts_to_path, path_to_parts class Requirements(Immutable): def __hash__(self): return hash(f...
/sanic-routing-23.6.0.tar.gz/sanic-routing-23.6.0/sanic_routing/route.py
0.781997
0.195844
route.py
pypi
from __future__ import annotations from typing import FrozenSet, List, Optional, Sequence, Tuple from sanic_routing.route import Requirements, Route from sanic_routing.utils import Immutable from .exceptions import InvalidUsage, RouteExists class RouteGroup: methods_index: Immutable passthru_properties = (...
/sanic-routing-23.6.0.tar.gz/sanic-routing-23.6.0/sanic_routing/group.py
0.949693
0.266703
group.py
pypi
import re import typing as t import uuid from datetime import date, datetime from types import SimpleNamespace from typing import Any, Callable, Dict, Pattern, Tuple, Type from sanic_routing.exceptions import InvalidUsage, NotFound def parse_date(d) -> date: return datetime.strptime(d, "%Y-%m-%d").date() def a...
/sanic-routing-23.6.0.tar.gz/sanic-routing-23.6.0/sanic_routing/patterns.py
0.64791
0.216198
patterns.py
pypi
import asyncio import inspect import logging import traceback from datetime import datetime, time, timedelta from typing import Callable, Optional, Union __all__ = ('task', 'SanicScheduler', 'make_task') logger = logging.getLogger('scheduler') _tasks = {} _wrk = [] def make_task(fn: Callable, period...
/sanic-scheduler-1.0.7.tar.gz/sanic-scheduler-1.0.7/sanic_scheduler/__init__.py
0.775392
0.161883
__init__.py
pypi
import functools import logging from fnmatch import fnmatch from sanic.request import Request from tortoise.exceptions import DoesNotExist from sanic_security.authentication import authenticate from sanic_security.exceptions import AuthorizationError from sanic_security.models import Role, Account, AuthenticationSess...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/authorization.py
0.839603
0.206334
authorization.py
pypi
import functools from contextlib import suppress from sanic.request import Request from sanic_security.exceptions import ( JWTDecodeError, NotFoundError, VerifiedError, ) from sanic_security.models import ( Account, TwoStepSession, CaptchaSession, ) """ An effective, simple, and async securit...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/verification.py
0.78609
0.28198
verification.py
pypi
import datetime import random import string from sanic.request import Request from sanic.response import json as sanic_json, HTTPResponse """ An effective, simple, and async security library for the Sanic framework. Copyright (C) 2020-present Aidan Stewart This program is free software: you can redistribute it and/...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/utils.py
0.742235
0.162879
utils.py
pypi
import base64 import functools import re from argon2 import PasswordHasher from argon2.exceptions import VerifyMismatchError from sanic import Sanic from sanic.log import logger from sanic.request import Request from tortoise.exceptions import DoesNotExist from sanic_security.configuration import config as security_c...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/authentication.py
0.654453
0.176388
authentication.py
pypi
from sanic.exceptions import SanicException from sanic_security.utils import json """ An effective, simple, and async security library for the Sanic framework. Copyright (C) 2020-present Aidan Stewart This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Pu...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/exceptions.py
0.844922
0.219547
exceptions.py
pypi
from os import environ from sanic.utils import str_to_bool """ An effective, simple, and async security library for the Sanic framework. Copyright (C) 2020-present Aidan Stewart This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as publis...
/sanic_security-1.11.7-py3-none-any.whl/sanic_security/configuration.py
0.722821
0.196441
configuration.py
pypi
from typing import Callable from sanic_session.base import BaseSessionInterface try: import asyncio_redis except ImportError: asyncio_redis = None class RedisSessionInterface(BaseSessionInterface): def __init__( self, redis_getter: Callable, domain: str = None, expiry: int...
/sanic_session-0.8.0.tar.gz/sanic_session-0.8.0/sanic_session/redis.py
0.825062
0.197541
redis.py
pypi
from sanic_session.base import BaseSessionInterface try: import aioredis except ImportError: aioredis = None class AIORedisSessionInterface(BaseSessionInterface): def __init__( self, redis, domain: str = None, expiry: int = 2592000, httponly: bool = True, c...
/sanic_session-0.8.0.tar.gz/sanic_session-0.8.0/sanic_session/aioredis.py
0.698741
0.171408
aioredis.py
pypi
import json from collections import OrderedDict class SseEvent(object): def __init__(self, event=None): self.data = None self.options = OrderedDict({ "event": event, }) @property def to_string(self): raise NotImplementedError("to_string method must be implement...
/sanic-sse-py3-1.0.6.tar.gz/sanic-sse-py3-1.0.6/sse/core/event.py
0.667798
0.228393
event.py
pypi
import asyncio import uuid from collections import defaultdict from typing import Dict class _StopMessage: # pylint: disable=too-few-public-methods pass class PubSub: """ Implementation of publish/subscriber protocol """ def __init__(self): self._channels = defaultdict(dict) def p...
/sanic_sse-0.3.1.tar.gz/sanic_sse-0.3.1/sanic_sse/pub_sub.py
0.776792
0.219756
pub_sub.py
pypi
from sanic.response import json from cerberus import Validator from functools import wraps JSON_DATA_ENTRY_TYPE = 'json_data_property' QUERY_ARG_ENTRY_TYPE = 'query_argument' REQ_BODY_ENTRY_TYPE = 'request_body' def validate_json(schema, clean=False, status_code=400): '''Decorator. Validates request body json. ...
/sanic-validation-0.5.1.tar.gz/sanic-validation-0.5.1/sanic_validation/decorators.py
0.733833
0.177063
decorators.py
pypi
from sanic.exceptions import InvalidUsage from sanic.constants import HTTP_METHODS class HTTPMethodView: """Simple class based implementation of view for the sanic. You should implement methods (get, post, put, patch, delete) for the class to every HTTP method you want to support. For example: ....
/sanic-win-0.6.1.tar.gz/sanic-win-0.6.1/sanic/views.py
0.82151
0.164617
views.py
pypi
from .base import BaseSessionInterface def check_aiomcache_installed(): """Check aiomcache installed, if absent - raises error. """ try: import aiomcache except ImportError: # pragma: no cover aiomcache = None if aiomcache is None: raise RuntimeError("Please install aiomc...
/sanic_session_2-0.2.6.tar.gz/sanic_session_2-0.2.6/sanic_session/memcache.py
0.715523
0.150496
memcache.py
pypi
from .base import BaseSessionInterface def check_aioredis_installed(): """Check aioredis installed, if absent - raises error. """ try: import aioredis except ImportError: raise RuntimeError("Please install aioredis: pip install sanic_session[aioredis]") class AIORedisSessionInterface...
/sanic_session_2-0.2.6.tar.gz/sanic_session_2-0.2.6/sanic_session/aioredis.py
0.725454
0.168036
aioredis.py
pypi
from typing import Callable from .base import BaseSessionInterface def check_asyncio_redis_installed(): """Check asyncio_redis installed, if absent - raises error. """ try: import asyncio_redis except ImportError: raise RuntimeError("Please install asyncio_redis: pip install sanic_ses...
/sanic_session_2-0.2.6.tar.gz/sanic_session_2-0.2.6/sanic_session/asyncio_redis.py
0.806434
0.205018
asyncio_redis.py
pypi
import traceback import aiomysql import pymysql version = "0.2" version_info = (0, 2, 0, 0) class SanicDB: """A lightweight wrapper around aiomysql.Pool for easy to use """ def __init__(self, host, database, user, password, loop=None, sanic=None, minsize=3, maxsize=5, ...
/sanicdb-0.2-py3-none-any.whl/sanicdb.py
0.509276
0.179423
sanicdb.py
pypi
sanitize_ml_labels ========================================================================================= |pip| |downloads| Simple python package to sanitize in a standard way ML-related labels. Why do I need this? ------------------- So you have some kind of plot and you have some ML-related labels. Since I alway...
/sanitize_ml_labels-1.0.50.tar.gz/sanitize_ml_labels-1.0.50/README.rst
0.95183
0.740632
README.rst
pypi
from typing import List, Dict, Union import re import compress_json from .find_true_hyphenated_words import find_true_hyphenated_words def consonants_to_upper(label: str) -> str: """Return given label with consonants groups to uppercase. Examples -------- Vanilla cnn model -> Vanilla CNN model ml...
/sanitize_ml_labels-1.0.50.tar.gz/sanitize_ml_labels-1.0.50/sanitize_ml_labels/sanitize_ml_labels.py
0.954308
0.545286
sanitize_ml_labels.py
pypi
<a href="https://pypi.org/project/sanity-html/"> <img src="https://img.shields.io/pypi/v/sanity-html.svg" alt="Package version"> </a> <a href="https://codecov.io/gh/otovo/python-sanity-html"> <img src="https://codecov.io/gh/otovo/python-sanity-html/branch/main/graph/badge.svg" alt="Code coverage"> </a> <a href=...
/sanity-html-1.0.0.tar.gz/sanity-html-1.0.0/README.md
0.670932
0.915922
README.md
pypi
from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING, cast from sanity_html.utils import get_default_marker_definitions if TYPE_CHECKING: from typing import Literal, Optional, Tuple, Type, Union from sanity_html.marker_definitions import MarkerDefiniti...
/sanity-html-1.0.0.tar.gz/sanity-html-1.0.0/sanity_html/types.py
0.888995
0.354126
types.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING from sanity_html.logger import logger if TYPE_CHECKING: from typing import Type from sanity_html.types import Block, Span class MarkerDefinition: """Base class for marker definition handlers.""" tag: str @classmethod def...
/sanity-html-1.0.0.tar.gz/sanity-html-1.0.0/sanity_html/marker_definitions.py
0.953665
0.349588
marker_definitions.py
pypi
from __future__ import annotations import html from typing import TYPE_CHECKING, cast from sanity_html.constants import STYLE_MAP from sanity_html.logger import logger from sanity_html.marker_definitions import DefaultMarkerDefinition from sanity_html.types import Block, Span from sanity_html.utils import get_list_ta...
/sanity-html-1.0.0.tar.gz/sanity-html-1.0.0/sanity_html/renderer.py
0.877483
0.208602
renderer.py
pypi
goog.provide('goog.math.Long'); goog.require('goog.reflect'); /** * Constructs a 64-bit two's-complement integer, given its low and high 32-bit * values as *signed* integers. See the from* functions below for more * convenient ways of constructing Longs. * * The internal representation of a long is the two gi...
/sanity-nupic-0.0.15.tar.gz/sanity-nupic-0.0.15/htmsanity/nupic/sanity/public/demos/out/goog/math/long.js
0.890556
0.507507
long.js
pypi
goog.provide('goog.math.Integer'); /** * Constructs a two's-complement integer an array containing bits of the * integer in 32-bit (signed) pieces, given in little-endian order (i.e., * lowest-order bits in the first piece), and the sign of -1 or 0. * * See the from* functions below for other convenient ways of...
/sanity-nupic-0.0.15.tar.gz/sanity-nupic-0.0.15/htmsanity/nupic/sanity/public/demos/out/goog/math/integer.js
0.895694
0.561936
integer.js
pypi
goog.provide('goog.math'); goog.require('goog.array'); goog.require('goog.asserts'); /** * Returns a random integer greater than or equal to 0 and less than {@code a}. * @param {number} a The upper bound for the random integer (exclusive). * @return {number} A random integer N such that 0 <= N < a. */ goog.math...
/sanity-nupic-0.0.15.tar.gz/sanity-nupic-0.0.15/htmsanity/nupic/sanity/public/demos/out/goog/math/math.js
0.960888
0.673641
math.js
pypi
[![ci-cd](https://github.com/UBC-MDS/sanityze/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/UBC-MDS/sanityze/actions/workflows/ci-cd.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Documentation Status](https://readthedocs.org/projects/san...
/sanityze-1.0.2.tar.gz/sanityze-1.0.2/README.md
0.44746
0.952309
README.md
pypi
# SankeyFlow SankeyFlow is a lightweight python package that plots [Sankey flow diagrams](https://en.wikipedia.org/wiki/Sankey_diagram) using Matplotlib. ![sankey example](example/msft_FY22q2.png) ```py import matplotlib.pyplot as plt from sankeyflow import Sankey flows = [ ('Product', 'Total revenue', 20779), ...
/sankeyflow-0.3.7.tar.gz/sankeyflow-0.3.7/README.md
0.414543
0.990741
README.md
pypi
## Detection Parameters To detect action potentials, SanPy uses a number of parameters. These can all be configured using the [detection parameter plugin](../plugins/#detection-parameters) or programmatically with the API [sanpy/detectionParams](../api/bDetection). Note: To update this table use sanpy/bDetection.py ...
/sanpy-ephys-0.1.25.tar.gz/sanpy-ephys-0.1.25/docs/docs/methods.md
0.926354
0.847337
methods.md
pypi
The SanPy deskop application is an easy to use and powerful GUI designed to satisfy all your analysis needs. You can [download](../download) the desktop appication or [build from source](../install). ## Getting Started Load a folder of raw data files with the `Load Folder` button, or use the `File - Load Folder ...` ...
/sanpy-ephys-0.1.25.tar.gz/sanpy-ephys-0.1.25/docs/docs/desktop-application.md
0.880618
0.930711
desktop-application.md
pypi
from matplotlib.backends import backend_qt5agg import matplotlib as mpl import matplotlib.pyplot as plt from sanpy.sanpyLogger import get_logger logger = get_logger(__name__) import sanpy from sanpy.interface.plugins import sanpyPlugin class exampleUserPlugin1(sanpyPlugin): """ Plot x/y statistics as a sca...
/sanpy-ephys-0.1.25.tar.gz/sanpy-ephys-0.1.25/sanpy/_userFiles/SanPy-User-Files/plugins/exampleUserPlugin1.py
0.667364
0.321274
exampleUserPlugin1.py
pypi
from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import QModelIndex from PyQt5.QtGui import QStandardItemModel from PyQt5.QtWidgets import QApplication, QTableView class CheckBoxDelegate(QtWidgets.QItemDelegate): """ A delegate that places a fully functioning QCheckBox cell of the column to which it's app...
/sanpy-ephys-0.1.25.tar.gz/sanpy-ephys-0.1.25/sandbox/myCheckboxInTable2.py
0.528777
0.205894
myCheckboxInTable2.py
pypi
from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import QModelIndex from PyQt5.QtGui import QStandardItemModel from PyQt5.QtWidgets import QApplication, QTableView class CheckBoxDelegate(QtWidgets.QItemDelegate): """ A delegate that places a fully functioning QCheckBox cell of the column to which it's app...
/sanpy-ephys-0.1.25.tar.gz/sanpy-ephys-0.1.25/sandbox/myCheckboxInTable.py
0.533641
0.206814
myCheckboxInTable.py
pypi
import san.pandas_utils import san.sanbase_graphql_helper as sgh from san.batch import Batch from san.error import SanError # to be removed def burn_rate(idx, slug, **kwargs): query_str = sgh.create_query_str('burn_rate', idx, slug, **kwargs) return query_str def token_age_consumed(idx, slug, **kwargs): ...
/sanpy-0.11.6-py3-none-any.whl/san/sanbase_graphql.py
0.625781
0.210036
sanbase_graphql.py
pypi
import san.sanbase_graphql from san.query_constants import DEPRECATED_QUERIES, CUSTOM_QUERIES, NO_SLUG_QUERIES from san.sanbase_graphql_helper import QUERY_MAPPING from san.graphql import execute_gql, get_response_headers from san.query import get_gql_query, parse_dataset from san.transform import transform_timeseries_...
/sanpy-0.11.6-py3-none-any.whl/san/get.py
0.797596
0.217628
get.py
pypi
import iso8601 import datetime _DEFAULT_INTERVAL = '1d' _DEFAULT_SOCIAL_VOLUME_TYPE = 'TELEGRAM_CHATS_OVERVIEW' _DEFAULT_SOURCE = 'TELEGRAM' _DEFAULT_SEARCH_TEXT = '' QUERY_MAPPING = { 'burn_rate': { # to be removed 'query': 'burnRate', 'return_fields': ['datetime', 'burnRate'] }, 'token_...
/sanpy-0.11.6-py3-none-any.whl/san/sanbase_graphql_helper.py
0.408041
0.325119
sanbase_graphql_helper.py
pypi
import operator import pandas as pd from san.pandas_utils import convert_to_datetime_idx_df from functools import reduce from collections import OrderedDict from san.graphql import execute_gql from san.error import SanError from san.sanbase_graphql_helper import QUERY_MAPPING QUERY_PATH_MAP = { 'eth_top_transactio...
/sanpy-0.11.6-py3-none-any.whl/san/transform.py
0.61231
0.416114
transform.py
pypi
import re import datetime import pandas as pd def convert_dt(timestamp_string, postfix=' 00:00:00'): if type(timestamp_string) == datetime.date: timestamp_string = timestamp_string.strftime('%Y-%m-%d') if type(timestamp_string) == datetime.datetime: timestamp_string = timestamp_string.strfti...
/sanpy-0.11.6-py3-none-any.whl/san/extras/utils.py
0.46393
0.308425
utils.py
pypi
import numpy as np import pandas as pd import matplotlib.pyplot as pyplot from datetime import timedelta from scipy import stats from IPython.display import display """ Event study to evaluate events or signals. The main parameters the event study function accepts are a pandas dataframe containing the price data of t...
/sanpy-0.11.6-py3-none-any.whl/san/extras/event_study.py
0.759136
0.592283
event_study.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 ...
/sans_distributions-0.1.tar.gz/sans_distributions-0.1/sans_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
from __future__ import annotations from dataclasses import dataclass import typing from .types import JsonDict, JsonList, JsonPrimitive @dataclass class JsonRpcError: """ Represents an error in the JSON RPC protocol. """ code: int message: str data: typing.Optional[JsonDict] = None def to_json...
/sansio_jsonrpc-0.2.0-py3-none-any.whl/sansio_jsonrpc/exc.py
0.92738
0.208421
exc.py
pypi
import typing as t from pydantic import BaseModel, PrivateAttr if t.TYPE_CHECKING: # avoid import cycle at runtime from .client import Client from .structs import ( JSONDict, Diagnostic, MessageType, MessageActionItem, CompletionList, TextEdit, MarkupContent, Range, Location, ...
/sansio_lsp_client-0.10.0-py3-none-any.whl/sansio_lsp_client/events.py
0.483161
0.183868
events.py
pypi
__all__ = ["parse_form_data"] from io import BytesIO from urllib.parse import parse_qs from .parser import MultipartParser from .utils import MultiDict, parse_options_header from .errors import MultipartError def parse_form_data(environ, charset="utf8", strict=False, **kwargs): """ Parse form data from an envi...
/sansio_multipart-0.3.tar.gz/sansio_multipart-0.3/sansio_multipart/wsgi_form_parser.py
0.569494
0.263469
wsgi_form_parser.py
pypi
__all__ = [ "header_quote", "header_unquote", "parse_options_header", "to_bytes", "MultiDict", ] import re from collections.abc import MutableMapping as DictMixin _special = re.escape('()<>@,;:"\\/[]?={} \t') _re_special = re.compile(r"[%s]" % _special) _quoted_string = r'"(?:\\.|[^"])*"' # Quo...
/sansio_multipart-0.3.tar.gz/sansio_multipart-0.3/sansio_multipart/utils.py
0.541894
0.280129
utils.py
pypi
from copy import deepcopy def remove_none_keys(dict_x): dict_y = {} for key, value in iter(dict_x.items()): if isinstance(value, dict): value = remove_none_keys(value) if key is not None: dict_y[key] = value return dict_y def remove_dict_none_values(value, from_dictified_objects_only=False...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/collection_helper.py
0.525612
0.326916
collection_helper.py
pypi
import logging import string logging.basicConfig( level=logging.DEBUG, format="%(levelname)s: %(asctime)s {%(filename)s:%(lineno)d}: %(message)s " ) class ClientInterface(object): """A common interface to a database server or system. Accessing databases through implementations of this interface enables one ...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/db/interfaces/__init__.py
0.794465
0.34834
__init__.py
pypi
from __future__ import absolute_import import json import logging import sys from copy import deepcopy import jsonpickle import jsonschema import toml from jsonschema import SchemaError from jsonschema import ValidationError from jsonschema.exceptions import best_match from six import string_types from toml.decoder i...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/schema/common.py
0.508788
0.159774
common.py
pypi
import logging import sys from sanskrit_data.schema import common from sanskrit_data.schema.common import UllekhanamJsonObject, TYPE_FIELD, JsonObject, Target, DataSource, Text, \ NamedEntity class BookPositionTarget(Target): schema = common.recursively_merge_json_schemas(Target.schema, { "type": "object", ...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/schema/books.py
0.625324
0.283591
books.py
pypi
import logging import sys from sanskrit_data.schema import common from sanskrit_data.schema.common import JsonObject, recursively_merge_json_schemas, TYPE_FIELD, update_json_class_index logging.basicConfig( level=logging.DEBUG, format="%(levelname)s: %(asctime)s {%(filename)s:%(lineno)d}: %(message)s " ) class ...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/schema/users.py
0.52342
0.226495
users.py
pypi
import logging logging.basicConfig( level=logging.DEBUG, format="%(levelname)s: %(asctime)s {%(filename)s:%(lineno)d}: %(message)s " ) from sanskrit_data.schema import common from sanskrit_data.schema.books import BookPortion from sanskrit_data.schema.common import Text, Target from sanskrit_data.schema.ullekhana...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/schema/ullekhanam/sanskrit.py
0.714329
0.300938
sanskrit.py
pypi
import logging import sys from sanskrit_data.schema import common from sanskrit_data.schema.books import BookPortion, CreationDetails from sanskrit_data.schema.common import JsonObject, UllekhanamJsonObject, Target, DataSource, Text, NamedEntity logging.basicConfig( level=logging.DEBUG, format="%(levelname)s: %(a...
/sanskrit_data-0.8.13-py3-none-any.whl/sanskrit_data/schema/ullekhanam/__init__.py
0.632162
0.266027
__init__.py
pypi
from __future__ import print_function from indic_transliteration import sanscript from indic_transliteration import detect from sanskrit_parser.util import normalization from contextlib import contextmanager import logging import six logger = logging.getLogger(__name__) denormalize = False class SanskritString(obje...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/base/sanskrit_base.py
0.772917
0.214455
sanskrit_base.py
pypi
from __future__ import print_function from indic_transliteration import sanscript from . import sanskrit_base import re import six class MaheshvaraSutras(object): """ Singleton MaheshvaraSutras class Attributes: MS(SanskritImmutableString) : Internal representation of mAheshvara sutras MSS(str) ...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/base/maheshvara_sutra.py
0.641984
0.228307
maheshvara_sutra.py
pypi
from indic_transliteration import sanscript from sanskrit_parser.base.sanskrit_base import SanskritImmutableString from decimal import Decimal from copy import deepcopy from sanskrit_parser.generator.paninian_object import PaninianObject import logging logger = logging.getLogger(__name__) # Global Domains class Glob...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/generator/sutra.py
0.618665
0.178383
sutra.py
pypi
from indic_transliteration import sanscript from sanskrit_parser.base.sanskrit_base import SanskritObject import logging logger = logging.getLogger(__name__) class PaninianObject(SanskritObject): """ Paninian Object Class: Derived From SanskritObject Attributes: """ def __init__(self, thing=None, enc...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/generator/paninian_object.py
0.403214
0.23444
paninian_object.py
pypi
from sanskrit_parser.generator.sutra import GlobalDomains from sanskrit_parser.generator.paninian_object import PaninianObject from copy import deepcopy, copy import logging logger = logging.getLogger(__name__) class PrakriyaVakya(object): """ Prakriya Vakya class Start with associated prakriti + pratyay...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/generator/prakriya.py
0.536799
0.15393
prakriya.py
pypi
import logging from tinydb import TinyDB, Query from sanskrit_parser.base.sanskrit_base import SanskritImmutableString from sanskrit_parser.util.data_manager import data_file_path class DhatuWrapper(object): """ Class to interface with the kRShNamAchArya dhAtupATha https://github.com/sanskrit-coders/star...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/util/DhatuWrapper.py
0.52074
0.205615
DhatuWrapper.py
pypi
import pickle import sqlite3 import logging from collections import namedtuple from sanskrit_parser.base.sanskrit_base import SanskritImmutableString from sanskrit_parser.util.lexical_lookup import LexicalLookup from sanskrit_parser.util.inriatagmapper import inriaTagMapper from sanskrit_parser.util.data_manager impor...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/util/inriaxmlwrapper.py
0.545286
0.352118
inriaxmlwrapper.py
pypi
from sanskrit_parser.util.inriaxmlwrapper import InriaXMLWrapper from sanskrit_parser.util.sanskrit_data_wrapper import SanskritDataWrapper from sanskrit_parser.util.lexical_lookup import LexicalLookup import logging def _merge_tags(tags): ''' Merge tags from multiple sources Inputs tags: List...
/sanskrit_parser-0.2.6.tar.gz/sanskrit_parser-0.2.6/sanskrit_parser/util/lexical_lookup_factory.py
0.439026
0.235834
lexical_lookup_factory.py
pypi
import io import json import logging from dataclasses import dataclass from enum import IntEnum import requests from indic_transliteration.sanscript.schemes import VisargaApproximation from pydub import AudioSegment from .base import TTSBase from .util import transliterate_text class BhashiniVoice(IntEnum): FEM...
/sanskrit_tts-0.0.5.tar.gz/sanskrit_tts-0.0.5/sanskrit_tts/bhashini_tts.py
0.45641
0.172729
bhashini_tts.py
pypi
#: All legal sounds, including anusvara, ardhachandra, and Vedic `'L'`. from builtins import map from builtins import zip ALL_SOUNDS = frozenset("aAiIuUfFxXeEoOMHkKgGNcCjJYwWqQRtTdDnpPbBmyrlLvSzsh'~") #: All legal tokens, including sounds, punctuation (`'|'`), and whitespace. ALL_TOKENS = ALL_SOUNDS | {'|', ' ', '\n'}...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/sounds.py
0.801897
0.239549
sounds.py
pypi
import six import types import os from sqlalchemy import create_engine, inspect from sqlalchemy.orm import scoped_session, sessionmaker from .schema import Base, EnumBase, GenderGroup class Context(object): """The package context. In addition to storing basic config information, such as the database URI or...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/context.py
0.684897
0.214393
context.py
pypi
import re from sqlalchemy import Boolean, Column, ForeignKey, Integer, String from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.orm import relationship Base = decla...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/schema.py
0.674158
0.428293
schema.py
pypi
from collections import defaultdict, namedtuple from . import sounds, util from .schema import * import pprint Ending = namedtuple('Ending', ['name', 'length', 'stem_type', 'gender_id', 'case_id', 'number_id', 'compounded', 'is_consonant_stem']) class ...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/analyze.py
0.506836
0.296234
analyze.py
pypi
from builtins import next from builtins import zip from builtins import range from builtins import object import six from . import sounds from .util import HashTrie class Exempt(six.text_type): """A helper class for marking strings as exempt from sandhi changes. To mark a string as exempt, just do the follow...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/sandhi.py
0.836087
0.379005
sandhi.py
pypi
from collections import defaultdict import six from . import sounds from .generate import NominalGenerator from .schema import * class SimpleQuery(object): """A simple API for database access.""" def __init__(self, ctx): self.ctx = ctx self.session = ctx.session self.nominal = Nomina...
/sanskrit_util-0.1.2.tar.gz/sanskrit_util-0.1.2/sanskrit_util/query.py
0.909132
0.302642
query.py
pypi
# LDAP Events Here are some common scenarios in the LDAP protocol and how they can be implemented with this library. The examples here are all based on an IO-less connection, this layer still needs to be provided by a higher layer. ## Authentication Authentication with LDAP falls into two different categories: * Si...
/sansldap-0.1.0.tar.gz/sansldap-0.1.0/docs/events.md
0.532911
0.739705
events.md
pypi
from typing import Tuple RELATIVE_DIRECTIONS = { 'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0), } GEOGRAPHICAL_DIRECTIONS = { 'N': (0, 1), 'S': (0, -1), 'W': (-1, 0), 'E': (1, 0), } def get_direction(ch: str) -> Tuple[int, int]: """Coordinates point for direction Args...
/santa_helpers-0.0.2.tar.gz/santa_helpers-0.0.2/santa_helpers/paths.py
0.920133
0.569583
paths.py
pypi
import logging from typing import List from typing import Optional from sqlalchemy import String, Float, Integer, select, insert, update from sqlalchemy.orm import DeclarativeBase, Session, Mapped, mapped_column from sqlalchemy.exc import IntegrityError from datetime import datetime from .parsers import parse_daily_mea...
/santacruz_watersmart-0.1.1.tar.gz/santacruz_watersmart-0.1.1/santacruz_watersmart/storage_class.py
0.752649
0.363534
storage_class.py
pypi
from functools import wraps from inspect import isawaitable from typing import Dict, Optional, Type, get_args, get_origin, get_type_hints from pydantic import ValidationError from sanic import Request from sanic.exceptions import SanicException from .fields import MethodType, SanticModel from .utils import validate_m...
/santic_validation-0.0.5-py3-none-any.whl/santic_validation/decorator.py
0.738386
0.208783
decorator.py
pypi
[![PyPI version](https://badge.fury.io/py/santoku.svg)](https://badge.fury.io/py/santoku) [![Install deps, Test & Release](https://github.com/wiris/santoku/actions/workflows/cd.yml/badge.svg)](https://github.com/wiris/santoku/actions/workflows/cd.yml) [![Code style: black](https://img.shields.io/badge/code%20style-bl...
/santoku-221018.38.tar.gz/santoku-221018.38/README.md
0.566019
0.961353
README.md
pypi
from .type import Type from .node import Node from .graph import Graph from .runtime_error import RuntimeError class Arc(Type): def __init__(self, source=None, target=None, weight=0.0, type_="directed"): self.source = source or Node(0.0) self.target = target or Node(0.0) self.weight = weig...
/sanya_script_runtime-0.1.5.tar.gz/sanya_script_runtime-0.1.5/sanya_script_runtime/arc.py
0.688049
0.169286
arc.py
pypi
from .type import Type from .runtime_error import RuntimeError class Graph(Type): def __init__(self, elements=()): self.nodes = set() self.arcs = set() self.set_elements(list(elements)) def set_elements(self, elements): self._resolve_elements(elements) def cast(self, type...
/sanya_script_runtime-0.1.5.tar.gz/sanya_script_runtime-0.1.5/sanya_script_runtime/graph.py
0.480966
0.186502
graph.py
pypi
import getopt import io import signal import sys import unicodedata USAGE = """Usage: szu-t [options] table_file [file ...] Translate CJK text using a translation table. Options: -h, --help print this help message and exit -v, --verbose include information useful for debugging """ def set_stdio_utf8...
/sanzang-utils-1.3.3.tar.gz/sanzang-utils-1.3.3/szu_t.py
0.417034
0.301542
szu_t.py
pypi
from sap.audit_logging.util import check_boolean, check_non_empty_string, validate_object from sap.audit_logging.messages.audit_message import AuditMessage DATA_ACCESS_ENDPOINT = '/data-accesses' class DataAccessMessage(AuditMessage): ''' DataAccessMessage ''' def __init__(self, logger): # pylint: d...
/sap_audit_logging-1.3.1-py3-none-any.whl/sap/audit_logging/messages/data_access_message.py
0.744192
0.209996
data_access_message.py
pypi
from concurrent.futures import ThreadPoolExecutor import json import logging import os import time from typing import Iterator, List, Union from sap_business_document_processing.common.http_client_base import CommonClient from sap_business_document_processing.common.helpers import get_ground_truth_json, function_wrap...
/sap_business_document_processing-0.3.2-py3-none-any.whl/sap_business_document_processing/document_classification_client/dc_api_client.py
0.77373
0.169372
dc_api_client.py
pypi
import mimetypes from .constants import API_FIELD_CLIENT_ID, API_FIELD_DOCUMENT_TYPE, API_FIELD_ENRICHMENT, API_FIELD_TEMPLATE_ID, \ API_FIELD_EXTRACTED_HEADER_FIELDS, API_FIELD_EXTRACTED_LINE_ITEM_FIELDS, API_REQUEST_FIELD_EXTRACTED_FIELDS, \ API_FIELD_FILE_TYPE, API_REQUEST_FIELD_RECEIVED_DATE def create_...
/sap_business_document_processing-0.3.2-py3-none-any.whl/sap_business_document_processing/document_information_extraction_client/helpers.py
0.52683
0.169406
helpers.py
pypi
import logging from .constants import DATASETS_ENDPOINT, DATASET_BY_ID_ENDPOINT, \ DATASET_DOCUMENTS_ENDPOINT, DATASET_DOCUMENT_BY_ID_ENDPOINT, TRAINING_JOBS_ENDPOINT, TRAINING_JOB_BY_ID_ENDPOINT, \ MODELS_ENDPOINT, MODEL_BY_NAME_ENDPOINT, MODEL_BY_VERSION_ENDPOINT, \ DEPLOYMENTS_ENDPOINT, DEPLOYMENT_BY_ID...
/sap_business_entity_recognition_client_library-1.4-py3-none-any.whl/sap_ber_client/ber_api_client.py
0.690037
0.266
ber_api_client.py
pypi
import numpy as np import argparse import os from PIL import Image class BackofficeIconConverter: """ Icon creator to convert an input file into the correct format needed by the SAP Commerce Backoffice framework to be used as icon in the explorer-tree. """ #: Side length of a single image (he...
/sap_commerce_backoffice_icons-1.0.0.tar.gz/sap_commerce_backoffice_icons-1.0.0/sap_commerce_backoffice_icons/backofficeIconConverter.py
0.623835
0.254596
backofficeIconConverter.py
pypi
triplet distance learning.""" from typing import Dict, List, Union, Tuple from collections.abc import Iterable as IsIterable from detectron2.structures import ImageList from detectron2.config import CfgNode import torch from torch import nn from .backbones import build_backbone class ProjectionLayer(nn.Module): ...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/modelling/base.py
0.977586
0.597138
base.py
pypi
from typing import Dict, List, Tuple, Union from detectron2.config import configurable from detectron2.modeling import META_ARCH_REGISTRY import torch from torch import nn from .base import BaseModel @META_ARCH_REGISTRY.register() class ImageClassifier(BaseModel): """Model for image classification. The mo...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/modelling/image_classifier.py
0.94743
0.329661
image_classifier.py
pypi
from typing import Callable, Dict, List, Tuple, Union import logging from detectron2.config import configurable, CfgNode from detectron2.modeling import META_ARCH_REGISTRY import torch from torch import nn from sap_computer_vision.data.triplet_sampling_utils import create_triplets_from_pk_sample, build_triplet_strat...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/modelling/distance_metric_learner.py
0.972663
0.481759
distance_metric_learner.py
pypi
import logging from typing import Union, List, Dict import torch from detectron2.modeling import BACKBONE_REGISTRY, Backbone from detectron2.layers import ShapeSpec from detectron2.modeling.backbone.fpn import LastLevelMaxPool, FPN try: import timm _timm_available = True except ImportError: _timm_availabl...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/modelling/backbones/timm_backbones.py
0.912651
0.394697
timm_backbones.py
pypi
from typing import Dict, Union, List import itertools import logging import torch import numpy as np from detectron2.config import configurable, CfgNode import detectron2.utils.comm as comm logger = logging.getLogger(__name__) class ImageClassificationEvaluator: """Detectron2 compatible evaluator to get metric...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/evaluators/image_classification.py
0.935243
0.331539
image_classification.py
pypi
import logging from collections import defaultdict, namedtuple import itertools from typing import Dict, Iterable, List, Any, Union import numpy as np import torch from detectron2.data import DatasetCatalog import detectron2.utils.comm as comm from detectron2.structures import Boxes, pairwise_iou from detectron2.model...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/evaluators/object_detection_pascal_voc_style.py
0.877955
0.305361
object_detection_pascal_voc_style.py
pypi
from typing import NoReturn, Union, Iterable, NoReturn, Dict import itertools import torch import numpy as np from detectron2.config import configurable from scipy.spatial.distance import pdist, cdist, squareform import detectron2.utils.comm as comm from detectron2.config import CfgNode class ContrastiveEvaluator: ...
/sap_computer_vision_package-1.1.7-py3-none-any.whl/sap_computer_vision/evaluators/contrastive.py
0.962036
0.472075
contrastive.py
pypi