code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class CharColumn(column.Column): """A Column holding single ASCII-character values. This implementation DOES NOT support null values. The i...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/charcolumn.py
0.758689
0.662073
charcolumn.py
pypi
import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class StringColumn(column.Column): """A Column holding string values (str). This implementation DOES NOT support null values or empty strings. ...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/stringcolumn.py
0.699768
0.464537
stringcolumn.py
pypi
import raven.struct.dataframe.bytecolumn as bytecolumn import raven.struct.dataframe.shortcolumn as shortcolumn import raven.struct.dataframe.intcolumn as intcolumn import raven.struct.dataframe.longcolumn as longcolumn import raven.struct.dataframe.floatcolumn as floatcolumn import raven.struct.dataframe.doublecolumn ...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/_columnutils.py
0.849191
0.395134
_columnutils.py
pypi
from struct import pack import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class DoubleColumn(column.Column): """A Column holding double values (float64). This implementation DOES NOT support nu...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/doublecolumn.py
0.758063
0.523908
doublecolumn.py
pypi
import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class BooleanColumn(column.Column): """A Column holding boolean values (bool). This implementation DOES NOT support null values. """ TY...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/booleancolumn.py
0.767298
0.510985
booleancolumn.py
pypi
import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class LongColumn(column.Column): """A Column holding long values (int64). This implementation DOES NOT support null values. """ TYPE_CO...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/longcolumn.py
0.717606
0.638863
longcolumn.py
pypi
import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class ByteColumn(column.Column): """A Column holding byte values (int8). This implementation DOES NOT support null values. """ TYPE_COD...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/bytecolumn.py
0.781122
0.552932
bytecolumn.py
pypi
from struct import pack import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class FloatColumn(column.Column): """A Column holding float values (float32). This implementation DOES NOT support null...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/floatcolumn.py
0.773516
0.553747
floatcolumn.py
pypi
from struct import unpack import numpy as np import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.column as column import raven.struct.dataframe._columnutils as utils class BinaryColumn(column.Column): """A Column holding binary values (bytearray). This implementation DOES NOT suppor...
/raven_pydf-1.1.4-py3-none-any.whl/raven/struct/dataframe/binarycolumn.py
0.703448
0.6081
binarycolumn.py
pypi
import re as regex_matcher import raven.struct.dataframe.core as dataframe import raven.struct.dataframe.stringcolumn as stringcolumn import raven.struct.dataframe._dataframeutils as dataframeutils # pylint: disable=C0103, R0911, R0912, R0914, R0915, R1705 def read(filepath, separator=",", header=True, encoding="utf...
/raven_pydf-1.1.4-py3-none-any.whl/raven/io/dataframe/csvfiles.py
0.736021
0.463869
csvfiles.py
pypi
======= History ======= 0.12.1 (2023-06-01) ------------------- This release is largely a bugfix to better stabilize performance and enhance the documentation. * Avoid repeatedly calling `xr.open_dataset` in `OutputReader`'s `hydrograph` and `storage` properties. This seems to cause kernel failures in Jupyter notebo...
/ravenpy-0.12.1.tar.gz/ravenpy-0.12.1/HISTORY.rst
0.90435
0.65557
HISTORY.rst
pypi
# 07 - Making and using hostart files ## Create a hotstart file to resume a simulation from given hydrological conditions Hydrological models have state variables that describe the snow pack, soil moisture, underground reservoirs, etc. Typically, those cannot be measured empirically, so one way to estimate those val...
/ravenpy-0.12.1.tar.gz/ravenpy-0.12.1/docs/notebooks/07_Making_and_using_hotstart_files.ipynb
0.681303
0.985328
07_Making_and_using_hotstart_files.ipynb
pypi
# Hindcasting with CaSPAr-Archived ECCC forecasts This notebook shows how to perform a streamflow hindcast, using CaSPar archived weather forecasts. It generates the hindcasts and plots them. CaSPAr (Canadian Surface Prediction Archive) is an archive of historical ECCC forecasts developed by Juliane Mai at the Univer...
/ravenpy-0.12.1.tar.gz/ravenpy-0.12.1/docs/notebooks/12_Performing_hindcasting_experiments.ipynb
0.553988
0.981329
12_Performing_hindcasting_experiments.ipynb
pypi
# 11 - Climatological ESP forecasting ## Extended Streamflow Prediction (ESP) forecasts from climatological time series This notebook shows how to perform a climatological Extended Streamflow Prediction (ESP) forecast, using historical weather as a proxy for future weather. The general idea is to initialize the sta...
/ravenpy-0.12.1.tar.gz/ravenpy-0.12.1/docs/notebooks/11_Climatological_ESP_forecasting.ipynb
0.7696
0.987166
11_Climatological_ESP_forecasting.ipynb
pypi
# Probabilistic flood risk assessment In this notebook, we combine the forecasting abilities and the time series analysis capabilities in a single seamless process to estimate the flood risk of a probabilistic forecast. As an example, we first perform a frequency analysis on an observed time series, then estimate the ...
/ravenpy-0.12.1.tar.gz/ravenpy-0.12.1/docs/notebooks/Assess_probabilistic_flood_risk.ipynb
0.791176
0.982938
Assess_probabilistic_flood_risk.ipynb
pypi
import requests # put in config from ravestate_nlp.yes_no import YesNo, YesNoWrapper NEW_SESSION_URL = "https://srv11.akinator.com:9152/ws/new_session?callback=&partner=&player=website-desktop&uid_ext_session=&frontaddr=NDYuMTA1LjExMC40NQ==&constraint=ETAT<>'AV'" ANSWER_URL = "https://srv11.akinator.com:9152/ws/answe...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_akinator/api.py
0.493897
0.210888
api.py
pypi
from datetime import datetime from random import randint from typing import List, Dict import ravestate as rs import ravestate_rawio as rawio import ravestate_ros2 as ros2 from reggol import get_logger logger = get_logger(__name__) ROBOY_COGNITION_AVAILABLE = False try: from roboy_cognition_msgs.msg import Recog...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_stalker/__init__.py
0.676406
0.177989
__init__.py
pypi
from enum import Enum NEGATION_TUPLE = ["neg", "not"] YES_SYNONYMS = {"yes", "y", "yeah", "sure", "definitely", "certainly"} NO_SYNONYMS = {"no", "n", "nope", "negative", "never", "nay"} PROBABLY_SYNONYMS = {"probably", "likely", "possibly", "perhaps", "maybe"} DO_NOT_KNOW_SET = {"know", "understand", "clue"} class ...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_nlp/yes_no.py
0.583203
0.177205
yes_no.py
pypi
from ravestate_nlp.question_word import QuestionWord from ravestate_nlp.triple import Triple from spacy.tokens import Token SUBJECT_SET = {"nsubj"} OBJECT_SET = {"dobj", "attr", "advmod", "pobj"} PREDICATE_SET = {"ROOT", "conj"} PREDICATE_AUX_SET = {"acomp", "aux", "xcomp"} VERB_AUX_SET = {"VERB", "ADJ"} RECURSION_BLA...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_nlp/extract_triples.py
0.582966
0.30439
extract_triples.py
pypi
from spacy.tokens import Token from typing import Optional, Set, Union, Tuple from ravestate_nlp.question_word import QuestionWord from ravestate_nlp.triple_match_result import TripleMatchResult class Triple: _subject: Union[Token, QuestionWord] _predicate: Token _object: Union[Token, QuestionWord] _...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_nlp/triple.py
0.903204
0.262965
triple.py
pypi
import re from typing import Dict import torch import torch.nn.functional as F from pytorch_transformers import GPT2Tokenizer, GPT2LMHeadModel from reggol import get_logger logger = get_logger(__name__) def top_k_logits(logits, k): """ Masks everything but the k top entries as -infinity (1e10). Used to ...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_wildtalk/gpt2_backend.py
0.584627
0.453746
gpt2_backend.py
pypi
import re from os.path import join, dirname, realpath from typing import Dict import torch import torch.nn.functional as F from pytorch_pretrained_bert import OpenAIGPTLMHeadModel, OpenAIGPTTokenizer, cached_path import tarfile import tempfile from itertools import chain from reggol import get_logger logger = get_log...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_wildtalk/convai_gpt_backend.py
0.797517
0.388966
convai_gpt_backend.py
pypi
from typing import List def check_if_list(value): if isinstance(value, List): return value raise AttributeError("Value is not a list: " + str(value)) class QAPhrases: """ Getting values from a yml file Parses files containing predefined questions and answers Expects the following inp...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_verbaliser/qa_phrases.py
0.75274
0.473901
qa_phrases.py
pypi
import os import random import yaml from typing import Dict, List, Optional from ravestate_verbaliser.qa_phrases import QAPhrases from reggol import get_logger logger = get_logger(__name__) """ Produces actual utterances. This should in the future lead to diversifying the ways Roboy is expressing information. """ TY...
/ravestate-0.7.0rc0-py3-none-any.whl/ravestate_verbaliser/verbaliser.py
0.634996
0.293329
verbaliser.py
pypi
![Ravioli](ravioli.png "Ravioli") A tool for calculating simple, useful complexity metrics -- notably the [Koopman Spaghetti Factor (KSF)](https://betterembsw.blogspot.com/2017/08/the-spaghetti-factor-software.html) -- for C. > I've had to review code that has spaghetti-level complexity in control flow (too high cycl...
/ravioli-0.3.0.tar.gz/ravioli-0.3.0/README.md
0.441914
0.73557
README.md
pypi
# RavML Ravenverse's Machine Learning Library RavML is the machine learning library based on RavOp. It contains implementations of various machine learning algorithms like ordinary least squares, linear regression, logistic regression, KNN, Kmeans, Mini batch Kmeans, Decision Tree classifier, and Naive Bayes classifie...
/ravml-0.5.tar.gz/ravml-0.5/README.md
0.690246
0.983101
README.md
pypi
vendors_dictionary = { '00:00:01': 'Xerox Corporation', '00:00:02': 'Xerox Corporation', '00:00:03': 'Xerox Corporation', '00:00:04': 'Xerox Corporation', '00:00:05': 'Xerox Corporation', '00:00:06': 'Xerox Corporation', '00:00:07': 'Xerox Corporation', '00:00:08': 'Xerox Corporation', ...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Utils/vendors.py
0.567697
0.68602
vendors.py
pypi
# region Description """ arp_fuzz.py: ARP fuzzing script Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import from sys import path from os.path import dirname, abspath from argparse import ArgumentParser from socket import socket, AF_PACKET, SOCK_RAW from struct impo...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scripts/ARP/arp_fuzz.py
0.684159
0.174797
arp_fuzz.py
pypi
# region Description """ icmpv6_spoof.py: ICMPv6 NA (Neighbor Advertisement) and NA (Neighbor Advertisement) spoofing Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import from raw_packet.Utils.base import Base from raw_packet.Utils.utils import Utils from raw_packet....
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scripts/IPv6/ipv6_spoof.py
0.789112
0.254833
ipv6_spoof.py
pypi
# region Description """ wat.py: Cross platform WiFi attack tool (wat) Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import from raw_packet.Utils.base import Base from raw_packet.Utils.wifi import WiFi from raw_packet.Utils.tm import ThreadManager from typing import ...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scripts/WiFi/wat.py
0.76769
0.163179
wat.py
pypi
# region Description """ examples.py: Raw-packet examples Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import from sys import path from os.path import dirname, abspath from json import dumps from socket import socket, AF_PACKET, SOCK_RAW # endregion # region Author...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scripts/Others/examples.py
0.475362
0.162945
examples.py
pypi
# region Description """ phishing.py: Phishing HTTP server (phishing) Author: Vladimir Ivanov License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import from raw_packet.Utils.base import Base from raw_packet.Servers.Phishing.phishing import PhishingServer from argparse import ArgumentParser, RawD...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scripts/Phishing/phishing.py
0.730482
0.172381
phishing.py
pypi
# endregion # region Import from raw_packet.Utils.base import Base from raw_packet.Utils.network import RawICMPv6, RawSniff, RawSend from raw_packet.Utils.tm import ThreadManager from time import sleep from random import randint from typing import Union, Dict, List # endregion # region Authorship information __author...
/raw_packet-0.2.1-py3-none-any.whl/raw_packet/Scanners/icmpv6_scanner.py
0.67694
0.171373
icmpv6_scanner.py
pypi
from os import path from importlib import import_module from sys import stdout from raw_sql_migrate import rsm_config from raw_sql_migrate.helpers import MigrationHelper, FileSystemHelper, DatabaseHelper from raw_sql_migrate.engines import database_api from raw_sql_migrate.exceptions import IncorrectMigrationFile _...
/raw-sql-migrate-0.3.4.tar.gz/raw-sql-migrate-0.3.4/raw_sql_migrate/migration.py
0.522446
0.222943
migration.py
pypi
from rawdata_emca.connections import BaseConnector from rawdata_emca.utilities import RawDataUtilities import os import csv class FileDateStrip(BaseConnector): ''' Connector is designed to strip off old data based on a date in a csv file You would use this if you are appending to a file and want to li...
/raw_data_emca-0.9.2.zip/raw_data_emca-0.9.2/rawdata_emca/connections/built_in.py
0.627152
0.303995
built_in.py
pypi
from rawdata_emca.processor import BaseProcessor from rawdata_emca.runner.config_entry import ConfigEntry from rawdata_emca.utilities import csvsort import os import datetime class RawCsvSort(BaseProcessor): """ This is a wrapper class around the module csvsort found here: https://pypi.python.org/pypi/csvsort...
/raw_data_emca-0.9.2.zip/raw_data_emca-0.9.2/rawdata_emca/processor/rawcsvsort.py
0.470007
0.265205
rawcsvsort.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 ...
/rawa_dist_distributions-0.1.tar.gz/rawa_dist_distributions-0.1/rawa_dist_distributions/Gaussiandistribution.py
0.688364
0.853058
Gaussiandistribution.py
pypi
rawes ===== About ----- rawes is an elasticsearch driver for Python. It provides a small level of abstraction above the requests library - enough abstraction to be useful, but not so much to obscure elasticsearch's great [native api](http://www.elasticsearch.org/guide/reference/api/) Features -------- * elasticsearc...
/rawes-0.5.5.tar.gz/rawes-0.5.5/README.md
0.577019
0.819821
README.md
pypi
from cv2 import cornerHarris, findTransformECC, MOTION_TRANSLATION, TERM_CRITERIA_COUNT, TERM_CRITERIA_EPS from numpy import argpartition, array, asarray, eye, column_stack, concatenate, float32, ndarray, ones, split, stack as stack_array, unravel_index from numpy.linalg import norm from PIL import Image from sklearn....
/lens/tca.py
0.918936
0.721007
tca.py
pypi
from lensfunpy import Database, Modifier from PIL import Image from torch import from_numpy, Tensor from torch.nn.functional import grid_sample def lens_grid (metadata: dict, width: int, height: int) -> Tensor: """ Compute lens correction sample grid. This method will return `None` if the grid cannot be ...
/lens/lens.py
0.9504
0.550547
lens.py
pypi
from ctypes import * # noqa class ph1_t(Structure): """Contains color data read by Phase One cameras.""" _fields_ = [ ('format', c_int), ('key_off', c_int), ('tag_21a', c_int), ('t_black', c_int), ('split_col', c_int), ('black_col', c_int), ('split_row...
/rawkit-0.6.0.tar.gz/rawkit-0.6.0/libraw/structs_17.py
0.839142
0.326781
structs_17.py
pypi
from ctypes import * # noqa class ph1_t(Structure): """Contains color data read by Phase One cameras.""" _fields_ = [ ('format', c_int), ('key_off', c_int), ('tag_21a', c_int), ('t_black', c_int), ('split_col', c_int), ('black_col', c_int), ('split_row...
/rawkit-0.6.0.tar.gz/rawkit-0.6.0/libraw/structs_18.py
0.834036
0.336249
structs_18.py
pypi
from ctypes import * # noqa class ph1_t(Structure): """Contains color data read by Phase One cameras.""" _fields_ = [ ('format', c_int), ('key_off', c_int), ('t_black', c_int), ('black_off', c_int), ('split_col', c_int), ('tag_21a', c_int), ('tag_210',...
/rawkit-0.6.0.tar.gz/rawkit-0.6.0/libraw/structs_16.py
0.82828
0.32178
structs_16.py
pypi
from ctypes import * # noqa from ctypes import util from libraw import errors from libraw.callbacks import data_callback from libraw.callbacks import memory_callback from libraw.callbacks import progress_callback from libraw.errors import c_error from libraw import structs_16 from libraw import structs_17 from libraw...
/rawkit-0.6.0.tar.gz/rawkit-0.6.0/libraw/bindings.py
0.63273
0.162148
bindings.py
pypi
from ctypes import c_int class c_error(c_int): """ An error type for LibRaw (since LibRaw errors are ints and you can't distinguish between functions that return an error and functions that return an int that doesn't code for an error). """ class LibRawError(Exception): """ A base exce...
/rawkit-0.6.0.tar.gz/rawkit-0.6.0/libraw/errors.py
0.872619
0.421343
errors.py
pypi
from __future__ import print_function from os.path import split as psplit, join as pjoin from subprocess import Popen, PIPE def back_tick(cmd, ret_err=False, as_str=True, shell=False): """ Run command `cmd`, return stdout, or stdout, stderr if `ret_err` Roughly equivalent to ``check_output`` in Python 2.7 ...
/rawpy-0.12.0-cp27-cp27m-macosx_10_10_x86_64.whl/terryfy/wafutils.py
0.799325
0.183832
wafutils.py
pypi
from pydantic import BaseModel from .perks import Perks class Participant(BaseModel): assists: int baron_kills: int bounty_level: int champ_experience: int champ_level: int champion_id: int champion_name: str champion_transform: int consumables_purchased: int damage_dealt_to_bu...
/rawr_python-0.1.0-py3-none-any.whl/rawr_python/classes/participant.py
0.519765
0.273963
participant.py
pypi
import math class Angle(object): @staticmethod def from_units(value, units): func_name = f'from_{units}' func = getattr(Angle, func_name, None) if func is not None: value = float(value) return func(value) raise ValueError(f"units '{units}' not implemen...
/rawrobotics-orion5-1.5.6.tar.gz/rawrobotics-orion5-1.5.6/orion5/upgrade.py
0.840292
0.361531
upgrade.py
pypi
# rawsec_cli [![mBouamama](https://github.com/mBouamama/rawsec_cli/workflows/Unit%20Test/badge.svg)](https://github.com/mBouamama/rawsec_cli) [![PyPI](https://img.shields.io/pypi/v/rawsec-cli)](https://pypi.org/project/rawsec-cli/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rawsec-cli)](https://py...
/rawsec-cli-1.2.0.tar.gz/rawsec-cli-1.2.0/README.md
0.522933
0.92976
README.md
pypi
from typing import Dict from typing import List import requests def load_inventory_json() -> Dict: """ Get rawsec inventory json. Returns ------- Dict rawsec dict of project """ r = requests.get("https://inventory.raw.pm/api/api.json") if r.status_code != 200 or "tools" not i...
/rawsec-cli-1.2.0.tar.gz/rawsec-cli-1.2.0/rawsec_cli/tools.py
0.82566
0.311676
tools.py
pypi
from typing import Dict from typing import List from rawsec_cli.tools import get_all_ctf from rawsec_cli.tools import get_all_operating from rawsec_cli.tools import get_all_resources from rawsec_cli.tools import get_all_tools def search_project_tools(json: Dict, project: str) -> List[Dict]: """ Search projec...
/rawsec-cli-1.2.0.tar.gz/rawsec-cli-1.2.0/rawsec_cli/search.py
0.850577
0.183411
search.py
pypi
import click from rawsec_cli.filter import filter_projects from rawsec_cli.output import print_output from rawsec_cli.search import search_project @click.command() @click.argument("project") @click.pass_context @click.option("--lang", "-l", help="Filter by Language") @click.option( "--paid", "-p", is_fla...
/rawsec-cli-1.2.0.tar.gz/rawsec-cli-1.2.0/rawsec_cli/cli/command/search_command.py
0.639849
0.197425
search_command.py
pypi
import sys import click from rawsec_cli.filter import filter_projects from rawsec_cli.output import print_output from rawsec_cli.tools import get_all_ctf from rawsec_cli.tools import get_all_operating from rawsec_cli.tools import get_all_resources from rawsec_cli.tools import get_all_tools from rawsec_cli.tools impor...
/rawsec-cli-1.2.0.tar.gz/rawsec-cli-1.2.0/rawsec_cli/cli/command/list_command.py
0.526586
0.172729
list_command.py
pypi
import functools import json from typing import Sequence from absl import app from flax import linen as nn import jax import jax.numpy as jnp import optax import rax import tensorflow as tf import tensorflow_datasets as tfds def read_data(batch_size: int = 1024, lists_per_batch: int = 64): """Reads ranking data in...
/rax-0.3.0.tar.gz/rax-0.3.0/examples/segmentation/main.py
0.933241
0.76708
main.py
pypi
from typing import Mapping import seqio import t5 import tensorflow as tf def _msmarco_preprocessor( dataset: tf.data.Dataset, output_features: Mapping[str, t5.data.Feature], shuffle_lists: bool = True, ) -> tf.data.Dataset: """Preprocessor for MS-Marco listwise ranking task. Args: dataset: The ...
/rax-0.3.0.tar.gz/rax-0.3.0/examples/t5x/tasks.py
0.943951
0.470433
tasks.py
pypi
import collections import functools import json from typing import Mapping, Optional, Sequence, Tuple from absl import app import flax import flax.linen as nn import jax import jax.numpy as jnp import optax import rax # Used for loading data and data-preprocessing. import tensorflow as tf import tensorflow_datasets...
/rax-0.3.0.tar.gz/rax-0.3.0/examples/flax_integration/main.py
0.928757
0.369514
main.py
pypi
import functools import json from typing import Optional, Sequence from absl import app from clu.metrics import Average import jax import jax.numpy as jnp import rax # Used for loading data and data-preprocessing. import tensorflow as tf import tensorflow_datasets as tfds def prepare_dataset( ds: tf.data.Datase...
/rax-0.3.0.tar.gz/rax-0.3.0/examples/approx_metrics/main.py
0.926943
0.462655
main.py
pypi
import novaclient.auth_plugin from novaclient import exceptions as exc from novaclient.i18n import _ IDENTITY_US = "https://identity.api.rackspacecloud.com/v2.0/" IDENTITY_UK = "https://lon.identity.api.rackspacecloud.com/v2.0/" def determine_auth_url(args): """Use Region to determine auth url if none is speci...
/raxtoken-auth-openstack-0.1.3.tar.gz/raxtoken-auth-openstack-0.1.3/raxtoken_auth_openstack/plugin.py
0.625095
0.163412
plugin.py
pypi
import typing from apache_beam import (pvalue, PTransform, Create, Reshuffle, Windowing, GroupByKey, ParDo) from apache_beam.io import Read from apache_beam.pipeline import PTransformOverride from apache_beam.runners.direct.direct_runner import _GroupAlsoByWindowDoFn from apache_beam.transform...
/ray_beam-0.0.1-py3-none-any.whl/ray_beam_runner/overrides.py
0.690037
0.305147
overrides.py
pypi
from typing import TypeVar, Iterable, Any import ray from ray.data.impl.compute import ComputeStrategy from ray.types import ObjectRef from ray.data.block import Block from ray.data.impl.block_list import BlockList from ray.data.impl.progress_bar import ProgressBar T = TypeVar("T") U = TypeVar("U") # A class type th...
/ray_beam-0.0.1-py3-none-any.whl/ray_beam_runner/custom_actor_pool.py
0.734215
0.152884
custom_actor_pool.py
pypi
# pytype: skip-file import logging import ray from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.runners.direct.direct_runner import BundleBasedDirectRunner from ray_beam_runner.collection import CollectionMap from ray_beam_runner.overrides import _get_overrides from ray_beam_runner.tra...
/ray_beam-0.0.1-py3-none-any.whl/ray_beam_runner/ray_runner.py
0.860457
0.234801
ray_runner.py
pypi
import logging import time import ray from ray import ray_constants logger = logging.getLogger(__name__) class Cluster: def __init__(self, initialize_head=False, connect=False, head_node_args=None, shutdown_at_exit=True): """Initializes...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/cluster_utils.py
0.816955
0.248546
cluster_utils.py
pypi
import ray.worker import logging from ray._private.client_mode_hook import client_mode_hook logger = logging.getLogger(__name__) class RuntimeContext(object): """A class used for getting runtime context.""" def __init__(self, worker): assert worker is not None self.worker = worker def g...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/runtime_context.py
0.842928
0.240072
runtime_context.py
pypi
from collections import namedtuple import logging import os import re import subprocess import sys import ray import ray.ray_constants as ray_constants logger = logging.getLogger(__name__) # Prefix for the node id resource that is automatically added to each node. # For example, a node may have id `node:172.23.42.1`...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/resource_spec.py
0.752013
0.327238
resource_spec.py
pypi
import ray class JobConfig: """A class used to store the configurations of a job. Attributes: worker_env (dict): Environment variables to be set on worker processes. num_java_workers_per_process (int): The number of java workers per worker process. jvm_options ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/job_config.py
0.713731
0.200421
job_config.py
pypi
import abc import logging import os import shutil import random import urllib from collections import namedtuple from typing import List, IO, Tuple import ray from ray.ray_constants import DEFAULT_OBJECT_PREFIX from ray._raylet import ObjectRef ParsedURL = namedtuple("ParsedURL", "base_url, offset, size") logger = lo...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/external_storage.py
0.865934
0.383035
external_storage.py
pypi
from collections import deque, OrderedDict import numpy as np from ray.rllib.utils import force_list from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() def unflatten(vector, shapes): i = 0 arrays = [] for shape in shapes: size = np.prod(shape, dtype=np.int) ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/experimental/tf_utils.py
0.939269
0.493958
tf_utils.py
pypi
import time from typing import List, Iterable, Tuple, Callable, Any, Union import ray from ray.cluster_utils import Cluster from ray import ObjectRef # TODO(ekl) why doesn't TypeVar() deserialize properly in Ray? # The type produced by the input reader function. InType = Any # The type produced by the output writer f...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/experimental/shuffle.py
0.726911
0.494812
shuffle.py
pypi
import base64 from collections import defaultdict from enum import Enum from typing import List import ray from ray._raylet import (TaskID, ActorID, JobID) from ray.internal.internal_api import node_stats import logging logger = logging.getLogger(__name__) # These values are used to calculate if objectRefs are act...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/new_dashboard/memory_utils.py
0.735831
0.243463
memory_utils.py
pypi
import logging import ray._private.utils logger = logging.getLogger(__name__) CPU_SHARES_PATH = "/sys/fs/cgroup/cpu/cpu.shares" CPU_USAGE_PATH = "/sys/fs/cgroup/cpuacct/cpuacct.usage" PROC_STAT_PATH = "/proc/stat" container_num_cpus = None host_num_cpus = None last_cpu_usage = None last_system_usage = None def c...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/new_dashboard/k8s_utils.py
0.67104
0.208501
k8s_utils.py
pypi
import time import re from collections import defaultdict PYCLASSNAME_RE = re.compile(r"(.+?)\(") def construct_actor_groups(actors): """actors is a dict from actor id to an actor or an actor creation task The shared fields currently are "actorClass", "actorId", and "state" """ actor_groups = _...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/new_dashboard/actor_utils.py
0.419172
0.199776
actor_utils.py
pypi
import gym from ray.rllib.models.modelv2 import ModelV2 from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.utils.annotations import override from ray.rllib.utils.framework import try_import_torch torch, nn = try_import_torch() class OnlineLinearRegression(nn.Module): def __init__(self,...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/bandits/models/linear_regression.py
0.909757
0.510558
linear_regression.py
pypi
import logging import time from gym import spaces from ray.rllib.agents.trainer import with_common_config from ray.rllib.contrib.bandits.models.linear_regression import \ DiscreteLinearModelThompsonSampling, \ DiscreteLinearModelUCB, DiscreteLinearModel, \ ParametricLinearModelThompsonSampling, ParametricL...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/bandits/agents/policy.py
0.635336
0.342737
policy.py
pypi
import copy import gym import numpy as np from gym import spaces DEFAULT_CONFIG_LINEAR = { "feature_dim": 8, "num_actions": 4, "reward_noise_std": 0.01 } class LinearDiscreteEnv(gym.Env): """Samples data from linearly parameterized arms. The reward for context X and arm i is given by X^T * thet...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/bandits/envs/discrete.py
0.833697
0.55441
discrete.py
pypi
import copy import gym import numpy as np from gym import spaces DEFAULT_RECO_CONFIG = { "num_users": 1, "num_items": 100, "feature_dim": 16, "slate_size": 1, "num_candidates": 25, "seed": 1 } class ParametricItemRecoEnv(gym.Env): """A recommendation environment which generates items wit...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/bandits/envs/parametric.py
0.672977
0.513729
parametric.py
pypi
from abc import ABC import numpy as np from ray.rllib.models.modelv2 import restore_original_dimensions from ray.rllib.models.preprocessors import get_preprocessor from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.utils.framework import try_import_torch torch, nn = try_import_torch() def ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/alpha_zero/models/custom_torch_models.py
0.960184
0.335024
custom_torch_models.py
pypi
from copy import deepcopy import numpy as np class RankedRewardsBuffer: def __init__(self, buffer_max_length, percentile): self.buffer_max_length = buffer_max_length self.percentile = percentile self.buffer = [] def add_reward(self, reward): if len(self.buffer) < self.buffer_...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/contrib/alpha_zero/core/ranked_rewards.py
0.61855
0.202857
ranked_rewards.py
pypi
import argparse from gym.spaces import Box, Discrete import numpy as np from ray.rllib.examples.models.custom_model_api import DuelingQModel, \ TorchDuelingQModel, ContActionQModel, TorchContActionQModel from ray.rllib.models.catalog import ModelCatalog, MODEL_DEFAULTS from ray.rllib.utils.framework import try_imp...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/custom_model_api.py
0.854566
0.334562
custom_model_api.py
pypi
import argparse import os import ray from ray import tune from ray.rllib.env.wrappers.unity3d_env import Unity3DEnv from ray.rllib.utils.test_utils import check_learning_achieved parser = argparse.ArgumentParser() parser.add_argument( "--env", type=str, default="3DBall", choices=[ "3DBall", ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/unity3d_env_local.py
0.690142
0.226014
unity3d_env_local.py
pypi
import argparse import gym import requests from starlette.requests import Request import ray import ray.rllib.agents.dqn as dqn from ray.rllib.env.wrappers.atari_wrappers import FrameStack, WarpFrame from ray import serve parser = argparse.ArgumentParser() parser.add_argument( "--framework", choices=["tf2", "tf",...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/serve_and_rllib.py
0.775137
0.224597
serve_and_rllib.py
pypi
from abc import ABC import ray import numpy as np from ray.rllib import Policy from ray.rllib.agents import with_common_config from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.evaluation.worker_set import WorkerSet from ray.rllib.execution.metric_ops import StandardMetricsReporting from ray...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/random_parametric_agent.py
0.888704
0.188473
random_parametric_agent.py
pypi
from typing import Dict import argparse import numpy as np import os import ray from ray import tune from ray.rllib.agents.callbacks import DefaultCallbacks from ray.rllib.env import BaseEnv from ray.rllib.evaluation import MultiAgentEpisode, RolloutWorker from ray.rllib.policy import Policy from ray.rllib.policy.samp...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/custom_metrics_and_callbacks.py
0.863103
0.231973
custom_metrics_and_callbacks.py
pypi
import argparse from gym.spaces import Discrete, Tuple import logging import os import ray from ray import tune from ray.tune import function from ray.rllib.examples.env.windy_maze_env import WindyMazeEnv, \ HierarchicalWindyMazeEnv from ray.rllib.utils.test_utils import check_learning_achieved parser = argparse....
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/hierarchical_training.py
0.632389
0.150559
hierarchical_training.py
pypi
from gym.spaces import Box, Discrete import numpy as np from rllib.models.tf.attention_net import TrXLNet from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() def bit_shift_generator(seq_length, shift, batch_size): while True: values = np.array([0., 1.], dtype=np.float32) ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/attention_net_supervised.py
0.917635
0.35081
attention_net_supervised.py
pypi
import argparse import os import random import ray from ray import tune from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.examples.models.eager_model import EagerModel from ray.rllib.models import ModelCatalog from ray.rllib.policy.sample_batch import SampleBatch from ray.rllib.policy.tf_polic...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/eager_execution.py
0.868757
0.245215
eager_execution.py
pypi
import argparse import gym import os import ray from ray.rllib.agents.dqn import DQNTrainer, DQNTFPolicy, DQNTorchPolicy from ray.rllib.agents.ppo import PPOTrainer, PPOTFPolicy, PPOTorchPolicy from ray.rllib.examples.env.multi_agent import MultiAgentCartPole from ray.tune.logger import pretty_print from ray.tune.regi...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/multi_agent_two_trainers.py
0.730578
0.209814
multi_agent_two_trainers.py
pypi
import argparse import numpy as np from gym.spaces import Discrete import os import ray from ray import tune from ray.rllib.agents.ppo.ppo import PPOTrainer from ray.rllib.agents.ppo.ppo_tf_policy import PPOTFPolicy, KLCoeffMixin, \ ppo_surrogate_loss as tf_loss from ray.rllib.agents.ppo.ppo_torch_policy import PP...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/centralized_critic.py
0.891823
0.274157
centralized_critic.py
pypi
import argparse from gym.spaces import Discrete, Box import numpy as np import os from ray import tune from ray.rllib.examples.env.random_env import RandomEnv from ray.rllib.examples.models.mobilenet_v2_with_lstm_models import \ MobileV2PlusRNNModel, TorchMobileV2PlusRNNModel from ray.rllib.models import ModelCat...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/mobilenet_v2_with_lstm.py
0.75183
0.193776
mobilenet_v2_with_lstm.py
pypi
import argparse from gym.spaces import Tuple, MultiDiscrete, Dict, Discrete import os import ray from ray import tune from ray.tune import register_env, grid_search from ray.rllib.env.multi_agent_env import ENV_STATE from ray.rllib.examples.env.two_step_game import TwoStepGame from ray.rllib.utils.test_utils import ch...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/two_step_game.py
0.634204
0.300694
two_step_game.py
pypi
import argparse import gym import numpy as np import ray from gym.spaces import Box, Discrete from ray import tune parser = argparse.ArgumentParser() parser.add_argument( "--framework", choices=["tf2", "tf", "tfe", "torch"], default="tf") parser.add_argument("--stop-iters", type=int, default=10) parser.add_argume...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/env_rendering_and_recording.py
0.896413
0.385346
env_rendering_and_recording.py
pypi
import argparse import gym import os import random import ray from ray import tune from ray.rllib.examples.env.multi_agent import MultiAgentCartPole from ray.rllib.examples.models.shared_weights_model import \ SharedWeightsModel1, SharedWeightsModel2, TF2SharedWeightsModel, \ TorchSharedWeightsModel from ray.r...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/multi_agent_cartpole.py
0.719384
0.188137
multi_agent_cartpole.py
pypi
import argparse import os import ray from ray import tune from ray.rllib.examples.env.look_and_push import LookAndPush, OneHot from ray.rllib.examples.env.repeat_after_me_env import RepeatAfterMeEnv from ray.rllib.examples.env.repeat_initial_obs_env import RepeatInitialObsEnv from ray.rllib.examples.env.stateless_cart...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/attention_net.py
0.713132
0.17545
attention_net.py
pypi
import argparse import os import ray from ray import tune from ray.rllib.agents.ppo import PPOTrainer from ray.rllib.examples.env.coin_game_non_vectorized_env import \ CoinGame, AsymCoinGame parser = argparse.ArgumentParser() parser.add_argument("--tf", action="store_true") parser.add_argument("--stop-iters", typ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/coin_game_env.py
0.621656
0.21963
coin_game_env.py
pypi
import argparse import numpy as np import os import ray from ray import tune def on_episode_start(info): episode = info["episode"] print("episode {} started".format(episode.episode_id)) episode.user_data["pole_angles"] = [] episode.hist_data["pole_angles"] = [] def on_episode_step(info): episo...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/custom_metrics_and_callbacks_legacy.py
0.669421
0.338842
custom_metrics_and_callbacks_legacy.py
pypi
import argparse from gym.spaces import Dict, Tuple, Box, Discrete import os import ray import ray.tune as tune from ray.tune.registry import register_env from ray.rllib.examples.env.nested_space_repeat_after_me_env import \ NestedSpaceRepeatAfterMeEnv from ray.rllib.utils.test_utils import check_learning_achieved ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/nested_action_spaces.py
0.638272
0.16455
nested_action_spaces.py
pypi
import numpy as np import ray import ray.rllib.agents.ppo as ppo from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.models.catalog import ModelCatalog from ray.rllib.utils.framework import try_import_torch torch, _ = try_import_torch() # __sphinx_doc_begin__ # The custom model that will b...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/lstm_auto_wrapping.py
0.7865
0.266876
lstm_auto_wrapping.py
pypi
from copy import deepcopy from numpy import float32 import os from supersuit import normalize_obs_v0, dtype_v0, color_reduction_v0 import ray from ray.rllib.agents.registry import get_trainer_class from ray.rllib.env import PettingZooEnv from pettingzoo.butterfly import pistonball_v1 from ray.tune.registry import reg...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/pettingzoo_env.py
0.742141
0.256107
pettingzoo_env.py
pypi
import argparse import os import ray from ray import tune from ray.rllib.agents.dqn.distributional_q_tf_model import \ DistributionalQTFModel from ray.rllib.models import ModelCatalog from ray.rllib.models.tf.misc import normc_initializer from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.models....
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/custom_keras_model.py
0.868241
0.173989
custom_keras_model.py
pypi
import argparse import gym import os import ray from ray import tune from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.agents.dqn.dqn import DEFAULT_CONFIG as DQN_CONFIG from ray.rllib.agents.dqn.dqn_tf_policy import DQNTFPolicy from ray.rllib.agents.dqn.dqn_torch_policy import DQNTorchPolicy ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/two_trainer_workflow.py
0.698638
0.186539
two_trainer_workflow.py
pypi
import argparse import numpy as np import ray from ray import tune from ray.rllib.utils.filter import Filter from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() parser = argparse.ArgumentParser() parser.add_argument("--run", type=str, default="PPO") parser.add_argument("--stop-iters", ...
/ray_delvewheel-1.3.0.0-cp38-cp38-win_amd64.whl/ray-1.3.0.data/purelib/ray/rllib/examples/custom_observation_filters.py
0.843911
0.242654
custom_observation_filters.py
pypi