id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,200 | ray-project/ray | python/ray/data/dataset.py | ray.data.dataset.Dataset | from ray.data.expressions import Expr
from ray.data.random_access_dataset import RandomAccessDataset
from ray.data._internal.split import _get_num_rows, _split_at_indices
from ray.data._internal.iterator.stream_split_iterator import StreamSplitDataIterator
from ray.air.util.tensor_extensions.arrow import ArrowTensorTyp... | @PublicAPI
class Dataset:
'''A Dataset is a distributed data collection for data loading and processing.
Datasets are distributed pipelines that produce ``ObjectRef[Block]`` outputs,
where each block holds data in Arrow format, representing a shard of the overall
data collection. The block also determin... | 276 | 96 | 49 | 7 | 18 | 24 | 2 | 1.35 | 0 | 75 | 52 | 1 | 97 | 5 | 99 | 99 | 5,413 | 831 | 1,951 | 853 | 1,262 | 2,639 | 785 | 357 | 650 | 13 | 0 | 3 | 258 |
10,201 | ray-project/ray | python/ray/data/dataset.py | ray.data.dataset.MaterializedDataset | from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Iterable, Iterator, List, Literal, Mapping, Optional, Tuple, TypeVar, Union
from ray.data.block import VALID_BATCH_FORMATS, Block, BlockAccessor, DataBatch, DataBatchColumn, T, U, UserDefinedFunction, _apply_batch_format
from ray.util.annotations import De... | @PublicAPI
class MaterializedDataset(Dataset, Generic[T]):
'''A Dataset materialized in Ray memory, e.g., via `.materialize()`.
The blocks of a MaterializedDataset object are materialized into Ray object store
memory, which means that this class can be shared or iterated over by multiple Ray
tasks witho... | 3 | 2 | 15 | 3 | 2 | 10 | 1 | 5 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 102 | 23 | 5 | 3 | 2 | 1 | 15 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
10,202 | ray-project/ray | python/ray/data/dataset.py | ray.data.dataset.Schema | from ray.data.context import DataContext
from ray.air.util.tensor_extensions.arrow import ArrowTensorTypeV2, get_arrow_extension_fixed_shape_tensor_types
from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Iterable, Iterator, List, Literal, Mapping, Optional, Tuple, TypeVar, Union
import copy
from ray.util.... | @PublicAPI(stability='beta')
class Schema:
'''Dataset schema.
Attributes:
base_schema: The underlying Arrow or Pandas schema.
'''
def __init__(self, base_schema: Union['pyarrow.lib.Schema', 'PandasBlockSchema'], *, data_context: Optional[DataContext]=None):
pass
@property
def na... | 9 | 3 | 15 | 2 | 11 | 1 | 2 | 0.18 | 0 | 10 | 4 | 0 | 5 | 2 | 5 | 5 | 88 | 17 | 60 | 24 | 45 | 11 | 43 | 17 | 35 | 7 | 0 | 3 | 12 |
10,203 | ray-project/ray | python/ray/data/datasource/datasink.py | ray.data.datasource.datasink.Datasink | from ray.util.annotations import DeveloperAPI
from ray.data._internal.execution.interfaces import TaskContext
from typing import Generic, Iterable, List, Optional, TypeVar
from ray.data.block import Block, BlockAccessor
@DeveloperAPI
class Datasink(Generic[WriteReturnType]):
"""Interface for defining write-related... | @DeveloperAPI
class Datasink(Generic[WriteReturnType]):
'''Interface for defining write-related logic.
If you want to write data to something that isn't built-in, subclass this class
and call :meth:`~ray.data.Dataset.write_datasink`.
'''
def on_write_start(self) -> None:
'''Callback for whe... | 11 | 8 | 9 | 1 | 3 | 5 | 1 | 1.37 | 1 | 7 | 1 | 6 | 7 | 0 | 7 | 9 | 81 | 17 | 27 | 16 | 13 | 37 | 21 | 10 | 13 | 3 | 1 | 1 | 9 |
10,204 | ray-project/ray | python/ray/data/datasource/datasink.py | ray.data.datasource.datasink.DummyOutputDatasink | from typing import Generic, Iterable, List, Optional, TypeVar
from ray.util.annotations import DeveloperAPI
from ray.data.block import Block, BlockAccessor
from ray.data._internal.execution.interfaces import TaskContext
import ray
@DeveloperAPI
class DummyOutputDatasink(Datasink[None]):
"""An example implementatio... | @DeveloperAPI
class DummyOutputDatasink(Datasink[None]):
'''An example implementation of a writable datasource for testing.
Examples:
>>> import ray
>>> from ray.data.datasource import DummyOutputDatasink
>>> output = DummyOutputDatasink()
>>> ray.data.range(10).write_datasink(ou... | 11 | 1 | 6 | 1 | 6 | 0 | 1 | 0.31 | 1 | 5 | 3 | 0 | 4 | 4 | 4 | 13 | 50 | 8 | 32 | 23 | 18 | 10 | 27 | 18 | 18 | 3 | 2 | 1 | 9 |
10,205 | ray-project/ray | python/ray/data/datasource/datasink.py | ray.data.datasource.datasink.WriteResult | from dataclasses import dataclass
from typing import Generic, Iterable, List, Optional, TypeVar
from ray.util.annotations import DeveloperAPI
@dataclass
@DeveloperAPI
class WriteResult(Generic[WriteReturnType]):
"""Aggregated result of the Datasink write operations."""
num_rows: int
size_bytes: int
wri... | @dataclass
@DeveloperAPI
class WriteResult(Generic[WriteReturnType]):
'''Aggregated result of the Datasink write operations.'''
pass | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 9 | 1 | 4 | 1 | 3 | 4 | 4 | 1 | 3 | 0 | 1 | 0 | 0 |
10,206 | ray-project/ray | python/ray/data/datasource/datasource.py | ray.data.datasource.datasource.Datasource | from typing import Callable, Iterable, List, Optional
from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
@PublicAPI
class Datasource(_DatasourceProjectionPushdownMixin):
"""Interface for defining a custom :class:`~ray.data.Dataset` datasource.
To read a datasource into a dataset, use :meth:`... | @PublicAPI
class Datasource(_DatasourceProjectionPushdownMixin):
'''Interface for defining a custom :class:`~ray.data.Dataset` datasource.
To read a datasource into a dataset, use :meth:`~ray.data.read_datasource`.
'''
@Deprecated
def create_reader(self, **read_args) -> 'Reader':
'''
... | 13 | 7 | 8 | 0 | 4 | 3 | 1 | 0.79 | 0 | 6 | 1 | 14 | 7 | 0 | 7 | 7 | 70 | 11 | 33 | 16 | 21 | 26 | 21 | 12 | 13 | 2 | 0 | 1 | 8 |
10,207 | ray-project/ray | python/ray/data/datasource/datasource.py | ray.data.datasource.datasource.RandomIntRowDatasource | import numpy as np
from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
from ray.data._internal.util import _check_pyarrow_version
from ray.data.block import Block, BlockMetadata, Schema
from typing import Callable, Iterable, List, Optional
@DeveloperAPI
class RandomIntRowDatasource(Datasource):
""... | @DeveloperAPI
class RandomIntRowDatasource(Datasource):
'''An example datasource that generates rows with random int64 columns.
Examples:
>>> import ray
>>> from ray.data.datasource import RandomIntRowDatasource
>>> source = RandomIntRowDatasource() # doctest: +SKIP
>>> ray.data.... | 7 | 2 | 13 | 1 | 11 | 1 | 1 | 0.29 | 1 | 4 | 1 | 0 | 4 | 2 | 4 | 11 | 72 | 10 | 48 | 19 | 38 | 14 | 25 | 16 | 18 | 2 | 1 | 1 | 6 |
10,208 | ray-project/ray | python/ray/data/datasource/datasource.py | ray.data.datasource.datasource.ReadTask | from ray.data.block import Block, BlockMetadata, Schema
from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
from typing import Callable, Iterable, List, Optional
@DeveloperAPI
class ReadTask(Callable[[], Iterable[Block]]):
"""A function used to read blocks from the :class:`~ray.data.Dataset`.
... | @DeveloperAPI
class ReadTask(Callable[[], Iterable[Block]]):
'''A function used to read blocks from the :class:`~ray.data.Dataset`.
Read tasks are generated by :meth:`~ray.data.Datasource.get_read_tasks`,
and return a list of ``ray.data.Block`` when called. Initial metadata about the read
operation can ... | 10 | 1 | 4 | 0 | 4 | 0 | 1 | 0.79 | 1 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 42 | 8 | 19 | 10 | 12 | 15 | 13 | 8 | 8 | 2 | 1 | 1 | 5 |
10,209 | ray-project/ray | python/ray/data/datasource/datasource.py | ray.data.datasource.datasource.Reader | from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
from typing import Callable, Iterable, List, Optional
@Deprecated
class Reader:
"""A bound read operation for a :class:`~ray.data.Datasource`.
This is a stateful class so that reads can be prepared in multiple stages.
For example, it is ... | @Deprecated
class Reader:
'''A bound read operation for a :class:`~ray.data.Datasource`.
This is a stateful class so that reads can be prepared in multiple stages.
For example, it is useful for :class:`Datasets <ray.data.Dataset>` to know the
in-memory size of the read prior to executing it.
'''
... | 4 | 3 | 10 | 2 | 2 | 6 | 1 | 3.4 | 0 | 2 | 0 | 2 | 2 | 0 | 2 | 2 | 28 | 6 | 5 | 3 | 2 | 17 | 5 | 3 | 2 | 1 | 0 | 0 | 2 |
10,210 | ray-project/ray | python/ray/data/datasource/datasource.py | ray.data.datasource.datasource._LegacyDatasourceReader | from typing import Callable, Iterable, List, Optional
class _LegacyDatasourceReader(Reader):
def __init__(self, datasource: Datasource, **read_args):
self._datasource = datasource
self._read_args = read_args
def estimate_inmemory_data_size(self) -> Optional[int]:
return None
def ... |
class _LegacyDatasourceReader(Reader):
def __init__(self, datasource: Datasource, **read_args):
pass
def estimate_inmemory_data_size(self) -> Optional[int]:
pass
def get_read_tasks(self, parallelism: int) -> List['ReadTask']:
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 3 | 2 | 3 | 5 | 10 | 2 | 8 | 6 | 4 | 0 | 8 | 6 | 4 | 1 | 1 | 0 | 3 |
10,211 | ray-project/ray | python/ray/data/datasource/file_based_datasource.py | ray.data.datasource.file_based_datasource.FileBasedDatasource | from ray.data.context import DataContext
from ray.data.datasource.partitioning import Partitioning, PathPartitionFilter, PathPartitionParser
import io
from ray.data._internal.util import RetryingContextManager, RetryingPyFileSystem, _check_pyarrow_version, _is_local_scheme, iterate_with_retry, make_async_gen
from ray.d... | @DeveloperAPI
class FileBasedDatasource(Datasource):
'''File-based datasource for reading files.
Don't use this class directly. Instead, subclass it and implement `_read_stream()`.
'''
def __init__(self, paths: Union[str, List[str]], *, filesystem: Optional['pyarrow.fs.FileSystem']=None, schema: Op... | 15 | 4 | 30 | 5 | 23 | 3 | 3 | 0.16 | 1 | 22 | 8 | 15 | 9 | 13 | 9 | 16 | 305 | 53 | 218 | 88 | 176 | 34 | 140 | 65 | 120 | 9 | 1 | 4 | 41 |
10,212 | ray-project/ray | python/ray/data/datasource/file_based_datasource.py | ray.data.datasource.file_based_datasource.FileShuffleConfig | from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Literal, Optional, Union
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
@dataclass
class FileShuffleConfig:
"""Configuration for file shuffling.
This configuration object controls ho... | @DeveloperAPI
@dataclass
class FileShuffleConfig:
'''Configuration for file shuffling.
This configuration object controls how files are shuffled while reading file-based
datasets.
.. note::
Even if you provided a seed, you might still observe a non-deterministic row
order. This is becaus... | 4 | 2 | 4 | 0 | 3 | 1 | 2 | 3.6 | 0 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 29 | 6 | 5 | 3 | 3 | 18 | 5 | 3 | 3 | 2 | 0 | 1 | 2 |
10,213 | ray-project/ray | python/ray/data/datasource/file_based_datasource.py | ray.data.datasource.file_based_datasource._S3FileSystemWrapper | class _S3FileSystemWrapper:
"""pyarrow.fs.S3FileSystem wrapper that can be deserialized safely.
Importing pyarrow.fs during reconstruction triggers the pyarrow
S3 subsystem initialization.
NOTE: This is only needed for pyarrow<14.0.0 and should be removed
once the minimum supported pyarrow ver... | class _S3FileSystemWrapper:
'''pyarrow.fs.S3FileSystem wrapper that can be deserialized safely.
Importing pyarrow.fs during reconstruction triggers the pyarrow
S3 subsystem initialization.
NOTE: This is only needed for pyarrow<14.0.0 and should be removed
once the minimum supported pyarrow versi... | 6 | 1 | 5 | 0 | 4 | 1 | 1 | 0.17 | 0 | 2 | 1 | 0 | 3 | 3 | 4 | 4 | 24 | 4 | 18 | 15 | 6 | 3 | 12 | 9 | 6 | 1 | 0 | 0 | 4 |
10,214 | ray-project/ray | python/ray/data/datasource/file_datasink.py | ray.data.datasource.file_datasink.BlockBasedFileDatasink | from ray.data.block import Block, BlockAccessor
from ray.data._internal.planner.plan_write_op import WRITE_UUID_KWARG_NAME
import posixpath
from ray.data._internal.util import RetryingPyFileSystem, _is_local_scheme, call_with_retry
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional
from ray.util.annotation... | @DeveloperAPI
class BlockBasedFileDatasink(_FileDatasink):
'''A datasink that writes multiple rows to each file.
Subclasses must implement ``write_block_to_file`` and call the superclass
constructor.
Examples:
.. testcode::
class CSVDatasink(BlockBasedFileDatasink):
d... | 8 | 2 | 7 | 1 | 5 | 1 | 1 | 0.68 | 1 | 3 | 0 | 10 | 4 | 1 | 4 | 21 | 54 | 12 | 25 | 13 | 16 | 17 | 16 | 9 | 10 | 1 | 3 | 1 | 5 |
10,215 | ray-project/ray | python/ray/data/datasource/file_datasink.py | ray.data.datasource.file_datasink.RowBasedFileDatasink | from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional
import posixpath
from ray.data._internal.planner.plan_write_op import WRITE_UUID_KWARG_NAME
from ray.data._internal.execution.interfaces import TaskContext
from ray.data._internal.util import RetryingPyFileSystem, _is_local_scheme, call_with_retry
from ray... | @DeveloperAPI
class RowBasedFileDatasink(_FileDatasink):
'''A datasink that writes one row to each file.
Subclasses must implement ``write_row_to_file`` and call the superclass constructor.
Examples:
.. testcode::
import io
from typing import Any, Dict
import pyar... | 5 | 2 | 9 | 1 | 7 | 2 | 1 | 1.39 | 1 | 5 | 0 | 4 | 2 | 0 | 2 | 19 | 55 | 12 | 18 | 8 | 14 | 25 | 12 | 7 | 8 | 2 | 3 | 1 | 4 |
10,216 | ray-project/ray | python/ray/data/datasource/file_datasink.py | ray.data.datasource.file_datasink._FileDatasink | from ray.data.block import Block, BlockAccessor
from ray.data.datasource.datasink import Datasink, WriteResult
from ray.data._internal.execution.interfaces import TaskContext
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray._private.arrow_utils import add_creatable_buckets_param_i... |
class _FileDatasink(Datasink[None]):
def __init__(self, path: str, *, filesystem: Optional['pyarrow.fs.FileSystem']=None, try_create_dir: bool=True, open_stream_args: Optional[Dict[str, Any]]=None, filename_provider: Optional[FilenameProvider]=None, dataset_uuid: Optional[str]=None, file_format: Optional[str]=Non... | 10 | 2 | 14 | 1 | 8 | 4 | 2 | 0.45 | 1 | 10 | 5 | 3 | 8 | 10 | 8 | 17 | 118 | 18 | 69 | 42 | 44 | 31 | 50 | 27 | 40 | 3 | 2 | 2 | 15 |
10,217 | ray-project/ray | python/ray/data/datasource/file_meta_provider.py | ray.data.datasource.file_meta_provider.BaseFileMetadataProvider | from ray.util.annotations import DeveloperAPI
from ray.data.datasource.partitioning import Partitioning, PathPartitionFilter
from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Tuple, TypeVar, Union
from ray.data.block import BlockMetadata
@DeveloperAPI
class BaseFileMetadataProvider(FileMetadataProv... | @DeveloperAPI
class BaseFileMetadataProvider(FileMetadataProvider):
'''Abstract callable that provides metadata for
:class:`~ray.data.datasource.file_based_datasource.FileBasedDatasource`
implementations that reuse the base :meth:`~ray.data.Datasource.prepare_read`
method.
Also supports file and fil... | 4 | 3 | 27 | 3 | 9 | 16 | 1 | 2.17 | 1 | 6 | 1 | 1 | 2 | 0 | 2 | 4 | 67 | 10 | 18 | 16 | 2 | 39 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
10,218 | ray-project/ray | python/ray/data/datasource/file_meta_provider.py | ray.data.datasource.file_meta_provider.DefaultFileMetadataProvider | from ray.data.block import BlockMetadata
from ray.util.annotations import DeveloperAPI
from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Tuple, TypeVar, Union
from ray.data.datasource.partitioning import Partitioning, PathPartitionFilter
@DeveloperAPI
class DefaultFileMetadataProvider(BaseFileMetad... | @DeveloperAPI
class DefaultFileMetadataProvider(BaseFileMetadataProvider):
'''Default metadata provider for
:class:`~ray.data.datasource.file_based_datasource.FileBasedDatasource`
implementations that reuse the base `prepare_read` method.
Calculates block size in bytes as the sum of its constituent file... | 4 | 1 | 14 | 0 | 14 | 1 | 2 | 0.25 | 1 | 5 | 1 | 2 | 2 | 0 | 2 | 6 | 37 | 3 | 28 | 17 | 12 | 7 | 8 | 4 | 5 | 3 | 2 | 1 | 4 |
10,219 | ray-project/ray | python/ray/data/datasource/file_meta_provider.py | ray.data.datasource.file_meta_provider.FastFileMetadataProvider | from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Tuple, TypeVar, Union
import itertools
from ray.util.annotations import DeveloperAPI
from ray.data.datasource.partitioning import Partitioning, PathPartitionFilter
@DeveloperAPI
class FastFileMetadataProvider(DefaultFileMetadataProvider):
"""Fas... | @DeveloperAPI
class FastFileMetadataProvider(DefaultFileMetadataProvider):
'''Fast Metadata provider for
:class:`~ray.data.datasource.file_based_datasource.FileBasedDatasource`
implementations.
Offers improved performance vs.
:class:`DefaultFileMetadataProvider`
by skipping directory path expans... | 3 | 1 | 21 | 2 | 19 | 0 | 2 | 0.5 | 1 | 7 | 1 | 0 | 1 | 0 | 1 | 7 | 35 | 5 | 20 | 8 | 12 | 10 | 6 | 2 | 4 | 2 | 3 | 1 | 2 |
10,220 | ray-project/ray | python/ray/data/datasource/file_meta_provider.py | ray.data.datasource.file_meta_provider.FileMetadataProvider | from ray.util.annotations import DeveloperAPI
from typing import TYPE_CHECKING, Callable, Iterator, List, Optional, Tuple, TypeVar, Union
from ray.data.block import BlockMetadata
@DeveloperAPI
class FileMetadataProvider:
"""Abstract callable that provides metadata for the files of a single dataset block.
Curr... | @DeveloperAPI
class FileMetadataProvider:
'''Abstract callable that provides metadata for the files of a single dataset block.
Current subclasses:
- :class:`BaseFileMetadataProvider`
'''
def _get_block_metadata(self, paths: List[str], **kwargs) -> BlockMetadata:
'''Resolves and ... | 4 | 2 | 13 | 2 | 7 | 5 | 1 | 0.93 | 0 | 3 | 0 | 2 | 2 | 0 | 2 | 2 | 35 | 6 | 15 | 13 | 2 | 14 | 5 | 3 | 2 | 1 | 0 | 0 | 2 |
10,221 | ray-project/ray | python/ray/data/datasource/filename_provider.py | ray.data.datasource.filename_provider.FilenameProvider | from ray.util.annotations import PublicAPI
from typing import Any, Dict, Optional
from ray.data.block import Block
@PublicAPI(stability='alpha')
class FilenameProvider:
"""Generates filenames when you write a :class:`~ray.data.Dataset`.
Use this class to customize the filenames used when writing a Dataset.
... | @PublicAPI(stability='alpha')
class FilenameProvider:
'''Generates filenames when you write a :class:`~ray.data.Dataset`.
Use this class to customize the filenames used when writing a Dataset.
Some methods write each row to a separate file, while others write each block to a
separate file. For example, ... | 4 | 3 | 21 | 4 | 4 | 14 | 1 | 6.33 | 0 | 4 | 0 | 1 | 2 | 0 | 2 | 2 | 86 | 20 | 9 | 7 | 2 | 57 | 5 | 3 | 2 | 1 | 0 | 0 | 2 |
10,222 | ray-project/ray | python/ray/data/datasource/filename_provider.py | ray.data.datasource.filename_provider._DefaultFilenameProvider | from ray.data.block import Block
from typing import Any, Dict, Optional
class _DefaultFilenameProvider(FilenameProvider):
def __init__(self, dataset_uuid: Optional[str]=None, file_format: Optional[str]=None):
self._dataset_uuid = dataset_uuid
self._file_format = file_format
def get_filename_f... |
class _DefaultFilenameProvider(FilenameProvider):
def __init__(self, dataset_uuid: Optional[str]=None, file_format: Optional[str]=None):
pass
def get_filename_for_block(self, block: Block, write_uuid: str, task_index: int, block_index: int) -> str:
pass
def get_filename_for_row(self, row... | 5 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 4 | 2 | 4 | 6 | 27 | 3 | 24 | 16 | 13 | 0 | 18 | 10 | 13 | 3 | 1 | 1 | 6 |
10,223 | ray-project/ray | python/ray/data/datasource/partitioning.py | ray.data.datasource.partitioning.PartitionStyle | from enum import Enum
from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class PartitionStyle(str, Enum):
"""Supported dataset partition styles.
Inherits from `str` to simplify plain text serialization/deserialization.
Examples:
>>> # Serialize to JSON text.
>>> json.d... | @DeveloperAPI
class PartitionStyle(str, Enum):
'''Supported dataset partition styles.
Inherits from `str` to simplify plain text serialization/deserialization.
Examples:
>>> # Serialize to JSON text.
>>> json.dumps(PartitionStyle.HIVE) # doctest: +SKIP
'"hive"'
>>> # Deseria... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 3.33 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 17 | 4 | 3 | 3 | 2 | 10 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
10,224 | ray-project/ray | python/ray/data/datasource/partitioning.py | ray.data.datasource.partitioning.Partitioning | from dataclasses import dataclass
from ray.util.annotations import DeveloperAPI, PublicAPI
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
@DeveloperAPI
@dataclass
class Partitioning:
"""Partition scheme used to describe path-based partitions.
Path-based partition formats em... | @DeveloperAPI
@dataclass
class Partitioning:
'''Partition scheme used to describe path-based partitions.
Path-based partition formats embed all partition keys and values directly in
their dataset file paths.
For example, to read a dataset with
`Hive-style partitions <https://athena.guide/articles/hi... | 9 | 4 | 10 | 1 | 7 | 2 | 2 | 1.33 | 0 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 102 | 18 | 36 | 16 | 28 | 48 | 29 | 14 | 23 | 3 | 0 | 1 | 9 |
10,225 | ray-project/ray | python/ray/data/datasource/partitioning.py | ray.data.datasource.partitioning.PathPartitionFilter | from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI(stability='beta')
class PathPartitionFilter:
"""Partition filter for path-based partition formats.
Used to explicitly keep or reject files based on a custom fi... | @PublicAPI(stability='beta')
class PathPartitionFilter:
'''Partition filter for path-based partition formats.
Used to explicitly keep or reject files based on a custom filter function that
takes partition keys and values parsed from the file's path as input.
'''
@staticmethod
def of(filter_fn: C... | 9 | 5 | 27 | 4 | 7 | 17 | 1 | 2.33 | 0 | 5 | 3 | 0 | 3 | 2 | 4 | 4 | 121 | 21 | 30 | 23 | 12 | 70 | 15 | 10 | 10 | 2 | 0 | 1 | 5 |
10,226 | ray-project/ray | python/ray/data/datasource/partitioning.py | ray.data.datasource.partitioning.PathPartitionParser | from ray.util.annotations import DeveloperAPI, PublicAPI
import posixpath
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
@DeveloperAPI
class PathPartitionParser:
"""Partition parser for path-based partition formats.
Path-based partition formats embed all partition keys and ... | @DeveloperAPI
class PathPartitionParser:
'''Partition parser for path-based partition formats.
Path-based partition formats embed all partition keys and values directly in
their dataset file paths.
Two path partition formats are currently supported - `HIVE` and `DIRECTORY`.
For `HIVE` Partitioning, ... | 11 | 8 | 20 | 2 | 11 | 8 | 3 | 0.97 | 0 | 7 | 2 | 0 | 6 | 2 | 7 | 7 | 180 | 24 | 79 | 31 | 63 | 77 | 48 | 23 | 40 | 6 | 0 | 3 | 19 |
10,227 | ray-project/ray | python/ray/data/exceptions.py | ray.data.exceptions.RayDataUserCodeException | from ray.exceptions import UserCodeException
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class RayDataUserCodeException(UserCodeException):
"""Represents an Exception originating from user code, e.g.
user-specified UDF used in a Ray Data transformation.
By default, the frames corresponding... | @DeveloperAPI
class RayDataUserCodeException(UserCodeException):
'''Represents an Exception originating from user code, e.g.
user-specified UDF used in a Ray Data transformation.
By default, the frames corresponding to Ray Data internal files are
omitted from the stack trace logged to stdout, but will s... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 10 | 2 | 2 | 1 | 1 | 6 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
10,228 | ray-project/ray | python/ray/data/exceptions.py | ray.data.exceptions.SystemException | from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class SystemException(Exception):
"""Represents an Exception originating from Ray Data internal code
or Ray Core private code paths, as opposed to user code. When
Exceptions of this form are raised, it likely indicates a bug
in Ray Data or Ray... | @DeveloperAPI
class SystemException(Exception):
'''Represents an Exception originating from Ray Data internal code
or Ray Core private code paths, as opposed to user code. When
Exceptions of this form are raised, it likely indicates a bug
in Ray Data or Ray Core.'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 7 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
10,229 | ray-project/ray | python/ray/data/grouped_data.py | ray.data.grouped_data.GroupedData | from ray.data._internal.compute import ComputeStrategy
from ray.data.dataset import Dataset
from ray.data.aggregate import AggregateFn, Count, Max, Mean, Min, Std, Sum
from ray.data.context import ShuffleStrategy
from ray.util.annotations import PublicAPI
from ray.data.block import Block, BlockAccessor, CallableClass, ... |
class GroupedData:
'''Represents a grouped dataset created by calling ``Dataset.groupby()``.
The actual groupby is deferred until an aggregation is applied.
'''
def __init__(self, dataset: Dataset, key: Optional[Union[str, List[str]]], *, num_partitions: Optional[int]):
'''Construct a data... | 24 | 11 | 32 | 4 | 10 | 18 | 1 | 1.9 | 0 | 19 | 10 | 0 | 11 | 3 | 11 | 11 | 475 | 69 | 140 | 83 | 75 | 266 | 59 | 35 | 42 | 4 | 0 | 2 | 21 |
10,230 | ray-project/ray | python/ray/data/iterator.py | ray.data.iterator.DataIterator | from ray.data._internal.logical.interfaces import LogicalPlan
from ray.data._internal.execution.interfaces import RefBundle
import warnings
from ray.data._internal.block_batching.iter_batches import BatchIterator
from ray.data.context import DataContext
import numpy as np
import time
from ray.data._internal.logical.ope... | @PublicAPI
class DataIterator(abc.ABC):
'''An iterator for reading records from a :class:`~Dataset`.
For Datasets, each iteration call represents a complete read of all items in the
Dataset.
If using Ray Train, each trainer actor should get its own iterator by calling
:meth:`ray.train.get_dataset_sh... | 35 | 12 | 47 | 5 | 24 | 18 | 3 | 1.07 | 1 | 20 | 7 | 0 | 12 | 0 | 12 | 32 | 869 | 105 | 369 | 147 | 250 | 395 | 142 | 58 | 111 | 11 | 4 | 3 | 56 |
10,231 | ray-project/ray | python/ray/data/iterator.py | ray.data.iterator._IterableFromIterator | from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union
class _IterableFromIterator(Iterable[T]):
def __init__(self, iterator_gen: Callable[[], Iterator[T]]):
"""Constructs an Iterable from an iterator generator.
Args:
iterator_... |
class _IterableFromIterator(Iterable[T]):
def __init__(self, iterator_gen: Callable[[], Iterator[T]]):
'''Constructs an Iterable from an iterator generator.
Args:
iterator_gen: A function that returns an iterator each time it
is called. For example, this can be a genera... | 3 | 1 | 5 | 1 | 2 | 3 | 1 | 1 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 12 | 2 | 5 | 4 | 2 | 5 | 5 | 4 | 2 | 1 | 1 | 0 | 2 |
10,232 | ray-project/ray | python/ray/data/llm.py | ray.data.llm.HttpRequestProcessorConfig | from ray.llm._internal.batch.processor import HttpRequestProcessorConfig as _HttpRequestProcessorConfig, Processor, ProcessorConfig as _ProcessorConfig, ServeDeploymentProcessorConfig as _ServeDeploymentProcessorConfig, SGLangEngineProcessorConfig as _SGLangEngineProcessorConfig, vLLMEngineProcessorConfig as _vLLMEngin... | @PublicAPI(stability='alpha')
class HttpRequestProcessorConfig(_HttpRequestProcessorConfig):
'''The configuration for the HTTP request processor.
Args:
batch_size: The batch size to send to the HTTP request.
url: The URL to send the HTTP request to.
headers: The headers to send with the ... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 15.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 38 | 5 | 2 | 1 | 1 | 31 | 2 | 1 | 1 | 0 | 7 | 0 | 0 |
10,233 | ray-project/ray | python/ray/data/llm.py | ray.data.llm.ProcessorConfig | from ray.util.annotations import PublicAPI
from ray.llm._internal.batch.processor import HttpRequestProcessorConfig as _HttpRequestProcessorConfig, Processor, ProcessorConfig as _ProcessorConfig, ServeDeploymentProcessorConfig as _ServeDeploymentProcessorConfig, SGLangEngineProcessorConfig as _SGLangEngineProcessorConf... | @PublicAPI(stability='alpha')
class ProcessorConfig(_ProcessorConfig):
'''The processor configuration.
Args:
batch_size: Configures batch size for the processor. Large batch sizes are
likely to saturate the compute resources and could achieve higher throughput.
On the other hand,... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 6 | 0 | 0 |
10,234 | ray-project/ray | python/ray/data/preprocessor.py | ray.data.preprocessor.Preprocessor | import warnings
import abc
from ray.air.util.data_batch_conversion import BatchFormat
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from ray.util.annotations import DeveloperAPI, PublicAPI
import base64
import collections
from enum import Enum
import pickle
@PublicAPI(stability='beta')
class Prepr... | @PublicAPI(stability='beta')
class Preprocessor(abc.ABC):
'''Implements an ML preprocessing operation.
Preprocessors are stateful objects that can be fitted against a Dataset and used
to transform both local data batches and distributed data. For example, a
Normalization preprocessor may calculate the m... | 29 | 16 | 14 | 2 | 8 | 5 | 2 | 0.67 | 1 | 9 | 3 | 27 | 14 | 1 | 16 | 36 | 291 | 52 | 143 | 50 | 108 | 96 | 81 | 39 | 59 | 5 | 4 | 1 | 31 |
10,235 | ray-project/ray | python/ray/data/preprocessor.py | ray.data.preprocessor.PreprocessorNotFittedException | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI(stability='beta')
class PreprocessorNotFittedException(RuntimeError):
"""Error raised when the preprocessor needs to be fitted first."""
pass | @PublicAPI(stability='beta')
class PreprocessorNotFittedException(RuntimeError):
'''Error raised when the preprocessor needs to be fitted first.'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,236 | ray-project/ray | python/ray/data/preprocessors/chain.py | ray.data.preprocessors.chain.Chain | from ray.air.util.data_batch_conversion import BatchFormat
from ray.data.preprocessor import Preprocessor
from typing import TYPE_CHECKING, Optional
class Chain(Preprocessor):
"""Combine multiple preprocessors into a single :py:class:`Preprocessor`.
When you call ``fit``, each preprocessor is fit on the datas... |
class Chain(Preprocessor):
'''Combine multiple preprocessors into a single :py:class:`Preprocessor`.
When you call ``fit``, each preprocessor is fit on the dataset produced by the
preceeding preprocessor's ``fit_transform``.
Example:
>>> import pandas as pd
>>> import ray
>>> fr... | 9 | 1 | 6 | 0 | 6 | 1 | 2 | 0.67 | 1 | 2 | 2 | 0 | 8 | 1 | 8 | 44 | 91 | 11 | 48 | 18 | 39 | 32 | 40 | 18 | 31 | 7 | 5 | 2 | 18 |
10,237 | ray-project/ray | python/ray/data/preprocessors/concatenator.py | ray.data.preprocessors.concatenator.Concatenator | import numpy as np
from ray.data.preprocessor import Preprocessor
from ray.util.annotations import PublicAPI
import pandas as pd
from typing import List, Optional
@PublicAPI(stability='alpha')
class Concatenator(Preprocessor):
"""Combine numeric columns into a column of type
:class:`~ray.air.util.tensor_extens... | @PublicAPI(stability='alpha')
class Concatenator(Preprocessor):
'''Combine numeric columns into a column of type
:class:`~ray.air.util.tensor_extensions.pandas.TensorDtype`. Only columns
specified in ``columns`` will be concatenated.
This preprocessor concatenates numeric columns and stores the result i... | 6 | 1 | 12 | 1 | 10 | 1 | 2 | 1.24 | 1 | 6 | 0 | 0 | 4 | 4 | 4 | 40 | 112 | 18 | 42 | 23 | 31 | 52 | 28 | 17 | 23 | 3 | 5 | 2 | 8 |
10,238 | ray-project/ray | python/ray/data/preprocessors/discretizer.py | ray.data.preprocessors.discretizer.CustomKBinsDiscretizer | from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Type, Union
import pandas as pd
from ray.util.annotations import PublicAPI
import numpy as np
from ray.data.preprocessor import Preprocessor
@PublicAPI(stability='alpha')
class CustomKBinsDiscretizer(_AbstractKBinsDiscretizer):
"""Bin values into di... | @PublicAPI(stability='alpha')
class CustomKBinsDiscretizer(_AbstractKBinsDiscretizer):
'''Bin values into discrete intervals using custom bin edges.
Columns must contain numerical values.
Examples:
Use :class:`CustomKBinsDiscretizer` to bin continuous features.
>>> import pandas as pd
... | 3 | 1 | 24 | 1 | 23 | 0 | 1 | 2.32 | 1 | 3 | 0 | 0 | 1 | 6 | 1 | 40 | 95 | 12 | 25 | 24 | 8 | 58 | 10 | 9 | 8 | 1 | 6 | 0 | 1 |
10,239 | ray-project/ray | python/ray/data/preprocessors/discretizer.py | ray.data.preprocessors.discretizer.UniformKBinsDiscretizer | import numpy as np
import pandas as pd
from ray.util.annotations import PublicAPI
from ray.data.preprocessor import Preprocessor
from ray.data.aggregate import Max, Min
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Type, Union
@PublicAPI(stability='alpha')
class UniformKBinsDiscretizer(_AbstractKBi... | @PublicAPI(stability='alpha')
class UniformKBinsDiscretizer(_AbstractKBinsDiscretizer):
'''Bin values into discrete intervals (bins) of uniform width.
Columns must contain numerical values.
Examples:
Use :class:`UniformKBinsDiscretizer` to bin continuous features.
>>> import pandas as pd
... | 6 | 1 | 15 | 1 | 14 | 0 | 3 | 1.05 | 1 | 7 | 2 | 0 | 4 | 7 | 4 | 43 | 133 | 17 | 57 | 34 | 41 | 60 | 38 | 23 | 33 | 8 | 6 | 2 | 13 |
10,240 | ray-project/ray | python/ray/data/preprocessors/discretizer.py | ray.data.preprocessors.discretizer._AbstractKBinsDiscretizer | import pandas as pd
from ray.data.preprocessor import Preprocessor
class _AbstractKBinsDiscretizer(Preprocessor):
"""Abstract base class for all KBinsDiscretizers.
Essentially a thin wraper around ``pd.cut``.
Expects either ``self.stats_`` or ``self.bins`` to be set and
contain {column:list_of_bin_in... |
class _AbstractKBinsDiscretizer(Preprocessor):
'''Abstract base class for all KBinsDiscretizers.
Essentially a thin wraper around ``pd.cut``.
Expects either ``self.stats_`` or ``self.bins`` to be set and
contain {column:list_of_bin_intervals}.
'''
def _transform_pandas(self, df: pd.DataFrame):... | 5 | 1 | 17 | 1 | 16 | 0 | 3 | 0.12 | 1 | 4 | 0 | 2 | 3 | 0 | 3 | 39 | 54 | 7 | 42 | 9 | 37 | 5 | 21 | 9 | 16 | 7 | 5 | 2 | 11 |
10,241 | ray-project/ray | python/ray/data/preprocessors/encoder.py | ray.data.preprocessors.encoder.Categorizer | from ray.data.preprocessor import Preprocessor, PreprocessorNotFittedException
from typing import TYPE_CHECKING, Any, Dict, List, Optional
import pandas as pd
from ray.util.annotations import PublicAPI
@PublicAPI(stability='alpha')
class Categorizer(Preprocessor):
"""Convert columns to ``pd.CategoricalDtype``.
... | @PublicAPI(stability='alpha')
class Categorizer(Preprocessor):
'''Convert columns to ``pd.CategoricalDtype``.
Use this preprocessor with frameworks that have built-in support for
``pd.CategoricalDtype`` like LightGBM.
.. warning::
If you don't specify ``dtypes``, fit this preprocessor before spl... | 6 | 1 | 9 | 0 | 9 | 0 | 2 | 1 | 1 | 2 | 0 | 0 | 4 | 3 | 4 | 40 | 82 | 12 | 35 | 14 | 26 | 35 | 20 | 10 | 15 | 2 | 5 | 1 | 6 |
10,242 | ray-project/ray | python/ray/data/preprocessors/encoder.py | ray.data.preprocessors.encoder.LabelEncoder | from ray.util.annotations import PublicAPI
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from ray.air.util.data_batch_conversion import BatchFormat
from ray.data.preprocessor import Preprocessor, PreprocessorNotFittedException
import pandas as pd
@PublicAPI(stability='alpha')
class LabelEncoder(Preproces... | @PublicAPI(stability='alpha')
class LabelEncoder(Preprocessor):
'''Encode labels as integer targets.
:class:`LabelEncoder` encodes labels as integer targets that range from
:math:`0` to :math:`n - 1`, where :math:`n` is the number of unique labels.
If you transform a label that isn't in the fitted datse... | 10 | 2 | 8 | 1 | 6 | 1 | 1 | 1.26 | 1 | 5 | 3 | 0 | 6 | 2 | 6 | 42 | 112 | 24 | 39 | 15 | 30 | 49 | 27 | 15 | 18 | 2 | 5 | 1 | 9 |
10,243 | ray-project/ray | python/ray/data/preprocessors/encoder.py | ray.data.preprocessors.encoder.MultiHotEncoder | from functools import partial
from collections import Counter, OrderedDict
import pandas as pd
from ray.util.annotations import PublicAPI
from ray.data.preprocessor import Preprocessor, PreprocessorNotFittedException
from typing import TYPE_CHECKING, Any, Dict, List, Optional
import numpy as np
@PublicAPI(stability='a... | @PublicAPI(stability='alpha')
class MultiHotEncoder(Preprocessor):
'''Multi-hot encode categorical data.
This preprocessor replaces each list of categories with an :math:`m`-length binary
list, where :math:`m` is the number of unique categories in the column or the value
specified in ``max_categories``.... | 7 | 1 | 9 | 1 | 8 | 0 | 2 | 1.75 | 1 | 5 | 0 | 0 | 4 | 3 | 4 | 40 | 105 | 17 | 32 | 14 | 24 | 56 | 21 | 12 | 15 | 3 | 5 | 1 | 8 |
10,244 | ray-project/ray | python/ray/data/preprocessors/encoder.py | ray.data.preprocessors.encoder.OneHotEncoder | from ray.util.annotations import PublicAPI
import numpy as np
import pandas as pd
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from ray.data.preprocessor import Preprocessor, PreprocessorNotFittedException
@PublicAPI(stability='alpha')
class OneHotEncoder(Preprocessor):
"""`One-hot encode <https://e... | @PublicAPI(stability='alpha')
class OneHotEncoder(Preprocessor):
'''`One-hot encode <https://en.wikipedia.org/wiki/One-hot#Machine_learning_and_statistics>`_
categorical data.
This preprocessor transforms each specified column into a one-hot encoded vector.
Each element in the vector corresponds to a un... | 7 | 1 | 10 | 0 | 9 | 1 | 2 | 1.75 | 1 | 5 | 0 | 0 | 4 | 3 | 4 | 40 | 117 | 18 | 36 | 15 | 29 | 63 | 22 | 13 | 17 | 4 | 5 | 2 | 7 |
10,245 | ray-project/ray | python/ray/data/preprocessors/encoder.py | ray.data.preprocessors.encoder.OrdinalEncoder | from functools import partial
from ray.util.annotations import PublicAPI
from typing import TYPE_CHECKING, Any, Dict, List, Optional
import pandas as pd
from ray.data.preprocessor import Preprocessor, PreprocessorNotFittedException
@PublicAPI(stability='alpha')
class OrdinalEncoder(Preprocessor):
"""Encode values ... | @PublicAPI(stability='alpha')
class OrdinalEncoder(Preprocessor):
'''Encode values within columns as ordered integer values.
:class:`OrdinalEncoder` encodes categorical features as integers that range from
:math:`0` to :math:`n - 1`, where :math:`n` is the number of categories.
If you transform a value ... | 9 | 1 | 8 | 1 | 6 | 1 | 1 | 1.97 | 1 | 6 | 0 | 0 | 4 | 3 | 4 | 40 | 111 | 22 | 30 | 12 | 22 | 59 | 25 | 12 | 17 | 3 | 5 | 2 | 9 |
10,246 | ray-project/ray | python/ray/data/preprocessors/hasher.py | ray.data.preprocessors.hasher.FeatureHasher | import pandas as pd
from typing import List
from ray.util.annotations import PublicAPI
import collections
from ray.data.preprocessors.utils import simple_hash
from ray.data.preprocessor import Preprocessor
@PublicAPI(stability='alpha')
class FeatureHasher(Preprocessor):
"""Apply the `hashing trick <https://en.wiki... | @PublicAPI(stability='alpha')
class FeatureHasher(Preprocessor):
'''Apply the `hashing trick <https://en.wikipedia.org/wiki/Feature_hashing>`_ to a
table that describes token frequencies.
:class:`FeatureHasher` creates ``num_features`` columns named ``hash_{index}``,
where ``index`` ranges from :math:`0... | 6 | 1 | 8 | 1 | 7 | 1 | 1 | 2.26 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 39 | 95 | 20 | 23 | 12 | 18 | 52 | 18 | 12 | 13 | 2 | 5 | 1 | 5 |
10,247 | ray-project/ray | python/ray/data/preprocessors/imputer.py | ray.data.preprocessors.imputer.SimpleImputer | from ray.data.aggregate import Mean
from pandas.api.types import is_categorical_dtype
import pandas as pd
from typing import TYPE_CHECKING, Dict, List, Optional, Union
from ray.util.annotations import PublicAPI
from ray.data.preprocessor import Preprocessor
from numbers import Number
import numpy as np
@PublicAPI(stab... | @PublicAPI(stability='alpha')
class SimpleImputer(Preprocessor):
'''Replace missing values with imputed values. If the column is missing from a
batch, it will be filled with the imputed value.
Examples:
>>> import pandas as pd
>>> import ray
>>> from ray.data.preprocessors import Sim... | 7 | 1 | 13 | 1 | 12 | 0 | 3 | 0.95 | 1 | 4 | 1 | 0 | 5 | 5 | 5 | 41 | 142 | 23 | 61 | 20 | 50 | 58 | 37 | 15 | 31 | 5 | 5 | 3 | 17 |
10,248 | ray-project/ray | python/ray/data/preprocessors/normalizer.py | ray.data.preprocessors.normalizer.Normalizer | from typing import List, Optional
from ray.util.annotations import PublicAPI
from ray.data.preprocessor import Preprocessor
import numpy as np
import pandas as pd
@PublicAPI(stability='alpha')
class Normalizer(Preprocessor):
"""Scales each sample to have unit norm.
This preprocessor works by dividing each sam... | @PublicAPI(stability='alpha')
class Normalizer(Preprocessor):
'''Scales each sample to have unit norm.
This preprocessor works by dividing each sample (i.e., row) by the sample's norm.
The general formula is given by
.. math::
s' = \frac{s}{\lVert s \rVert_p}
where :math:`s` is the sample, :... | 5 | 1 | 6 | 1 | 6 | 0 | 1 | 2.08 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 39 | 96 | 22 | 24 | 10 | 20 | 50 | 15 | 10 | 11 | 2 | 5 | 1 | 4 |
10,249 | ray-project/ray | python/ray/data/preprocessors/scaler.py | ray.data.preprocessors.scaler.MaxAbsScaler | from ray.data.aggregate import AbsMax, Max, Mean, Min, Std
from typing import TYPE_CHECKING, List, Optional, Tuple
from ray.util.annotations import PublicAPI
import pandas as pd
from ray.data.preprocessor import Preprocessor
@PublicAPI(stability='alpha')
class MaxAbsScaler(Preprocessor):
"""Scale each column by it... | @PublicAPI(stability='alpha')
class MaxAbsScaler(Preprocessor):
'''Scale each column by its absolute max value.
The general formula is given by
.. math::
x' = \frac{x}{\max{\vert x \vert}}
where :math:`x` is the column and :math:`x'` is the transformed column. If
:math:`\max{\vert x \vert} =... | 7 | 1 | 7 | 1 | 5 | 1 | 1 | 2.4 | 1 | 3 | 1 | 0 | 4 | 3 | 4 | 40 | 87 | 19 | 20 | 11 | 14 | 48 | 18 | 11 | 12 | 2 | 5 | 1 | 6 |
10,250 | ray-project/ray | python/ray/data/preprocessors/scaler.py | ray.data.preprocessors.scaler.MinMaxScaler | from ray.util.annotations import PublicAPI
import pandas as pd
from ray.data.preprocessor import Preprocessor
from ray.data.aggregate import AbsMax, Max, Mean, Min, Std
from typing import TYPE_CHECKING, List, Optional, Tuple
@PublicAPI(stability='alpha')
class MinMaxScaler(Preprocessor):
"""Scale each column by it... | @PublicAPI(stability='alpha')
class MinMaxScaler(Preprocessor):
'''Scale each column by its range.
The general formula is given by
.. math::
x' = \frac{x - \min(x)}{\max{x} - \min{x}}
where :math:`x` is the column and :math:`x'` is the transformed column. If
:math:`\max{x} - \min{x} = 0` (i.... | 7 | 1 | 7 | 1 | 6 | 1 | 1 | 2.32 | 1 | 4 | 2 | 0 | 4 | 3 | 4 | 40 | 93 | 20 | 22 | 13 | 16 | 51 | 20 | 13 | 14 | 2 | 5 | 1 | 6 |
10,251 | ray-project/ray | python/ray/data/preprocessors/scaler.py | ray.data.preprocessors.scaler.RobustScaler | import pandas as pd
from ray.data.preprocessor import Preprocessor
from ray.util.annotations import PublicAPI
import numpy as np
from typing import TYPE_CHECKING, List, Optional, Tuple
@PublicAPI(stability='alpha')
class RobustScaler(Preprocessor):
"""Scale and translate each column using quantiles.
The gener... | @PublicAPI(stability='alpha')
class RobustScaler(Preprocessor):
'''Scale and translate each column using quantiles.
The general formula is given by
.. math::
x' = \frac{x - \mu_{1/2}}{\mu_h - \mu_l}
where :math:`x` is the column, :math:`x'` is the transformed column,
:math:`\mu_{1/2}` is the... | 8 | 1 | 14 | 2 | 10 | 1 | 1 | 1.21 | 1 | 4 | 0 | 0 | 4 | 4 | 4 | 40 | 139 | 24 | 52 | 33 | 40 | 63 | 39 | 28 | 32 | 2 | 5 | 1 | 8 |
10,252 | ray-project/ray | python/ray/data/preprocessors/scaler.py | ray.data.preprocessors.scaler.StandardScaler | import numpy as np
from typing import TYPE_CHECKING, List, Optional, Tuple
from ray.util.annotations import PublicAPI
from ray.data.preprocessor import Preprocessor
import pandas as pd
from ray.data.aggregate import AbsMax, Max, Mean, Min, Std
@PublicAPI(stability='alpha')
class StandardScaler(Preprocessor):
"""Tr... | @PublicAPI(stability='alpha')
class StandardScaler(Preprocessor):
'''Translate and scale each column by its mean and standard deviation,
respectively.
The general formula is given by
.. math::
x' = \frac{x - \bar{x}}{s}
where :math:`x` is the column, :math:`x'` is the transformed column,
... | 7 | 1 | 7 | 1 | 5 | 1 | 1 | 2.55 | 1 | 4 | 2 | 0 | 4 | 3 | 4 | 40 | 97 | 19 | 22 | 13 | 16 | 56 | 20 | 13 | 14 | 2 | 5 | 1 | 6 |
10,253 | ray-project/ray | python/ray/data/preprocessors/tokenizer.py | ray.data.preprocessors.tokenizer.Tokenizer | from typing import Callable, List, Optional
import pandas as pd
from ray.data.preprocessors.utils import simple_split_tokenizer
from ray.data.preprocessor import Preprocessor
from ray.util.annotations import PublicAPI
@PublicAPI(stability='alpha')
class Tokenizer(Preprocessor):
"""Replace each string with a list o... | @PublicAPI(stability='alpha')
class Tokenizer(Preprocessor):
'''Replace each string with a list of tokens.
Examples:
>>> import pandas as pd
>>> import ray
>>> df = pd.DataFrame({"text": ["Hello, world!", "foo bar\nbaz"]})
>>> ds = ray.data.from_pandas(df) # doctest: +SKIP
... | 6 | 1 | 6 | 0 | 5 | 0 | 1 | 1.65 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 39 | 64 | 11 | 20 | 13 | 11 | 33 | 13 | 9 | 8 | 1 | 5 | 0 | 4 |
10,254 | ray-project/ray | python/ray/data/preprocessors/torch.py | ray.data.preprocessors.torch.TorchVisionPreprocessor | from ray.data.preprocessor import Preprocessor
import numpy as np
from ray.air.util.tensor_extensions.utils import _create_possibly_ragged_ndarray
from ray.air.util.data_batch_conversion import BatchFormat
from typing import TYPE_CHECKING, Callable, Dict, List, Mapping, Optional, Union
from ray.util.annotations import ... | @PublicAPI(stability='alpha')
class TorchVisionPreprocessor(Preprocessor):
'''Apply a `TorchVision transform <https://pytorch.org/vision/stable/transforms.html>`_
to image columns.
Examples:
Torch models expect inputs of shape :math:`(B, C, H, W)` in the range
:math:`[0.0, 1.0]`. To convert ... | 8 | 1 | 15 | 1 | 13 | 1 | 2 | 0.8 | 1 | 7 | 1 | 0 | 4 | 4 | 4 | 40 | 135 | 25 | 61 | 25 | 44 | 49 | 38 | 17 | 29 | 4 | 5 | 2 | 14 |
10,255 | ray-project/ray | python/ray/data/preprocessors/transformer.py | ray.data.preprocessors.transformer.PowerTransformer | from typing import List, Optional
from ray.data.preprocessor import Preprocessor
import pandas as pd
from ray.util.annotations import PublicAPI
import numpy as np
@PublicAPI(stability='alpha')
class PowerTransformer(Preprocessor):
"""Apply a `power transform <https://en.wikipedia.org/wiki/Power_transform>`_ to
... | @PublicAPI(stability='alpha')
class PowerTransformer(Preprocessor):
'''Apply a `power transform <https://en.wikipedia.org/wiki/Power_transform>`_ to
make your data more normally distributed.
Some models expect data to be normally distributed. By making your data more
Gaussian-like, you might be able to ... | 6 | 1 | 17 | 2 | 15 | 1 | 2 | 0.52 | 1 | 4 | 0 | 0 | 3 | 3 | 3 | 39 | 78 | 16 | 42 | 12 | 37 | 22 | 28 | 12 | 23 | 5 | 5 | 2 | 9 |
10,256 | ray-project/ray | python/ray/data/preprocessors/vectorizer.py | ray.data.preprocessors.vectorizer.CountVectorizer | import pandas as pd
from collections import Counter
from ray.util.annotations import PublicAPI
from ray.data.preprocessors.utils import simple_hash, simple_split_tokenizer
from typing import TYPE_CHECKING, Callable, List, Optional
from ray.data.preprocessor import Preprocessor
@PublicAPI(stability='alpha')
class Count... | @PublicAPI(stability='alpha')
class CountVectorizer(Preprocessor):
'''Count the frequency of tokens in a column of strings.
:class:`CountVectorizer` operates on columns that contain strings. For example:
.. code-block::
corpus
0 I dislike Python
1 I like Pyth... | 9 | 1 | 10 | 1 | 9 | 0 | 2 | 1 | 1 | 5 | 0 | 0 | 4 | 4 | 4 | 40 | 125 | 23 | 51 | 32 | 38 | 51 | 38 | 27 | 30 | 4 | 5 | 3 | 12 |
10,257 | ray-project/ray | python/ray/data/preprocessors/vectorizer.py | ray.data.preprocessors.vectorizer.HashingVectorizer | from typing import TYPE_CHECKING, Callable, List, Optional
from ray.data.preprocessor import Preprocessor
from ray.util.annotations import PublicAPI
from collections import Counter
import pandas as pd
from ray.data.preprocessors.utils import simple_hash, simple_split_tokenizer
@PublicAPI(stability='alpha')
class Hashi... | @PublicAPI(stability='alpha')
class HashingVectorizer(Preprocessor):
'''Count the frequency of tokens using the
`hashing trick <https://en.wikipedia.org/wiki/Feature_hashing>`_.
This preprocessors creates a list column for each input column. For each row,
the list contains the frequency counts of tokens... | 6 | 1 | 9 | 1 | 7 | 1 | 2 | 2.79 | 1 | 4 | 0 | 0 | 3 | 3 | 3 | 39 | 130 | 24 | 28 | 20 | 18 | 78 | 20 | 15 | 15 | 3 | 5 | 2 | 6 |
10,258 | ray-project/ray | python/ray/data/random_access_dataset.py | ray.data.random_access_dataset.RandomAccessDataset | from typing import TYPE_CHECKING, Any, List, Optional
from collections import defaultdict
import bisect
import ray
from ray.data._internal.execution.interfaces.ref_bundle import _ref_bundles_iterator_to_block_refs_list
from ray.util.annotations import PublicAPI
import time
import random
from ray.data.context import Dat... | @PublicAPI(stability='alpha')
class RandomAccessDataset:
'''A class that provides distributed, random access to a Dataset.
See: ``Dataset.to_random_access_dataset()``.
'''
def __init__(self, ds: 'Dataset', key: str, num_workers: int):
'''Construct a RandomAccessDataset (internal API).
T... | 9 | 5 | 23 | 2 | 18 | 3 | 3 | 0.2 | 0 | 13 | 3 | 0 | 7 | 7 | 7 | 7 | 173 | 22 | 126 | 56 | 113 | 25 | 93 | 49 | 85 | 7 | 0 | 3 | 24 |
10,259 | ray-project/ray | python/ray/data/random_access_dataset.py | ray.data.random_access_dataset._ArrowListWrapper | class _ArrowListWrapper:
def __init__(self, arrow_col):
self.arrow_col = arrow_col
def __getitem__(self, i):
return self.arrow_col[i].as_py()
def __len__(self):
return len(self.arrow_col) | class _ArrowListWrapper:
def __init__(self, arrow_col):
pass
def __getitem__(self, i):
pass
def __len__(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
10,260 | ray-project/ray | python/ray/data/random_access_dataset.py | ray.data.random_access_dataset._RandomAccessWorker | import time
import numpy as np
from ray.data.block import BlockAccessor
import ray
@ray.remote(num_cpus=0)
class _RandomAccessWorker:
def __init__(self, key_field):
self.blocks = None
self.key_field = key_field
self.num_accesses = 0
self.total_time = 0
def assign_blocks(self, ... | @ray.remote(num_cpus=0)
class _RandomAccessWorker:
def __init__(self, key_field):
pass
def assign_blocks(self, block_ref_dict):
pass
def get(self, block_index, key):
pass
def multiget(self, block_indices, keys):
pass
def ping(self):
pass
def stats(se... | 9 | 0 | 7 | 0 | 7 | 0 | 2 | 0.06 | 0 | 4 | 1 | 0 | 7 | 4 | 7 | 7 | 59 | 6 | 50 | 24 | 42 | 3 | 43 | 24 | 35 | 4 | 0 | 1 | 11 |
10,261 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ActorDiedError | from typing import Optional, Union
from ray.util.annotations import DeveloperAPI, PublicAPI
from ray._raylet import ActorID, TaskID, WorkerID
from ray.core.generated.common_pb2 import PYTHON, ActorDiedErrorContext, Address, Language, NodeDeathInfo, RayException
@DeveloperAPI
class ActorDiedError(RayActorError):
""... | @DeveloperAPI
class ActorDiedError(RayActorError):
'''Indicates that the actor died unexpectedly before finishing a task.
This exception could happen either because the actor process dies while
executing a task, or because a task is submitted to a dead actor.
Args:
cause: The cause of the actor ... | 5 | 2 | 27 | 1 | 23 | 3 | 5 | 0.35 | 1 | 2 | 1 | 0 | 1 | 0 | 2 | 19 | 73 | 7 | 49 | 12 | 43 | 17 | 34 | 9 | 31 | 9 | 5 | 2 | 10 |
10,262 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ActorPlacementGroupRemoved | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ActorPlacementGroupRemoved(RayError):
"""Raised when the corresponding placement group was removed."""
def __str__(self):
return 'The placement group corresponding to this Actor has been removed.' | @PublicAPI
class ActorPlacementGroupRemoved(RayError):
'''Raised when the corresponding placement group was removed.'''
def __str__(self):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 14 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,263 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ActorUnavailableError | from ray._raylet import ActorID, TaskID, WorkerID
from typing import Optional, Union
from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class ActorUnavailableError(RayActorError):
"""Raised when the actor is temporarily unavailable but may be available later."""
def __init__(self, error_me... | @DeveloperAPI
class ActorUnavailableError(RayActorError):
'''Raised when the actor is temporarily unavailable but may be available later.'''
def __init__(self, error_message: str, actor_id: Optional[bytes]):
pass | 3 | 1 | 10 | 1 | 9 | 0 | 2 | 0.1 | 1 | 3 | 0 | 0 | 1 | 0 | 1 | 18 | 13 | 2 | 10 | 5 | 8 | 1 | 7 | 5 | 5 | 2 | 5 | 0 | 2 |
10,264 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ActorUnschedulableError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ActorUnschedulableError(RayError):
"""Raised when the actor cannot be scheduled.
One example is that the node specified through
NodeAffinitySchedulingStrategy is dead.
"""
def __init__(self, error_message: str):
sel... | @PublicAPI
class ActorUnschedulableError(RayError):
'''Raised when the actor cannot be scheduled.
One example is that the node specified through
NodeAffinitySchedulingStrategy is dead.
'''
def __init__(self, error_message: str):
pass
def __str__(self):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.8 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 15 | 12 | 3 | 5 | 4 | 2 | 4 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
10,265 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.AsyncioActorExit | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class AsyncioActorExit(RayError):
"""Raised when an asyncio actor intentionally exits via exit_actor()."""
pass | @PublicAPI
class AsyncioActorExit(RayError):
'''Raised when an asyncio actor intentionally exits via exit_actor().'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,266 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.CrossLanguageError | from ray.core.generated.common_pb2 import PYTHON, ActorDiedErrorContext, Address, Language, NodeDeathInfo, RayException
from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class CrossLanguageError(RayError):
"""Raised from another language."""
def __init__(self, ray_exception):
super()... | @PublicAPI
class CrossLanguageError(RayError):
'''Raised from another language.'''
def __init__(self, ray_exception):
pass | 3 | 1 | 7 | 0 | 7 | 0 | 1 | 0.13 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 10 | 1 | 8 | 2 | 6 | 1 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,267 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.GetTimeoutError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class GetTimeoutError(RayError, TimeoutError):
"""Indicates that a call to the worker timed out."""
pass | @PublicAPI
class GetTimeoutError(RayError, TimeoutError):
'''Indicates that a call to the worker timed out.'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
10,268 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.LocalRayletDiedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class LocalRayletDiedError(RayError):
"""Indicates that the task's local raylet died."""
def __str__(self):
return "The task's local raylet died. Check raylet.out for more information." | @PublicAPI
class LocalRayletDiedError(RayError):
'''Indicates that the task's local raylet died.'''
def __str__(self):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 14 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,269 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.NodeDiedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class NodeDiedError(RayError):
"""Indicates that the node is either dead or unreachable."""
def __init__(self, message):
self.message = message
def __str__(self):
return self.message | @PublicAPI
class NodeDiedError(RayError):
'''Indicates that the node is either dead or unreachable.'''
def __init__(self, message):
pass
def __str__(self):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.4 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 15 | 9 | 2 | 5 | 4 | 2 | 2 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
10,270 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectFetchTimedOutError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ObjectFetchTimedOutError(ObjectLostError):
"""Indicates that an object fetch timed out.
Args:
object_ref_hex: Hex ID of the object.
"""
def __str__(self):
return self._base_str() + '\n\n' + f'Fetch for object {s... | @PublicAPI
class ObjectFetchTimedOutError(ObjectLostError):
'''Indicates that an object fetch timed out.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 10 | 0 | 10 | 0 | 1 | 0.36 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 17 | 2 | 11 | 2 | 9 | 4 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,271 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectFreedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class ObjectFreedError(ObjectLostError):
"""Indicates that an object was manually freed by the application.
Attributes:
object_ref_hex: Hex ID of the object.
"""
def __str__(self):
return self._base_str() + '\n\n' ... | @DeveloperAPI
class ObjectFreedError(ObjectLostError):
'''Indicates that an object was manually freed by the application.
Attributes:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 10 | 0 | 10 | 0 | 1 | 0.36 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 17 | 2 | 11 | 2 | 9 | 4 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,272 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectLostError | from ray.util.annotations import DeveloperAPI, PublicAPI
import ray._private.ray_constants as ray_constants
@PublicAPI
class ObjectLostError(RayError):
"""Indicates that the object is lost from distributed memory, due to
node failure or system error.
Args:
object_ref_hex: Hex ID of the object.
... | @PublicAPI
class ObjectLostError(RayError):
'''Indicates that the object is lost from distributed memory, due to
node failure or system error.
Args:
object_ref_hex: Hex ID of the object.
'''
def __init__(self, object_ref_hex, owner_address, call_site):
pass
def _base_str(self):... | 5 | 1 | 9 | 0 | 9 | 0 | 1 | 0.17 | 1 | 0 | 0 | 7 | 3 | 3 | 3 | 16 | 38 | 4 | 29 | 8 | 25 | 5 | 13 | 8 | 9 | 2 | 4 | 1 | 4 |
10,273 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectReconstructionFailedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ObjectReconstructionFailedError(ObjectLostError):
"""Indicates that the object cannot be reconstructed.
Args:
object_ref_hex: Hex ID of the object.
"""
def __str__(self):
return self._base_str() + '\n\n' + 'The ... | @PublicAPI
class ObjectReconstructionFailedError(ObjectLostError):
'''Indicates that the object cannot be reconstructed.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 10 | 0 | 10 | 0 | 1 | 0.36 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 17 | 2 | 11 | 2 | 9 | 4 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,274 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectReconstructionFailedLineageEvictedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ObjectReconstructionFailedLineageEvictedError(ObjectLostError):
"""Indicates that the object cannot be reconstructed because its lineage
was evicted due to memory pressure.
Args:
object_ref_hex: Hex ID of the object.
"""... | @PublicAPI
class ObjectReconstructionFailedLineageEvictedError(ObjectLostError):
'''Indicates that the object cannot be reconstructed because its lineage
was evicted due to memory pressure.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 11 | 0 | 11 | 0 | 1 | 0.42 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 19 | 2 | 12 | 2 | 10 | 5 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,275 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectReconstructionFailedMaxAttemptsExceededError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ObjectReconstructionFailedMaxAttemptsExceededError(ObjectLostError):
"""Indicates that the object cannot be reconstructed because the maximum
number of task retries has been exceeded.
Args:
object_ref_hex: Hex ID of the obje... | @PublicAPI
class ObjectReconstructionFailedMaxAttemptsExceededError(ObjectLostError):
'''Indicates that the object cannot be reconstructed because the maximum
number of task retries has been exceeded.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 11 | 0 | 11 | 0 | 1 | 0.42 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 19 | 2 | 12 | 2 | 10 | 5 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,276 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectRefStreamEndOfStreamError | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class ObjectRefStreamEndOfStreamError(RayError):
"""Raised by streaming generator tasks when there are no more ObjectRefs to
read.
"""
pass | @DeveloperAPI
class ObjectRefStreamEndOfStreamError(RayError):
'''Raised by streaming generator tasks when there are no more ObjectRefs to
read.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,277 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ObjectStoreFullError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class ObjectStoreFullError(RayError):
"""Indicates that the object store is full.
This is raised if the attempt to store the object fails
because the object store is full even after multiple retries.
"""
def __str__(self):
... | @PublicAPI
class ObjectStoreFullError(RayError):
'''Indicates that the object store is full.
This is raised if the attempt to store the object fails
because the object store is full even after multiple retries.
'''
def __str__(self):
pass | 3 | 1 | 7 | 0 | 7 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 14 | 2 | 8 | 2 | 6 | 4 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,278 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.OufOfBandObjectRefSerializationException | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class OufOfBandObjectRefSerializationException(RayError):
"""Raised when an `ray.ObjectRef` is out of band serialized by
`ray.cloudpickle`. It is an anti pattern.
"""
pass | @DeveloperAPI
class OufOfBandObjectRefSerializationException(RayError):
'''Raised when an `ray.ObjectRef` is out of band serialized by
`ray.cloudpickle`. It is an anti pattern.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,279 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.OutOfDiskError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class OutOfDiskError(RayError):
"""Indicates that the local disk is full.
This is raised if the attempt to store the object fails
because both the object store and disk are full.
"""
def __str__(self):
return super(OutOfD... | @PublicAPI
class OutOfDiskError(RayError):
'''Indicates that the local disk is full.
This is raised if the attempt to store the object fails
because both the object store and disk are full.
'''
def __str__(self):
pass | 3 | 1 | 10 | 0 | 9 | 1 | 1 | 0.5 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 17 | 2 | 10 | 2 | 8 | 5 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,280 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.OutOfMemoryError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class OutOfMemoryError(RayError):
"""Indicates that the node is running out of memory and is close to full.
This is raised if the node is low on memory and tasks or actors are being
evicted to free up memory.
"""
def __init__(sel... | @PublicAPI
class OutOfMemoryError(RayError):
'''Indicates that the node is running out of memory and is close to full.
This is raised if the node is low on memory and tasks or actors are being
evicted to free up memory.
'''
def __init__(self, message):
pass
def __str__(self):
p... | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 15 | 13 | 3 | 5 | 4 | 2 | 5 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
10,281 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.OwnerDiedError | from ray.util.annotations import DeveloperAPI, PublicAPI
from ray._raylet import ActorID, TaskID, WorkerID
from ray.core.generated.common_pb2 import PYTHON, ActorDiedErrorContext, Address, Language, NodeDeathInfo, RayException
@PublicAPI
class OwnerDiedError(ObjectLostError):
"""Indicates that the owner of the obj... | @PublicAPI
class OwnerDiedError(ObjectLostError):
'''Indicates that the owner of the object has died while there is still a
reference to the object.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 28 | 1 | 25 | 2 | 3 | 0.27 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 17 | 36 | 3 | 26 | 6 | 24 | 7 | 13 | 6 | 11 | 3 | 5 | 2 | 3 |
10,282 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.PendingCallsLimitExceeded | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class PendingCallsLimitExceeded(RayError):
"""Raised when the pending actor calls exceeds `max_pending_calls` option.
This exception could happen probably because the caller calls the callee
too frequently.
"""
pass | @PublicAPI
class PendingCallsLimitExceeded(RayError):
'''Raised when the pending actor calls exceeds `max_pending_calls` option.
This exception could happen probably because the caller calls the callee
too frequently.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 8 | 2 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,283 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.PlasmaObjectNotAvailable | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class PlasmaObjectNotAvailable(RayError):
"""Called when an object was not available within the given timeout."""
pass | @PublicAPI
class PlasmaObjectNotAvailable(RayError):
'''Called when an object was not available within the given timeout.'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,284 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayActorError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class RayActorError(RayError):
"""Indicates that the actor has outages unexpectedly before finishing a task.
This exception could happen because the actor process is dead, or is unavailable for
the moment. Ray raises subclasses `ActorDied... | @PublicAPI
class RayActorError(RayError):
'''Indicates that the actor has outages unexpectedly before finishing a task.
This exception could happen because the actor process is dead, or is unavailable for
the moment. Ray raises subclasses `ActorDiedError` and `ActorUnavailableError`
respectively.
''... | 8 | 1 | 5 | 0 | 4 | 1 | 1 | 0.43 | 1 | 2 | 0 | 3 | 4 | 4 | 4 | 17 | 36 | 6 | 21 | 18 | 8 | 9 | 13 | 10 | 8 | 1 | 4 | 0 | 4 |
10,285 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayCgraphCapacityExceeded | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI(stability='alpha')
class RayCgraphCapacityExceeded(RaySystemError):
"""Raised when the Compiled Graph channel's buffer is at max capacity"""
pass | @PublicAPI(stability='alpha')
class RayCgraphCapacityExceeded(RaySystemError):
'''Raised when the Compiled Graph channel's buffer is at max capacity'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
10,286 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayChannelError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI(stability='alpha')
class RayChannelError(RaySystemError):
"""Indicates that Ray encountered a system error related
to ray.experimental.channel.
"""
pass | @PublicAPI(stability='alpha')
class RayChannelError(RaySystemError):
'''Indicates that Ray encountered a system error related
to ray.experimental.channel.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 15 | 6 | 1 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
10,287 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayChannelTimeoutError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI(stability='alpha')
class RayChannelTimeoutError(RayChannelError, TimeoutError):
"""Raised when the Compiled Graph channel operation times out."""
pass | @PublicAPI(stability='alpha')
class RayChannelTimeoutError(RayChannelError, TimeoutError):
'''Raised when the Compiled Graph channel operation times out.'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 6 | 0 | 0 |
10,288 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayError | from traceback import format_exception
from ray.util.annotations import DeveloperAPI, PublicAPI
from ray.core.generated.common_pb2 import PYTHON, ActorDiedErrorContext, Address, Language, NodeDeathInfo, RayException
import ray.cloudpickle as pickle
@PublicAPI
class RayError(Exception):
"""Super class of all ray ex... | @PublicAPI
class RayError(Exception):
'''Super class of all ray exception types.'''
def to_bytes(self):
pass
@staticmethod
def from_bytes(b):
pass
@staticmethod
def from_ray_exception(ray_exception):
pass | 7 | 1 | 7 | 0 | 7 | 0 | 2 | 0.08 | 1 | 3 | 1 | 25 | 1 | 0 | 3 | 13 | 29 | 3 | 24 | 11 | 18 | 2 | 17 | 8 | 13 | 3 | 3 | 2 | 5 |
10,289 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RaySystemError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class RaySystemError(RayError):
"""Indicates that Ray encountered a system error.
This exception can be thrown when the raylet is killed.
"""
def __init__(self, client_exc, traceback_str=None):
self.client_exc = client_exc
... | @PublicAPI
class RaySystemError(RayError):
'''Indicates that Ray encountered a system error.
This exception can be thrown when the raylet is killed.
'''
def __init__(self, client_exc, traceback_str=None):
pass
def __str__(self):
pass | 4 | 1 | 4 | 0 | 4 | 0 | 2 | 0.33 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 15 | 15 | 3 | 9 | 6 | 6 | 3 | 9 | 6 | 6 | 2 | 4 | 1 | 3 |
10,290 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RayTaskError | import os
import colorama
from ray.util.annotations import DeveloperAPI, PublicAPI
import ray.cloudpickle as pickle
import ray._private.ray_constants as ray_constants
import sys
@PublicAPI
class RayTaskError(RayError):
"""Indicates that a task threw an exception during execution.
If a task throws an exception... | @PublicAPI
class RayTaskError(RayError):
'''Indicates that a task threw an exception during execution.
If a task throws an exception during execution, a RayTaskError is stored in
the object store for each of the task's outputs. When an object is
retrieved from the object store, the Python method that re... | 19 | 5 | 17 | 1 | 11 | 4 | 2 | 0.45 | 1 | 7 | 2 | 2 | 6 | 9 | 6 | 19 | 208 | 26 | 127 | 56 | 100 | 57 | 86 | 44 | 69 | 8 | 4 | 3 | 25 |
10,291 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.ReferenceCountingAssertionError | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class ReferenceCountingAssertionError(ObjectLostError, AssertionError):
"""Indicates that an object has been deleted while there was still a
reference to it.
Args:
object_ref_hex: Hex ID of the object.
"""
def __str__(... | @DeveloperAPI
class ReferenceCountingAssertionError(ObjectLostError, AssertionError):
'''Indicates that an object has been deleted while there was still a
reference to it.
Args:
object_ref_hex: Hex ID of the object.
'''
def __str__(self):
pass | 3 | 1 | 9 | 0 | 9 | 0 | 1 | 0.5 | 2 | 0 | 0 | 0 | 1 | 0 | 1 | 18 | 17 | 2 | 10 | 2 | 8 | 5 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
10,292 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RpcError | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class RpcError(RayError):
"""Indicates an error in the underlying RPC system."""
def __init__(self, message, rpc_code=None):
self.message = message
self.rpc_code = rpc_code
def __str__(self):
return self.messag... | @DeveloperAPI
class RpcError(RayError):
'''Indicates an error in the underlying RPC system.'''
def __init__(self, message, rpc_code=None):
pass
def __str__(self):
pass | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.17 | 1 | 0 | 0 | 0 | 2 | 2 | 2 | 15 | 9 | 2 | 6 | 5 | 3 | 1 | 6 | 5 | 3 | 1 | 4 | 0 | 2 |
10,293 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.RuntimeEnvSetupError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class RuntimeEnvSetupError(RayError):
"""Raised when a runtime environment fails to be set up.
Args:
error_message: The error message that explains
why runtime env setup has failed.
"""
def __init__(self, error_me... | @PublicAPI
class RuntimeEnvSetupError(RayError):
'''Raised when a runtime environment fails to be set up.
Args:
error_message: The error message that explains
why runtime env setup has failed.
'''
def __init__(self, error_message: str=None):
pass
def __str__(self):
... | 4 | 1 | 4 | 0 | 4 | 0 | 2 | 0.63 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 15 | 16 | 3 | 8 | 5 | 5 | 5 | 8 | 5 | 5 | 2 | 4 | 1 | 3 |
10,294 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.TaskCancelledError | from ray.util.annotations import DeveloperAPI, PublicAPI
from ray._raylet import ActorID, TaskID, WorkerID
from typing import Optional, Union
@PublicAPI
class TaskCancelledError(RayError):
"""Raised when this task is cancelled.
Args:
task_id: The TaskID of the function that was directly
ca... | @PublicAPI
class TaskCancelledError(RayError):
'''Raised when this task is cancelled.
Args:
task_id: The TaskID of the function that was directly
cancelled.
'''
def __init__(self, task_id: Optional[TaskID]=None, error_message: Optional[str]=None):
pass
def __str__(self)... | 4 | 1 | 6 | 0 | 6 | 0 | 2 | 0.38 | 1 | 1 | 0 | 1 | 2 | 2 | 2 | 15 | 21 | 3 | 13 | 8 | 8 | 5 | 11 | 6 | 8 | 3 | 4 | 1 | 4 |
10,295 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.TaskPlacementGroupRemoved | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class TaskPlacementGroupRemoved(RayError):
"""Raised when the corresponding placement group was removed."""
def __str__(self):
return 'The placement group corresponding to this task has been removed.' | @PublicAPI
class TaskPlacementGroupRemoved(RayError):
'''Raised when the corresponding placement group was removed.'''
def __str__(self):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 14 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,296 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.TaskUnschedulableError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class TaskUnschedulableError(RayError):
"""Raised when the task cannot be scheduled.
One example is that the node specified through
NodeAffinitySchedulingStrategy is dead.
"""
def __init__(self, error_message: str):
self.... | @PublicAPI
class TaskUnschedulableError(RayError):
'''Raised when the task cannot be scheduled.
One example is that the node specified through
NodeAffinitySchedulingStrategy is dead.
'''
def __init__(self, error_message: str):
pass
def __str__(self):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.8 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 15 | 12 | 3 | 5 | 4 | 2 | 4 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
10,297 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.UserCodeException | from ray.util.annotations import DeveloperAPI, PublicAPI
@DeveloperAPI
class UserCodeException(RayError):
"""Indicates that an exception occurred while executing user code.
For example, this exception can be used to wrap user code exceptions
from a remote task or actor. The `retry_exceptions` parameter wil... | @DeveloperAPI
class UserCodeException(RayError):
'''Indicates that an exception occurred while executing user code.
For example, this exception can be used to wrap user code exceptions
from a remote task or actor. The `retry_exceptions` parameter will
still respect the underlying cause of this exception... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 13 | 7 | 1 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
10,298 | ray-project/ray | python/ray/exceptions.py | ray.exceptions.WorkerCrashedError | from ray.util.annotations import DeveloperAPI, PublicAPI
@PublicAPI
class WorkerCrashedError(RayError):
"""Indicates that the worker died unexpectedly while executing a task."""
def __str__(self):
return 'The worker died unexpectedly while executing this task. Check python-core-worker-*.log files for ... | @PublicAPI
class WorkerCrashedError(RayError):
'''Indicates that the worker died unexpectedly while executing a task.'''
def __str__(self):
pass | 3 | 1 | 5 | 0 | 5 | 0 | 1 | 0.17 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 14 | 8 | 1 | 6 | 2 | 4 | 1 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
10,299 | ray-project/ray | python/ray/experimental/channel/auto_transport_type.py | ray.experimental.channel.auto_transport_type.AutoTransportType | from ray.experimental.channel import ChannelOutputType
from typing import Dict, List, Optional, Tuple, Union
from ray.experimental.util.types import Device
class AutoTransportType(ChannelOutputType):
"""
Type hint for automatic transport selection for tensors.
With this type hint Compiled Graphs automatic... |
class AutoTransportType(ChannelOutputType):
'''
Type hint for automatic transport selection for tensors.
With this type hint Compiled Graphs automatically decide the best transport
to use (e.g., accellerator or shared memory) based on the node locations and
GPU IDs of the readers and writers.
'... | 5 | 2 | 9 | 0 | 7 | 2 | 1 | 0.67 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 7 | 28 | 3 | 15 | 10 | 7 | 10 | 6 | 5 | 3 | 1 | 1 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.