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
# Don't connect with the Copyright comment above! # Version 24.05.2019 import json from rafcon.utils import log from rafcontpp.model.type_tree import TypeTree logger = log.get_logger(__name__) class TypeMerger: def __init__(self, datastore): """ :param datastore: A datastore containing: A pd...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/type_merger.py
0.661923
0.263576
type_merger.py
pypi
# Don't connect with the Copyright comment above! # Version 21.08.1019 import copy import json import os import time from rafcon.core.singleton import library_manager from rafcon.core.singleton import state_machine_manager from rafcon.core.state_machine import StateMachine from rafcon.core.states.execution_state im...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/state_machine_generator.py
0.567218
0.279958
state_machine_generator.py
pypi
# Don't connect with the Copyright comment above! # Version 05.07.2019 import os from rafcon.core.config import global_config from rafcon.core.singleton import library_manager from rafcon.utils import log from rafcontpp.logic.pddl_action_parser import PddlActionParser from rafcontpp.model.datastore import SEMANTIC_D...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/mapper.py
0.512205
0.247294
mapper.py
pypi
# Don't connect with the Copyright comment above! # Version 09.09.2019 import os from datetime import datetime from rafcon.utils import log from rafcontpp.logic.predicate_merger import PredicateMerger from rafcontpp.logic.type_merger import TypeMerger from rafcontpp.model.datastore import PLUGIN_VERSION logger = lo...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/domain_generator.py
0.659295
0.17858
domain_generator.py
pypi
# Don't connect with the Copyright comment above! # Version 05.07.2019 import os import unicodedata from rafcon.core.singleton import library_manager from rafcon.utils import log from rafcontpp.logic.pddl_action_parser import PddlActionParser from rafcontpp.model.datastore import SEMANTIC_DATA_DICT_NAME, PDDL_ACTION...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/pddl_action_loader.py
0.52975
0.278898
pddl_action_loader.py
pypi
# Don't connect with the Copyright comment above! # Version: 17.05.2019 import re from rafcon.utils import log from rafcontpp.model.pddl_action_representation import PddlActionRepresentation logger = log.get_logger(__name__) class PddlActionParser: """ PddlActionParser PddlActionParser is able to parse an...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/pddl_action_parser.py
0.593256
0.276623
pddl_action_parser.py
pypi
# Don't connect with the Copyright comment above! # Version 21.02.2020 import math import time import rafcon from gaphas.solver import Variable from rafcon.gui.models.state_machine import StateMachineModel from rafcon.gui.singleton import state_machine_manager_model from rafcon.gui.utils import constants from rafcon....
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/state_machine_layouter.py
0.548674
0.507568
state_machine_layouter.py
pypi
# Don't connect with the Copyright comment above! # Version 17.05.2019 import re from rafcon.utils import log logger = log.get_logger(__name__) class PddlFactsParser: def __init__(self, facts_string): """ The facts file parser will later be used to parse a raw facts file into a pddl facts fi...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/logic/pddl_facts_parser.py
0.652241
0.287577
pddl_facts_parser.py
pypi
# Don't connect with the Copyright comment above! # Version 14.06.2019 import os import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class StatePoolInfoWindow: """ The State Pool Infow Window is a info window displaying detailed information about the configured state pool(s) It for e...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/view/state_pool_info_window.py
0.727298
0.233335
state_pool_info_window.py
pypi
# Don't connect with the Copyright comment above! # Version 24.05.2019 import os import threading import time import traceback from rafcon.utils import log from rafcontpp.control.planning_controller import PlanningController from rafcontpp.logic.domain_generator import DomainGenerator from rafcontpp.logic.mapper im...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/control/execution_controller.py
0.523908
0.190611
execution_controller.py
pypi
# Don't connect with the Copyright comment above! # Version 19.07.2019 import os from threading import Thread import rafcon.gui.singleton as gui_singletons from rafcon.core.states.hierarchy_state import HierarchyState from rafcon.gui.singleton import state_machine_manager_model from rafcon.utils import log from raf...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/control/planning_setup_form_controller.py
0.604749
0.221624
planning_setup_form_controller.py
pypi
# Don't connect with the Copyright comment above! # Version 14.06.2019 class TypeTree: """ A class that helps to create a pddl-type-tree TypeTree is a datastructure that helps to create a pddl-type-tree out of a type databse containing type:parent entries. although it is a type tree, it has no advant...
/rafcon-task-planner-plugin-1.5.2.tar.gz/rafcon-task-planner-plugin-1.5.2/source/rafcontpp/model/type_tree.py
0.795857
0.417865
type_tree.py
pypi
from collections.abc import MutableMapping def brush_stroke(string, matches, brush): '''Apply color to matching words in string''' for match in matches: replacement = '%s%s%s' % (brush['open_color_tag'], match, brush['close_color_tag']) string = string.replace(match, replacement) return ...
/raffaello-4.0.1.tar.gz/raffaello-4.0.1/src/paint.py
0.821939
0.244543
paint.py
pypi
import matplotlib.pyplot as plt import sys from numpy.polynomial import Polynomial as P from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score from rafComputing.ML.CustomSettings.settings import AUTO_DRIVER_DEFAULT_OUTPUT_NAME from rafComputing.ML.features.feature_ty...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/MLAutoDriver.py
0.616936
0.540136
MLAutoDriver.py
pypi
import matplotlib.pyplot as plt import numpy as np import sys from numpy.polynomial import Polynomial as P from sklearn.metrics import mean_squared_error, r2_score from rafComputing.ML.CustomSettings.settings import ( MAX_ITER, ALPHA, DEFAULT_ITER_INCREASE_STEPS_LOG, DEFAULT_ITER_INCREASE_STEPS, DE...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/MLdriver.py
0.613005
0.511107
MLdriver.py
pypi
import numpy as np from sklearn.model_selection import train_test_split from rafComputing.ML.features.feature_transformation import extract_features from rafComputing.ML.features.feature_types import POLYNOMIAL_FEATURE_TYPE from rafComputing.ML.helpers.generate_larger_evaluation_set import generate_larger_evaluation_s...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/helpers/load_data.py
0.822759
0.626938
load_data.py
pypi
import matplotlib.pyplot as plt import sys from sklearn.metrics import mean_squared_error, r2_score from rafComputing.ML.CustomSettings.settings import ( MAX_ITER, ALPHA, MAX_ITER_LinearRegressionTraining, ALPHA_LinearRegressionTraining, AUTO_DRIVER_DEFAULT_OUTPUT_NAME, ) from rafComputing.ML.Regre...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/snippets/MLdriver_more_graphs_prediction.py
0.578805
0.562537
MLdriver_more_graphs_prediction.py
pypi
import matplotlib.pyplot as plt import sys from sklearn.metrics import mean_squared_error, r2_score from rafComputing.ML.CustomSettings.settings import ( MAX_ITER, ALPHA, MAX_ITER_LinearRegressionTraining, ALPHA_LinearRegressionTraining, AUTO_DRIVER_DEFAULT_OUTPUT_NAME, ) from rafComputing.ML.Regre...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/snippets/MLdriver_more_graphs.py
0.567937
0.658733
MLdriver_more_graphs.py
pypi
import matplotlib.pyplot as plt from sklearn.metrics import mean_squared_error, r2_score from rafComputing.ML.CustomSettings.settings import ( MAX_ITER_LinearRegressionTraining, ALPHA_LinearRegressionTraining, AUTO_DRIVER_DEFAULT_OUTPUT_NAME, ) from rafComputing.ML.RegressionEngine.LinearRegressionGD impor...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/snippets/demo/strassen/CustomStrassenLinearRegressionTrainingMoreGraphsPrediction.py
0.766119
0.649078
CustomStrassenLinearRegressionTrainingMoreGraphsPrediction.py
pypi
import matplotlib.pyplot as plt import numpy as np import sys from rafComputing.ML.CustomSettings.settings import ( MAX_ITER, DEFAULT_ITER_INCREASE_STEPS_LOG, DEFAULT_ITER_INCREASE_STEPS, DEFAULT_RANGE_, MAX_ITER_LinearRegressionTraining, ALPHA_LinearRegressionTraining, OUTPUT_PREFIX, O...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/snippets/demo/strassen/MLdriver_n3_memory.py
0.515864
0.433142
MLdriver_n3_memory.py
pypi
import matplotlib.pyplot as plt import numpy as np import sys from rafComputing.ML.CustomSettings.settings import ( MAX_ITER, DEFAULT_ITER_INCREASE_STEPS_LOG, DEFAULT_ITER_INCREASE_STEPS, DEFAULT_RANGE_, MAX_ITER_LinearRegressionTraining, ALPHA_LinearRegressionTraining, OUTPUT_PREFIX, O...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/rafComputing/ML/snippets/demo/strassen/MLdriver_strassen_memory.py
0.509764
0.435962
MLdriver_strassen_memory.py
pypi
from WebMonitoring.API.resources.last_seven_entries_metrics import ( get_last_seven_entries_size, ) def get_results_resource_get_size(mysql, resource_name): result_args_get_size = [] result_args_old_get_size = [] list_sample = [] try: conn = mysql.connect() cursor = conn.cursor() ...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/resources/size_metrics.py
0.402627
0.166777
size_metrics.py
pypi
from WebMonitoring.API.constants import PERIOD, BYTES_TO_KBYTES from WebMonitoring.API.resources.helpers import get_timestamp_query def resources_get_samples_size_daily(mysql, resource_name): try: conn = mysql.connect() cursor = conn.cursor() """ Compatibility warning: PEP-249 spec...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/resources/samples_size_resource.py
0.495361
0.253907
samples_size_resource.py
pypi
from WebMonitoring.API.resources.last_seven_entries_metrics import ( get_last_seven_entries_time, ) def get_results_resource_get_time(mysql, resource_name): result_args_get_time = [] result_args_old_get_time = [] list_sample = [] try: conn = mysql.connect() cursor = conn.cursor() ...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/resources/time_metrics.py
0.406155
0.161089
time_metrics.py
pypi
from WebMonitoring.API.constants import PERIOD from WebMonitoring.API.resources.helpers import get_timestamp_query def resources_get_samples_time_daily(mysql, resource_name): try: conn = mysql.connect() cursor = conn.cursor() """ Compatibility warning: PEP-249 specifies that any mo...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/resources/samples_time_resource.py
0.47317
0.26541
samples_time_resource.py
pypi
from WebMonitoring.API.resources.numerical_helpers import lt_w_none, get_percent_w_none def render_dict( result_args_get, result_args_old_get, list_sample, product_name, color, roundDecimal=2, ): return { "product": product_name, "total": { "monthly": round(res...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/resources/metrics_renderer.py
0.594316
0.22414
metrics_renderer.py
pypi
from WebMonitoring.API.constants import PERIOD, BYTES_TO_MBYTES from WebMonitoring.API.resources.helpers import get_timestamp_query def websites_get_samples_size_daily(mysql, resource_name): try: conn = mysql.connect() cursor = conn.cursor() """ Compatibility warning: PEP-249 speci...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/websites/samples_size_websites.py
0.462959
0.283013
samples_size_websites.py
pypi
from WebMonitoring.API.constants import PERIOD from WebMonitoring.API.resources.helpers import get_timestamp_query def websites_get_samples_time_daily(mysql, resource_name): try: conn = mysql.connect() cursor = conn.cursor() """ Compatibility warning: PEP-249 specifies that any mod...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/WebMonitoring/API/websites/samples_time_websites.py
0.460289
0.270151
samples_time_websites.py
pypi
__author__ = ["[Brandon Amos](http://bamos.github.io)"] __date__ = "2014.02.14" """ `rank-writing.py` ranks the writing quality of my blog's Markdown posts and my project's Markdown README files. The following programs should be on your `PATH`: + [aspell](http://aspell.net/) + [write-good](https://github.com/btford/wr...
/rafmetrics-0.0.3.tar.gz/rafmetrics-0.0.3/tools/rank_writing/rank_writing.py
0.640973
0.737678
rank_writing.py
pypi
"""Program build utilities.""" from ._ffi import build_info def git_version(): """Current git version.""" return build_info.git_version() def with_cuda(): """Whether build with CUDA. if true, return the CUDA version, or None otherwise.""" if build_info.use_cuda(): return build_info.cuda_ver...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/build.py
0.852782
0.247918
build.py
pypi
# Acknowledgement: The main logic originates from TVM # pylint: disable=missing-function-docstring,invalid-name,undefined-variable """Compute definitions and schedules for operator argwhere""" from .._lib import tvm as _tvm from .._lib import _reg, _op _topi = _tvm.topi # pylint: disable=no-member _te = _tvm.te # ...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/argwhere.py
0.793346
0.599251
argwhere.py
pypi
# pylint: disable=missing-function-docstring, undefined-loop-variable, unused-argument, invalid-name """Compute definition and schedules for data transform operators""" import numpy as np from raf._tvm_op.nn import schedule_generic from .._lib import register_compute from .._lib import strategy from .._lib import tvm...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/transform.py
0.619586
0.342791
transform.py
pypi
# pylint: disable=missing-function-docstring """Compute definition and schedules for loss functions.""" from .._lib import register_compute from .._lib import tvm as _tvm from .._lib import _reg _topi = _tvm.topi # pylint: disable=invalid-name,no-member @register_compute("raf.op.tvm.smooth_l1_loss") def smooth_l1_...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/loss.py
0.66061
0.344003
loss.py
pypi
"""Utilities for processing TVM ops.""" # pylint: disable=protected-access import os from threading import Thread import numpy as np import tvm from raf import distributed as dist @tvm._ffi.register_func("raf._tvm_op.utils.export_library") def export_library(mod, path): """Export a built TVM runtime module to...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/utils.py
0.880373
0.59249
utils.py
pypi
# pylint: disable=missing-function-docstring, unused-argument """Schedule registries for unary operators.""" import math from .._lib import register_compute from .._lib import tvm as _tvm from .._lib import _reg _reg.register_broadcast_schedule("raf.op.tvm.copy") _reg.register_broadcast_schedule("raf.op.tvm.ceil") _...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/unary.py
0.664431
0.413536
unary.py
pypi
# pylint: disable=too-many-locals, invalid-name, no-member """Schedule for some injective operators, based on 3rdparty/tvm/python/tvm/topi/cuda/reduction.py""" import tvm from tvm import te import tvm.topi.utils as utils def schedule_injective_from_existing(sch, out): """Schedule for injective op from existing s...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_tvm_op/cuda/injective.py
0.800497
0.370652
injective.py
pypi
# pylint: disable=missing-class-docstring,missing-function-docstring """Runtime value instances.""" from raf._core.core_utils import dev2str, register_node, str2dev from raf._ffi import value as ffi from raf._ffi.ir._make import Constant as make_const_expr from raf._ffi.value import _make, ToTVM from raf._lib import O...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_core/value.py
0.636127
0.331498
value.py
pypi
# pylint: disable=missing-class-docstring,missing-function-docstring """Multi-dimension array representation""" import ctypes from raf._core.core_utils import dev2str, set_module, str2dev from raf._core.value import TensorValue from raf._ffi.binding import ( BindNDArray, BindSymbol, RebindNDArray, Loo...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_core/ndarray.py
0.843509
0.252096
ndarray.py
pypi
"""Device.""" import re from .core_utils import register_node, DEVICE_TYPE_MAP from .._lib import Object from .._ffi import device as ffi @register_node("raf.device.Device") class Device(Object): """Construct a Device object. Parameters ---------- device_str: str The device string such as "...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_core/device.py
0.830937
0.236483
device.py
pypi
# pylint: disable=missing-class-docstring,missing-function-docstring """Utilities for core components.""" import inspect import functools from collections import deque, OrderedDict from raf._lib import tvm from raf._lib import _DLDevice from raf._lib import _NodeBase as NodeBase # pylint: disable=unused-import from ...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_core/core_utils.py
0.715325
0.20351
core_utils.py
pypi
"""RAF executor.""" # pylint: disable=no-else-return,unidiomatic-typecheck,undefined-variable,invalid-name # pylint: disable=protected-access import os import tvm from tvm import auto_scheduler, autotvm from tvm.auto_scheduler.dispatcher import ApplyHistoryBest from .. import _ffi from . import vm from .device import ...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_core/executor.py
0.885235
0.301006
executor.py
pypi
# pylint: disable=missing-module-docstring,missing-function-docstring from numbers import Number import numpy as np from raf._core.ndarray import ndarray from raf._core.value import BoolValue, FloatValue, IntValue, StringValue, TensorValue, Value from raf._lib import Array, relay def to_any(a): if isinstance(a...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_op/imp_utils.py
0.406744
0.339499
imp_utils.py
pypi
"""Define dialect fusion patterns.""" from .dialect import register_pattern from ..ir.dataflow_pattern import is_op, wildcard, is_constant, has_dtype, has_shape from .._core.value import StringValue, IntValue MATMUL_OPS = [ "raf.op.dense", "raf.op.matmul", "raf.op.matmul_nt", "raf.op.matmul_tn", "...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_op/dialect_pattern.py
0.873431
0.578448
dialect_pattern.py
pypi
# pylint: disable=missing-function-docstring """Symbolic API utilities""" from numbers import Number import numpy as np from raf._core.ndarray import Symbol, ndarray from raf._core.value import TensorValue, Value def to_any(a): if isinstance(a, Symbol): return a._Symbol__handle # pylint: disable=prote...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/_op/sym_utils.py
0.652574
0.342379
sym_utils.py
pypi
# pylint: disable=missing-function-docstring """Graph IR builder utilities for ops""" from numbers import Number from raf._lib import relay from .constant import const def to_any(a): if isinstance(a, relay.Expr): return a if a is None: return const(None) if isinstance(a, (Number, str))...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/ir/op_utils.py
0.642096
0.303435
op_utils.py
pypi
# pylint: disable=protected-access,too-many-return-statements,too-many-branches """Utils to create constant expr.""" import numpy as _np from raf._core import ndarray as _nd from raf._core import value as _value from raf._ffi.ir._make import Constant def to_value(value, dtype=None): """Convert to value. Pa...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/ir/constant.py
0.904539
0.346624
constant.py
pypi
"""Traced Optimizers""" from raf.frontend.model import _get_func_output_var from raf.ir import RAFSequential from .. import distributed as dist from .._core.ndarray import Symbol, get_symbol_handle from .._core.value import NoGradValue, Value from .._core.ir_ext import ExtendedVar from ..model.trace import _get_func_i...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/optim/optim.py
0.666062
0.241076
optim.py
pypi
# pylint: disable=invalid-name, missing-function-docstring, too-many-instance-attributes, too-many-locals, too-many-statements, protected-access, too-many-arguments, too-many-branches """LANS optimizer.""" import numpy as np from raf._core.core_utils import get_chained_attr from raf._core.ndarray import array, ndarra...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/optim/lans.py
0.88607
0.402862
lans.py
pypi
"""SGD optimizer.""" # pylint: disable=too-many-statements,too-many-instance-attributes import numpy as np from raf._core.core_utils import get_chained_attr from raf._core.ndarray import ndarray, array from raf.model import trace, Model, trace_mutate_attr from raf.model.trace import _get_func_inputs from raf._op impo...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/optim/sgd.py
0.894404
0.326781
sgd.py
pypi
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring # pylint: disable=no-self-use import ast from contextlib import contextmanager from inspect import isfunction from numbers import Number from typing import Callable, Dict from raf._core.value import Value from raf._lib impor...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/hybrid/ir_builder.py
0.666931
0.316528
ir_builder.py
pypi
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring # pylint: disable=protected-access, too-many-locals import ast import inspect from typing import Callable, Dict, List from raf._lib import relay from raf._core.core_utils import get_func_name from .cfg import CFG, BasicBloc...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/hybrid/to_relay.py
0.746231
0.233843
to_relay.py
pypi
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring import ast from collections import defaultdict from typing import Dict, List, Tuple, Union from .hybrid_utils import NodeVisitor, unbound_constant_expr # Tuple[()] : Return # Tuple[ast.AST]: unconditional jump # Tuple[ast.A...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/hybrid/cfg.py
0.785391
0.226848
cfg.py
pypi
"""The frontend that converts PyTorch models to RAF models via Relay.""" # pylint: disable=too-many-locals from collections import OrderedDict import os import hashlib import torch from raf import distributed as dist from .._core.ndarray import ndarray from .._lib import relay from .._ffi.pass_ import FromRelay, Swit...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/frontend/pytorch.py
0.918535
0.384652
pytorch.py
pypi
"""Model that wraps the IR converted from deep learning frameworks.""" # pylint: disable=protected-access, attribute-defined-outside-init from tvm import relay from raf._ffi.model import RunModel from raf.model.model import BaseModel from raf.model.trace import _unwrap, _TraceRecord from raf._core.ir_ext import exten...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/frontend/model.py
0.896756
0.183155
model.py
pypi
# pylint: disable=line-too-long """Operator-specific type hints for automatic mixed precision. The type hint function for each operator should return a list of type hints, and the list size should be the same as the argument number. Here are some type hint examples: - PrimType("float32"): The argument must be in flo...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/amp/type_hints.py
0.799912
0.554169
type_hints.py
pypi
# pylint: disable=too-many-locals, too-many-arguments, protected-access # pylint: disable=missing-class-docstring, missing-function-docstring, no-self-use # pylint: disable=attribute-defined-outside-init import os from copy import copy import tvm import raf from raf._core.executor import MetaFallbackContext from raf....
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/utils/tuner.py
0.756088
0.304677
tuner.py
pypi
"""Runtime profiler""" import json from raf import build from raf._ffi.profiler import EnableProfiler, DisableProfiler from raf._ffi.profiler import CollectBaseProfile, CollectCudaProfile, GetProfile def start(prof_level=1): """Enable the profiler in backend and start to profile the execution from now. Para...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/utils/profiler.py
0.856632
0.248454
profiler.py
pypi
# pylint: disable=protected-access, invalid-name """Collective communication operators""" from .._op import sym from .communicator import get_communicator def allreduce(x, computation="sum", rank_list=None): """General allreduce operators, take tensor or list of tensors as input.""" if not isinstance(x, (tup...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/distributed/op.py
0.929967
0.502747
op.py
pypi
# pylint: disable=missing-function-docstring,too-many-arguments """NN-specific random initializers.""" import math import numpy as np from .np import normal, uniform def _calc_fan_in_out(shape): ndim = len(shape) if ndim < 2: raise ValueError("Please provide shape with at least 2 dims") if ndim...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/random/nn.py
0.7011
0.386156
nn.py
pypi
# pylint: disable=missing-module-docstring,missing-function-docstring, protected-access import functools import sys from collections import OrderedDict, namedtuple from raf._core import cacher from raf._core.core_utils import get_bound_args, get_func_name from raf._core.global_scope import SCOPE from raf._core.module...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/model/trace.py
0.405566
0.205376
trace.py
pypi
# pylint: disable=missing-class-docstring,missing-function-docstring,attribute-defined-outside-init """Neural network specific Model blocks.""" import math import numpy as np from raf._core.ndarray import ndarray, array from raf._core.core_utils import get_chained_attr from raf._op import sym from raf.random import ...
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/model/nn.py
0.82347
0.200127
nn.py
pypi
# pylint: disable=missing-class-docstring,missing-function-docstring """Interactive interface for training & inference.""" from collections import OrderedDict import re from raf._core import cacher from raf._core.core_utils import bfs, get_attr, get_named_attr, set_module from raf._core.device import Device from raf....
/rafproject-0.2.tar.gz/rafproject-0.2/src/raf/python/raf/model/model.py
0.802013
0.200519
model.py
pypi
from typing import Callable, Union from math import cos, floor, pi from random import random from PIL import Image, ImageColor, ImageDraw Color = tuple[int, int, int] Gradient = dict[float, Color] def clamp(val: float) -> int: """Clamp a number to that expected by a reasonable RGB component This ensures that...
/rafraser_theia-0.0.2-py3-none-any.whl/theia/color.py
0.971685
0.737371
color.py
pypi
from PIL import Image, ImageFilter from theia.color import clamp, Color def apply_outline(im: Image, color: Color, width: int = 8, softness: int = 127) -> Image: """Apply an outline to an image Args: im (Image): Image to apply outline to. Must be in RGBA format. color (Color): Color of the ou...
/rafraser_theia-0.0.2-py3-none-any.whl/theia/outline.py
0.969999
0.624752
outline.py
pypi
import argparse import os import re import requests def download_icons_from_page(url: str, path: str, max_images: int = 0): """Download all Flaticons from a given Flaticon search URL Args: url (str): URL to fetch icons from path (str): Output directory max_images (int, optional): Maxi...
/rafraser_theia-0.0.2-py3-none-any.whl/theia/flaticon.py
0.752468
0.263348
flaticon.py
pypi
from theia.color import Color, color_to_hex, distance_squared from PIL import ImageColor import json import os import re import requests # Extension to use for palette files # Palettes are saved as unencoded plain text, one color per line PALETTE_EXT = "txt" ColorPalette = dict[str, Color] def parse_palette(content...
/rafraser_theia-0.0.2-py3-none-any.whl/theia/palettes.py
0.911833
0.35248
palettes.py
pypi
from os import listdir, path from PIL import Image from pathlib import Path def images_from_path(filepath: str, input_root: str = "input") -> list[str]: """Get a list of image paths from a given location Args: filepath (str): Filepath to load image(s) from input_root (str, optional): Extra di...
/rafraser_theia-0.0.2-py3-none-any.whl/theia/image.py
0.867373
0.529507
image.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 ...
/rafsun_dst-0.1.tar.gz/rafsun_dst-0.1/rafsun_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
import os from raft import Collection, task from raft.util import LOG_FORMAT from local_convocations import travis, checks from local_convocations.docs import docs, www, sites, watch_docs from local_convocations.pytest import coverage as coverage_, test as test_ from local_convocations.packaging import vendorize, rel...
/raft-1.4.1.4.tar.gz/raft-1.4.1.4/tasks.py
0.441673
0.347011
tasks.py
pypi
from __future__ import unicode_literals from raft import task @task(name="blacken", iterable=["folders"]) def blacken( c, line_length=79, folders=None, check=False, diff=False, find_opts=None ): r""" Run black on the current source tree (all ``.py`` files). .. warning:: ``black`` only runs o...
/raft-1.4.1.4.tar.gz/raft-1.4.1.4/local_convocations/checks.py
0.827445
0.274088
checks.py
pypi
from contextlib import contextmanager from typing import ( Any, Dict, Optional, TextIO, ) import colorama @contextmanager def disable_colorama(): import sys colorama.deinit() try: yield finally: if sys.stdout: sys.stdout.flush() if sys.stderr: ...
/raga_cli-0.1.70-py3-none-any.whl/rc/ui/__init__.py
0.436382
0.173954
__init__.py
pypi
import logging import os import re from typing import Dict, List from rc.utils.run_cli_cmd import * import socket import colorama logger = logging.getLogger(__name__) def colorize(message, color=None, style=None): """Returns a message in a specified color.""" if not color: return message styles...
/raga_cli-0.1.70-py3-none-any.whl/rc/utils/__init__.py
0.810966
0.166269
__init__.py
pypi
<h1 align="center"> <img style="vertical-align:middle" height="200" src="./docs/assets/logo.png"> </h1> <p align="center"> <i>Evaluation framework for your Retrieval Augmented Generation (RAG) pipelines</i> </p> <p align="center"> <a href="https://github.com/explodinggradients/ragas/releases"> <img a...
/ragas-0.0.11.tar.gz/ragas-0.0.11/README.md
0.636127
0.923385
README.md
pypi
``` # only run this if your have an editable install %load_ext autoreload %autoreload 2 ``` the dataset has 2 modes - fullwiki - here the model is required to generate answer give the first paragraphs of all the wikipedia articles - distractor - here the context as a mix of 8 missleading paragraphs and 2 golden paragr...
/ragas-0.0.11.tar.gz/ragas-0.0.11/experiments/baselines/hotpotqa/explore-dataset.ipynb
0.417746
0.567337
explore-dataset.ipynb
pypi
``` # only run this if your have an editable install %load_ext autoreload %autoreload 2 from datasets import load_dataset fiqa_test = load_dataset("explodinggradients/fiqa", "main", split="test") fiqa_test ``` ## k=1, chunk_size=300 We know the performance of the baseline model so lets try and see if we can make imp...
/ragas-0.0.11.tar.gz/ragas-0.0.11/experiments/baselines/fiqa/improving-baselines.ipynb
0.538255
0.622
improving-baselines.ipynb
pypi
``` # only run this if your have an editable install %load_ext autoreload %autoreload 2 from datasets import load_dataset, concatenate_datasets DATASET_URL = "wiki_qa" SPLIT = "test" ds = load_dataset(DATASET_URL, split=SPLIT) ds ``` ### Download the wikipedia pages ``` import wikipedia as wiki wiki_doc_titles = s...
/ragas-0.0.11.tar.gz/ragas-0.0.11/experiments/baselines/wikiqa/dataset-exploration-and-baseline.ipynb
0.47244
0.597667
dataset-exploration-and-baseline.ipynb
pypi
import os from typing import Dict, Union, Text, Optional, Tuple import jwt from jwt import InvalidSignatureError import rasa.cli.utils as rasa_cli_utils import rasa.core.constants as rasa_core_constants import rasa.core.utils as rasa_core_utils from ragex.community import constants, config from ragex.community.utils ...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/jwt.py
0.856152
0.292997
jwt.py
pypi
import json import os from typing import Dict, Text, Any, Optional import sqlalchemy as sa from ragex.community import config from sqlalchemy import Column from sqlalchemy.orm import relationship, deferred from rasa.constants import DEFAULT_DATA_PATH from ragex.community.database import utils from ragex.community.dat...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/data.py
0.803598
0.226163
data.py
pypi
import json from typing import Any, Text, Dict, Union import sqlalchemy as sa from sqlalchemy.orm import relationship from ragex.community.database import utils from ragex.community.database.base import Base # Table for many-to-many relationship between users and roles. user_role_mapping = sa.Table( "user_role_m...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/admin.py
0.750187
0.187281
admin.py
pypi
import json import time from typing import Any, Text, Dict, Optional, List, Union import sqlalchemy as sa from sqlalchemy.orm import relationship from ragex.community.database.base import Base class ConversationStatistic(Base): """Stores statistics about every user conversation.""" __tablename__ = "convers...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/analytics.py
0.818628
0.180757
analytics.py
pypi
import json from collections import defaultdict from typing import Any, Text, Dict, Union import sqlalchemy as sa from sqlalchemy.orm import relationship from rasa.core.domain import ( Domain as RasaDomain, SESSION_CONFIG_KEY, SESSION_EXPIRATION_TIME_KEY, CARRY_OVER_SLOTS_KEY, ) from ragex.community.d...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/domain.py
0.724188
0.165694
domain.py
pypi
import json from typing import Dict, Any, Text import sqlalchemy as sa from sqlalchemy.orm import relationship from ragex.community.constants import DEFAULT_RASA_ENVIRONMENT from ragex.community.database.base import Base from ragex.community.database import utils class Conversation(Base): """Stores the user's c...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/conversation.py
0.697506
0.223568
conversation.py
pypi
from typing import Dict, Text, Any import sqlalchemy as sa from sqlalchemy.orm import relationship from ragex.community.database.base import Base from ragex.community.database import utils class Intent(Base): """Stores the intents (currently only temporary ones).""" __tablename__ = "intent" id = sa.Co...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/intent.py
0.71602
0.238961
intent.py
pypi
from typing import Any, Text, Dict, Union import sqlalchemy as sa from sqlalchemy.orm import relationship from ragex.community.database.base import Base from ragex.community.database import utils class Model(Base): """Stores metadata about trained models.""" __tablename__ = "model" id = sa.Column(sa.I...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/model.py
0.854065
0.258665
model.py
pypi
from alembic import op import sqlalchemy as sa import logging from typing import Dict, Text, Union, List import ragex.community.database.schema_migrations.alembic.utils as migration_utils logger = logging.getLogger(__name__) # revision identifiers, used by Alembic. revision = "4daabca814ee" down_revision = "6fce967...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/database/schema_migrations/alembic/versions/migration_2019_08_26_oracle_migrations_4daabca814ee.py
0.424412
0.209874
migration_2019_08_26_oracle_migrations_4daabca814ee.py
pypi
json_schema = { "login": { "type": "object", "required": ["username", "password"], "properties": {"username": {"type": "string"}, "password": {"type": "string"}}, }, "change_password": { "type": "object", "required": [ "username", "old_password...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/api/__init__.py
0.400749
0.421433
__init__.py
pypi
import json import logging import uuid from typing import Text, Optional, List, Dict, Any, Union, Tuple import math import time from sqlalchemy import func, false, distinct, Integer, cast, and_, Float from sqlalchemy.util import KeyedTuple from rasa.core.events import Restarted, UserUttered, BotUttered from ragex.com...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/analytics_service.py
0.855972
0.194674
analytics_service.py
pypi
import itertools import json import logging import time from typing import Text, List, Dict, Any, Optional, Tuple, Set from sqlalchemy import or_, and_, true, false from ragex.community import config from ragex.community.database.data import Template from ragex.community.database.service import DbService from ragex.c...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/nlg_service.py
0.821259
0.374876
nlg_service.py
pypi
import logging from typing import Text, Dict, Union, List, Optional from ragex.community import config, metrics from ragex.community.database.admin import PlatformFeature from ragex.community.database.service import DbService logger = logging.getLogger(__name__) class FeatureService(DbService): def set_feature(...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/feature_service.py
0.76145
0.154026
feature_service.py
pypi
import logging import time from typing import Text, Dict, Any, Optional, List from sqlalchemy.orm import Session from ragex.community import config from ragex.community.database.model import NluEvaluation, NluEvaluationPrediction, Model from ragex.community.database.service import DbService from ragex.community.serv...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/evaluation_service.py
0.786008
0.215867
evaluation_service.py
pypi
import uuid import json import os import logging from typing import Text, Tuple, Dict, List, Any, Optional, Union, Type from ragex.community.database.service import DbService from ragex.community.database.admin import ConfigValue from ragex.community import config logger = logging.getLogger(__name__) class ConfigKe...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/config_service.py
0.834002
0.274048
config_service.py
pypi
import copy import logging import time from typing import Any, Text, Dict, List, Optional, Tuple, Set, Union import re import typing from sqlalchemy import and_, or_ from rasa.core.actions.action import default_action_names from rasa.core.events import ActionExecuted, UserUttered, SlotSet from rasa.core.interpreter ...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/story_service.py
0.754101
0.219526
story_service.py
pypi
import logging from typing import Text, Dict, List, Union, Optional from sqlalchemy import and_ from ragex.community.database.intent import UserGoal, UserGoalIntent from ragex.community.database.service import DbService logger = logging.getLogger(__name__) GOAL_NAME_KEY = "name" GOAL_INTENTS_KEY = "intents" class...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/user_goal_service.py
0.847195
0.257771
user_goal_service.py
pypi
import logging import typing from typing import Text, List, Optional, Union, Dict import time import ragex.community.config as rasa_x_config from rasa.utils import endpoints from ragex.community.services.event_consumers.event_consumer import EventConsumer if typing.TYPE_CHECKING: from kafka.structs import TopicP...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/event_consumers/kafka_consumer.py
0.882409
0.164819
kafka_consumer.py
pypi
import logging import typing from rasa.utils import endpoints if typing.TYPE_CHECKING: from ragex.community.services.event_consumers.event_consumer import EventConsumer logger = logging.getLogger(__name__) def from_endpoint_config( broker_config: endpoints.EndpointConfig, should_run_liveness_endpoint: bool...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/event_consumers/utils.py
0.757974
0.172207
utils.py
pypi
import json import logging import os import typing from contextlib import ExitStack from typing import Text, Optional, Union from sanic.response import HTTPResponse from ragex.community import utils from ragex.community.database.utils import session_scope from ragex.community.services.analytics_service import Analyti...
/rage_ts-0.4.18-py3-none-any.whl/ragex/community/services/event_consumers/event_consumer.py
0.869894
0.16388
event_consumer.py
pypi
from typing import Any, Generic, List, Protocol, Type, TypeVar, Union, cast, overload from numpy.typing import NDArray import numpy as np from .ragged_buffer import ( RaggedBufferF32, RaggedBufferI64, RaggedBufferBool, translate_rotate, ) ScalarType = TypeVar("ScalarType", bound=np.generic) class Ra...
/ragged_buffer-0.4.8-cp37-cp37m-macosx_10_7_x86_64.whl/ragged_buffer/__init__.py
0.838481
0.382199
__init__.py
pypi
# Ragger [![codecov](https://codecov.io/gh/LedgerHQ/ragger/branch/develop/graph/badge.svg)](https://codecov.io/gh/LedgerHQ/ragger) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=LedgerHQ_ragger&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=LedgerHQ_ragger) [![CodeQL]...
/ragger-1.11.4.tar.gz/ragger-1.11.4/README.md
0.571886
0.854278
README.md
pypi
.. _Rationale: =========== Rationale =========== Testing, easily manipulating a Ledger :term:`application` is hard. Although :term:`Speculos` strongly eases it, it cannot always replace IRL tests on physical devices. There are libraries allowing to communicate with a physical device. However, it would be very conve...
/ragger-1.11.4.tar.gz/ragger-1.11.4/doc/rationale.rst
0.954806
0.790004
rationale.rst
pypi
from collections import namedtuple, defaultdict AlignmentInfo = namedtuple("AlignmentInfo", ["s_ref", "e_ref", "s_qry", "e_qry", "len_ref", "len_qry", "ref_id", "contig_id"]) class Hit: def __init__(self, index, chr, coord, sign): self.index = index self.chr = chr ...
/ragout-0.2b.tar.gz/ragout-0.2b/scripts/utils/nucmer_parser.py
0.550366
0.201145
nucmer_parser.py
pypi