code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
import logging
import os
from typing import List, Optional, Set, Tuple
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql # noqa
from sqlalchemy.orm import sessionmaker
from .constants import (
BUILTIN_SCHEMAS,
DEFAULT_SCHEMA,
DELETE,
LOGICAL_SLOT_PREFIX,
LOGICAL_SLOT_SUFFIX,
... | /retake_pgsync-2.5.4-py3-none-any.whl/pgsync/base.py | 0.770335 | 0.159577 | base.py | pypi |
import logging
from typing import Any, Dict, Optional
from .constants import ( # noqa
CONCAT_TRANSFORM,
RENAME_TRANSFORM,
REPLACE_TRANSFORM,
)
logger = logging.getLogger(__name__)
class Transform(object):
"""Transform is really a builtin plugin"""
@classmethod
def rename(cls, data: dict, n... | /retake_pgsync-2.5.4-py3-none-any.whl/pgsync/transform.py | 0.651466 | 0.394201 | transform.py | pypi |
class RelationshipTypeError(Exception):
"""
This error is raised if the relationship type is none of
"One to one", "One to many" or "Many to Many"
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class RelationshipVariantError(Excep... | /retake_pgsync-2.5.4-py3-none-any.whl/pgsync/exc.py | 0.840881 | 0.301381 | exc.py | pypi |
import psycopg2
from psycopg2.extras import LogicalReplicationConnection
from typing import List, Generator, cast
from core.extract.base import Extractor, ExtractorResult
class ConnectionError(Exception):
pass
class PostgresExtractor(Extractor):
def __init__(self, dsn: str) -> None:
self.dsn = dsn... | /retake-0.1.14.tar.gz/retake-0.1.14/core/extract/postgres.py | 0.52683 | 0.181735 | postgres.py | pypi |
from elasticsearch import Elasticsearch, helpers
from typing import Dict, List, Union, Optional, Any, cast
from core.load.base import Loader
from core.sdk.target import ElasticSearchTarget
class FieldTypeError(Exception):
pass
class ElasticSearchLoader(Loader):
def __init__(
self,
host: Opti... | /retake-0.1.14.tar.gz/retake-0.1.14/core/load/elasticsearch.py | 0.902481 | 0.35262 | elasticsearch.py | pypi |
import pinecone
from core.load.base import Loader
from typing import Dict, List, Union, Optional, Any
from core.sdk.target import PineconeTarget
class PineconeLoader(Loader):
def __init__(
self,
api_key: str,
environment: str,
) -> None:
pinecone.init(api_key=api_key, environm... | /retake-0.1.14.tar.gz/retake-0.1.14/core/load/pinecone.py | 0.786828 | 0.302604 | pinecone.py | pypi |
from opensearchpy import OpenSearch
from typing import List, Union, Optional, Dict, Any
from core.load.base import Loader
from core.sdk.target import OpenSearchTarget
class OpenSearchLoader(Loader):
def __init__(
self,
hosts: List[Dict[str, str]],
user: str,
password: str,
... | /retake-0.1.14.tar.gz/retake-0.1.14/core/load/opensearch.py | 0.828558 | 0.242183 | opensearch.py | pypi |
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
from core.load.base import Loader
from typing import Dict, List, Union, Optional, Any, cast
from core.sdk.target import QdrantTarget, QdrantSimilarity
class QdrantLoader(Loader):
def __init__(
self... | /retake-0.1.14.tar.gz/retake-0.1.14/core/load/qdrant.py | 0.879677 | 0.254521 | qdrant.py | pypi |
import os
import uuid
from weaviate import Client, AuthApiKey
from core.load.base import Loader
from typing import Dict, List, Union, Optional, Any, cast
from core.sdk.target import WeaviateTarget, WeaviateVectorizer
DEFAULT_BATCH_SIZE = 100
UUID_NAMESPACE = uuid.NAMESPACE_DNS
class WeaviateLoader(Loader):
def... | /retake-0.1.14.tar.gz/retake-0.1.14/core/load/weaviate.py | 0.759225 | 0.180793 | weaviate.py | pypi |
from pydantic import BaseModel
from enum import Enum
from typing import Optional, Dict, Any
class ElasticSimilarity(Enum):
L2_NORM = "l2_norm"
DOT_PRODUCT = "dot_product"
COSINE = "cosine"
class QdrantSimilarity(Enum):
COSINE = "Cosine"
EUCLID = "Euclid"
DOT = "Dot"
class WeaviateVectorize... | /retake-0.1.14.tar.gz/retake-0.1.14/core/sdk/target.py | 0.887357 | 0.2084 | target.py | pypi |
from tqdm import tqdm
from typing import Union, Tuple, Any, Optional, Dict, List, cast
from core.sdk.embedding import (
OpenAIEmbedding,
SentenceTransformerEmbedding,
CohereEmbedding,
CustomEmbedding,
)
from core.sdk.source import PostgresSource
from core.sdk.sink import (
ElasticSearchSink,
Op... | /retake-0.1.14.tar.gz/retake-0.1.14/core/sdk/pipeline.py | 0.91114 | 0.152442 | pipeline.py | pypi |
from pydantic import BaseModel
from typing import Optional, List, Dict
class ElasticSearchSink(BaseModel):
host: Optional[str] = None
user: Optional[str] = None
password: Optional[str] = None
ssl_assert_fingerprint: Optional[str] = None
cloud_id: Optional[str] = None
@property
def config(... | /retake-0.1.14.tar.gz/retake-0.1.14/core/sdk/sink.py | 0.89172 | 0.348423 | sink.py | pypi |
import httpx
from opensearchpy import Search
from typing import Any, List, Dict, Optional, Union
class Database:
def __init__(self, host: str, user: str, password: str, port: int, dbname: str):
self.host = host
self.user = user
self.password = password
self.port = port
sel... | /retakesearch_fork-0.2.0.tar.gz/retakesearch_fork-0.2.0/retakesearch/index.py | 0.634317 | 0.18838 | index.py | pypi |
import sys
import requests
PY3 = sys.version_info[0] == 3
if PY3:
from urllib.parse import parse_qs, urlencode, urlparse
def fetch_url(prepared_request): # type: ignore
"""
This is a util method that helps in reconstructing the request url.
:param prepared_request: unsigned request
:return: r... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/helpers/signer.py | 0.477798 | 0.212722 | signer.py | pypi |
from datetime import datetime, timedelta
from six import iteritems, itervalues
from opensearchpy.helpers.aggs import A
from .query import MatchAll, Nested, Range, Terms
from .response import Response
from .search import Search
from .utils import AttrDict
__all__ = [
"FacetedSearch",
"HistogramFacet",
"... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/helpers/faceted_search.py | 0.925873 | 0.357343 | faceted_search.py | pypi |
try:
import collections.abc as collections_abc # only works on python 3.3+
except ImportError:
import collections as collections_abc
from .response.aggs import AggResponse, BucketData, FieldBucketData, TopHitsData
from .utils import DslBase
def A(name_or_agg, filter=None, **params):
if filter is not No... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/helpers/aggs.py | 0.674158 | 0.239444 | aggs.py | pypi |
import six
from opensearchpy.connection.connections import get_connection
from opensearchpy.helpers.utils import AttrDict, DslBase, merge
__all__ = ["tokenizer", "analyzer", "char_filter", "token_filter", "normalizer"]
class AnalysisBase(object):
@classmethod
def _type_shortcut(cls, name_or_instance, type=... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/helpers/analysis.py | 0.734786 | 0.16388 | analysis.py | pypi |
from opensearchpy.connection.connections import get_connection
from ..helpers.query import Bool, Q
from ..helpers.search import ProxyDescriptor, QueryProxy, Request
from .response import UpdateByQueryResponse
from .utils import recursive_to_dict
class UpdateByQuery(Request):
query = ProxyDescriptor("query")
... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/helpers/update_by_query.py | 0.88299 | 0.228737 | update_by_query.py | pypi |
from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IndexManagementClient(NamespacedClient):
@query_params()
def put_policy(self, policy, body=None, params=None, headers=None):
"""
Creates, or updates, a policy.
:arg policy: The name of the poli... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/plugins/index_management.py | 0.701509 | 0.257281 | index_management.py | pypi |
from ..client.utils import NamespacedClient, _make_path, query_params
class AlertingClient(NamespacedClient):
@query_params()
def search_monitor(self, body, params=None, headers=None):
"""
Returns the search result for a monitor.
:arg monitor_id: The configuration for the monitor we... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/plugins/alerting.py | 0.765593 | 0.277908 | alerting.py | pypi |
import copy
from six import iteritems, string_types
from opensearchpy._async.helpers.actions import aiter, async_scan
from opensearchpy.connection.async_connections import get_connection
from opensearchpy.exceptions import IllegalOperation, TransportError
from opensearchpy.helpers.aggs import A
from opensearchpy.hel... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/helpers/search.py | 0.814975 | 0.204084 | search.py | pypi |
from six import iteritems, itervalues
from opensearchpy._async.helpers.search import AsyncSearch
from opensearchpy.helpers.faceted_search import FacetedResponse
from opensearchpy.helpers.query import MatchAll
class AsyncFacetedSearch(object):
"""
Abstraction for creating faceted navigation searches that ta... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/helpers/faceted_search.py | 0.825765 | 0.416856 | faceted_search.py | pypi |
from opensearchpy.connection.async_connections import get_connection
from opensearchpy.helpers.query import Bool, Q
from opensearchpy.helpers.response import UpdateByQueryResponse
from opensearchpy.helpers.search import ProxyDescriptor, QueryProxy, Request
from opensearchpy.helpers.utils import recursive_to_dict
cla... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/helpers/update_by_query.py | 0.910035 | 0.235317 | update_by_query.py | pypi |
from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IndexManagementClient(NamespacedClient):
@query_params()
async def put_policy(self, policy, body=None, params=None, headers=None):
"""
Creates, or updates, a policy.
:arg policy: The name of th... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/plugins/index_management.py | 0.69946 | 0.249619 | index_management.py | pypi |
from ..client.utils import NamespacedClient, _make_path, query_params
class AlertingClient(NamespacedClient):
@query_params()
async def search_monitor(self, body, params=None, headers=None):
"""
Returns the search result for a monitor.
:arg monitor_id: The configuration for the monit... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/plugins/alerting.py | 0.764452 | 0.268821 | alerting.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SnapshotClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion")
async def create(self, repository, snapshot, body=None, params=None, headers=None):
"""
Create... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/snapshot.py | 0.523908 | 0.18429 | snapshot.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
)
async def delete_dangling_index(self, index_uuid, params=None, headers=None):
... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/dangling_indices.py | 0.593374 | 0.172033 | dangling_indices.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class ClusterClient(NamespacedClient):
@query_params(
"expand_wildcards",
"level",
"local",
"master_timeout",
"cluster_manager_timeout",
"timeout",
"wait_for_active_shards",
... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/cluster.py | 0.642769 | 0.325266 | cluster.py | pypi |
from .utils import NamespacedClient, _make_path, query_params
class NodesClient(NamespacedClient):
@query_params("timeout")
async def reload_secure_settings(
self, body=None, node_id=None, params=None, headers=None
):
"""
Reloads secure settings.
:arg body: An object co... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/nodes.py | 0.794225 | 0.218649 | nodes.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IngestClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "summary")
async def get_pipeline(self, id=None, params=None, headers=None):
"""
Returns a pipeline.
:arg id:... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/ingest.py | 0.609873 | 0.203371 | ingest.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IndicesClient(NamespacedClient):
@query_params()
async def analyze(self, body=None, index=None, params=None, headers=None):
"""
Performs the analysis process on a text and return the tokens breakdown of the
... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/indices.py | 0.675015 | 0.334617 | indices.py | pypi |
import warnings
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class TasksClient(NamespacedClient):
@query_params(
"actions",
"detailed",
"group_by",
"nodes",
"parent_task_id",
"timeout",
"wait_for_completion",
)
async... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/_async/client/tasks.py | 0.622 | 0.265357 | tasks.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class SnapshotClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion")
def create(self, repository, snapshot, body=None, params=None, headers=None):
"""
Creates a sn... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/snapshot.py | 0.543833 | 0.177312 | snapshot.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class DanglingIndicesClient(NamespacedClient):
@query_params(
"accept_data_loss", "master_timeout", "cluster_manager_timeout", "timeout"
)
def delete_dangling_index(self, index_uuid, params=None, headers=None):
"... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/dangling_indices.py | 0.594198 | 0.177668 | dangling_indices.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class ClusterClient(NamespacedClient):
@query_params(
"expand_wildcards",
"level",
"local",
"master_timeout",
"cluster_manager_timeout",
"timeout",
"wait_for_active_shards",
... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/cluster.py | 0.658527 | 0.347897 | cluster.py | pypi |
from .utils import NamespacedClient, _make_path, query_params
class NodesClient(NamespacedClient):
@query_params("timeout")
def reload_secure_settings(
self, body=None, node_id=None, params=None, headers=None
):
"""
Reloads secure settings.
:arg body: An object containi... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/nodes.py | 0.788787 | 0.222151 | nodes.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IngestClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "summary")
def get_pipeline(self, id=None, params=None, headers=None):
"""
Returns a pipeline.
:arg id: Comma... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/ingest.py | 0.609408 | 0.205635 | ingest.py | pypi |
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class IndicesClient(NamespacedClient):
@query_params()
def analyze(self, body=None, index=None, params=None, headers=None):
"""
Performs the analysis process on a text and return the tokens breakdown of the
t... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/indices.py | 0.689619 | 0.344581 | indices.py | pypi |
import warnings
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params
class TasksClient(NamespacedClient):
@query_params(
"actions",
"detailed",
"group_by",
"nodes",
"parent_task_id",
"timeout",
"wait_for_completion",
)
def l... | /retakesearch-py-2.2.5.tar.gz/retakesearch-py-2.2.5/opensearchpy/client/tasks.py | 0.613005 | 0.269365 | tasks.py | pypi |
from typing import List, Union
import logging
from retarus.commons.config import Configuration
from .model import Client
from retarus.commons.region import RegionUri
from retarus.commons.exceptions import RetarusSDKError
from retarus.commons.transport import Transporter
class RetarusRessourceNotFound(RetarusSDKError):... | /retarus_fax-1.0.1-py3-none-any.whl/retarus/fax_in_poll/_async.py | 0.725357 | 0.185615 | _async.py | pypi |
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel, validator
from retarus.commons.utils import to_camel_case
class Options(BaseModel):
src: Optional[str]
encoding: Optional[str]
billcode: Optional[str]
status_requested: Optional[bool]
flash: Option... | /retarus_sms-1.0.1-py3-none-any.whl/retarus/sms/model.py | 0.926162 | 0.325829 | model.py | pypi |
import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
from ._jsii import *
import aws_cdk.aws_ec2
import aws_cdk.aws_iam
import aws_cdk.core
import constructs
class ECRDeployment(
aws_cdk.core.Construct,
metaclass=jsii.JSIIMeta,
jsi... | /retbrown-cdk-ecr-deployment-1.0.3.tar.gz/retbrown-cdk-ecr-deployment-1.0.3/src/retbrown_cdk_ecr_deployment/__init__.py | 0.685002 | 0.242531 | __init__.py | pypi |
import contextlib
import datetime
import os
import shutil
import time
class Resource:
"""Base class of all resources.
:param str id: Unique identifier of the resource.
:param retdec.conn.APIConnection conn: Connection to the API to be used for
sending API requests.
"""
#: Time interval a... | /retdec-python-0.5.2.tar.gz/retdec-python-0.5.2/retdec/resource.py | 0.792986 | 0.291718 | resource.py | pypi |
from retdec.decompilation import Decompilation
from retdec.exceptions import MissingParameterError
from retdec.file import File
from retdec.service import Service
class Decompiler(Service):
"""Access to the decompilation service."""
def start_decompilation(self, **kwargs):
"""Starts a decompilation w... | /retdec-python-0.5.2.tar.gz/retdec-python-0.5.2/retdec/decompiler.py | 0.865196 | 0.466177 | decompiler.py | pypi |
from retdec.exceptions import ArchiveGenerationFailedError
from retdec.exceptions import CFGGenerationFailedError
from retdec.exceptions import CGGenerationFailedError
from retdec.exceptions import DecompilationFailedError
from retdec.exceptions import NoSuchCFGError
from retdec.exceptions import OutputNotRequestedErro... | /retdec-python-0.5.2.tar.gz/retdec-python-0.5.2/retdec/decompilation.py | 0.888982 | 0.331958 | decompilation.py | pypi |
class RetdecError(Exception):
"""Base class of all custom exceptions raised by the library."""
class MissingAPIKeyError(RetdecError):
"""Exception raised when an API key is missing."""
def __init__(self):
super().__init__(
'No explicit API key given'
' and environment vari... | /retdec-python-0.5.2.tar.gz/retdec-python-0.5.2/retdec/exceptions.py | 0.929919 | 0.317969 | exceptions.py | pypi |
from abc import ABC
from datetime import datetime as DateTime, timedelta as TimeDelta
_reference_date = DateTime(1970, 1, 1)
def _year(time_stamp: DateTime) -> int:
return time_stamp.year - _reference_date.year
def _day(time_stamp: DateTime) -> int:
return int((time_stamp - _reference_date).days)
class P... | /retention_rules-0.1.1-py3-none-any.whl/retention_rules/periods.py | 0.928124 | 0.564639 | periods.py | pypi |
from dataclasses import dataclass
from enum import Enum
from .periods import Period
from datetime import datetime as DateTime
from typing import List, Optional, Any, Callable
class RetainStrategy(Enum):
OLDEST = "oldest"
NEWEST = "newest"
@dataclass
class PolicyRule:
applies_for: Period
applies_peri... | /retention_rules-0.1.1-py3-none-any.whl/retention_rules/policy.py | 0.933794 | 0.461623 | policy.py | pypi |
import re
from typing import Dict, Tuple, Callable
from .policy import RetentionPolicy, RetainStrategy
from .periods import *
class PolicyBuilder:
def __init__(self, **kwargs):
self.keys: Dict[str, Callable[[], Period]] = kwargs.get("keys", _by_key)
def build(self, policy_dict: Dict) -> RetentionPol... | /retention_rules-0.1.1-py3-none-any.whl/retention_rules/builder.py | 0.809427 | 0.197735 | builder.py | pypi |
import torch
class InvalidRetentionParametersException(Exception):
"""
Raised in the event that parameters passed to the
model are invalid according to the architecture
defined in the original paper.
"""
def __init__(self, hidden_size: int, number_of_heads: int):
self.message = f"hid... | /retentive_network-0.1.0.tar.gz/retentive_network-0.1.0/retentive_network/exceptions.py | 0.873566 | 0.619615 | exceptions.py | pypi |
import torch
import torch.nn as nn
from retentive_network.exceptions import InvalidTemperatureException
from retentive_network.models.network import RetentiveNetwork
class RetentiveNetworkCLM(nn.Module):
"""
Huge shoutout to @Jamie-Stirling for
breaking ground here first. The code below
has been fit ... | /retentive_network-0.1.0.tar.gz/retentive_network-0.1.0/retentive_network/models/clm.py | 0.95877 | 0.561335 | clm.py | pypi |
import torch
import torch.nn as nn
from retentive_network.exceptions import InvalidHiddenSizeException
from retentive_network.layers.feed_forward import FeedForward
from retentive_network.layers.layer_norm import LayerNorm
from retentive_network.layers.multi_scale_retention import MultiScaleRetention
class Retentive... | /retentive_network-0.1.0.tar.gz/retentive_network-0.1.0/retentive_network/models/network.py | 0.949704 | 0.476641 | network.py | pypi |
import torch
import torch.nn as nn
import torch.nn.functional as F
from retentive_network.exceptions import InvalidBatchSizeException
from retentive_network.layers.projection import Projection
class Retention(nn.Module):
def __init__(
self,
hidden_size: int,
head_size: int,
gamma:... | /retentive_network-0.1.0.tar.gz/retentive_network-0.1.0/retentive_network/layers/retention.py | 0.966513 | 0.715349 | retention.py | pypi |
# author: rethge
# created data: 2023/07/20
import torch
from torch import nn
import torch.nn.functional as F
# Depthwise separeble conv———————————————————————————————————————————————
class RTG_depthwise_separable_conv(nn.Module):
def __init__(self, input_size, output_size, kernel_size,
strid... | /rethge_torch-0.0.2.tar.gz/rethge_torch-0.0.2/src/rethge_torch/rethge_components.py | 0.913955 | 0.535098 | rethge_components.py | pypi |
import rethinkdb
docsSource = [
(
rethinkdb.net.Connection.close,
b"conn.close(noreply_wait=True)\n\nClose an open connection.\n\nClosing a connection normally waits until all outstanding requests have finished and then frees any open resources associated with the connection. By passing `False` to... | /rethinkdb_iantocristian-2.4.8.post2.tar.gz/rethinkdb_iantocristian-2.4.8.post2/rethinkdb/docs.py | 0.868827 | 0.346984 | docs.py | pypi |
import base64
import binascii
import hashlib
import hmac
import struct
import sys
import threading
from random import SystemRandom
import six
from rethinkdb import ql2_pb2
from rethinkdb.errors import ReqlAuthError, ReqlDriverError
from rethinkdb.helpers import chain_to_bytes, decode_utf8
from rethinkdb.logger impor... | /rethinkdb_iantocristian-2.4.8.post2.tar.gz/rethinkdb_iantocristian-2.4.8.post2/rethinkdb/handshake.py | 0.510252 | 0.209308 | handshake.py | pypi |
import rethinkdb
from ._compat import get_unbound_func
get_unbound_func(rethinkdb.net.Cursor.close).__doc__ = u'Close a cursor. Closing a cursor cancels the corresponding query and frees the memory\nassociated with the open request.\n\n*Example:* Close a cursor.\n\n>>> cursor.close()\n'
get_unbound_func(rethinkdb.ne... | /rethinkdb-py3-0.2.tar.gz/rethinkdb-py3-0.2/rethinkdb/docs.py | 0.806014 | 0.239816 | docs.py | pypi |
import rethinkdb
docsSource = [
(rethinkdb.net.Connection.close, b'conn.close(noreply_wait=True)\n\nClose an open connection.\n\nClosing a connection normally waits until all outstanding requests have finished and then frees any open resources associated with the connection. By passing `False` to the `noreply_wait`... | /rethinkdb_next-2.2.0.post1.tar.gz/rethinkdb_next-2.2.0.post1/rethinkdb/docs.py | 0.890604 | 0.364721 | docs.py | pypi |
from __future__ import print_function
import json, math, numbers, os, socket, time
import rethinkdb as r
from optparse import OptionParser
from ._backup import *
info = "'_negative_zero_check` finds and lists inaccessible rows with negative zero in their ID"
usage = " _negative_zero_check [-c HOST:PORT] [-a AUTH_KEY... | /rethinkdb_next-2.2.0.post1.tar.gz/rethinkdb_next-2.2.0.post1/rethinkdb/_negative_zero_check.py | 0.474875 | 0.208058 | _negative_zero_check.py | pypi |
import retico_core
import threading
import openai
import time
import os
class ChatGPTDialogueModule(retico_core.AbstractModule):
"""ChatGPT Dialogue Module that uses the OpenAI API to generate responses to user
input. The ChatGPTDialogueModule is not running locally, but uses the OpenAI API to
generate re... | /retico-chatgpt-0.0.1.tar.gz/retico-chatgpt-0.0.1/retico_chatgpt/chatgpt.py | 0.715623 | 0.232288 | chatgpt.py | pypi |
import threading
import queue
import time
import wave
import platform
import pyaudio
import retico_core
CHANNELS = 1
"""Number of channels. For now, this is hard coded MONO. If there is interest to do
stereo or audio with even more channels, it has to be integrated into the modules."""
TIMEOUT = 0.01
"""Timeout in ... | /retico-core-0.2.10.tar.gz/retico-core-0.2.10/retico_core/audio.py | 0.726911 | 0.236362 | audio.py | pypi |
import queue
import threading
import time
import enum
import copy
class UpdateType(enum.Enum):
"""The update type enum that defines all the types with which the incremental units
can be transmitted. Per default, the UpdateMessge class checks that the update type
is one of the types listed in this enum. Ho... | /retico-core-0.2.10.tar.gz/retico-core-0.2.10/retico_core/abstract.py | 0.817465 | 0.347094 | abstract.py | pypi |
import retico_core
import time
class DialogueActIU(retico_core.IncrementalUnit):
"""A Dialog Act Incremental Unit.
This IU represents a Dialogue Act together with concepts and their
values. In this implementation only a single act can be expressed with a
single IU.
Attributes:
act (strin... | /retico-core-0.2.10.tar.gz/retico-core-0.2.10/retico_core/dialogue.py | 0.834946 | 0.421076 | dialogue.py | pypi |
import pickle
def load(filename: str):
"""Loads a network from file and returns a list of modules in that network.
The connections between the module have been set according to the file.
Args:
filename (str): The path to the .rtc file containing a network.
Returns:
(list, list): A l... | /retico-core-0.2.10.tar.gz/retico-core-0.2.10/retico_core/network.py | 0.728652 | 0.558628 | network.py | pypi |
import retico_core
def get_text_increment(module, new_text):
"""Compares the full text given by the asr with the IUs that are already
produced (current_output) and returns only the increment from the last update. It
revokes all previously produced IUs that do not match.
For example, if the ``current_... | /retico-core-0.2.10.tar.gz/retico-core-0.2.10/retico_core/text.py | 0.831998 | 0.368747 | text.py | pypi |
import queue
import threading
import retico_core
from retico_core.text import SpeechRecognitionIU
from retico_core.audio import AudioIU
from google.cloud import speech as gspeech
class GoogleASRModule(retico_core.AbstractModule):
"""A Module that recognizes speech by utilizing the Google Speech API."""
def _... | /retico-googleasr-0.1.5.tar.gz/retico-googleasr-0.1.5/retico_googleasr/googleasr.py | 0.744935 | 0.191101 | googleasr.py | pypi |
import http.client
import json
import os
import subprocess
import base64
import random
import wave
from hashlib import blake2b
import time
import threading
import retico_core
# Helper functions ==============
def get_gcloud_token():
"""Return the gcloud access token as a string.
This functions requires the... | /retico-googletts-0.1.3.tar.gz/retico-googletts-0.1.3/retico_googletts/googletts.py | 0.723798 | 0.166641 | googletts.py | pypi |
import transformers
transformers.logging.set_verbosity_error()
from transformers import pipeline
import retico_core
class HFTranslate:
TRANSLATION_MAP = {
"en_fr": "Helsinki-NLP/opus-mt-en-fr",
"fr_en": "Helsinki-NLP/opus-mt-fr-en",
"en_de": "Helsinki-NLP/opus-mt-en-de",
"de_en"... | /retico-hftranslate-0.1.2.tar.gz/retico-hftranslate-0.1.2/retico_hftranslate/hftranslate.py | 0.647575 | 0.203846 | hftranslate.py | pypi |
# RetinaFace
<div align="center">
[](https://pepy.tech/project/retina-face)
[[0])
if tf_version == 1:
from keras.models import Model
from keras.layers import Input, BatchNormalization, ZeroPadding2D, Conv2D, ReLU, MaxPool2D, Add, UpSampling2D, concatenate, Softmax
else:
... | /retina-face-0.0.13.tar.gz/retina-face-0.0.13/retinaface/model/retinaface_model.py | 0.664867 | 0.345547 | retinaface_model.py | pypi |
import re
from itertools import product
from typing import List, Tuple
import numpy as np
def nms(x1: np.ndarray, y1: np.ndarray, x2: np.ndarray, y2: np.ndarray,
scores: np.ndarray, thresh: float) -> List[int]:
b = 1
areas = (x2 - x1 + b) * (y2 - y1 + b)
order = scores.argsort()[::-1]
keep =... | /retinaface_post_processing-0.0.4.tar.gz/retinaface_post_processing-0.0.4/RetinaFacePostProcessing/retinaface_post_processing.py | 0.880399 | 0.533823 | retinaface_post_processing.py | pypi |
from __future__ import print_function
import argparse
import torch
import torch.backends.cudnn as cudnn
import numpy as np
import time
import cv2
from retinaface.data import cfg_mnet, cfg_re50
from retinaface.layers.functions.prior_box import PriorBox
from retinaface.utils.nms.py_cpu_nms import py_cpu_nms
from retina... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/detect.py | 0.567577 | 0.24121 | detect.py | pypi |
from __future__ import print_function
import argparse
import torch
from data import cfg_mnet, cfg_re50
from models.retinaface import RetinaFace
parser = argparse.ArgumentParser(description='Test')
parser.add_argument('-m', '--trained_model', default='./weights/mobilenet0.25_Final.pth',
type=str,... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/convert_to_onnx.py | 0.699665 | 0.219358 | convert_to_onnx.py | pypi |
import torch
import numpy as np
torch.set_grad_enabled(False)
# My libs
import retinaface.models.retinaface as rf_model
import retinaface.detect as rf_detect
import retinaface.data.config as rf_config
import retinaface.layers.functions.prior_box as rf_priors
import retinaface.utils.box_utils as rf_ubox
import retinaf... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/inference_framework.py | 0.759404 | 0.220342 | inference_framework.py | pypi |
import torch
import torch.nn as nn
import torch.nn.functional as F
def conv_bn(inp, oup, stride = 1, leaky = 0):
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
nn.BatchNorm2d(oup),
nn.LeakyReLU(negative_slope=leaky, inplace=True)
)
def conv_bn_no_relu(inp, oup, s... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/models/net.py | 0.913505 | 0.497192 | net.py | pypi |
import torch
import torch.nn as nn
import torchvision.models._utils as _utils
import torch.nn.functional as F
from retinaface.models.net import MobileNetV1 as MobileNetV1
from retinaface.models.net import FPN as FPN
from retinaface.models.net import SSH as SSH
class ClassHead(nn.Module):
def __init__(self,incha... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/models/retinaface.py | 0.913368 | 0.307118 | retinaface.py | pypi |
import torch
import torch.nn as nn
import torch.nn.functional as F
from retinaface.utils.box_utils import match, log_sum_exp
from retinaface.data import cfg_mnet
GPU = cfg_mnet['gpu_train']
class MultiBoxLoss(nn.Module):
"""SSD Weighted Loss Function
Compute Targets:
1) Produce Confidence Target Indice... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/layers/modules/multibox_loss.py | 0.923648 | 0.691706 | multibox_loss.py | pypi |
import torch
import torch.utils.data as data
import cv2
import numpy as np
class WiderFaceDetection(data.Dataset):
def __init__(self, txt_path, preproc=None):
self.preproc = preproc
self.imgs_path = []
self.words = []
f = open(txt_path,'r')
lines = f.readlines()
isFi... | /retinaface_py-0.0.2-py3-none-any.whl/retinaface/data/wider_face.py | 0.637482 | 0.325346 | wider_face.py | pypi |
# Retinaface
[](https://zenodo.org/badge/latestdoi/280950959)

This repo is build on top of [https://github.com/biubug6/Pytor... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/README.md | 0.481454 | 0.886764 | README.md | pypi |
import argparse
import os
from collections import OrderedDict
from pathlib import Path
from typing import Any, Callable, Dict, List, Tuple, Union
import numpy as np
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
import yaml
from addict import Dict as Adict
from albumentations.core.serializ... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/train.py | 0.897482 | 0.353289 | train.py | pypi |
from typing import Dict, List
import torch
import torch.nn.functional as F
from torch import nn
def conv_bn(inp: int, oup: int, stride: int = 1, leaky: float = 0) -> nn.Sequential:
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
nn.BatchNorm2d(oup),
nn.LeakyReLU(negat... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/net.py | 0.952552 | 0.531817 | net.py | pypi |
import random
from typing import Tuple
import numpy as np
from retinaface.box_utils import matrix_iof
def random_crop(
image: np.ndarray, boxes: np.ndarray, labels: np.ndarray, landm: np.ndarray, img_dim: int
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, bool]:
"""Crop random patch.
if ran... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/data_augment.py | 0.687315 | 0.653106 | data_augment.py | pypi |
import json
from pathlib import Path
from typing import Any, Dict, List, Tuple
import albumentations as albu
import numpy as np
import torch
from iglovikov_helper_functions.dl.pytorch.utils import tensor_from_rgb_image
from iglovikov_helper_functions.utils.image_utils import load_rgb
from torch.utils import data
from... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/dataset.py | 0.877293 | 0.473292 | dataset.py | pypi |
from typing import Tuple
import torch
import torch.nn.functional as F
from torch import nn
from retinaface.box_utils import log_sum_exp, match
class MultiBoxLoss(nn.Module):
"""SSD Weighted Loss Function.
Compute Targets:
1) Produce Confidence Target Indices by matching ground truth boxes
... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/multibox_loss.py | 0.961171 | 0.74297 | multibox_loss.py | pypi |
from collections import OrderedDict
from typing import Dict, List, Union
import albumentations as A
import numpy as np
import torch
from torch.nn import functional as F
from torchvision.ops import nms
from retinaface.box_utils import decode, decode_landm
from retinaface.network import RetinaFace
from retinaface.prior... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/predict_single.py | 0.950434 | 0.461381 | predict_single.py | pypi |
from typing import Dict, Tuple
import torch
from torch import nn
from torchvision import models
from torchvision.models import _utils
from retinaface.net import FPN, SSH
class ClassHead(nn.Module):
def __init__(self, in_channels: int = 512, num_anchors: int = 3) -> None:
super().__init__()
self.... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/network.py | 0.964237 | 0.584597 | network.py | pypi |
import argparse
import json
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import albumentations as albu
import cv2
import numpy as np
import torch
import torch.nn.parallel
import torch.utils.data
import torch.utils.data.distributed
import yaml
from albumentations.core.serializatio... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/retinaface/inference.py | 0.892808 | 0.268054 | inference.py | pypi |
import argparse
from typing import Dict, List, Tuple, Union
import albumentations as albu
import cv2
import numpy as np
import onnx
import onnxruntime as ort
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils import model_zoo
from torchvision.ops import nms
from retinaface.box_uti... | /retinaface_pytorch-0.0.8.tar.gz/retinaface_pytorch-0.0.8/converters/to_onnx.py | 0.894376 | 0.42179 | to_onnx.py | pypi |
import tensorflow as tf
import numpy as np
from utilpack.util import *
import os
class RetinaFace(object):
def __init__(self,quality='normal'):
"""
:param quality: one of [ 'high','normal','speed' ]
"""
if quality == 'normal':
self._resizeFunc = lambda v: PyImageUtil.... | /src/retinaface.py | 0.719482 | 0.319201 | retinaface.py | pypi |
import numpy as np
import matplotlib.pyplot as plt
import retinotopic_mapping.StimulusRoutines as stim
from retinotopic_mapping.MonitorSetup import Monitor, Indicator
from retinotopic_mapping.DisplayStimulus import DisplaySequence
"""
To get up and running quickly before performing any experiments it is
sufficient to... | /retinotopic_mapping-2.7.0.tar.gz/retinotopic_mapping-2.7.0/retinotopic_mapping/examples/visual_stimlation/example_locally_sparse_noise.py | 0.45641 | 0.51751 | example_locally_sparse_noise.py | pypi |
from psychopy import visual, event
import os
import datetime
import numpy as np
import matplotlib.pyplot as plt
import time
from tools import FileTools as ft
from tools.IO import nidaq as iodaq
def analyze_frames(ts, refresh_rate, check_point=(0.02, 0.033, 0.05, 0.1)):
"""
Analyze frame durations of time sta... | /retinotopic_maps-2.0.0.tar.gz/retinotopic_maps-2.0.0/retinotopic_mapping/DisplayStimulus.py | 0.710929 | 0.506774 | DisplayStimulus.py | pypi |
from typing import (
cast,
Literal,
Optional,
Any,
Generator,
Union,
Iterable,
TypedDict,
Protocol,
)
from datetime import datetime
from google.cloud.exceptions import Conflict, NotFound
from google.cloud.firestore_v1.base_query import BaseQuery
from google.cloud.firestore_v1.trans... | /retirable_resources-0.1.9.tar.gz/retirable_resources-0.1.9/retirable_resources/resource_manager.py | 0.647018 | 0.157266 | resource_manager.py | pypi |
# http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
http_status_codes = {
100: '100 Continue',
101: '101 Switching Protocols',
102: '102 Processing',
200: '200 OK',
201: '201 Created',
202: '202 Accepted',
203: '203 Non-Authoritative Information',
204: '204 No Co... | /retort-cgi-1.0.1.tar.gz/retort-cgi-1.0.1/retort/data.py | 0.7011 | 0.25682 | data.py | pypi |
import functools
import logging
import numbers
import time
try:
import pbr.version
except ImportError:
# The version is only programatically available in some contexts and you
# must have pbr installed. Since we don't want to enforce that dependency
# this may not work. Also, the version isn't availabl... | /retrace-3.0.0.tar.gz/retrace-3.0.0/src/retrace.py | 0.59749 | 0.234472 | retrace.py | pypi |
<p align="center">
<a href="https://github.com/gabrielguarisa/retrack"><img src="https://raw.githubusercontent.com/gabrielguarisa/retrack/main/logo.png" alt="retrack"></a>
</p>
<p align="center">
<em>A business rules engine</em>
</p>
<div align="center">
[](https://github.com/ddelange/retrie/actions?query=branch%3Amaster)
[](ht... | /retrie-0.2.3.tar.gz/retrie-0.2.3/README.md | 0.620162 | 0.898767 | README.md | pypi |
# The observability actor should store all data, but only expose a subset of it by default.
"""
What do we want to see?
- What actions are being taken by each actor
- See the path of messages through the system
"""
import json
from typing import Type, Optional
from types import TracebackType
import termcolor
impo... | /retriever_research-0.0.5.tar.gz/retriever_research-0.0.5/retriever_research/logging.py | 0.733738 | 0.326889 | logging.py | pypi |
import time
from datetime import datetime, timezone
import psutil
from typing import List, Tuple
GIGA = 1_000_000_000
MEGA = 1_000_000
class ThroughputTracker:
def __init__(self, name: str, multiplier: float = 1.0):
self.name = name
self.multiplier = multiplier # Adjust output unit
self.... | /retriever_research-0.0.5.tar.gz/retriever_research-0.0.5/retriever_research/profiler/collectors.py | 0.75401 | 0.419529 | collectors.py | pypi |

[](https://github.com/weecology/retriever/actions/workflows/python-package.yml)
[![Build Status (windows)](https://ci.appveyor.com/api/projects/status/qetgo4jxa5769... | /retriever-3.1.0.tar.gz/retriever-3.1.0/README.md | 0.46563 | 0.889864 | README.md | pypi |
<div align="center">
<img src="https://repository-images.githubusercontent.com/566840861/ce7eeed0-7454-4aff-9073-235a83eeb6e7">
</div>
<p align="center">
<!-- Python -->
<a href="https://www.python.org" alt="Python">
<img src="https://badges.aleen42.com/src/python.svg" />
</a>
<!-- Version -->
<a hre... | /retriv-0.2.3.tar.gz/retriv-0.2.3/README.md | 0.590307 | 0.831109 | README.md | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.