code stringlengths 114 1.05M | path stringlengths 3 312 | quality_prob float64 0.5 0.99 | learning_prob float64 0.2 1 | filename stringlengths 3 168 | kind stringclasses 1
value |
|---|---|---|---|---|---|
from abc import ABC
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Dict, List
from _qwak_proto.qwak.audience.v1.audience_pb2 import (
AudienceRoutesEntry as AudienceProto,
)
from _qwak_proto.qwak.audience.v1.audience_pb2 import Route as RouteProto
fr... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/deploy/_logic/deployment.py | 0.743168 | 0.207767 | deployment.py | pypi |
from __future__ import annotations
from typing import Dict, List
from _qwak_proto.qwak.auto_scaling.v1.auto_scaling_pb2 import AutoScalingConfig
from _qwak_proto.qwak.deployment.deployment_pb2 import (
RealTimeConfig,
ServingStrategy,
TrafficConfig,
Variation,
)
from _qwak_proto.qwak.deployment.deploy... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py | 0.730386 | 0.159938 | serving_strategy_mapper.py | pypi |
import click
from qwak.inner.const import QwakConstants
from qwak.tools.logger.logger import set_qwak_logger_stdout_verbosity_level
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
DeployConfig,
PurchaseOption,
)
from qwak_sdk.commands.models.deployments.deploy._logic.deployment_r... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/deploy/batch/ui.py | 0.517815 | 0.164852 | ui.py | pypi |
from typing import List
import click
from qwak.clients.model_management import ModelsManagementClient
from qwak.tools.logger.logger import get_qwak_logger
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
DeployConfig,
)
from qwak_sdk.commands.models.deployments.undeploy._logic.reques... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/undeploy/ui.py | 0.670932 | 0.152947 | ui.py | pypi |
from __future__ import annotations
from typing import List, Set
from _qwak_proto.qwak.deployment.deployment_pb2 import Variation
from qwak.exceptions import QwakException
from qwak_sdk.commands.models.deployments.deploy._logic.variations import (
validate_percentages,
validate_shadow_variation,
)
def valid... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/undeploy/_logic/variations.py | 0.713831 | 0.336467 | variations.py | pypi |
from typing import Dict, List, Set
from _qwak_proto.qwak.audience.v1.audience_pb2 import AudienceRoutesEntry
from _qwak_proto.qwak.deployment.deployment_pb2 import (
DeploymentHostingServiceType,
EnvironmentDeploymentDetailsMessage,
EnvironmentUndeploymentMessage,
ModelDeploymentStatus,
TrafficConf... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/deployments/undeploy/_logic/request_undeploy.py | 0.569374 | 0.178007 | request_undeploy.py | pypi |
from typing import Dict, List, Optional
from _qwak_proto.qwak.deployment.deployment_pb2 import (
EnvironmentTrafficMessage,
Variation,
)
from _qwak_proto.qwak.ecosystem.v0.ecosystem_pb2 import EnvironmentDetails
from qwak.clients.deployment.client import DeploymentManagementClient
from qwak.exceptions import Q... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/runtime/traffic_update/_logic/variations.py | 0.803868 | 0.249082 | variations.py | pypi |
from typing import List
from .config.config_v1 import ConfigV1
from .constant.step_description import BuildPhase, PhaseDetails
from .context import Context
from .interface.step_inteface import Step
from .phase.a_fetch_model_code import get_fetch_model_code_steps
from .phase.b_remote_register_qwak_build import get_remo... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/build/_logic/build_steps.py | 0.831827 | 0.26647 | build_steps.py | pypi |
import logging
from abc import ABC, abstractmethod
from pathlib import Path
from qwak.exceptions import QwakException
from yaspin.core import Yaspin
from qwak_sdk.tools.colors import Color
from .messages import (
FAILED_CONTACT_QWAK_SUPPORT,
FAILED_CONTACT_QWAK_SUPPORT_PROGRAMMATIC,
)
from .utils import zip_... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/build/_logic/client_logs/build_run_handlers.py | 0.602763 | 0.160924 | build_run_handlers.py | pypi |
from __future__ import annotations
import shutil
from abc import ABC, abstractmethod
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Optional, Tuple, Union
_IGNORED_PATTERNS = [r"\..*", r"__pycache__"]
QWAK_IGNORE_FILE_NAME = ".qwakignore"
if TYPE_CHECKING:
from qwak_sdk.commands.model... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/strategy.py | 0.818229 | 0.180974 | strategy.py | pypi |
import shutil
from pathlib import Path
from typing import List, Optional
from qwak_sdk.exceptions import QwakSuggestionException
from qwak_sdk.tools.files import copytree
from ...common import get_git_commit_id
from ..strategy import Strategy, get_ignore_pattern
class FolderStrategy(Strategy):
def fetch(
... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/folder/folder_strategy.py | 0.637482 | 0.214609 | folder_strategy.py | pypi |
import shutil
import tempfile
from pathlib import Path
from typing import Optional, Union
from zipfile import ZipFile
from qwak_sdk.exceptions import QwakSuggestionException
from qwak_sdk.tools.files import copytree
from ...common import get_git_commit_id
from ..strategy import Strategy, get_ignore_pattern
class Zi... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/zip/zip_strategy.py | 0.578329 | 0.172276 | zip_strategy.py | pypi |
from datetime import datetime
from typing import List, Tuple
import click
from _qwak_proto.qwak.feature_store.features.feature_set_pb2 import (
FeaturesetSchedulingState,
FeatureStatus,
)
from _qwak_proto.qwak.feature_store.features.feature_set_service_pb2 import (
GetFeaturesetSchedulingStateResponse,
... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/feature_store/list/ui.py | 0.651244 | 0.233018 | ui.py | pypi |
from typing import List, Optional, Tuple
from _qwak_proto.qwak.feature_store.features.feature_set_pb2 import Feature
from _qwak_proto.qwak.features_operator.v3.features_operator_pb2 import (
SparkColumnDescription,
ValidationSuccessResponse,
)
from qwak.clients.feature_store import FeatureRegistryClient
from q... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/commands/feature_store/register/_logic.py | 0.839635 | 0.277042 | _logic.py | pypi |
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Dict, List, Tuple
from marshmallow_dataclass import class_schema
from qwak.exceptions import QwakException
from yaml import Loader, dump, load
from qwak_sdk.common.run_config.utils import ConfigCliMap, rgetattr, rsetattr
class Qwak... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/common/run_config/base.py | 0.899969 | 0.229654 | base.py | pypi |
import functools
from collections.abc import Iterable
from dataclasses import dataclass, field
from typing import Any, Callable
@dataclass
class ConfigCliMap:
"""Mapping between cli argument to properties argument.
Attributes:
key (str): key of the argument in the cli.
prop (str): property pa... | /qwak_sdk-0.10.2-py3-none-any.whl/qwak_sdk/common/run_config/utils.py | 0.896217 | 0.528898 | utils.py | pypi |
class Error(BaseException):
def __init__(self, error_name: str, details: str):
"""Initialize the error instance with error name and details
Parameters
----------
error_name : str
Name of the error.
details : str
Additional details about the error.
... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/Errors.py | 0.939644 | 0.354852 | Errors.py | pypi |
from __future__ import annotations
import warnings
import numpy as np
import json
from utils.jsonTools import json_matrix_to_complex, complex_matrix_to_json
from qwak.Operator import Operator
from qwak.State import State
warnings.filterwarnings("ignore")
class QuantumWalk:
def __init__(self, state: State, ope... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/QuantumWalk.py | 0.889235 | 0.563318 | QuantumWalk.py | pypi |
from __future__ import annotations
from typing import Union
import numpy as np
from scipy.linalg import inv
import json
from qwak.Errors import StateOutOfBounds, NonUnitaryState
from utils.jsonTools import json_matrix_to_complex, complex_matrix_to_json
class State:
def __init__(self, n: int, nodeList: list = No... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/State.py | 0.891019 | 0.428951 | State.py | pypi |
import networkx as nx
import numpy as np
from qutip import Options
from qwak.Errors import StateOutOfBounds, NonUnitaryState
from qwak.State import State
from qwak.StochasticOperator import StochasticOperator
from qwak.StochasticProbabilityDistribution import StochasticProbabilityDistribution
from qwak.StochasticQuant... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/StochasticQwak.py | 0.755997 | 0.356783 | StochasticQwak.py | pypi |
from __future__ import annotations
import networkx as nx
import numpy as np
from qutip import Qobj, basis
class StochasticOperator(object):
"""
Stochastic quantum walker on QuTip.
Class containing an open quantum system described by a Lindblad equation obtained from the adjacency matrix.
Theoretical... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/StochasticOperator.py | 0.935025 | 0.673527 | StochasticOperator.py | pypi |
from __future__ import annotations
from typing import Union
import numpy as np
from qwak.State import State
from qwak.Errors import MissingNodeInput
import json
from utils.jsonTools import json_matrix_to_complex, complex_matrix_to_json
from functools import reduce
class ProbabilityDistribution:
def __init__(self... | /qwak_sim-2023.1014a0-py3-none-any.whl/qwak/ProbabilityDistribution.py | 0.939699 | 0.501953 | ProbabilityDistribution.py | pypi |
def complex_to_json(z):
if isinstance(z, complex):
return {'real': z.real, 'imag': z.imag}
else:
type_name = z.__class__.__name__
raise TypeError(
f"Object of type '{type_name}' is not JSON serializable")
def complex_matrix_to_json(complex_matrix):
jsonList = []
jso... | /qwak_sim-2023.1014a0-py3-none-any.whl/utils/jsonTools.py | 0.504639 | 0.231755 | jsonTools.py | pypi |
import numpy as np
from matplotlib import pyplot as plt
import math
import copy
import os
import seaborn as sns
import pandas as pd
from matplotlib.colors import LinearSegmentedColormap, Normalize
def plot_qwak(
x_value_matrix,
y_value_matrix,
x_label=None,
y_label=None,
plot_t... | /qwak_sim-2023.1014a0-py3-none-any.whl/utils/plotTools.py | 0.766031 | 0.445771 | plotTools.py | pypi |
from math import sqrt, ceil, pow
import numpy as np
from sympy import gcd, div, Float
def isStrCospec(A, a, b):
"""For a graph to have PST it needs to obey numerous rules and the first one is that the vertices with PST must be
strongly cospectral. Two vertices a and b are strong cospectral if the characteris... | /qwak_sim-2023.1014a0-py3-none-any.whl/utils/PerfectStateTransfer.py | 0.901923 | 0.754418 | PerfectStateTransfer.py | pypi |
from flask_restx import Api as BaseApi
from collections import OrderedDict
from werkzeug.datastructures import MultiDict
from flask_restx.reqparse import Argument
class Api(BaseApi):
"""Custom Flask-RESTPlus Api subclass for overriding default root route
NOTE: endpoint of route '/' must be named 'root'::
... | /qwc_services_core-1.3.19-py3-none-any.whl/qwc_services_core/api.py | 0.809615 | 0.17172 | api.py | pypi |
import struct
from typing import Any, Union
import dateutil.parser
from . import helper, parse_save
def write(
save_data: list[int],
number: Union[dict[str, int], int],
length: Union[int, None] = None,
) -> list[int]:
"""Writes a little endian number to the save data"""
if length is None and is... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/serialise_save.py | 0.727879 | 0.3333 | serialise_save.py | pypi |
import json
import os
from typing import Any
from . import config_manager, helper, managed_item
class TrackerItem:
"""Tracker item"""
def __init__(
self, value: int, managed_item_type: managed_item.ManagedItemType
) -> None:
"""Initialize the tracker item"""
self.value = value
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/tracker.py | 0.649356 | 0.258139 | tracker.py | pypi |
import datetime
import hashlib
import hmac
import json
from random import randint
import time
from typing import Any, Optional, Union
import requests
from . import helper, managed_item, serialise_save, patcher, config_manager, tracker
def get_current_time() -> int:
"""Get current time."""
return int(time.... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/server_handler.py | 0.76533 | 0.211315 | server_handler.py | pypi |
import filecmp
import json
from multiprocessing import Process
import os
import shutil
import sys
import time
from typing import Any, Callable, Generator, Optional, Union
import colored # type: ignore
from . import (
user_input_handler,
server_handler,
patcher,
serialise_save,
parse_save,
tra... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/helper.py | 0.63023 | 0.201224 | helper.py | pypi |
import collections
import datetime
import json
import struct
import traceback
from typing import Any, Optional, Union
from . import helper
from . import updater
address = 0
save_data_g = None
def re_order(data: dict[str, Any]) -> collections.OrderedDict[str, Any]:
"""Move all unknown vals to the bottom of the... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/parse_save.py | 0.718792 | 0.386735 | parse_save.py | pypi |
from typing import Optional, Union
from . import managed_item, user_input_handler, helper, locale_handler, tracker
class Bannable:
def __init__(self, type: "managed_item.ManagedItemType", work_around: str = ""):
self.type = type
self.work_around = work_around
class Int:
def __init__(self, va... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/item.py | 0.870136 | 0.170335 | item.py | pypi |
import os
from typing import Optional
import requests
from . import helper
URL = "https://raw.githubusercontent.com/fieryhenry/BCData/master/"
def download_file(
game_version: str,
pack_name: str,
file_name: str,
get_data: bool = True,
print_progress: bool = True,
) -> bytes:
"""
Downloa... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/game_data_getter.py | 0.800692 | 0.283066 | game_data_getter.py | pypi |
import os
import subprocess
from typing import Optional
from . import helper
def get_data_path() -> str:
"""
Get the data path
Returns:
str: The data path
"""
return "/data/data/"
def get_installed_battlecats_versions() -> Optional[list[str]]:
"""
Get a list of installed battle ... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/root_handler.py | 0.684791 | 0.23421 | root_handler.py | pypi |
import subprocess
from typing import Any, Optional
import requests
from . import config_manager, helper
def update(latest_version: str, command: str = "py") -> bool:
"""Update pypi package testing for py and python"""
helper.colored_text("Updating...", base=helper.GREEN)
try:
full_cmd = f"{com... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/updater.py | 0.767646 | 0.180179 | updater.py | pypi |
import enum
import os
import re
import subprocess
from typing import Union
from . import helper, user_input_handler, config_manager
class ADBExceptionTypes(enum.Enum):
"""ADB exception types"""
NO_DEVICE = enum.auto()
DEVICE_OFFLINE = enum.auto()
PATH_NOT_FOUND = enum.auto()
ADB_NOT_INSTALLED =... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/adb_handler.py | 0.611034 | 0.161949 | adb_handler.py | pypi |
from typing import Any, Union
from . import (
helper,
user_input_handler,
config_manager,
)
from .edits import basic, cats, gamototo, levels, other, save_management
def fix_elsewhere_old(save_stats: dict[str, Any]) -> dict[str, Any]:
"""Fix the elsewhere error using 2 save files"""
main_token =... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/feature_handler.py | 0.580947 | 0.306488 | feature_handler.py | pypi |
import os
from typing import Any, Optional
import yaml
from . import helper, user_input_handler, locale_handler
def get_config_value_category(category: str, key: str) -> Any:
"""
Returns the value of the given key in the config file.
"""
print()
def get_config_file() -> dict[str, Any]:
"""
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/config_manager.py | 0.710929 | 0.153708 | config_manager.py | pypi |
from typing import Any, Optional, Tuple, Union
from . import helper, locale_handler
def handle_all_at_once(
ids: list[int],
all_at_once: bool,
data: list[int],
names: list[Any],
item_name: str,
group_name: str,
explain_text: str = "",
) -> list[int]:
"""Handle all at once option"""
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/user_input_handler.py | 0.776835 | 0.211753 | user_input_handler.py | pypi |
from typing import Any, Union
from ... import helper, user_input_handler
from . import cat_id_selector, cat_helper
def set_level_caps(save_stats: dict[str, Any]) -> dict[str, Any]:
"""
Set the level caps for the cats
Args:
save_stats (dict[str, Any]): The save stats
Returns:
dict[st... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/upgrade_cats.py | 0.737064 | 0.191649 | upgrade_cats.py | pypi |
from typing import Any
from ... import helper, user_input_handler, csv_handler, game_data_getter
from . import cat_id_selector
def set_t_ids(save_stats: dict[str, Any]) -> dict[str, Any]:
"""handler for editing treasure ids"""
unit_drops_stats = save_stats["unit_drops"]
data = get_data(helper.check_dat... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/chara_drop.py | 0.651355 | 0.29988 | chara_drop.py | pypi |
from typing import Any
from ... import helper, csv_handler, game_data_getter
from . import cat_id_selector
def get_evolve(save_stats: dict[str, Any]) -> dict[str, Any]:
"""Handler for evolving cats"""
cat_ids = cat_id_selector.select_cats(save_stats)
return evolve_handler_ids(
save_stats=save_st... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/evolve_cats.py | 0.587707 | 0.238196 | evolve_cats.py | pypi |
import os
from multiprocessing import Process
from typing import Any, Callable, Optional
from ... import (
csv_handler,
game_data_getter,
helper,
user_input_handler,
)
from ..levels import treasures
from . import cat_helper
def select_cats(save_stats: dict[str, Any], current: bool = True) -> list[i... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/cat_id_selector.py | 0.713731 | 0.24168 | cat_id_selector.py | pypi |
from typing import Any, Optional
from ... import helper, item, csv_handler, game_data_getter, user_input_handler
from . import cat_id_selector
def get_talent_data(save_stats: dict[str, Any]) -> Optional[dict[Any, Any]]:
"""Get talent data for all cats"""
file_data = game_data_getter.get_file_latest(
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/talents.py | 0.693992 | 0.206154 | talents.py | pypi |
from typing import Any, Optional
from ... import csv_handler, game_data_getter, helper
from ..levels import main_story, uncanny
TYPES = [
"Normal",
"Special",
"Rare",
"Super Rare",
"Uber Super Rare",
"Legend Rare",
]
def get_level_cap_increase_amount(cat_base_level: int) -> int:
"""
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/cats/cat_helper.py | 0.85555 | 0.324075 | cat_helper.py | pypi |
from typing import Any, Optional
from ... import user_input_handler, server_handler, helper, adb_handler
from ..levels import clear_tutorial
def select(save_stats: dict[str, Any]) -> dict[str, Any]:
helper.check_changes(None)
options = [
"Download save data from the game using transfer and confirmatio... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/save_management/load.py | 0.617167 | 0.293886 | load.py | pypi |
from typing import Any
from ... import helper, serialise_save, patcher, adb_handler, root_handler
def save(save_stats: dict[str, Any]) -> dict[str, Any]:
"""Serialise the save data and exit"""
save_data = serialise_save.start_serialize(save_stats)
helper.write_save_data(
save_data, save_stats["... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/save_management/save.py | 0.738858 | 0.190423 | save.py | pypi |
from typing import Any, Optional
from ... import game_data_getter, helper, item, user_input_handler
def get_boundaries(is_jp: bool) -> Optional[list[int]]:
"""
Returns the xp requirements for each level
Args:
is_jp (bool): If the save file is japanese
Returns:
list[int]: The xp requ... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/other/cat_shrine.py | 0.865253 | 0.321846 | cat_shrine.py | pypi |
from typing import Any, Optional
from ... import user_input_handler, game_data_getter, csv_handler, helper
def get_mission_conditions(is_jp: bool) -> Optional[dict[Any, Any]]:
"""Get the mission data and what you need to do to complete it"""
file_data = game_data_getter.get_file_latest(
"DataLocal",... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/other/missions.py | 0.740925 | 0.260251 | missions.py | pypi |
from typing import Any
from ... import csv_handler, game_data_getter, helper, user_input_handler
def get_item_names(is_jp: bool) -> list[str]:
"""Get the item names
Args:
is_jp (bool): If the data is for jp
Returns:
list[str]: The item names
"""
item_names = game_data_getter.get... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/other/scheme_item.py | 0.794305 | 0.240351 | scheme_item.py | pypi |
import json
from typing import Any, Optional
from BCSFE_Python import game_data_getter, csv_handler, helper, user_input_handler
class RawOrbInfo:
def __init__(
self,
orb_id: int,
grade_id: int,
effect_id: int,
value: list[int],
attribute_id: int,
):
"""I... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/basic/talent_orbs_new.py | 0.851876 | 0.208179 | talent_orbs_new.py | pypi |
from typing import Any
from ... import item, managed_item
def edit_cat_food(save_stats: dict[str, Any]) -> dict[str, Any]:
"""Handler for editing cat food"""
cat_food = item.IntItem(
name="Cat Food",
value=item.Int(save_stats["cat_food"]["Value"]),
max_value=45000,
bannable=it... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/basic/basic_items.py | 0.7011 | 0.287343 | basic_items.py | pypi |
from typing import Any
from ... import helper, user_input_handler
def edit_all_orbs(save_stats: dict[str, Any], orb_list: list[str]) -> dict[str, Any]:
"""Handler for editing all talent orbs"""
val = user_input_handler.colored_input(
"What do you want to set the value of all talent orbs to?:"
)... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/basic/talent_orbs.py | 0.526586 | 0.261997 | talent_orbs.py | pypi |
from typing import Any, Optional
from ... import user_input_handler, item, game_data_getter, csv_handler, helper
def get_canon_types(is_jp: bool) -> Optional[list[str]]:
"""Get the cannon types"""
file_data = game_data_getter.get_file_latest(
"resLocal", "CastleRecipeDescriptions.csv", is_jp
)
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/gamototo/ototo_cat_cannon.py | 0.72086 | 0.194559 | ototo_cat_cannon.py | pypi |
from typing import Any, Optional
from ... import item, game_data_getter, helper
def get_gamatoto_helpers(is_jp: bool) -> Optional[dict[str, Any]]:
"""Get the rarities of all gamatoto helpers"""
if is_jp:
country_code = "ja"
else:
country_code = "en"
file_data = game_data_getter.get_... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/gamototo/helpers.py | 0.686895 | 0.292248 | helpers.py | pypi |
from typing import Any, Optional
from ... import helper, user_input_handler, item, game_data_getter
def get_boundaries(is_jp: bool) -> Optional[list[int]]:
"""Get the xp requirements for each level"""
file_data = game_data_getter.get_file_latest(
"DataLocal", "GamatotoExpedition.csv", is_jp
)
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/gamototo/gamatoto_xp.py | 0.747063 | 0.310342 | gamatoto_xp.py | pypi |
from typing import Any
from ... import user_input_handler, helper
from ...edits.other import meow_medals
def set_stage_data(
stage_data_edit: dict[str, Any],
stage_id: int,
stars: int,
lengths: dict[str, int],
unlock_next: bool,
) -> dict[str, Any]:
"""Set the stage data for a stage"""
i... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/levels/event_stages.py | 0.584508 | 0.249807 | event_stages.py | pypi |
from typing import Optional
from ... import user_input_handler, helper
from . import main_story
def select_specific_chapters() -> list[int]:
"""Select specific levels"""
print("What chapters do you want to select?")
ids = user_input_handler.select_not_inc(main_story.CHAPTERS, "clear")
return ids
d... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/levels/story_level_id_selector.py | 0.785144 | 0.259842 | story_level_id_selector.py | pypi |
from typing import Any, Optional
from ... import user_input_handler, helper
from . import main_story
def get_available_chapters(outbreaks: dict[int, Any]) -> list[str]:
"""Get available chapters"""
available_chapters: list[str] = []
for chapter_index in outbreaks:
if chapter_index > 2:
... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/levels/outbreaks.py | 0.707101 | 0.255367 | outbreaks.py | pypi |
from typing import Any
from ... import helper
from . import story_level_id_selector
CHAPTERS = [
"Empire of Cats 1",
"Empire of Cats 2",
"Empire of Cats 3",
"Into the Future 1",
"Into the Future 2",
"Into the Future 3",
"Cats of the Cosmos 1",
"Cats of the Cosmos 2",
"Cats of the ... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/levels/main_story.py | 0.708717 | 0.383295 | main_story.py | pypi |
from typing import Any, Optional
from ... import helper, user_input_handler, item, csv_handler, game_data_getter
from . import story_level_id_selector, main_story
def get_stages(is_jp: bool) -> Optional[list[list[list[int]]]]:
"""Get what stages belong to which treasure group"""
treasures_values: list[list[... | /qwer_python-0.0.2-py3-none-any.whl/qwer_python/edits/levels/treasures.py | 0.656768 | 0.171234 | treasures.py | pypi |
from typing import Callable, Union
import numpy as np
from weighted_levenshtein import dam_lev, lev
# Source for NEIGHBORS_OF: A. Samuellson Master's Thesis
# https://kth.diva-portal.org/smash/get/diva2:1116701/FULLTEXT01.pdf
NEIGHBORS_OF = {}
NEIGHBORS_OF["q"] = ["w", "a"]
NEIGHBORS_OF["w"] = ["e", "s", "a", "q"]
NEI... | /qwerty-weighted-levenshtein-0.0.8.tar.gz/qwerty-weighted-levenshtein-0.0.8/src/qwerty_weighted_levenshtein/qwerty_weighted_levenshtein.py | 0.762601 | 0.397412 | qwerty_weighted_levenshtein.py | pypi |
import datetime
class PhaseTracker:
def __init__(self, init_phase, initial_time=None, history_on=False):
self.__initial_time = initial_time if initial_time else datetime.date.min
self.__indices = {}
self.__history = []
self.__timespans = []
self.__last_time = self.__initial... | /qwertywerty-1.0.0.tar.gz/qwertywerty-1.0.0/O2DESPy/phase_tracker.py | 0.67662 | 0.172381 | phase_tracker.py | pypi |
from abc import ABC, abstractmethod
import datetime
class IReadOnlyHourCounter(ABC):
@abstractmethod
def last_time(self):
pass
@abstractmethod
def last_count(self):
pass
@abstractmethod
def paused(self):
pass
@abstractmethod
def total_increment(self):
... | /qwertywerty-1.0.0.tar.gz/qwertywerty-1.0.0/O2DESPy/hour_counter.py | 0.792022 | 0.222457 | hour_counter.py | pypi |
import datetime
class PhaseTracker:
def __init__(self, init_phase, initial_time=None, history_on=False):
self.__initial_time = initial_time if initial_time else datetime.date.min
self.__indices = {}
self.__history = []
self.__timespans = []
self.__last_time = self.__initial... | /qwertywerty123-1234.tar.gz/qwertywerty123-1234/o2despy/phase_tracker.py | 0.67662 | 0.172381 | phase_tracker.py | pypi |
from abc import ABC, abstractmethod
import datetime
class IReadOnlyHourCounter(ABC):
@abstractmethod
def last_time(self):
pass
@abstractmethod
def last_count(self):
pass
@abstractmethod
def paused(self):
pass
@abstractmethod
def total_increment(self):
... | /qwertywerty123-1234.tar.gz/qwertywerty123-1234/o2despy/hour_counter.py | 0.792022 | 0.222457 | hour_counter.py | pypi |
import datetime
class PhaseTracker:
def __init__(self, init_phase, initial_time=None, history_on=False):
self.__initial_time = initial_time if initial_time else datetime.date.min
self.__indices = {}
self.__history = []
self.__timespans = []
self.__last_time = self.__initial... | /qwertywertyerty12-1.0.0-py3-none-any.whl/qwertywertyerty123/phase_tracker.py | 0.67662 | 0.172381 | phase_tracker.py | pypi |
from abc import ABC, abstractmethod
import datetime
class IReadOnlyHourCounter(ABC):
@abstractmethod
def last_time(self):
pass
@abstractmethod
def last_count(self):
pass
@abstractmethod
def paused(self):
pass
@abstractmethod
def total_increment(self):
... | /qwertywertyerty12-1.0.0-py3-none-any.whl/qwertywertyerty123/hour_counter.py | 0.792022 | 0.222457 | hour_counter.py | pypi |
import glob
import matplotlib.pyplot as plt
import random
import re
import sqlite3
import statistics
'''
Script that will read data from a number of database files and produce some
results based on the contents. Results will be stored in respective files
either as text or as plots.
Out files:
time_stats.txt - Bas... | /qwilfish-0.4.1.tar.gz/qwilfish-0.4.1/extras/plot_results.py | 0.473901 | 0.42054 | plot_results.py | pypi |
import sqlite3
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import tkinter as tk
from tkinter import ttk
class PlotApp():
def __init__(self):
self.current_db = None
self.x_values = None
self.y... | /qwilfish-0.4.1.tar.gz/qwilfish-0.4.1/extras/quickplot.py | 0.538012 | 0.223409 | quickplot.py | pypi |
from typing import Any, Optional, Sequence
import sklearn
from sklearn.linear_model import LogisticRegression
import numpy as np
from qxbranch.quantum_feature_detector import logging_service, QuantumFeatureDetector, EncoderBase, DecoderBase
class QuantumModel:
"""
Class that builds and trains the overall qu... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/quantum_model.py | 0.956624 | 0.713244 | quantum_model.py | pypi |
from typing import Any, Sequence
from qxbranch.quantum_feature_detector.circuit_base import CircuitBase
from qxbranch.quantum_feature_detector.encoder_base import EncoderBase
from qxbranch.quantum_feature_detector.decoder_base import DecoderBase, TDecodedResults
from qxbranch.quantum_feature_detector import logging_s... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/quantum_feature_detector.py | 0.975284 | 0.660474 | quantum_feature_detector.py | pypi |
from abc import abstractmethod
from typing import Any, Generic, Sequence, Tuple, TypeVar, Type
from qxbranch.quantum_feature_detector.encoder_base import EncoderBase
from qxbranch.quantum_feature_detector.decoder_base import TDecodedResults, DecoderBase
from qxbranch.quantum_feature_detector.quantum_transform import ... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/circuit_base.py | 0.953955 | 0.604107 | circuit_base.py | pypi |
from abc import abstractmethod
import networkx as nx
import numpy as np
import random
# flake8 doesn't check the usage of List in a typing comment
from typing import Any, Generic, List, Optional, TypeVar, Tuple # noqa
from qxbranch.quantum_feature_detector.circuit_base import CircuitBase
from qxbranch.quantum_feat... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/circuit_generator_base.py | 0.918316 | 0.597021 | circuit_generator_base.py | pypi |
import numpy as np
from typing import Any, List, Sequence
from pyquil.quil import Program
from pyquil.gates import RX, X
from qxbranch.quantum_feature_detector.encoder_base import EncoderBase
class Encoder(EncoderBase[Program]):
"""Generic encoder object compatible with :py:class:`Circuit` objects."""
def... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/pyquil/encoder.py | 0.949983 | 0.769903 | encoder.py | pypi |
import time
from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union
from pyquil.api import QuantumComputer, get_qc, QVMConnection
from pyquil.quil import Gate, Program
from pyquil import quilbase
import pyquil.gates
from qxbranch.quantum_feature_detector.pyquil.encoder import Encoder
from qxbranch.q... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/pyquil/circuit.py | 0.919208 | 0.689489 | circuit.py | pypi |
from typing import Dict, List
from qxbranch.quantum_feature_detector.decoder_base import DecoderBase, TDecodedResults
MeasurementResultsPyquil = Dict[int, List[int]]
class Decoder(DecoderBase[MeasurementResultsPyquil, TDecodedResults]):
"""
Decoder object that returns the raw measurement results. Use this ... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/pyquil/decoder.py | 0.965763 | 0.796609 | decoder.py | pypi |
import random
from typing import Optional, Tuple, Union
from pyquil.api import QuantumComputer
from qxbranch.quantum_feature_detector.pyquil.circuit import Circuit
from qxbranch.quantum_feature_detector.quantum_transform import QuantumTransform
from qxbranch.quantum_feature_detector.circuit_generator_base import Cir... | /qxbranch.quantum_feature_detector-1.0.2.tar.gz/qxbranch.quantum_feature_detector-1.0.2/qxbranch/quantum_feature_detector/pyquil/circuit_generator.py | 0.943452 | 0.724675 | circuit_generator.py | pypi |
import sys
from types import NoneType
import yaml
import re
from typing import Any, Generator, Tuple
def parse(docs, *queries):
result, errors = [], []
for doc in yaml.safe_load_all(docs):
for query in queries:
for query_doc in yaml.safe_load_all(query):
for ok, value in do... | /qyaml-smartptr-0.0.2.tar.gz/qyaml-smartptr-0.0.2/src/qyaml/qyaml.py | 0.503418 | 0.407392 | qyaml.py | pypi |

# Qympy - Quantum Analytic Computation with Sympy
A sympy based python package for symbolic calculation of quantum circuit and machine learning.
See GitHub: https://github.com/r08222011/Qympy
---
### Installation
Simply run `pip install`, see [Qympy](https://pypi.org/project/qympy... | /qympy-1.5.0.tar.gz/qympy-1.5.0/README.md | 0.828904 | 0.986085 | README.md | pypi |
import sys
import logging
import subprocess
from blessings import Terminal
from qz7.shell.cmdlist import CmdList
from qz7.shell.ssh import get_ssh_client
DEFAULT_ENCODING = "UTF-8"
DEFAULT_TERM_WIDTH = 1024
TERM = None
log = logging.getLogger(__name__)
def set_term(term):
"""
Set the global terminal objec... | /qz7.shell-0.0.4.tar.gz/qz7.shell-0.0.4/qz7/shell/run_remote.py | 0.53607 | 0.152032 | run_remote.py | pypi |
import os
import numpy as np
from copy import deepcopy
from mmap import mmap, ACCESS_READ
from contextlib import closing
from multiprocessing import Pool
from .io_tools import Input, Output
from .utilities import (
is_number, create_supercell, lattice_array_to_unit_cell, to_list
)
from .molecular import MolecularS... | /qztest-0.0.3.tar.gz/qztest-0.0.3/pywindow/trajectory.py | 0.787073 | 0.468912 | trajectory.py | pypi |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from typing import Optional, Tuple, List, Any
from numpy import ndarray
from ..molecule import Molecule, HostMolecule, GuestMolecule, HostGuestComplex
class ElementNotFoundError(Exception):
pass
class OPLSAAParameter:
"""
Notes
... | /qztest-0.0.3.tar.gz/qztest-0.0.3/organic_ff/oplsaa_parameters.py | 0.710628 | 0.463991 | oplsaa_parameters.py | pypi |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from typing import Optional, Tuple, List, Any
from numpy import ndarray
from ..molecule import Molecule, HostMolecule, GuestMolecule, HostGuestComplex
class ElementNotFoundError(Exception):
pass
class Amber99Parameter:
# Parameters fo... | /qztest-0.0.3.tar.gz/qztest-0.0.3/organic_ff/amber_parameters.py | 0.696165 | 0.580709 | amber_parameters.py | pypi |
import abc
import numpy as np
from ..molecule import HostGuestComplex
from .uff4mof_parameter_assign import UFF4MOFAssign
from scipy.spatial import distance
from rdkit.Chem import AllChem
class UFFPotential:
"""
Very fast energy calculation through 'AllChem.UFFGetMoleculeForceField'
in 'rdkit'.
"""... | /qztest-0.0.3.tar.gz/qztest-0.0.3/metal_ff/potential.py | 0.627609 | 0.256378 | potential.py | pypi |
import networkx as nx
from openbabel import openbabel
from openbabel.openbabel import OBChargeModel
from rdkit.Chem.rdchem import HybridizationType
from .uff4mof_parameter import UFF4MOF_ELEMENTS, get_uff4mof_para
class AtomTypeError(Exception):
pass
class UFF4MOFAssign:
def __init__(
self,
... | /qztest-0.0.3.tar.gz/qztest-0.0.3/metal_ff/uff4mof_parameter_assign.py | 0.561095 | 0.333056 | uff4mof_parameter_assign.py | pypi |
import yaml
from pathlib import Path
from typing import Any
class RConfig(dict):
def __init__(self, *args, **kwargs):
# type: (tuple[Any], dict[str, Any]) -> None
super().__init__(*args, **kwargs)
self.update(self)
def update(self, r=None, **kwargs):
# type: (RConfig | dict,... | /r_config-0.4.1.tar.gz/r_config-0.4.1/r_config/r_config.py | 0.770249 | 0.171304 | r_config.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 ... | /r_distributions-0.1.tar.gz/r_distributions-0.1/r_distributions/Gaussiandistribution.py | 0.688364 | 0.853058 | Gaussiandistribution.py | pypi |
from __future__ import unicode_literals
import datetime
import re
from django.core import exceptions
from django.db import models
from django.utils.translation import ugettext_lazy as _
partial_date_re = re.compile(
r'^(?P<year>\d{4})(?:-(?P<month>\d{1,2}))?(?:-(?P<day>\d{1,2}))?$'
)
class PartialDate(object):... | /r-django-partial-date-1.3.1.1.tar.gz/r-django-partial-date-1.3.1.1/partial_date/fields.py | 0.753013 | 0.163145 | fields.py | pypi |
import json
from asyncio.subprocess import create_subprocess_exec
from os import path
from subprocess import PIPE, run as run_subprocess
from tempfile import TemporaryDirectory
from typing import Any
# executes a function from the specified source file
r_source = """
args = commandArgs(trailingOnly = TRUE)
source_file... | /r-functions-1.0.3.tar.gz/r-functions-1.0.3/r_functions.py | 0.575707 | 0.200636 | r_functions.py | pypi |
import os
import re
import logging
from ruamel.yaml import YAML
import click
class RContainerLint(object):
""" Object that hold linting info and result """
def __init__(self, pipeline_dir):
""" Init the linting object """
self.path = pipeline_dir
self.conda_config = {}
self.fa... | /r-lint-0.1.0.tar.gz/r-lint-0.1.0/r_lint/lint.py | 0.534855 | 0.240507 | lint.py | pypi |
import re
from typing import Callable, Tuple, Optional, Any, List, Iterable
from functools import partial
leading_zero_re = re.compile(r'0*(\d+)')
ParseMatch = Optional[Tuple[Any,str]]
def parse_fixed_width_leading_zero_int(fixed_width:int, s:str) -> ParseMatch:
if fixed_width == 0:
raise ValueError("Expe... | /r_map-0.9.0-py3-none-any.whl/r_map/arrayed_node_name_parser.py | 0.730386 | 0.406332 | arrayed_node_name_parser.py | pypi |
import r_map
from r_map import Node
"""schema:
{
root: { #need a starting point
type: xxx,
children: [ <uuid>, ]
},
<uuid>: {
name: xxx,
type: xxx,
<other metadata>,
_ref: <uuid>,
children: [ <uuid>, ]
}
}
"""
default_serialization_classes = {
... | /r_map-0.9.0-py3-none-any.whl/r_map/serialize.py | 0.473901 | 0.3398 | serialize.py | pypi |
from __future__ import annotations
from random import random
from functools import wraps
from typing import Callable, Optional, TypeVar, Generic
T = TypeVar('T')
class ProgressBar:
detail: int
showPercent: bool
symbols: list
started: bool = False
percent: float = 0
filled: int = 0
partial... | /r_repeat-0.1.1-py3-none-any.whl/r_repeat/main.py | 0.834542 | 0.266727 | main.py | pypi |
from dataclasses import dataclass
from typing import List
import _sqlite3
import typer
from rich import print
app = typer.Typer()
@dataclass
class Tasklists:
id: int
task: str
is_done: bool
class Sqlite3:
tablename: str = "tasks"
def __init__(self):
self.con = _sqlite3.connect("/tmp/... | /r_todolist-0.1.1.tar.gz/r_todolist-0.1.1/r_todolist/main.py | 0.63273 | 0.18641 | main.py | pypi |
import json
import dill as pickle
from dill.source import getsource
from tqdm import tqdm
from typing import List, Optional
from types import MethodType
from pathlib import Path
from r2c_isg.structures.projects import Project
class Dataset(object):
def __init__(self, registry: str = None, **kwargs):
from... | /r2c-inputset-generator-0.3.2.tar.gz/r2c-inputset-generator-0.3.2/r2c_isg/structures/dataset.py | 0.798619 | 0.184988 | dataset.py | pypi |
from typing import List, Optional
from types import MethodType
from r2c_isg.structures.versions import Version
class Project(object):
def __init__(self, uuids_: dict = {}, meta_: dict = {}, **kwargs):
# a project contains versions
self.versions: List[Version] = []
# set the uuid/meta fun... | /r2c-inputset-generator-0.3.2.tar.gz/r2c-inputset-generator-0.3.2/r2c_isg/structures/projects/_project.py | 0.895981 | 0.309898 | _project.py | pypi |
from typing import List
from r2c_isg.structures import Dataset
def sort(ds: Dataset, params: List[str]) -> None:
"""Sorts the projects/versions based on the given parameters."""
# useful url: https://realpython.com/python-sort/
# organize the params list--sort by last param first
# default sort orde... | /r2c-inputset-generator-0.3.2.tar.gz/r2c-inputset-generator-0.3.2/r2c_isg/functions/sort.py | 0.864625 | 0.354545 | sort.py | pypi |
import json
from tqdm import tqdm
from r2c_isg.loaders import Loader
from r2c_isg.structures import Dataset, DefaultProject, DefaultVersion
from r2c_isg.structures.projects import project_map
from r2c_isg.structures.versions import version_map
class R2cLoader(Loader):
@classmethod
def load(cls, filepath: str... | /r2c-inputset-generator-0.3.2.tar.gz/r2c-inputset-generator-0.3.2/r2c_isg/loaders/core/r2c_loader.py | 0.455441 | 0.187133 | r2c_loader.py | pypi |
import csv
from r2c_isg.loaders import Loader
from r2c_isg.structures import Dataset, DefaultProject, DefaultVersion
from r2c_isg.structures.projects import project_map
from r2c_isg.structures.versions import version_map
class CsvLoader(Loader):
@classmethod
def load(cls, filepath: str, **kwargs) -> Dataset:... | /r2c-inputset-generator-0.3.2.tar.gz/r2c-inputset-generator-0.3.2/r2c_isg/loaders/file/csv_loader.py | 0.461259 | 0.187263 | csv_loader.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.