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 enum import IntEnum from typing import Dict, Set, List, Optional from .isa_loader import InstructionSet from .interfaces import Coverage, EquivalenceClass, TestCase, Executor, Model, Analyser, \ ExecutionTrace, TracedInstruction, Instruction, RegisterOperand, OT from .x86.x86_generator import X86TargetDesc fr...
/revizor_fuzzer-1.2.3.tar.gz/revizor_fuzzer-1.2.3/revizor/coverage.py
0.776029
0.342462
coverage.py
pypi
from typing import Tuple, Dict, Type, List, Callable from . import input_generator, analyser, coverage, postprocessor, interfaces, model from .x86 import x86_model, x86_executor, x86_fuzzer, x86_generator, get_spec from .config import CONF, ConfigException GENERATORS: Dict[str, Type[interfaces.Generator]] = { "x8...
/revizor_fuzzer-1.2.3.tar.gz/revizor_fuzzer-1.2.3/revizor/factory.py
0.799051
0.317982
factory.py
pypi
from typing import List # x86_option_values attribute MUST be the first attribute in the file x86_option_values = { 'executor_mode': ['P+P', 'F+R', 'E+R', 'PP+P'], # 'GPR' is intentionally left out 'permitted_faults': [ 'DE-zero', 'DE-overflow', 'UD', 'UD-vtx', 'UD-svm', 'PF-present', 'PF-writable', '...
/revizor_fuzzer-1.2.3.tar.gz/revizor_fuzzer-1.2.3/revizor/x86/x86_config.py
0.732018
0.372676
x86_config.py
pypi
# RevLib Simple and efficient RevNet-Library for PyTorch with XLA and DeepSpeed support and parameter offload ## Table of Contents * [RevLib](#revlib) * [Table Of Contents](#table-of-contents) * [Features](#features) * [Getting Started](#getting-started) * [Installation](#installation) * [Exa...
/revlib-1.7.0.tar.gz/revlib-1.7.0/README.md
0.950423
0.916596
README.md
pypi
import dateutil.parser import json from datetime import timedelta class Field(object): def __init__(self, source=None): self.source = source self.client = None def convert(self, value, client): return value class StringField(Field): def convert(self, value, client): if...
/revo-client-0.9.0.tar.gz/revo-client-0.9.0/myotest/wrapper.py
0.624064
0.284762
wrapper.py
pypi
import re import pandas as pd from uuid import uuid4 from datetime import date from dateutil.relativedelta import relativedelta from myotest.wrapper import ( WrapperObject, StringField, DateTimeField, ListField, IDField, FloatField, DurationField, LinkField, DictField, DateField, IntegerField, BooleanFiel...
/revo-client-0.9.0.tar.gz/revo-client-0.9.0/myotest/models.py
0.622115
0.226677
models.py
pypi
from __future__ import annotations import mimetypes from typing import TYPE_CHECKING from .enums import AssetType from .utils import Ulid if TYPE_CHECKING: from io import IOBase from .state import State from .types import File as FilePayload __all__ = ("Asset", "PartialAsset") class Asset(Ulid): ...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/asset.py
0.929832
0.278367
asset.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, AsyncGenerator, Optional from .types.message import Component from .enums import SortType if TYPE_CHECKING: from .embed import SendableEmbed from .file import File from .message import Masquerade, Message, MessageInteractions, MessageR...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/messageable.py
0.936742
0.22072
messageable.py
pypi
from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, Coroutine, Optional, Union from .types.message import Component from .asset import Asset, PartialAsset from .channel import DMChannel, GroupDMChannel, TextChannel, SavedMessageChannel from .embed import Embed, SendableEmbed, t...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/message.py
0.860765
0.266003
message.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING from .asset import Asset from .utils import Ulid if TYPE_CHECKING: from .state import State from .channel import Channel from .server import Server from .types import Invite as InvitePayload from .user import User __all__ = ("...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/invite.py
0.89648
0.161221
invite.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union from .asset import Asset from .enums import ChannelType from .messageable import Messageable from .permissions import Permissions, PermissionsOverwrite from .utils import Missing, Ulid from abc import abstractmethod if TYPE_CHE...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/channel.py
0.926611
0.17515
channel.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from .permissions import Overwrite, PermissionsOverwrite from .utils import Missing, Ulid if TYPE_CHECKING: from .server import Server from .state import State from .types import Role as RolePayload __all__ = ("Role",) ...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/role.py
0.932161
0.317281
role.py
pypi
from __future__ import annotations import datetime import inspect from contextlib import asynccontextmanager from operator import attrgetter from typing import Any, Callable, Coroutine, Iterable, Literal, TypeVar, Union import ulid from aiohttp import ClientSession from typing_extensions import ParamSpec __all__ = (...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/utils.py
0.829423
0.224002
utils.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, NamedTuple, Optional, Union from weakref import WeakValueDictionary from .asset import Asset, PartialAsset from .channel import DMChannel, GroupDMChannel, SavedMessageChannel from .enums import PresenceType, RelationshipType from .flags import User...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/user.py
0.898438
0.239216
user.py
pypi
from __future__ import annotations from typing import Callable, Iterator, Optional, Union, overload from typing_extensions import Self __all__ = ("Flag", "Flags", "UserBadges") class Flag: __slots__ = ("flag", "__doc__") def __init__(self, func: Callable[[], int]): self.flag: int = func() ...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/flags.py
0.912324
0.228608
flags.py
pypi
from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, Optional from .utils import _Missing, Missing, parse_timestamp from .asset import Asset from .permissions import Permissions from .permissions_calculator import calculate_permissions from .user import User from .file import Fi...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/member.py
0.922783
0.204521
member.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from typing_extensions import Self from .flags import Flag, Flags from .types.permissions import Overwrite __all__ = ("Permissions", "PermissionsOverwrite", "UserPermissions") class UserPermissions(Flags): """Permissions for use...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/permissions.py
0.897993
0.317347
permissions.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Optional, cast from .asset import Asset from .category import Category from .invite import Invite from .permissions import Permissions from .role import Role from .utils import Ulid from .channel import Channel, TextChannel, VoiceChannel from .membe...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/server.py
0.922343
0.218868
server.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, TypedDict, Union from typing_extensions import NotRequired if TYPE_CHECKING: from .embed import Embed from .file import File __all__ = ( "UserAddContent", "UserRemoveContent", "UserJoinedContent", "UserLeftContent", "U...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/types/message.py
0.764716
0.164886
message.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Literal, TypedDict, Union from typing_extensions import NotRequired if TYPE_CHECKING: from .file import File __all__ = ("Embed", "SendableEmbed", "WebsiteEmbed", "ImageEmbed", "TextEmbed", "NoneEmbed", "YoutubeSpecial", "TwitchSpecial", "Spoti...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/types/embed.py
0.72086
0.187021
embed.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Generic, Optional import revolt from revolt.utils import maybe_coroutine from .command import Command from .group import Group from .utils import ClientT_Co_D if TYPE_CHECKING: from .view import StringView from revolt.state import Sta...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/context.py
0.910379
0.160135
context.py
pypi
from __future__ import annotations from typing import Any, Callable, Coroutine, Union, cast from typing_extensions import TypeVar import revolt from .command import Command from .context import Context from .errors import (MissingPermissionsError, NotBotOwner, NotServerOwner, ServerOnly) from .u...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/checks.py
0.886457
0.155751
checks.py
pypi
from __future__ import annotations import inspect import traceback from contextlib import suppress from typing import (TYPE_CHECKING, Annotated, Any, Callable, Coroutine, Generic, Literal, Optional, Union, get_args, get_origin) from typing_extensions import ParamSpec from revolt.utils import maybe...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/command.py
0.915013
0.153296
command.py
pypi
from revolt import RevoltError __all__ = ( "CommandError", "CommandNotFound", "NoClosingQuote", "CheckError", "NotBotOwner", "NotServerOwner", "ServerOnly", "ConverterError", "InvalidLiteralArgument", "BadBoolArgument", "CategoryConverterError", "ChannelConverterError", ...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/errors.py
0.826432
0.206294
errors.py
pypi
from __future__ import annotations from typing import Any, Callable, Coroutine, Optional from .command import Command from .utils import ClientT_Co_D, ClientT_D __all__ = ( "Group", "group" ) class Group(Command[ClientT_Co_D]): """Class for holding info about a group command. Parameters ------...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/group.py
0.948251
0.32013
group.py
pypi
from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Generic, Optional, TypedDict, Union, cast from typing_extensions import NotRequired from .cog import Cog from .command import Command from .context import Context from .group import Group from .utils import Clien...
/revolt_baidu.py-0.0.5.tar.gz/revolt_baidu.py-0.0.5/revolt/ext/commands/help.py
0.773302
0.251998
help.py
pypi
from __future__ import annotations import mimetypes from typing import TYPE_CHECKING from .enums import AssetType from .utils import Ulid if TYPE_CHECKING: from io import IOBase from .state import State from .types import File as FilePayload __all__ = ("Asset", "PartialAsset") class Asset(Ulid): ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/asset.py
0.916159
0.277332
asset.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Optional from .enums import SortType if TYPE_CHECKING: from .embed import SendableEmbed from .file import File from .message import Masquerade, Message, MessageInteractions, MessageReply from .state import State __all__ = ("Messag...
/revolt_py-0.1.11-py3-none-any.whl/revolt/messageable.py
0.930923
0.292038
messageable.py
pypi
from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, Coroutine, Optional, Union from revolt.types.message import SystemMessageContent from .asset import Asset, PartialAsset from .channel import DMChannel, GroupDMChannel, TextChannel from .embed import Embed, SendableEmbed, to_emb...
/revolt_py-0.1.11-py3-none-any.whl/revolt/message.py
0.848863
0.249639
message.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING from .asset import Asset from .utils import Ulid if TYPE_CHECKING: from .state import State from .channel import Channel from .server import Server from .types import Invite as InvitePayload from .user import User __all__ = ("...
/revolt_py-0.1.11-py3-none-any.whl/revolt/invite.py
0.89648
0.161221
invite.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional, Union from .asset import Asset from .enums import ChannelType from .messageable import Messageable from .permissions import Permissions, PermissionsOverwrite from .utils import Missing, Ulid if TYPE_CHECKING: from .message import...
/revolt_py-0.1.11-py3-none-any.whl/revolt/channel.py
0.938899
0.152347
channel.py
pypi
from __future__ import annotations import asyncio import logging from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union, cast import aiohttp from .channel import (DMChannel, GroupDMChannel, SavedMessageChannel, TextChannel, VoiceChannel, channel_factory) from .http import Htt...
/revolt_py-0.1.11-py3-none-any.whl/revolt/client.py
0.929176
0.155816
client.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from .permissions import Overwrite, PermissionsOverwrite from .utils import Missing, Ulid if TYPE_CHECKING: from .server import Server from .state import State from .types import Role as RolePayload __all__ = ("Role",) ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/role.py
0.932161
0.317281
role.py
pypi
import datetime import inspect from contextlib import asynccontextmanager from operator import attrgetter from typing import Any, Callable, Coroutine, Iterable, Literal, TypeVar, Union import ulid from aiohttp import ClientSession from typing_extensions import ParamSpec __all__ = ("Missing", "copy_doc", "maybe_corout...
/revolt_py-0.1.11-py3-none-any.whl/revolt/utils.py
0.80954
0.219672
utils.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, NamedTuple, Optional, Union from weakref import WeakValueDictionary from .asset import Asset, PartialAsset from .channel import DMChannel, GroupDMChannel from .enums import PresenceType, RelationshipType from .flags import UserBadges from .messageab...
/revolt_py-0.1.11-py3-none-any.whl/revolt/user.py
0.919086
0.220857
user.py
pypi
from __future__ import annotations from typing import Callable, Iterator, Optional, Union, overload from typing_extensions import Self __all__ = ("Flag", "Flags", "UserBadges") class Flag: __slots__ = ("flag", "__doc__") def __init__(self, func: Callable[[], int]): self.flag: int = func() ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/flags.py
0.912324
0.228608
flags.py
pypi
from __future__ import annotations import datetime from typing import TYPE_CHECKING, Any, Optional from .utils import _Missing, Missing from .asset import Asset from .permissions import Permissions from .permissions_calculator import calculate_permissions from .user import User from .file import File if TYPE_CHECK...
/revolt_py-0.1.11-py3-none-any.whl/revolt/member.py
0.920799
0.172764
member.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Optional from typing_extensions import Self from .flags import Flag, Flags from .types.permissions import Overwrite __all__ = ("Permissions", "PermissionsOverwrite", "UserPermissions") class UserPermissions(Flags): """Permissions for use...
/revolt_py-0.1.11-py3-none-any.whl/revolt/permissions.py
0.897993
0.317347
permissions.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Optional, cast from .asset import Asset from .category import Category from .invite import Invite from .permissions import Permissions from .role import Role from .utils import Ulid if TYPE_CHECKING: from .channel import Channel, TextChannel, V...
/revolt_py-0.1.11-py3-none-any.whl/revolt/server.py
0.923208
0.208904
server.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Literal, TypedDict, Union from typing_extensions import NotRequired if TYPE_CHECKING: from .file import File __all__ = ("Embed", "SendableEmbed", "WebsiteEmbed", "ImageEmbed", "TextEmbed", "NoneEmbed", "YoutubeSpecial", "TwitchSpecial", "Spoti...
/revolt_py-0.1.11-py3-none-any.whl/revolt/types/embed.py
0.72086
0.187021
embed.py
pypi
from __future__ import annotations from typing import TYPE_CHECKING, Any, Generic, Optional import revolt from revolt.utils import maybe_coroutine from .command import Command from .group import Group from .utils import ClientCoT if TYPE_CHECKING: from .view import StringView from revolt.state import State ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/ext/commands/context.py
0.909549
0.151812
context.py
pypi
from __future__ import annotations from typing import Any, Callable, Coroutine, Union, cast from typing_extensions import TypeVar import revolt from .command import Command from .context import Context from .errors import (MissingPermissionsError, NotBotOwner, NotServerOwner, ServerOnly) from .u...
/revolt_py-0.1.11-py3-none-any.whl/revolt/ext/commands/checks.py
0.8931
0.153994
checks.py
pypi
from revolt import RevoltError __all__ = ( "CommandError", "CommandNotFound", "NoClosingQuote", "CheckError", "NotBotOwner", "NotServerOwner", "ServerOnly", "ConverterError", "InvalidLiteralArgument", "BadBoolArgument", "CategoryConverterError", "ChannelConverterError", ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/ext/commands/errors.py
0.826432
0.206294
errors.py
pypi
from __future__ import annotations from typing import Any, Callable, Coroutine, Optional from .command import Command from .utils import ClientCoT, ClientT __all__ = ( "Group", "group" ) class Group(Command[ClientCoT]): """Class for holding info about a group command. Parameters ----------- ...
/revolt_py-0.1.11-py3-none-any.whl/revolt/ext/commands/group.py
0.954223
0.296476
group.py
pypi
from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, Generic, Optional, TypedDict, Union from typing_extensions import NotRequired from .cog import Cog from .command import Command from .context import Context from .group import Group from .utils import Client...
/revolt_py-0.1.11-py3-none-any.whl/revolt/ext/commands/help.py
0.764804
0.197909
help.py
pypi
from datetime import date, datetime import dateutil.parser from decimal import Decimal import requests from typing import Optional, Union from . import base, utils class Order(utils._UpdateFromKwargsMixin): id: str = "" client = None public_id: str = "" merchant_order_ext_ref: str = "" type: str ...
/revolut-python-0.10.1.tar.gz/revolut-python-0.10.1/revolut/merchant.py
0.891575
0.198413
merchant.py
pypi
import csv from datetime import datetime import io from revolut import Amount, Transaction _CSV_COLUMNS = ["date", "hour", "from_amount", "from_currency", "to_amount", "to_currency"] def csv_to_dict(csv_str, separator=","): """ From a csv string, returns a list of dictionnaries >>> csv_to_dict("...
/revolut-0.1.4.tar.gz/revolut-0.1.4/revolut_bot/__init__.py
0.700383
0.210969
__init__.py
pypi
import code import re from typing import Callable from PySide6.QtCore import (Qt, Signal, QEvent, QSize, ) from PySide6.QtGui import (QTextCharFormat, QBrush, QColor, QFont) from PySide6.QtWidgets import (QLineEdit, QWidget, QGridLayout, QPlainTextEdit) class LineEdit(QLineEdit): """QLIneEdit with a history buff...
/revolution-eda-0.5.2.tar.gz/revolution-eda-0.5.2/revedaEditor/gui/pythonConsole.py
0.703651
0.179459
pythonConsole.py
pypi
import pathlib class verilogaC: """ This class represents an imported verilog-A module. """ def __init__(self, pathObj: pathlib.Path): self._pathObj = pathObj keyWords = ["analog", "electrical"] self._vaModule = '' self.instanceParams = dict() self.modelParams...
/revolution-eda-0.5.2.tar.gz/revolution-eda-0.5.2/revedaEditor/backend/hdlBackEnd.py
0.532911
0.182826
hdlBackEnd.py
pypi
import json import revedaEditor.common.net as net import revedaEditor.common.shape as shp class symbolAttribute(object): def __init__(self, name: str, definition: str): self._name = name self._definition = definition def __str__(self): return f'{self.name}: {self.definition}' d...
/revolution-eda-0.5.2.tar.gz/revolution-eda-0.5.2/revedaEditor/fileio/symbolEncoder.py
0.719975
0.411525
symbolEncoder.py
pypi
import logging """ _logging.py websocket - WebSocket client library for Python Copyright 2023 engn33r Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2....
/revolution.py-5.0.1.4.tar.gz/revolution.py-5.0.1.4/websocket/_logging.py
0.707
0.194502
_logging.py
pypi
import os import socket import struct from urllib.parse import unquote, urlparse """ _url.py websocket - WebSocket client library for Python Copyright 2023 engn33r Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy o...
/revolution.py-5.0.1.4.tar.gz/revolution.py-5.0.1.4/websocket/_url.py
0.635336
0.181825
_url.py
pypi
import array import os import struct import sys from ._exceptions import * from ._utils import validate_utf8 from threading import Lock """ _abnf.py websocket - WebSocket client library for Python Copyright 2023 engn33r Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except...
/revolution.py-5.0.1.4.tar.gz/revolution.py-5.0.1.4/websocket/_abnf.py
0.555435
0.169956
_abnf.py
pypi
import struct import warnings from json import load as jload from os import access, F_OK, R_OK from signal import signal, SIG_DFL, SIGINT, SIGTERM from threading import Thread, Event, Lock from timeit import default_timer # Globale Werte OFF = 0 GREEN = 1 RED = 2 RISING = 31 FALLING = 32 BOTH = 33 warnings.simplefilt...
/revpimodio-1.0.3.tar.gz/revpimodio-1.0.3/revpimodio.py
0.446012
0.237024
revpimodio.py
pypi
======= revrand ======= .. image:: https://travis-ci.org/NICTA/revrand.svg?branch=master :target: https://travis-ci.org/NICTA/revrand .. image:: https://codecov.io/github/NICTA/revrand/coverage.svg?branch=master :target: https://codecov.io/github/NICTA/revrand?branch=master ----------------------------------...
/revrand-1.0.0.tar.gz/revrand-1.0.0/README.rst
0.95165
0.857291
README.rst
pypi
[![Build Status](https://travis-ci.org/wikimedia/revscoring.svg?branch=master)](https://travis-ci.org/wikimedia/revscoring) [![Test coverage](https://codecov.io/gh/wikimedia/revscoring/branch/master/graph/badge.svg)](https://codecov.io/gh/wikimedia/revscoring) [![GitHub license](https://img.shields.io/github/license/wi...
/revscoring-2.11.10.tar.gz/revscoring-2.11.10/README.md
0.522933
0.928084
README.md
pypi
from abc import ABC, abstractmethod import torch from torch.optim import Adam import torchrl.utils as U class BaseOpt: def __init__( self, model, *, num_epochs=1, num_mini_batches=1, shuffle=True, opt_fn=None, opt_params=None, lr_schedule=Non...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/optimizers/base_opt.py
0.913437
0.263377
base_opt.py
pypi
from collections import OrderedDict import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from torchrl.utils import get_obj, to_tensor class ModuleExtended(nn.Module): """ A torch module with added functionalities. """ @property def is_cuda(self): ret...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/nn/container.py
0.933005
0.566438
container.py
pypi
import torchrl.utils as U class BaseBatcher: """ The returned batch will have the shape (num_steps, num_envs, *shape) """ def __init__(self, runner, batch_size, transforms=None): self.runner = runner self.batch_size = batch_size self.transforms = transforms or [] self....
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/batchers/base_batcher.py
0.791217
0.549882
base_batcher.py
pypi
import torchrl.utils as U from .base_transform import BaseTransform class StackStates(BaseTransform): def __init__(self, n, dim=1): super().__init__() self.n = n self.dim = dim self.ring_buffer = None self.eval_ring_buffer = None def transform(self, state): sta...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/batchers/transforms/state_transforms.py
0.795579
0.42925
state_transforms.py
pypi
import torch import torch.nn.functional as F from torch.distributions.kl import kl_divergence from torchrl.models import BasePGModel class SurrogatePGModel(BasePGModel): r""" The Surrogate Policy Gradient algorithm instead maximizes a "surrogate" objective, given by: .. math:: L^{CPI}({\theta})...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/surrogate_pg_model.py
0.952042
0.578657
surrogate_pg_model.py
pypi
from abc import abstractproperty import torch from torchrl.distributions import Categorical, Normal import torchrl.utils as U from torchrl.models import BaseModel from torchrl.nn import ActionLinear class BasePGModel(BaseModel): """ Base class for all Policy Gradient Models. """ def __init__(self, mo...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/base_pg_model.py
0.950595
0.398641
base_pg_model.py
pypi
import torch from torchrl.models import SurrogatePGModel class PPOModel(SurrogatePGModel): def __init__( self, policy_nn_config, value_nn_config=None, share_body=False, ppo_clip_range=0.2, kl_penalty_coef=1, kl_target=0.01, **kwargs ): se...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/ppo_model_deprecated.py
0.847716
0.224576
ppo_model_deprecated.py
pypi
from abc import ABC, abstractmethod, abstractproperty from collections import ChainMap import os import numpy as np import torch import torch.nn as nn import torchrl.utils as U from torchrl.nn import ModuleExtended from multiprocessing import Process # TODO; Paramters changes, change doc class BaseModel(ModuleExte...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/base_model.py
0.811937
0.445891
base_model.py
pypi
import torch import torch.nn.functional as F from torch.distributions import kl_divergence from torchrl.models import BasePGModel class SurrogatePGModel(BasePGModel): def train(self, batch, num_epochs=1): batch["actions"] = self._to_tensor(batch["actions"]) batch["advantages"] = self._to_tensor(b...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/surrogate_pg_model_deprecated.py
0.787523
0.422505
surrogate_pg_model_deprecated.py
pypi
import torch import torchrl.utils as U from torchrl.models import SurrogatePGModel from torch.distributions.kl import kl_divergence class PPOAdaptiveModel(SurrogatePGModel): """ Proximal Policy Optimization as described in https://arxiv.org/pdf/1707.06347.pdf. Parameters ---------- num_epochs: i...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/ppo_adaptive_model.py
0.880951
0.360433
ppo_adaptive_model.py
pypi
import torch import torch.nn.functional as F from torch.distributions import Categorical, Normal import torchrl.utils as U from torchrl.models import BaseModel class BasePGModel(BaseModel): """ Base class for all Policy Gradient Models, has some basic functionalities. Parameters ---------- polic...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/models/base_pg_model_deprecated.py
0.943634
0.464051
base_pg_model_deprecated.py
pypi
from collections import OrderedDict from torchrl.utils import get_obj, Config from torchrl.nn import SequentialExtended def auto_input_shape(obj_config, input_shape): """ Create the right input parameter for the type of layer Parameters ---------- obj_config: dict A dict containing the fu...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/utils/net_builder.py
0.949646
0.516595
net_builder.py
pypi
import numpy as np import torch from torch.utils.data import DataLoader, TensorDataset from torchrl.utils.memories import SimpleMemory from torchrl.utils import to_tensor, join_first_dims class Batch(SimpleMemory): def __len__(self): return len(self["state_t"]) def apply_to_all(self, func): ...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/utils/batch.py
0.788665
0.536616
batch.py
pypi
import numpy as np import torch from numbers import Number from collections import OrderedDict from torch.autograd import Variable from torchrl.utils import EPSILON import cv2 from functools import wraps def get_obj(config): """ Creates an object based on the given config. Parameters ---------- c...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/utils/utils.py
0.858837
0.611034
utils.py
pypi
from abc import ABCMeta from collections import OrderedDict import yaml from yaml.representer import Representer # Support for abstract classes Representer.add_representer(ABCMeta, Representer.represent_name) class Config: """ Configuration object used for initializing an Agent. It maintains the order f...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/utils/config/config.py
0.882782
0.233215
config.py
pypi
import gym from torchrl.envs.base_env import BaseEnv import torchrl.utils as U class GymEnv(BaseEnv): """ Creates and wraps a gym environment. Parameters ---------- env_name: str The Gym ID of the env. For a list of available envs check `this <https://gym.openai.com/envs/>`_ page....
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/envs/gym_env.py
0.94651
0.630059
gym_env.py
pypi
from abc import ABC, abstractmethod class BaseEnv(ABC): """ Abstract base class used for implementing new environments. Includes some basic functionalities, like the option to use a running mean and standard deviation for normalizing states. Parameters ---------- env_name: str Th...
/reward-0.0.4.tar.gz/reward-0.0.4/torchrl/envs/base_env.py
0.963532
0.670221
base_env.py
pypi
from typing import Generic, TypeVar, Any, SupportsFloat ObsType = TypeVar("ObsType") ActType = TypeVar("ActType") RenderFrame = TypeVar("RenderFrame") class RewardsEnv(Generic[ObsType, ActType]): """ rewards_envs generic class for implementing and integrating the rewards.ai agents environment. An environmen...
/rewards_envs-0.1.3.tar.gz/rewards_envs-0.1.3/rewards_envs/core.py
0.94913
0.870982
core.py
pypi
import os import math import pygame from pathlib import Path import matplotlib.pyplot as plt from pydantic import BaseModel, Field from typing import Any, Callable, Dict, List, Optional, Tuple, Union, SupportsFloat class CarConfig(BaseModel): car_scale: int = Field(default=500) drive_factor: int = Field(defau...
/rewards_envs-0.1.3.tar.gz/rewards_envs-0.1.3/rewards_envs/engines/pygame/car_race/car_race.py
0.840324
0.395543
car_race.py
pypi
import os import json import torch import shutil from .config import CONFIG from typing import Optional, Union, Any, Dict class RootMeanSquaredError(torch.nn.Module): def __init__(self): """Root mean squared error function in PyTorch""" super(RootMeanSquaredError, self).__init__() def for...
/rewards_experimental-0.0.2-py3-none-any.whl/rewards_experimental/utils.py
0.742141
0.216746
utils.py
pypi
import os import torch import random import numpy as np import torch.nn as nn import torch.optim as optim from typing import Any, List, Union from .agent import Agent from .utils import RootMeanSquaredError, MeanAbsoluteError class QTrainer(Agent): def __init__(self, **training_params): self.lr = t...
/rewards_experimental-0.0.2-py3-none-any.whl/rewards_experimental/trainer.py
0.847842
0.346196
trainer.py
pypi
# **rewards** ### A low code sdk for crearing custom environments and deep RL agents. <br> ### **Installation** **`[linux]`** Installing `rewards` is easy in linux. First clone the repository by running ```bash git clone https://github.com/rewards/rewards.git ``` One cloned go to the repository and make sure...
/rewards-1.0.2.tar.gz/rewards-1.0.2/README.md
0.790247
0.873593
README.md
pypi
import inspect import time from dataclasses import dataclass from typing import Callable, List, Optional, Tuple, Union import pandas as pd import pygame import torch import wandb from .envs.car import CarGame from .models import LinearQNet from .trainer import QTrainer # TODO: Make a video recording feature (that wi...
/rewardsAI-0.0.9-py3-none-any.whl/rewards/workflow.py
0.613352
0.253613
workflow.py
pypi
import os import random from collections import deque from dataclasses import dataclass from pathlib import Path from typing import Any, List, Optional, Union import numpy as np import torch # TODO: # - Use Hydra for configuration management @dataclass class AgentConf: MAX_MEMORY: int = 100000 BATCH_SIZE: i...
/rewardsAI-0.0.9-py3-none-any.whl/rewards/agent.py
0.704567
0.525125
agent.py
pypi
import os import random from typing import Any, List, Union import numpy as np import torch import torch.nn as nn import torch.optim as optim from .agent import Agent # TODO: # - Move RMSE, MAE to utils module class RootMeanSquaredError(torch.nn.Module): def __init__(self): """Root mean squared error f...
/rewardsAI-0.0.9-py3-none-any.whl/rewards/trainer.py
0.824533
0.555073
trainer.py
pypi
import os from typing import List, Optional import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class DeepNet(nn.Module): """ Base Class for all the models that will be added from here and inherited from this class. """ def __init__(self) -> None: s...
/rewardsAI-0.0.9-py3-none-any.whl/rewards/models.py
0.846451
0.290723
models.py
pypi
"""Network clients used to communicate with the Rewind server.""" import logging import zmq logger = logging.getLogger(__name__) class QueryException(Exception): """Raised when rewind server returns an error. Usually this exception means you have used a non-existing query key. """ pass def q...
/rewind-client-0.3.0.tar.gz/rewind-client-0.3.0/rewind/client/__init__.py
0.890413
0.49646
__init__.py
pypi
======= Rewind ======= .. image:: https://secure.travis-ci.org/JensRantil/rewind.png?branch=develop :target: http://travis-ci.org/#!/JensRantil/rewind Have you ever been nervous of all those DBMSs schema changes when you are deploying your applications? They are gonna take too long, or break backward compatibility...
/rewind-0.3.1.tar.gz/rewind-0.3.1/README.rst
0.806319
0.818156
README.rst
pypi
from warnings import warn from werkzeug.datastructures import ImmutableMultiDict class dictobj(dict): """ a dict-like object: * whose values can also be get/set using the `obj.key` notation * object[key] returns None if the key is not known """ def __getattr__(self, name): return self[na...
/rework_ui-0.14.0-py3-none-any.whl/rework_ui/helper.py
0.91487
0.339745
helper.py
pypi
import analyzing_data_slice_win_design import global_data import numpy as np import ctypes from PyQt5 import QtWidgets class AnalyzingDataSliceWin(QtWidgets.QMainWindow, analyzing_data_slice_win_design.Ui_MainWindow): def __init__(self): super().__init__() self.setupUi(self) self.setFixedS...
/rewrite_for_file-0.1.0.tar.gz/rewrite_for_file-0.1.0/rewrite_for_file/AnalyzingDataSliceWin.py
0.41478
0.223398
AnalyzingDataSliceWin.py
pypi
# Rex: an open-source quadruped robot ![](images/intro.gif) The goal of this project is to train an open-source 3D printed quadruped robot exploring `Reinforcement Learning` and `OpenAI Gym`. The aim is to let the robot learns domestic and generic tasks in the simulations and then successfully transfer the knowledg...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/README.md
0.855851
0.989491
README.md
pypi
r"""Running a pre-trained ppo agent on rex environments""" import logging import os import site import time import tensorflow.compat.v1 as tf from rex_gym.agents.scripts import utility from rex_gym.agents.ppo import simple_ppo_agent from rex_gym.util import flag_mapper class PolicyPlayer: def __init__(self, env_...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/playground/policy_player.py
0.510985
0.298542
policy_player.py
pypi
"""Memory that stores episodes.""" import tensorflow as tf class EpisodeMemory(object): def __init__(self, template, capacity, max_length, scope): """ Create a memory that stores episodes. Each transition tuple consists of quantities specified by the template. These quantities wo...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/ppo/memory.py
0.970951
0.667486
memory.py
pypi
"""Normalize tensors based on streaming estimates of mean and variance.""" import tensorflow as tf class StreamingNormalize(object): """Normalize tensors based on streaming estimates of mean and variance.""" def __init__(self, template, center=True, scale=True, clip=10, name='normalize'): """Normaliz...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/ppo/normalize.py
0.985936
0.704376
normalize.py
pypi
import tensorflow as tf from . import normalize from ..scripts import utility class SimplePPOPolicy(object): """A simple PPO policy that is independent to the PPO infrastructure. This class restores the policy network from a tensorflow checkpoint that was learned from PPO training. The purpose of this class ...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/ppo/simple_ppo_agent.py
0.941021
0.590927
simple_ppo_agent.py
pypi
"""Utilities for the PPO algorithm.""" import collections import math import re import tensorflow as tf from tensorflow.python.client import device_lib def create_nested_vars(tensors): """Create variables matching a nested tuple of tensors. Args: tensors: Nested tuple of list of tensors. Returns: N...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/ppo/utility.py
0.948238
0.562237
utility.py
pypi
import collections import tensorflow as tf import tensorflow_probability as tfp from . import memory from . import normalize from . import utility _NetworkOutput = collections.namedtuple('NetworkOutput', 'policy, mean, logstd, value, state') class PPOAlgorithm(object): """A vectorized implementation of the PPO...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/ppo/algorithm.py
0.939032
0.296629
algorithm.py
pypi
"""Networks for the PPO algorithm defined as recurrent cells.""" import tensorflow as tf _MEAN_WEIGHTS_INITIALIZER = tf.contrib.layers.variance_scaling_initializer(factor=0.1) _LOGSTD_INITIALIZER = tf.random_normal_initializer(-1, 1e-10) class LinearGaussianPolicy(tf.contrib.rnn.RNNCell): """Indepent linear netw...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/scripts/networks.py
0.942639
0.483526
networks.py
pypi
"""Example configurations using the PPO algorithm.""" from ..ppo.algorithm import PPOAlgorithm from ..scripts import networks def default(): """Default configuration for PPO.""" # General algorithm = PPOAlgorithm num_agents = 25 eval_episodes = 25 use_gpu = False # Network network = ...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/scripts/configs.py
0.89217
0.407805
configs.py
pypi
"""Utilities for using reinforcement learning algorithms.""" import logging import os import re import warnings import ruamel.yaml as yaml import tensorflow as tf from rex_gym.agents.tools import wrappers from rex_gym.agents.tools.attr_dict import AttrDict from rex_gym.agents.tools.batch_env import BatchEnv from rex_...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/scripts/utility.py
0.88833
0.42674
utility.py
pypi
"""Batch of environments inside the TensorFlow graph.""" import gym import tensorflow as tf class InGraphBatchEnv(object): """Batch of environments inside the TensorFlow graph. The batch of environments will be stepped and reset inside of the graph using a tf.py_func(). The current batch of observations, act...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/tools/in_graph_batch_env.py
0.974203
0.719069
in_graph_batch_env.py
pypi
"""Combine multiple environments to step them in batch.""" import numpy as np class BatchEnv(object): """Combine multiple environments to step them in batch.""" def __init__(self, envs, blocking): """Combine multiple environments to step them in batch. To step environments in parallel, environme...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/tools/batch_env.py
0.959364
0.69795
batch_env.py
pypi
"""Mock environment for testing reinforcement learning code.""" import gym import gym.spaces import numpy as np class MockEnvironment(object): """Generate random agent input and keep track of statistics.""" def __init__(self, observ_shape, action_shape, min_duration, max_duration): """Generate random...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/tools/mock_environment.py
0.962831
0.640425
mock_environment.py
pypi
"""Execute operations in a loop and coordinate logging and checkpoints.""" import collections import os import tensorflow as tf from . import streaming_mean _Phase = collections.namedtuple( 'Phase', 'name, writer, op, batch, steps, feed, report_every, log_every,' 'checkpoint_every') class Loop(obj...
/rex_gym-0.2.7.tar.gz/rex_gym-0.2.7/rex_gym/agents/tools/loop.py
0.958972
0.51623
loop.py
pypi