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 boto3, datetime, re, time, json from dataclasses import dataclass from typing import Union, Optional from RW.AWS.mixins.AWSAuthenticationMixin import AWSAuthenticationMixin class CloudFormation(AWSAuthenticationMixin): """ AWS CloudFormation keyword library for integrating with AWS CloudFormation. ...
/runwhen_keywords-0.0.1.tar.gz/runwhen_keywords-0.0.1/RW/AWS/CloudFormation.py
0.820685
0.26169
CloudFormation.py
pypi
import json import urllib import re import dateutil.parser import google.auth.transport.requests from datetime import datetime, timezone from dataclasses import dataclass from google.oauth2 import service_account from google.cloud import monitoring_v3, logging from google.protobuf.json_format import MessageToDict from ...
/runwhen_keywords-0.0.1.tar.gz/runwhen_keywords-0.0.1/RW/GCP/OpsSuite.py
0.579162
0.191101
OpsSuite.py
pypi
import uuid from typing import List, Optional from runzero.client import Client from runzero.types import Site, SiteOptions __all__ = [ "SiteOptions", "Sites", ] class Sites: """Management of runZero sites. Assets, tasks, and other objects are contained within or associated with Sites. :param ...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/sites.py
0.875455
0.35407
sites.py
pypi
import uuid from typing import List, Optional from runzero.client import Client from runzero.types import Explorer, ExplorerSiteID __all__ = [ "Explorers", ] class Explorers: """Management of runZero Explorers. Explorers are deployed to a machine and are assigned to :class:`runzero.api.Sites` where ...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/explorers.py
0.842394
0.438064
explorers.py
pypi
import uuid from typing import Dict, List, Optional, Union from runzero.client import Client from runzero.types import Task, TaskOptions class Tasks: """Management of runZero tasks. :param client: A handle to the :class:`runzero.Client` client which manages interactions with the runZero server. ...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/tasks.py
0.913626
0.358185
tasks.py
pypi
import base64 import uuid from typing import Any, List, Optional from runzero.client import Client from runzero.types import CustomIntegration class CustomIntegrations: """Read access to custom integrations. This is a subset of operations available in runzero.admin.custom_integrations.CustomIntegrationsAdmi...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/custom_integrations.py
0.895016
0.356643
custom_integrations.py
pypi
import uuid from typing import List, Optional from runzero.client import Client from runzero.types import HostedZone __all__ = [ "HostedZones", ] class HostedZones: """Management of runZero hosted zones. A hosted zone is a pool of cloud-hosted :class:`runzero.api.Explorers` available to Enterprise ...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/hosted_zones.py
0.900544
0.394084
hosted_zones.py
pypi
import gzip import tempfile import time import uuid from typing import Iterable, List, Optional from runzero.client import Client from runzero.types import ImportAsset, ImportTask, NewAssetImport, Task class CustomAssets: """Management of Custom Asset Data for your own custom integrations. Custom data integ...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/imports/assets.py
0.772187
0.431464
assets.py
pypi
import uuid from typing import List, Optional from runzero.client import Client from runzero.types import ScanTemplate, ScanTemplateOptions, Task # pylint: disable=duplicate-code ## Acknowledged that this very similar to the org-level tasks interface class TasksAdmin: """Account level management of runZero tas...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/admin/tasks.py
0.91419
0.401219
tasks.py
pypi
import base64 import pathlib import uuid from pathlib import Path from typing import Any, List, Optional, Union from runzero.client import Client from runzero.errors import Error from runzero.types import BaseCustomIntegration, CustomIntegration, NewCustomIntegration from ._sdk_source_icon import _PY_ICON_BYTES cla...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/admin/custom_integrations.py
0.913024
0.335623
custom_integrations.py
pypi
import uuid from typing import List, Optional from runzero.client import Client from runzero.types import Organization, OrgOptions class OrgsAdmin: """Management of runZero organizations. Organizations are an administrative boundary for various platform-level objects and methods. :param client: A handl...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/api/admin/orgs.py
0.890199
0.334019
orgs.py
pypi
from __future__ import annotations from datetime import datetime from enum import Enum from ipaddress import IPv4Address, IPv6Address from typing import Any, Dict, List, Optional from uuid import UUID from pydantic import BaseModel, Field class BaseResponse(BaseModel): """ Minimal identifying information w...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/types/_data_models_gen.py
0.806662
0.241428
_data_models_gen.py
pypi
from __future__ import annotations from dataclasses import dataclass from typing import Any, Optional @dataclass class RateLimitInformation: """Describes rate limits to API users. See https://www.runzero.com/docs/leveraging-the-api/#api-client-credentials for details. :param usage_limit: int, optional...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/types/_rate_limit_information.py
0.92756
0.306864
_rate_limit_information.py
pypi
from typing import Any, Iterable, Optional from pydantic import Field from ._data_models_gen import CustomAttribute as RESTCustomAttribute from ._data_models_gen import CustomIntegration as RESTCustomIntegration from ._data_models_gen import Hostname as RESTHostname from ._data_models_gen import ScanOptions as RESTSc...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/types/_wrapped.py
0.934634
0.207375
_wrapped.py
pypi
from __future__ import annotations from enum import Enum from typing import Any, Optional from urllib.parse import urlparse import requests from pydantic import BaseModel from requests.exceptions import ConnectionError as RequestsConnectionError from requests.exceptions import ConnectTimeout as RequestsConnectTimeout...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/client/client.py
0.884299
0.205197
client.py
pypi
from __future__ import annotations from typing import Optional from runzero.errors import APIError, Error from runzero.types import RateLimitInformation from runzero.types.errors import RFC7807Error class UnsupportedRequestError(ValueError, Error): """ UnsupportedRequestError is a named Exception class rep...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/client/errors.py
0.953384
0.322499
errors.py
pypi
from datetime import datetime from typing import Dict import requests from pydantic import BaseModel, Field from requests.auth import AuthBase class OAuthToken(BaseModel): """Handles OAuth tokens for the runZero platform""" access_token: str = Field(...) token_type: str = Field(...) expires_in: in...
/runzero_sdk-0.4.0-py3-none-any.whl/runzero/client/_http/auth.py
0.899501
0.192634
auth.py
pypi
from ruobr_api.exceptions import ( AuthenticationException, NoChildrenException, NoSuccessException, ) import httpx import base64 from datetime import date, datetime from typing import List, Union class Ruobr(object): """Класс для доступа к API электронного дневника""" def __init__(self, username...
/ruobr_api-2.0.2.tar.gz/ruobr_api-2.0.2/ruobr_api/__main__.py
0.546496
0.23219
__main__.py
pypi
from dataclasses import dataclass from itertools import groupby,chain import inspect import openpyxl from openpyxl.styles import NamedStyle, PatternFill, Font, Alignment from openpyxl.utils import get_column_letter from datetime import datetime from calendar import monthrange from dateutil.relativedelta import relati...
/ruobr_student-1.0.0-py3-none-any.whl/ruobr_student/excel.py
0.476092
0.207696
excel.py
pypi
import logging import random import sys import os from pathlib import Path from typing import Any, Dict, List, Tuple import numpy as np import pandas as pd import torch import torch.optim as opt from tqdm.auto import trange from transformers.models.t5.configuration_t5 import T5Config from transformers.models.t5.modeli...
/rupersonaagent-0.1.0-py3-none-any.whl/knowledge_distillation/train.py
0.558568
0.264441
train.py
pypi
import argparse import os from typing import Tuple import torch from transformers.models.t5.modeling_t5 import T5ForConditionalGeneration from transformers.models.t5.tokenization_t5 import T5Tokenizer os.environ["TF_ENABLE_ONEDNN_OPTS"] = "0" def get_parser() -> argparse.ArgumentParser: parser = argparse.Argum...
/rupersonaagent-0.1.0-py3-none-any.whl/knowledge_distillation/chat.py
0.731922
0.219526
chat.py
pypi
``` from typing import List, Dict, Tuple, Any import torch from torch.jit import script, trace import torch.nn as nn from torch import optim import torch.nn.functional as F import csv import random import re import os import unicodedata import codecs from io import open import itertools import math import json from tra...
/rupersonaagent-0.1.0-py3-none-any.whl/knowledge_distillation/train.ipynb
0.560012
0.326271
train.ipynb
pypi
import argparse import os import time from pathlib import Path from typing import Any, Dict, List, Tuple import numpy as np import pandas as pd import torch from nltk.translate.bleu_score import SmoothingFunction, sentence_bleu from tqdm.auto import tqdm, trange from transformers.models.t5.modeling_t5 import T5ForCond...
/rupersonaagent-0.1.0-py3-none-any.whl/knowledge_distillation/evaluation.py
0.713232
0.248534
evaluation.py
pypi
import argparse import os from pathlib import Path from typing import Any, Dict, List, Tuple import jsonlines import numpy as np import pandas as pd import torch from nltk.translate.bleu_score import SmoothingFunction, sentence_bleu from tqdm.auto import tqdm from transformers.models.t5.modeling_t5 import T5ForConditi...
/rupersonaagent-0.1.0-py3-none-any.whl/knowledge_distillation/generate_knowledge.py
0.667364
0.252839
generate_knowledge.py
pypi
``` from transformers import T5ForConditionalGeneration t5_cpu = T5ForConditionalGeneration.from_pretrained("cointegrated/rut5-base-multitask", resume_download=True).eval() t5_cuda = t5_cpu.cuda() import torch import torch.utils.benchmark as benchmark import os num_threads = 16 os.environ["OMP_NUM_THREADS"] = str(nu...
/rupersonaagent-0.1.0-py3-none-any.whl/inference_optimization/benchmark.ipynb
0.517083
0.34091
benchmark.ipynb
pypi
``` import torch import pytorch_lightning as pl import transformers import torchmetrics import pandas as pd import os import json from model import T5MultiTask from data_module import TolokaDataModule # proxy os.environ["http_proxy"] = "http://proxy.ad.speechpro.com:3128" os.environ["https_proxy"] = "http://proxy.ad...
/rupersonaagent-0.1.0-py3-none-any.whl/generative_model/main.ipynb
0.473901
0.274364
main.ipynb
pypi
import pytorch_lightning as pl import torch import torchmetrics import transformers from typing import Literal def parse_recursive_dict(inp_dict, tokens=None): tokens = tokens or [] for k in inp_dict: if isinstance(inp_dict[k], dict): tokens = parse_recursive_dict(inp_dict[k], tokens=token...
/rupersonaagent-0.1.0-py3-none-any.whl/generative_model/model.py
0.839701
0.391173
model.py
pypi
import pandas as pd from speech_extraction.SpeechCharacteristic import SpeechCharacteristic, characteristics import nltk from nltk.tokenize import sent_tokenize, word_tokenize from statistics import mean import string import operator import functools from collections import Counter import scipy.stats as stats nltk.dow...
/rupersonaagent-0.1.0-py3-none-any.whl/speech_extraction/SpeechExtraction.py
0.495361
0.241109
SpeechExtraction.py
pypi
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Basic script which allows local human keyboard input to talk to a trained model. Examples -------- .. code-block:: shell python projects...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/interactive.py
0.756627
0.288131
interactive.py
pypi
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Train model for ppl metric with pre-selected parameters. These parameters have some variance in their final perplexity, but they were used to...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/train_cosplay_in_supervised.py
0.882567
0.250597
train_cosplay_in_supervised.py
pypi
import os import copy from parlai.core.teachers import FbDialogTeacher from parlai.tasks.convai2.build import build def _path(opt, persona, use_cands=None, self_play=False): """ :param opt: :param persona: string, e.g. 'self', 'other', 'both', 'all', 'self_revised', 'oth...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/tasks/convai2/agents.py
0.488039
0.298939
agents.py
pypi
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.core.teachers import FbDialogTeacher from parlai.core.utils import warn_once from .build_data import build import copy import os ...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/tasks/convai2cosplay/agents.py
0.73077
0.244713
agents.py
pypi
import torch from torch import nn class TokenCrossEntropyLoss(nn.Module): def __init__(self, pad_index=0): super(TokenCrossEntropyLoss, self).__init__() self.pad_index = pad_index self.base_loss_function = nn.CrossEntropyLoss(reduction='sum', ignore_index=pad_index) def forward(self...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/agents/cosplay/gpt/loss.py
0.964971
0.530662
loss.py
pypi
import numpy as np def _calculate_expect_softmax_loss(score_view, ys): denominator = np.exp(score_view).sum(-1) numerator = [] for i, y in enumerate(ys): numerator.append(np.exp(score_view[i][y]).reshape(1, )) numerator = np.concatenate(numerator, axis=0) out = numerator / denominator ...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/agents/utils/utils.py
0.436142
0.493287
utils.py
pypi
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.core.dict import DictionaryAgent import torch try: from pytorch_pretrained_bert import OpenAIGPTTokenizer except ImportError: ...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/agents/common/gpt_dictionary.py
0.612426
0.244916
gpt_dictionary.py
pypi
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.core.dict import DictionaryAgent from parlai.zoo.bert.build import download try: from pytorch_pretrained_bert import BertTokeniz...
/rupersonaagent-0.1.0-py3-none-any.whl/personification/agents/common/bert_dictonary.py
0.742422
0.242463
bert_dictonary.py
pypi
from torch.nn import CrossEntropyLoss from transformers import T5ForConditionalGeneration from transformers.modeling_outputs import Seq2SeqLMOutput import torch class FiDT5(T5ForConditionalGeneration): """ Modification of T5 model that can use Fusion-in-Decoder method """ def __init__(self, config): ...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/fid.py
0.968013
0.273194
fid.py
pypi
import os import bitsandbytes as bnb import pytorch_lightning as pl import torch import torchmetrics from fid import FiDT5 from peft import (prepare_model_for_kbit_training, LoraConfig, get_peft_model, TaskType, PeftModel) from transformers import (GPT2Tokenizer, get_cosine_...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/in_model.py
0.624523
0.249185
in_model.py
pypi
import os from argparse import ArgumentParser import in_model as im import torch from datasets import Dataset from transformers import AutoModel, AutoTokenizer from tqdm.auto import tqdm def add_cmdline_args(): parser = ArgumentParser() parser.add_argument( '--save_name', type=str, d...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/inference.py
0.721743
0.207335
inference.py
pypi
import os from argparse import ArgumentParser import dataset import pytorch_lightning as pl import torch import torch.utils.data from model import Retriever from pytorch_lightning import loggers as pl_loggers def add_cmdline_args(): parser = ArgumentParser() parser.add_argument( '--save_name', ...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/retriever/train.py
0.675229
0.19789
train.py
pypi
import os import pytorch_lightning as pl import torch import torchmetrics from transformers import (BertModel, AutoTokenizer, get_cosine_schedule_with_warmup) PERSONA1 = '<Персона пользователя 1>' PERSONA2 = '<Персона пользователя 2>' SEARCH_TASK = '<Выполнить поиск>' KNOWLEDGE_TASK = '<Изв...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/retriever/model.py
0.629091
0.381047
model.py
pypi
import asyncio from abc import ABCMeta, abstractmethod from contextlib import suppress from enum import Enum, unique from urllib.parse import urlencode, urlparse from bs4 import BeautifulSoup from search.exceptions import NoResultsOrTrafficError from .utils import CacheHandler, get_rand_user_agent @unique class Ret...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/search/base.py
0.769946
0.170681
base.py
pypi
from search.base import BaseSearch, ReturnType, SearchItem class Search(BaseSearch): """ Searches DuckDuckGo for string """ name = "DuckDuckGo" base_url = "https://www.duckduckgo.com" search_url = "https://www.duckduckgo.com/html/?" summary = "\tHas a number of advantages over the other se...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/search/engines/duckduckgo.py
0.750187
0.303293
duckduckgo.py
pypi
import re from search.base import BaseSearch, ReturnType, SearchItem class Search(BaseSearch): """ Searches Yahoo for string """ name = "Yahoo" search_url = "https://search.yahoo.com/search?" summary = "\tYahoo is one the most popular email providers and holds the fourth place in "\ "...
/rupersonaagent-0.1.0-py3-none-any.whl/internet_memory_model/search/engines/yahoo.py
0.548674
0.275154
yahoo.py
pypi
import requests from web3 import Web3 import json import numpy as np import urllib.parse as urlparse import time from ..utils import helper from ..web3_utils import web3_globals, web3_generic def is_list_of_addresses(self,address_list:str): ''' web3_generic method: send simple transaction Parameters...
/rupineWeb3Utils-0.0.26.tar.gz/rupineWeb3Utils-0.0.26/RupineWeb3Utils/web3_utils/web3_checker.py
0.441191
0.150746
web3_checker.py
pypi
from web3 import Web3 from eth_abi import encode_single, encode_abi from eth_account import Account import secrets import requests import json import math import os from RupineHeroku.rupine_db import herokuCredentials, herokuAbi headers = { 'User-Agent': 'NMask User Agent 1.0', 'From': 'nmask@nmask.com' # Th...
/rupineWeb3Utils-0.0.26.tar.gz/rupineWeb3Utils-0.0.26/RupineWeb3Utils/web3_utils/web3_generic.py
0.622459
0.187839
web3_generic.py
pypi
import json import os import sys import time import datetime from pandas.core.frame import DataFrame from web3 import Web3 from collections import deque def datetime_string_to_datetime(datetime_string:str): ''' utils helper method: string to datetime type Parameters -------- datetime_string : str...
/rupineWeb3Utils-0.0.26.tar.gz/rupineWeb3Utils-0.0.26/RupineWeb3Utils/utils/helper.py
0.506347
0.289409
helper.py
pypi
r""" Exact segmentation: dynamic programming ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- The method is implemented in :class:`ruptures.detection.Dyn...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/detection/dynp.py
0.940216
0.790813
dynp.py
pypi
import numpy as np from numpy.linalg import lstsq from ruptures.utils import pairwise class GreedyLinear: """Greedy change point detection for piecewise linear processes.""" def __init__(self, jump=10): """ Args: jump (int, optional): only consider change points multiple of *jum...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/detection/greedylinear.py
0.904376
0.529568
greedylinear.py
pypi
import numpy as np from numpy.lib.stride_tricks import as_strided from numpy.linalg import lstsq from ruptures.utils import pairwise class GreedyAR: """Greedy change point detection for piecewise autoregressive processes.""" def __init__(self, order=2, jump=10): """ Args: order ...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/detection/greedyar.py
0.91661
0.52141
greedyar.py
pypi
r""" Exact segmentation: Pelt ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- The method is implemented in :class:`ruptures.detection.Pelt`. Because th...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/detection/pelt.py
0.935575
0.746624
pelt.py
pypi
r""" .. _sec-pw-linear: Shift in linear model ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- This function simulates a piecewise linear model (see :re...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/datasets/pw_linear.py
0.89671
0.764452
pw_linear.py
pypi
r""" .. _sec-hausdorff: Hausdorff metric ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- The Hausdorff metric measures the worst prediction error. Assu...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/metrics/hausdorff.py
0.962585
0.754779
hausdorff.py
pypi
r""" .. _sec-randindex: Rand index ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- The Rand index measures the similarity between two segmentations. Fo...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/metrics/randindex.py
0.941862
0.873107
randindex.py
pypi
r""" .. _sec-precision: Precision and recall ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- A true changepoint is declared "detected" (or positive) i...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/metrics/precisionrecall.py
0.962796
0.687717
precisionrecall.py
pypi
r""" .. _sec-display: Display ==================================================================================================== Description ---------------------------------------------------------------------------------------------------- The function :func:`display` displays a signal and the change points pro...
/ruptures_headless-1.0a1.post2-py3-none-any.whl/ruptures/show/display.py
0.913859
0.751534
display.py
pypi
# rudolf-tools My personal python tools ## Getting started To make it easy for you to get started with GitLab, here's a list of recommended next steps. Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! ## Add your files - [ ...
/ruru-tools-0.0.1.tar.gz/ruru-tools-0.0.1/README.md
0.514644
0.822759
README.md
pypi
import collections import json import logging import optparse from ruruki import graphs from flask import Flask from flask import jsonify from flask import request from flask.ext.cors import CORS from werkzeug.exceptions import NotFound app = Flask(__name__) CORS(app) DB = graphs.Graph() LOGGER = logging.getLogger...
/ruruki-eye-0.1.3.tar.gz/ruruki-eye-0.1.3/ruruki_eye/server.py
0.71413
0.251464
server.py
pypi
import hashlib import time from collections import namedtuple from django.core.cache import cache from django.shortcuts import render Rate = namedtuple("Rate", "amount duration") def parse(rate): ret = None if rate: amount, duration = rate.split("/") amount = int(amount) duration_ma...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/ratelimit.py
0.442637
0.17113
ratelimit.py
pypi
from __future__ import absolute_import from django.core.exceptions import ValidationError from django.urls import reverse from django.utils.translation import gettext_lazy as _ from ..account import app_settings as account_settings from ..account.adapter import get_adapter as get_account_adapter from ..account.app_se...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/adapter.py
0.563858
0.150528
adapter.py
pypi
import requests from allauth.socialaccount import app_settings from allauth.socialaccount.providers.gitlab.provider import GitLabProvider from allauth.socialaccount.providers.oauth2.client import OAuth2Error from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/gitlab/views.py
0.438064
0.219149
views.py
pypi
import os from django.utils.translation import get_language, to_locale def _build_locale_table(filename_or_file): """ Parses the FacebookLocales.xml file and builds a dict relating every available language ('en, 'es, 'zh', ...) with a list of available regions for that language ('en' -> 'US', 'EN') a...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/facebook/locale.py
0.434221
0.175786
locale.py
pypi
from allauth.account.models import EmailAddress from allauth.socialaccount.providers.amazon_cognito.utils import ( convert_to_python_bool_if_value_is_json_string_bool, ) from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider clas...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/amazon_cognito/provider.py
0.492676
0.273544
provider.py
pypi
from allauth.account.models import EmailAddress from allauth.socialaccount import app_settings from allauth.socialaccount.adapter import get_adapter class ProviderException(Exception): pass class Provider(object): slug = None def __init__(self, request): self.request = request @classmetho...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/base/provider.py
0.819929
0.201204
provider.py
pypi
import requests from django.conf import settings from allauth.socialaccount.providers.oauth2.client import OAuth2Error from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import BattleNetProvider class Region: APAC = "apac"...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/battlenet/views.py
0.598899
0.283924
views.py
pypi
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class DataportenAccount(ProviderAccount): def get_avatar_url(self): """ Returns a valid URL to an 128x128 .png photo of the user """ # Documen...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/socialaccount/providers/dataporten/provider.py
0.712032
0.325554
provider.py
pypi
import unicodedata from collections import OrderedDict from django.conf import settings from django.contrib import messages from django.contrib.auth import update_session_auth_hash from django.core.exceptions import FieldDoesNotExist, ValidationError from django.db import models from django.db.models import Q from dja...
/rurusetto_allauth-0.53.0-py3-none-any.whl/allauth/account/utils.py
0.532182
0.198802
utils.py
pypi
from __future__ import absolute_import, unicode_literals, print_function try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import warnings import functools from collections import namedtuple from .tagset import Tag Token = namedtuple('Token', 'text an...
/ruscorpora-tools-0.3.tar.gz/ruscorpora-tools-0.3/ruscorpora/__init__.py
0.6705
0.269719
__init__.py
pypi
from collections import Counter __author__ = 'sergeysmetanin' import os.path import pickle import numpy as np class MultinominalNB: def __init__(self, directory=None): if directory is not None: self._classes = self.__read_from_file(directory+'_classes.txt') self._priors = self.__r...
/rusentiment-0.0.3.tar.gz/rusentiment-0.0.3/clf/classifier.py
0.4436
0.20951
classifier.py
pypi
import re import logging from typing import Set, Tuple, List SENT_RE = re.compile(r'[^\.?!…]+[\.?!…]*["»“]*') _LAST_WORD = re.compile(r'(?:\b|\d)([a-zа-я]+)\.$', re.IGNORECASE) _FIRST_WORD = re.compile(r'^\W*(\w+)') _ENDS_WITH_ONE_LETTER_LAT_AND_DOT = re.compile(r'(\d|\W|\b)([a-zA-Z])\.$') _HAS_DOT_INSIDE = re.compil...
/rusenttokenize-0.0.5-py3-none-any.whl/ru_sent_tokenize/tokenizer.py
0.42179
0.278532
tokenizer.py
pypi
import sys from collections import OrderedDict import click from rush_cli.read_tasks import ReadTasks from rush_cli.utils import beautify_task_cmd from rush_cli.utils import beautify_task_name from rush_cli.utils import scream class PrepTasks(ReadTasks): """Class for preprocessing tasks before running.""" ...
/rush-cli-0.6.1.tar.gz/rush-cli-0.6.1/rush_cli/prep_tasks.py
0.505615
0.230649
prep_tasks.py
pypi
import asyncio import functools import inspect import time import typing import attr from rush import exceptions from rush import result from rush import throttle as _throttle @attr.s class ThrottleDecorator: """The class that acts as a decorator used to throttle function calls. This class requires an inta...
/contrib/decorator.py
0.764188
0.244048
decorator.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 ...
/rushed_distributions-0.1.tar.gz/rushed_distributions-0.1/rushed_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
import logging from typing import Any, Dict, List, Optional, TypedDict, Union import requests logger = logging.getLogger(__name__) class RushmoreResponse(TypedDict): """Type class for Rushmore Response.""" TotalWells: Optional[int] TotalPages: Optional[int] PageInfo: Optional[Dict[str, Any]] D...
/rushmore-tools-0.1.2.tar.gz/rushmore-tools-0.1.2/rushmore_tools/_api/api.py
0.884121
0.222732
api.py
pypi
from typing import Optional, Tuple def rig_type(arg: str) -> Tuple[str, bool]: """Converts Rushmore Rig Type designation keyword to text. Returns: Tuple, where: 1st element is the rig type 2nd element is for determining whether a dual action rig was part of the supplied ...
/rushmore-tools-0.1.2.tar.gz/rushmore-tools-0.1.2/rushmore_tools/utils/conversion_functions.py
0.878588
0.431285
conversion_functions.py
pypi
import base64 import json import struct from typing import Dict, List, Optional from russel_python_interface.basic_routines import StandardRoutine from russel_python_interface.routine import Routine class TaskSet: my_task_id: Dict[str, int] = {} # Id that this task set will get from the russel daemon ro...
/russel-python-interface-0.1a3.tar.gz/russel-python-interface-0.1a3/russel_python_interface/task_sets.py
0.69987
0.262777
task_sets.py
pypi
import time from _thread import start_new_thread from typing import List, Dict from uuid import uuid4 import russel_python_interface.static_vars from russel_python_interface.basic_routines import StandardRoutine, MatrixScalarProd, MatrixVectorMulti, MatrixSum from russel_python_interface.benchmark import BenchmarkData...
/russel-python-interface-0.1a3.tar.gz/russel-python-interface-0.1a3/russel_python_interface/engine.py
0.684264
0.174164
engine.py
pypi
import time from typing import Any, Dict, Tuple, Callable # This file generates Statistics class BenchmarkData: average_response_time: float = 0 average_response_time_tasks: float = 0 variance_in_response_time: float = 0 variance_in_task_response_time: float = 0 max_response_time: float = 0 ...
/russel-python-interface-0.1a3.tar.gz/russel-python-interface-0.1a3/russel_python_interface/benchmark.py
0.829492
0.521776
benchmark.py
pypi
import copy import time from typing import List, Dict from russel_python_interface.engine import Engine from russel_python_interface.task_sets import TaskSetTask, TaskSet class MultiEngineNetwork: engines: Dict[float, Engine] = {} persistent: List[Engine] = [] @staticmethod def create(endpoints: Lis...
/russel-python-interface-0.1a3.tar.gz/russel-python-interface-0.1a3/russel_python_interface/multi_engine_network.py
0.604282
0.415017
multi_engine_network.py
pypi
from pytz import timezone from tzlocal import get_localzone DEFAULT_ENV = "keras" PST_TIMEZONE = timezone("Asia/Shanghai") LOCAL_TIMEZONE = get_localzone() DEFAULT_FLOYD_IGNORE_LIST = """ # Directories to ignore when uploading code to floyd # Do not add a trailing slash for directories .* .git .eggs eggs lib lib64...
/russell-cli-0.7.8.tar.gz/russell-cli-0.7.8/russell/constants.py
0.544801
0.460835
constants.py
pypi
from marshmallow import Schema, fields, post_load from russell.cli.utils import sizeof_fmt from russell.model.base import BaseModel from pytz import utc from russell.constants import LOCAL_TIMEZONE from russell.date_utils import pretty_date class DataDetailsSchema(Schema): state = fields.Str() size = fields.S...
/russell-cli-0.7.8.tar.gz/russell-cli-0.7.8/russell/model/module.py
0.587943
0.196479
module.py
pypi
import math import re DIGIT_DICT = { "penny": { 1: "одна", 2: "две", 3: "три", }, "thousand": { 1: "одна", 2: "две", 3: "три", }, 1: "один", 2: "два", 3: "три", 4: "четыре", 5: "пять", 6: "шесть", 7: "семь", 8: "восемь", ...
/russian_cost-0.0.2-py3-none-any.whl/russian_coast/russian_cost.py
0.410756
0.401072
russian_cost.py
pypi
import random from russian_names.utils import transliterate_word class RussianNames: _data = [] __slots__ = ( 'name', 'name_reduction', 'name_max_len', 'patronymic', 'patronymic_reduction', 'patronymic_max_len', 'surname', 'surname_reduction', 'surname_max_len', 'count', 'gender', ...
/russian_names-0.1.2-py3-none-any.whl/russian_names/names.py
0.550366
0.219296
names.py
pypi
import zipfile from os.path import abspath, join, dirname from russian_names.consts import TRANSLITERATE_TABLE, SUFFIXES, PATRONYMIC_RULES def transliterate_word(word): trans_word = '' for char in word: trans_word += TRANSLITERATE_TABLE.get(char, char) return trans_word def check_suffix(word, s...
/russian_names-0.1.2-py3-none-any.whl/russian_names/utils.py
0.431105
0.176281
utils.py
pypi
from __future__ import unicode_literals import re from decimal import Decimal from six import ensure_text, string_types class NumberToWords(object): """ Переводит дробное или целое число в количественные числительные без указания единиц измерения. """ words0 = (1, '', '', '') words1 = (1, ''...
/russian-numerals-0.2b0.tar.gz/russian-numerals-0.2b0/russian_numerals/handlers.py
0.492188
0.444083
handlers.py
pypi
from difflib import SequenceMatcher from sentence_transformers import util from collections import defaultdict from scipy.spatial import distance import logging import nltk logger = logging.getLogger(__name__) def range_by_allcs(sentences, sent, smodel, threshold=0.7): sentences = sentences + [sent] hypothes...
/russian_paraphrasers-0.0.3-py3-none-any.whl/russian_paraphrasers/candidates_filter_metrics.py
0.608594
0.407098
candidates_filter_metrics.py
pypi
import torch from typing import Dict from transformers import MT5ForConditionalGeneration, AutoTokenizer from russian_paraphrasers.utils import set_seed from russian_paraphrasers.paraphrasers import Paraphraser from russian_paraphrasers.candidates_filter_metrics import ( get_scores, range_candidates, check_...
/russian_paraphrasers-0.0.3-py3-none-any.whl/russian_paraphrasers/paraphrasers/paraphraser_mt5.py
0.876714
0.224374
paraphraser_mt5.py
pypi
import logging from abc import abstractmethod from sentence_transformers import SentenceTransformer, util from nlgeval import NLGEval from typing import Any import torch import nltk try: nltk.data.find('tokenizers/punkt') except LookupError: nltk.download('punkt') class Paraphraser: def __init__( ...
/russian_paraphrasers-0.0.3-py3-none-any.whl/russian_paraphrasers/paraphrasers/core.py
0.719876
0.169234
core.py
pypi
from typing import Dict from russian_paraphrasers.paraphrasers import Paraphraser from russian_paraphrasers.candidates_filter_metrics import ( get_scores, range_candidates, check_input, ) from russian_paraphrasers.utils import clean from transformers import ( GPT2LMHeadModel, GPT2Tokenizer, ) import...
/russian_paraphrasers-0.0.3-py3-none-any.whl/russian_paraphrasers/paraphrasers/paraphraser_gpt.py
0.883223
0.232397
paraphraser_gpt.py
pypi
import re from collections import Counter import markdown2 from russian_protowhat.Feedback import Feedback from russian_protowhat.Test import Test """ This file holds the reporter class. """ class TestRunner: def __init__(self): self.tests = [] def do_test(self, test): """Raise failing tes...
/russian_protowhat-1.13.1.tar.gz/russian_protowhat-1.13.1/russian_protowhat/Reporter.py
0.714827
0.326755
Reporter.py
pypi
from typing import TypeVar, Generic, Union, List, Dict, Tuple from collections import Mapping from ast import NodeVisitor import inspect import importlib from russian_protowhat.utils_messaging import get_ord class Selector(NodeVisitor): def __init__(self, target_cls, target_cls_name=None, strict=True, priority=N...
/russian_protowhat-1.13.1.tar.gz/russian_protowhat-1.13.1/russian_protowhat/selectors.py
0.685529
0.206994
selectors.py
pypi
from pathlib import Path def check_file( state, path, missing_msg="Вы создали файл `{}`?", is_dir_msg="Хотите проверить файл `{}`, но нашли каталог.", parse=True, solution_code=None, ): """Test whether file exists, and make its contents the student code. Args: state: State ins...
/russian_protowhat-1.13.1.tar.gz/russian_protowhat-1.13.1/russian_protowhat/checks/check_files.py
0.721939
0.638525
check_files.py
pypi
from __future__ import absolute_import, unicode_literals import collections from .utils import bigrams, find_shortest_path class NoConvertPath(Exception): pass class Registry(object): def __init__(self): # Directed graph of all possible transformations. # _registry['from']['to'] -> transforma...
/russian-tagsets-0.6.tar.gz/russian-tagsets-0.6/russian_tagsets/converters.py
0.877975
0.388792
converters.py
pypi
from __future__ import absolute_import, unicode_literals, print_function import collections import array TagInfo = collections.namedtuple('TagInfo', 'position letter name full_name values') TAGS_POSITIONS = [ TagInfo(1, 'p', 'POS', 'Part of Speech', { 'N': 'Noun', 'A': 'Adjective', 'P': 'P...
/russian-tagsets-0.6.tar.gz/russian-tagsets-0.6/russian_tagsets/positional/__init__.py
0.619471
0.352648
__init__.py
pypi
from pathlib import Path import re, string, itertools, marisa_trie from russian_uncensor.rd_wr_util import rd_wr_module path_current_file = Path(__file__).parent class Uncensor: def __init__(self, dict_path=None, freq_letter_fn=None, bi_grams_fn=None, tri_grams_fn=None): """ Init Uncensor class. ...
/russian_uncensor-0.1.7.tar.gz/russian_uncensor-0.1.7/russian_uncensor/uncensored.py
0.535827
0.299931
uncensored.py
pypi
import os, marisa_trie from pathlib import Path from collections import Counter from russian_uncensor.rd_wr_util import rd_wr_module path_current_file = Path(__file__).parent class WordStats: def __init__(self, dict_path=None, neg_words_fn=None, freq_letters_fn=None, bigrams_fn=None, trigrams_fn=None, ...
/russian_uncensor-0.1.7.tar.gz/russian_uncensor-0.1.7/russian_uncensor/n_grams.py
0.410756
0.347842
n_grams.py
pypi
import asyncio import re import logging # Maintain compat with various 3.x async changes if hasattr(asyncio, 'ensure_future'): ensure_future = asyncio.ensure_future else: ensure_future = getattr(asyncio, 'async') logger = logging.getLogger('russound') _re_response = re.compile( r"(?:(?:S\[(?P<source>...
/russound_rio-1.0.0.tar.gz/russound_rio-1.0.0/russound_rio/rio.py
0.574514
0.159348
rio.py
pypi
import os from .game_config import GameConfig class Result: def __init__(self, match_config, cfg=None): if isinstance(match_config, GameConfig): self.match_id = None self.bot1 = match_config.player1 self.bot2 = match_config.player2 self.map = match_config.m...
/rust_arenaclient-0.2.4-cp38-cp38-manylinux_2_31_x86_64.whl/rust_ac/result.py
0.464659
0.195191
result.py
pypi
from __future__ import annotations from typing import Callable, List, Dict, Optional, Any, Tuple from dataclasses import dataclass, field, asdict from wit_gen import FixedGenContext, StepInstance from expr import Expr from util import uuid from query import Queriable # pub struct Circuit<F, TraceArgs> { # pub st...
/rust_chiquito-0.1.0.tar.gz/rust_chiquito-0.1.0/pychiquito/chiquito_ast.py
0.841517
0.328341
chiquito_ast.py
pypi
# Part 3: Fibonacci Example The best learning is by doing, In this Chapter, we will walk through the [fibonacci.py](https://github.com/qwang98/PyChiquito/blob/main/pychiquito/fibonacci.py) example. # Chapter 1: Fibonacci and Chiquito Concepts The Fibonacci series is an infinite series, starting from "1" and "1", in whi...
/rust_chiquito-0.1.0.tar.gz/rust_chiquito-0.1.0/pychiquito/tutorial_pt3_ch1.ipynb
0.809163
0.97711
tutorial_pt3_ch1.ipynb
pypi