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,100
ray-project/ray
python/ray/data/_internal/logical/interfaces/optimizer.py
ray.data._internal.logical.interfaces.optimizer.Rule
from .plan import Plan from typing import List, Type class Rule: """Abstract class for optimization rule.""" def apply(self, plan: Plan) -> Plan: """Apply the optimization rule to the execution plan.""" raise NotImplementedError @classmethod def dependencies(cls) -> List[Type['Rule']]...
class Rule: '''Abstract class for optimization rule.''' def apply(self, plan: Plan) -> Plan: '''Apply the optimization rule to the execution plan.''' pass @classmethod def dependencies(cls) -> List[Type['Rule']]: '''List of rules that must be applied before this rule.''' ...
6
4
3
0
2
1
1
0.67
0
2
1
7
1
0
1
1
6
1
3
2
1
2
3
2
1
1
0
0
1
10,101
ray-project/ray
python/ray/data/_internal/logical/interfaces/physical_plan.py
ray.data._internal.logical.interfaces.physical_plan.PhysicalPlan
from .plan import Plan from typing import TYPE_CHECKING, Dict from .logical_operator import LogicalOperator class PhysicalPlan(Plan): """The plan with a DAG of physical operators.""" def __init__(self, dag: 'PhysicalOperator', op_map: Dict['PhysicalOperator', LogicalOperator], context: 'DataContext'): ...
class PhysicalPlan(Plan): '''The plan with a DAG of physical operators.''' def __init__(self, dag: 'PhysicalOperator', op_map: Dict['PhysicalOperator', LogicalOperator], context: 'DataContext'): pass @property def dag(self) -> 'PhysicalOperator': '''Get the DAG of physical operators.''...
6
3
6
0
4
1
1
0.31
1
2
1
0
3
2
3
6
24
3
16
13
5
5
9
6
5
1
1
0
3
10,102
ray-project/ray
python/ray/data/_internal/logical/interfaces/plan.py
ray.data._internal.logical.interfaces.plan.Plan
from .operator import Operator class Plan: """Abstract class for logical/physical execution plans. This plan should hold an operator representing the plan DAG and any auxiliary data that's useful for plan optimization or execution. """ def __init__(self, context: 'DataContext'): self._con...
class Plan: '''Abstract class for logical/physical execution plans. This plan should hold an operator representing the plan DAG and any auxiliary data that's useful for plan optimization or execution. ''' def __init__(self, context: 'DataContext'): pass @property def dag(self) -> O...
6
1
2
0
2
0
1
0.44
0
2
1
2
3
1
3
3
17
4
9
7
3
4
7
5
3
1
0
0
3
10,103
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.AbstractAllToAll
from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Dict, List, Optional class AbstractAllToAll(LogicalOperator): """Abstract class for logical operators should be converted to physical AllToAllOperator. """ def __init__(self, name: str, input_op: L...
class AbstractAllToAll(LogicalOperator): '''Abstract class for logical operators should be converted to physical AllToAllOperator. ''' def __init__(self, name: str, input_op: LogicalOperator, num_outputs: Optional[int]=None, sub_progress_bar_names: Optional[List[str]]=None, ray_remote_args: Optional[D...
2
2
22
0
12
10
1
1
1
4
0
5
1
3
1
16
27
1
13
12
4
13
6
5
4
1
2
0
1
10,104
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.Aggregate
from typing import TYPE_CHECKING, Any, Dict, List, Optional from ray.data._internal.planner.exchange.sort_task_spec import SortKey, SortTaskSpec from ray.data.aggregate import AggregateFn from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from ray.data._internal.logical.interfaces import Logica...
class Aggregate(AbstractAllToAll): '''Logical operator for aggregate.''' def __init__(self, input_op: LogicalOperator, key: Optional[str], aggs: List[AggregateFn], num_partitions: Optional[int]=None, batch_format: Optional[str]='default'): pass
2
1
21
0
21
0
1
0.05
1
6
3
0
1
4
1
17
24
1
22
13
13
1
7
6
5
1
3
0
1
10,105
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.RandomShuffle
from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from typing import TYPE_CHECKING, Any, Dict, List, Optional from ray.data._internal.logical.interfaces import LogicalOperator class RandomShuffle(AbstractAllToAll): """Logical operator for random_shuffle.""" def __init__(self, input_o...
class RandomShuffle(AbstractAllToAll): '''Logical operator for random_shuffle.''' def __init__(self, input_op: LogicalOperator, name: str='RandomShuffle', seed: Optional[int]=None, ray_remote_args: Optional[Dict[str, Any]]=None): pass def infer_metadata(self) -> 'BlockMetadata': pass ...
4
1
10
0
10
0
1
0.05
1
5
1
0
2
1
2
18
24
2
21
10
12
1
7
4
4
1
3
0
2
10,106
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.RandomizeBlocks
from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Dict, List, Optional class RandomizeBlocks(AbstractAllToAll): """Logical operator for randomize_block_order.""" def __init__(self, input_op: LogicalOperator, seed: Optional[int]=None): super().__in...
class RandomizeBlocks(AbstractAllToAll): '''Logical operator for randomize_block_order.''' def __init__(self, input_op: LogicalOperator, seed: Optional[int]=None): pass def infer_metadata(self) -> 'BlockMetadata': pass def infer_schema(self) -> Optional['Schema']: pass
4
1
7
0
7
0
1
0.07
1
2
0
0
2
1
2
18
17
2
14
8
7
1
7
4
4
1
3
0
2
10,107
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.Repartition
from ray.data._internal.logical.interfaces import LogicalOperator from ray.data._internal.planner.exchange.shuffle_task_spec import ShuffleTaskSpec from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from typing import TYPE_CHECKING, Any, Dict, List, Optional class Repartition(AbstractAllToAll)...
class Repartition(AbstractAllToAll): '''Logical operator for repartition.''' def __init__(self, input_op: LogicalOperator, num_outputs: int, shuffle: bool, keys: Optional[List[str]]=None, sort: bool=False): pass def infer_metadata(self) -> 'BlockMetadata': pass def infer_schema(self)...
4
1
13
0
13
0
2
0.04
1
5
2
0
2
1
2
18
29
2
26
10
18
1
10
5
7
2
3
1
3
10,108
ray-project/ray
python/ray/data/_internal/logical/operators/all_to_all_operator.py
ray.data._internal.logical.operators.all_to_all_operator.Sort
from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Dict, List, Optional from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from ray.data._internal.planner.exchange.sort_task_spec import SortKey, SortTaskSpec class Sort(AbstractAllToAll): ...
class Sort(AbstractAllToAll): '''Logical operator for sort.''' def __init__(self, input_op: LogicalOperator, sort_key: SortKey, batch_format: Optional[str]='default'): pass def infer_metadata(self) -> 'BlockMetadata': pass def infer_schema(self) -> Optional['Schema']: pass
4
1
10
0
10
0
1
0.05
1
5
3
0
2
2
2
18
24
2
21
10
13
1
8
5
5
1
3
0
2
10,109
ray-project/ray
python/ray/data/_internal/logical/operators/count_operator.py
ray.data._internal.logical.operators.count_operator.Count
from ray.data._internal.logical.interfaces import LogicalOperator class Count(LogicalOperator): """Logical operator that represents counting the number of rows in inputs. Physical operators that implement this logical operator should produce one or more rows with a single column named `Count.COLUMN_NAME`....
class Count(LogicalOperator): '''Logical operator that represents counting the number of rows in inputs. Physical operators that implement this logical operator should produce one or more rows with a single column named `Count.COLUMN_NAME`. When you sum the values in this column, you should get the tot...
2
1
5
0
5
0
1
0.71
1
1
0
0
1
0
1
16
15
3
7
6
2
5
4
3
2
1
2
0
1
10,110
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.AbstractFrom
from typing import TYPE_CHECKING, List, Optional, Union from ray.data.block import Block, BlockMetadata, BlockMetadataWithSchema from ray.data._internal.execution.interfaces import RefBundle import abc import functools from ray.data._internal.logical.interfaces import LogicalOperator, SourceOperator from ray.types impo...
class AbstractFrom(LogicalOperator, SourceOperator, metaclass=abc.ABCMeta): '''Abstract logical operator for `from_*`.''' def __init__(self, input_blocks: List[ObjectRef[Block]], input_metadata: List[BlockMetadataWithSchema]): pass @property def input_data(self) -> List[RefBundle]: pas...
12
1
5
0
5
0
1
0.06
2
4
1
5
9
1
9
44
59
9
47
19
31
3
27
13
17
2
3
1
11
10,111
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.FromArrow
class FromArrow(AbstractFrom): """Logical operator for `from_arrow`.""" pass
class FromArrow(AbstractFrom): '''Logical operator for `from_arrow`.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
44
4
1
2
1
1
1
2
1
1
0
4
0
0
10,112
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.FromBlocks
class FromBlocks(AbstractFrom): """Logical operator for `from_blocks`.""" pass
class FromBlocks(AbstractFrom): '''Logical operator for `from_blocks`.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
44
4
1
2
1
1
1
2
1
1
0
4
0
0
10,113
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.FromItems
class FromItems(AbstractFrom): """Logical operator for `from_items`.""" pass
class FromItems(AbstractFrom): '''Logical operator for `from_items`.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
44
4
1
2
1
1
1
2
1
1
0
4
0
0
10,114
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.FromNumpy
class FromNumpy(AbstractFrom): """Logical operator for `from_numpy`.""" pass
class FromNumpy(AbstractFrom): '''Logical operator for `from_numpy`.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
44
4
1
2
1
1
1
2
1
1
0
4
0
0
10,115
ray-project/ray
python/ray/data/_internal/logical/operators/from_operators.py
ray.data._internal.logical.operators.from_operators.FromPandas
class FromPandas(AbstractFrom): """Logical operator for `from_pandas`.""" pass
class FromPandas(AbstractFrom): '''Logical operator for `from_pandas`.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
44
4
1
2
1
1
1
2
1
1
0
4
0
0
10,116
ray-project/ray
python/ray/data/_internal/logical/operators/input_data_operator.py
ray.data._internal.logical.operators.input_data_operator.InputData
from ray.data._internal.execution.interfaces import RefBundle from ray.data.block import BlockMetadata from ray.data._internal.util import unify_schemas_with_validation from ray.data._internal.logical.interfaces import LogicalOperator, SourceOperator import functools from typing import List, Optional class InputData(L...
class InputData(LogicalOperator, SourceOperator): '''Logical operator for input data. This may hold cached blocks from a previous Dataset execution. ''' def __init__(self, input_data: List[RefBundle]): pass def output_data(self) -> Optional[List[RefBundle]]: pass def infer_me...
10
1
6
0
6
0
2
0.1
1
3
0
0
8
2
8
23
65
10
50
18
36
5
33
13
24
2
2
1
13
10,117
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.AbstractMap
from ray.data._internal.logical.operators.one_to_one_operator import AbstractOneToOne from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional from ray.data._internal.logical.interfaces import LogicalOperator from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy class Abstract...
class AbstractMap(AbstractOneToOne): '''Abstract class for logical operators that should be converted to physical MapOperator. ''' def __init__(self, name: str, input_op: Optional[LogicalOperator]=None, num_outputs: Optional[int]=None, *, min_rows_per_bundled_input: Optional[int]=None, ray_remote_args...
2
2
32
0
16
16
1
1.12
1
4
0
4
1
4
1
19
37
1
17
16
5
19
7
6
5
1
3
0
1
10,118
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.AbstractUDFMap
import inspect from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional from ray.data.block import UserDefinedFunction import functools from ray.data.preproce...
class AbstractUDFMap(AbstractMap): '''Abstract class for logical operators performing a UDF that should be converted to physical MapOperator. ''' def __init__(self, name: str, input_op: LogicalOperator, fn: UserDefinedFunction, *, fn_args: Optional[Iterable[Any]]=None, fn_kwargs: Optional[Dict[str, An...
3
3
39
1
22
17
4
0.84
1
5
0
4
2
6
2
21
84
3
44
23
28
37
22
9
19
6
4
2
7
10,119
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.Filter
from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy from ray.data._internal.logical.interfaces import LogicalOperator from ray.data.block import UserDefinedFunction from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional class Filter(AbstractUDFMap): """Logical operator...
class Filter(AbstractUDFMap): '''Logical operator for filter.''' def __init__(self, input_op: LogicalOperator, fn: Optional[UserDefinedFunction]=None, fn_args: Optional[Iterable[Any]]=None, fn_kwargs: Optional[Dict[str, Any]]=None, fn_constructor_args: Optional[Iterable[Any]]=None, fn_constructor_kwargs: Opti...
3
1
12
1
11
1
2
0.08
1
5
0
0
2
1
2
23
29
3
24
13
12
2
8
4
5
2
5
1
3
10,120
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.FlatMap
from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy from ray.data.block import UserDefinedFunction from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional class FlatMap(AbstractUDFMap): """Logical operato...
class FlatMap(AbstractUDFMap): '''Logical operator for flat_map.''' def __init__(self, input_op: LogicalOperator, fn: UserDefinedFunction, fn_args: Optional[Iterable[Any]]=None, fn_kwargs: Optional[Dict[str, Any]]=None, fn_constructor_args: Optional[Iterable[Any]]=None, fn_constructor_kwargs: Optional[Dict[st...
3
1
13
0
13
0
1
0.04
1
4
0
0
2
0
2
23
31
2
28
15
13
1
5
3
2
1
5
0
2
10,121
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.MapBatches
from ray.data.block import UserDefinedFunction from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional class MapBatches(AbstractUDFMap): """Logical oper...
class MapBatches(AbstractUDFMap): '''Logical operator for map_batches.''' def __init__(self, input_op: LogicalOperator, fn: UserDefinedFunction, batch_size: Optional[int]=None, batch_format: str='default', zero_copy_batch: bool=False, fn_args: Optional[Iterable[Any]]=None, fn_kwargs: Optional[Dict[str, Any]]=...
3
1
17
0
17
0
1
0.03
1
5
0
0
2
3
2
23
39
2
36
22
17
1
8
6
5
1
5
0
2
10,122
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.MapRows
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional from ray.data.block import UserDefinedFunction from ray.data._internal.logical.interfaces import LogicalOperator from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy class MapRows(AbstractUDFMap): """Logical operato...
class MapRows(AbstractUDFMap): '''Logical operator for map.''' def __init__(self, input_op: LogicalOperator, fn: UserDefinedFunction, fn_args: Optional[Iterable[Any]]=None, fn_kwargs: Optional[Dict[str, Any]]=None, fn_constructor_args: Optional[Iterable[Any]]=None, fn_constructor_kwargs: Optional[Dict[str, An...
3
1
13
0
13
0
1
0.04
1
4
0
0
2
0
2
23
31
2
28
15
13
1
5
3
2
1
5
0
2
10,123
ray-project/ray
python/ray/data/_internal/logical/operators/map_operator.py
ray.data._internal.logical.operators.map_operator.Project
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional from ray.data.expressions import Expr from ray.data._internal.logical.interfaces import LogicalOperator from ray.data._internal.compute import ComputeStrategy, TaskPoolStrategy class Project(AbstractMap): """Logical operator for select...
class Project(AbstractMap): '''Logical operator for select_columns.''' def __init__(self, input_op: LogicalOperator, cols: Optional[List[str]]=None, cols_rename: Optional[Dict[str, str]]=None, exprs: Optional[Dict[str, 'Expr']]=None, compute: Optional[ComputeStrategy]=None, ray_remote_args: Optional[Dict[str,...
9
1
6
0
6
0
1
0.03
1
4
0
0
4
5
4
23
34
4
29
20
14
1
14
10
9
1
4
0
4
10,124
ray-project/ray
python/ray/data/_internal/logical/operators/n_ary_operator.py
ray.data._internal.logical.operators.n_ary_operator.NAry
from ray.data._internal.logical.interfaces import LogicalOperator from typing import Optional class NAry(LogicalOperator): """Base class for n-ary operators, which take multiple input operators.""" def __init__(self, *input_ops: LogicalOperator, num_outputs: Optional[int]=None): """ Args: ...
class NAry(LogicalOperator): '''Base class for n-ary operators, which take multiple input operators.''' def __init__(self, *input_ops: LogicalOperator, num_outputs: Optional[int]=None): ''' Args: input_ops: The input operators. ''' pass
2
2
10
0
6
4
1
0.71
1
3
0
2
1
0
1
16
13
1
7
6
1
5
3
2
1
1
2
0
1
10,125
ray-project/ray
python/ray/data/_internal/logical/operators/n_ary_operator.py
ray.data._internal.logical.operators.n_ary_operator.Union
from ray.data._internal.logical.interfaces import LogicalOperator class Union(NAry): """Logical operator for union.""" def __init__(self, *input_ops: LogicalOperator): super().__init__(*input_ops) def estimated_num_outputs(self): total_num_outputs = 0 for input in self._input_depe...
class Union(NAry): '''Logical operator for union.''' def __init__(self, *input_ops: LogicalOperator): pass def estimated_num_outputs(self): pass
3
1
7
0
7
0
2
0.07
1
1
0
0
2
0
2
18
17
2
14
9
8
1
11
6
8
3
3
2
4
10,126
ray-project/ray
python/ray/data/_internal/logical/operators/n_ary_operator.py
ray.data._internal.logical.operators.n_ary_operator.Zip
from ray.data._internal.logical.interfaces import LogicalOperator class Zip(NAry): """Logical operator for zip.""" def __init__(self, left_input_op: LogicalOperator, right_input_op: LogicalOperator): """ Args: left_input_op: The input operator at left hand side. right_i...
class Zip(NAry): '''Logical operator for zip.''' def __init__(self, left_input_op: LogicalOperator, right_input_op: LogicalOperator): ''' Args: left_input_op: The input operator at left hand side. right_input_op: The input operator at right hand side. ''' ...
3
2
9
0
6
3
2
0.46
1
1
0
0
2
0
2
18
21
2
13
9
6
6
9
5
6
2
3
1
3
10,127
ray-project/ray
python/ray/data/_internal/logical/operators/one_to_one_operator.py
ray.data._internal.logical.operators.one_to_one_operator.AbstractOneToOne
from ray.data._internal.logical.interfaces import LogicalOperator from typing import TYPE_CHECKING, Any, Dict, Optional class AbstractOneToOne(LogicalOperator): """Abstract class for one-to-one logical operators, which have one input and one output dependency. """ def __init__(self, name: str, input_o...
class AbstractOneToOne(LogicalOperator): '''Abstract class for one-to-one logical operators, which have one input and one output dependency. ''' def __init__(self, name: str, input_op: Optional[LogicalOperator], num_outputs: Optional[int]=None): ''' Args: name: Name for thi...
5
3
6
0
3
3
1
0.86
1
4
0
2
3
0
3
18
29
3
14
11
2
12
6
4
2
2
2
0
4
10,128
ray-project/ray
python/ray/data/_internal/logical/operators/one_to_one_operator.py
ray.data._internal.logical.operators.one_to_one_operator.Limit
from typing import TYPE_CHECKING, Any, Dict, Optional from ray.data._internal.logical.interfaces import LogicalOperator from ray.data.block import BlockMetadata class Limit(AbstractOneToOne): """Logical operator for limit.""" def __init__(self, input_op: LogicalOperator, limit: int): super().__init__(...
class Limit(AbstractOneToOne): '''Logical operator for limit.''' def __init__(self, input_op: LogicalOperator, limit: int): pass def can_modify_num_rows(self) -> bool: pass def infer_metadata(self) -> BlockMetadata: pass def infer_schema(self) -> Optional['Schema']: ...
7
1
6
0
6
0
1
0.03
1
3
0
0
6
1
6
24
42
6
35
14
23
1
20
9
13
2
3
1
7
10,129
ray-project/ray
python/ray/data/_internal/logical/operators/read_operator.py
ray.data._internal.logical.operators.read_operator.Read
from ray.data.block import BlockMetadata, BlockMetadataWithSchema from typing import Any, Dict, List, Optional, Union from ray.data._internal.logical.interfaces import LogicalOperatorSupportsProjectionPushdown, SourceOperator import functools import copy from ray.data.datasource.datasource import Datasource, Reader fro...
class Read(AbstractMap, SourceOperator, LogicalOperatorSupportsProjectionPushdown): '''Logical operator for read.''' def __init__(self, datasource: Datasource, datasource_or_legacy_reader: Union[Datasource, Reader], parallelism: int, mem_size: Optional[int], num_outputs: Optional[int]=None, ray_remote_args: O...
13
4
16
2
11
3
2
0.28
1
6
2
0
5
6
5
24
86
13
57
28
41
16
34
18
28
7
4
2
11
10,130
ray-project/ray
python/ray/data/_internal/logical/operators/write_operator.py
ray.data._internal.logical.operators.write_operator.Write
from typing import Any, Dict, Optional, Union from ray.data._internal.logical.interfaces import LogicalOperator from ray.data.datasource.datasource import Datasource from ray.data._internal.logical.operators.map_operator import AbstractMap from ray.data.datasource.datasink import Datasink class Write(AbstractMap): ...
class Write(AbstractMap): '''Logical operator for write.''' def __init__(self, input_op: LogicalOperator, datasink_or_legacy_datasource: Union[Datasink, Datasource], ray_remote_args: Optional[Dict[str, Any]]=None, concurrency: Optional[int]=None, **write_args): pass
2
1
24
1
23
0
2
0.04
1
6
2
0
1
3
1
20
27
2
24
13
15
1
9
6
7
2
4
1
2
10,131
ray-project/ray
python/ray/data/_internal/logical/optimizers.py
ray.data._internal.logical.optimizers.LogicalOptimizer
from ray.data._internal.logical.interfaces import LogicalPlan, Optimizer, PhysicalPlan, Rule from typing import List class LogicalOptimizer(Optimizer): """The optimizer for logical operators.""" @property def rules(self) -> List[Rule]: return [rule_cls() for rule_cls in get_logical_ruleset()]
class LogicalOptimizer(Optimizer): '''The optimizer for logical operators.''' @property def rules(self) -> List[Rule]: pass
3
1
2
0
2
0
1
0.25
1
1
1
0
1
0
1
3
6
1
4
3
1
1
3
2
1
1
1
0
1
10,132
ray-project/ray
python/ray/data/_internal/logical/optimizers.py
ray.data._internal.logical.optimizers.PhysicalOptimizer
from ray.data._internal.logical.interfaces import LogicalPlan, Optimizer, PhysicalPlan, Rule from typing import List class PhysicalOptimizer(Optimizer): """The optimizer for physical operators.""" @property def rules(self) -> List[Rule]: return [rule_cls() for rule_cls in get_physical_ruleset()]
class PhysicalOptimizer(Optimizer): '''The optimizer for physical operators.''' @property def rules(self) -> List[Rule]: pass
3
1
2
0
2
0
1
0.25
1
1
1
0
1
0
1
3
6
1
4
3
1
1
3
2
1
1
1
0
1
10,133
ray-project/ray
python/ray/data/_internal/logical/rules/inherit_batch_format.py
ray.data._internal.logical.rules.inherit_batch_format.InheritBatchFormatRule
from typing import Iterable from ray.data._internal.logical.operators.all_to_all_operator import AbstractAllToAll from ray.data._internal.logical.operators.map_operator import MapBatches from ray.data._internal.logical.interfaces import LogicalOperator, LogicalPlan, Rule from collections import deque class InheritBatc...
class InheritBatchFormatRule(Rule): '''For AbstractAllToAll based operator, apply this rule to inherit batch_format from upstream operator by traversing the entire DAG.''' def apply(self, plan: LogicalPlan) -> LogicalPlan: pass def _apply(self, op: LogicalOperator): pass
3
1
14
2
11
2
4
0.32
1
4
4
0
2
0
2
3
34
5
22
9
19
7
19
9
16
6
1
4
7
10,134
ray-project/ray
python/ray/data/_internal/logical/rules/inherit_target_max_block_size.py
ray.data._internal.logical.rules.inherit_target_max_block_size.InheritTargetMaxBlockSizeRule
from ray.data._internal.logical.interfaces import PhysicalPlan, Rule from typing import Optional from ray.data._internal.execution.interfaces import PhysicalOperator class InheritTargetMaxBlockSizeRule(Rule): """For each op that has overridden the default target max block size, propagate to upstream ops until ...
class InheritTargetMaxBlockSizeRule(Rule): '''For each op that has overridden the default target max block size, propagate to upstream ops until we reach an op that has also overridden the target max block size.''' def apply(self, plan: PhysicalPlan) -> PhysicalPlan: pass def _propagate_t...
3
1
9
1
7
2
3
0.4
1
2
1
0
2
0
2
3
24
3
15
6
10
6
10
4
7
4
1
1
5
10,135
ray-project/ray
python/ray/data/_internal/logical/rules/limit_pushdown.py
ray.data._internal.logical.rules.limit_pushdown.LimitPushdownRule
from collections import deque from ray.data._internal.logical.interfaces import LogicalOperator, LogicalPlan, Rule from ray.data._internal.logical.operators.one_to_one_operator import AbstractOneToOne, Limit import copy from typing import Iterable, List from ray.data._internal.logical.operators.n_ary_operator import Un...
class LimitPushdownRule(Rule): '''Rule for pushing down the limit operator. When a limit operator is present, we apply the limit on the most upstream operator that supports it. We are conservative and only push through operators that we know for certain do not modify row counts: - Project operation...
7
5
36
5
20
11
5
0.67
1
6
5
0
3
0
3
4
121
21
60
24
56
40
51
24
47
7
1
4
14
10,136
ray-project/ray
python/ray/data/_internal/logical/rules/set_read_parallelism.py
ray.data._internal.logical.rules.set_read_parallelism.SetReadParallelismRule
from ray.data._internal.execution.interfaces import PhysicalOperator from ray.data._internal.logical.interfaces import PhysicalPlan, Rule from ray.data._internal.execution.operators.input_data_buffer import InputDataBuffer from ray.data._internal.logical.operators.read_operator import Read class SetReadParallelismRule...
class SetReadParallelismRule(Rule): ''' This rule sets the read op's task parallelism based on the target block size, the requested parallelism, the number of read files, and the available resources in the cluster. If the parallelism is lower than requested, this rule also sets a split factor t...
3
1
23
3
20
0
4
0.2
1
3
3
0
2
0
2
3
57
9
40
10
37
8
23
7
20
4
1
2
8
10,137
ray-project/ray
python/ray/data/_internal/memory_tracing.py
ray.data._internal.memory_tracing._MemActor
from io import StringIO import ray from typing import Dict, List @ray.remote(num_cpus=0) class _MemActor: def __init__(self): self.allocated: Dict[ray.ObjectRef, dict] = {} self.deallocated: Dict[ray.ObjectRef, dict] = {} self.skip_dealloc: Dict[ray.ObjectRef, str] = {} self.peak_m...
@ray.remote(num_cpus=0) class _MemActor: def __init__(self): pass def trace_alloc(self, ref: List[ray.ObjectRef], loc: str): pass def trace_dealloc(self, ref: List[ray.ObjectRef], loc: str, freed: bool): pass def leak_report(self) -> str: pass
6
0
19
0
19
1
3
0.04
0
4
0
0
4
5
4
4
81
4
76
21
70
3
61
21
55
4
0
3
13
10,138
ray-project/ray
python/ray/data/_internal/output_buffer.py
ray.data._internal.output_buffer.BlockOutputBuffer
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder from typing import Any, Optional from ray.data.block import Block, BlockAccessor, DataBatch from ray.data.context import MAX_SAFE_BLOCK_SIZE_FACTOR, MAX_SAFE_ROWS_PER_BLOCK_FACTOR import math class BlockOutputBuffer: """Generates output...
class BlockOutputBuffer: '''Generates output blocks of a given size or number of rows given a stream of inputs. This class is used to turn a stream of items / blocks of arbitrary size into a stream of blocks of target max block size or target max rows per block. The caller should check ``has_next()...
14
7
10
1
6
3
2
0.91
0
4
1
0
7
4
7
7
102
14
46
17
38
42
38
17
30
4
0
2
11
10,139
ray-project/ray
python/ray/data/_internal/pandas_block.py
ray.data._internal.pandas_block.PandasBlockAccessor
import collections import sys from ray.air.constants import TENSOR_COLUMN_NAME from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union from ray.data.block import Block, BlockAccessor, BlockColumn, BlockColumnAccessor, BlockExecStats, BlockType, U from ray.data._internal.tab...
class PandasBlockAccessor(TableBlockAccessor): def __init__(self, table: 'pandas.DataFrame'): pass def column_names(self) -> List[str]: pass def fill_column(self, name: str, value: Any) -> Block: pass @staticmethod def _build_tensor_row(row: PandasRow) -> np.ndarray: ...
31
1
17
2
13
2
3
0.18
1
25
6
0
27
1
33
49
579
91
413
163
338
76
324
131
277
13
2
6
110
10,140
ray-project/ray
python/ray/data/_internal/pandas_block.py
ray.data._internal.pandas_block.PandasBlockBuilder
from ray.air.util.tensor_extensions.utils import _should_convert_to_tensor from ray.data.block import Block, BlockAccessor, BlockColumn, BlockColumnAccessor, BlockExecStats, BlockType, U from ray.data.context import DataContext from ray.data._internal.numpy_support import convert_to_numpy import pandas as pd from typin...
class PandasBlockBuilder(TableBlockBuilder): def __init__(self): pass @staticmethod def _table_from_pydict(columns: Dict[str, List[Any]]) -> 'pandas.DataFrame': pass @staticmethod def _combine_tables(tables: List['pandas.DataFrame']) -> 'pandas.DataFrame': pass @staticm...
11
0
7
1
6
0
2
0
1
6
2
0
2
0
6
28
51
11
40
24
25
0
32
18
23
3
3
2
10
10,141
ray-project/ray
python/ray/data/_internal/pandas_block.py
ray.data._internal.pandas_block.PandasRow
from ray.data._internal.row import TableRow from pandas.api.types import is_object_dtype, is_scalar, is_string_dtype import pandas as pd from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union class PandasRow(TableRow): """ Row of a tabular Dataset backed by a Pand...
class PandasRow(TableRow): ''' Row of a tabular Dataset backed by a Pandas DataFrame block. ''' def __getitem__(self, key: Union[str, List[str]]) -> Any: pass def get_item(keys: List[str]) -> Any: pass def __iter__(self) -> Iterator: pass def __len__(...
6
1
15
3
10
3
3
0.28
1
5
1
0
3
0
3
42
48
11
29
13
23
8
27
13
21
4
7
1
11
10,142
ray-project/ray
python/ray/data/_internal/plan.py
ray.data._internal.plan.ExecutionPlan
from ray.data._internal.logical.interfaces.logical_plan import LogicalPlan from ray.data.block import BlockMetadataWithSchema, _take_first_non_empty_schema import ray from ray.util.debug import log_once from ray._private.internal_api import get_memory_info_reply, get_state_from_address from typing import TYPE_CHECKING,...
class ExecutionPlan: '''A lazy execution plan for a Dataset. This lazy execution plan builds up a chain of ``List[RefBundle]`` --> ``List[RefBundle]`` operators. Prior to execution, we apply a set of logical plan optimizations, such as operator fusion, in order to reduce Ray task overhead and data ...
29
22
26
3
18
6
3
0.36
0
20
11
0
20
11
20
20
567
75
363
117
307
131
235
90
205
21
0
4
76
10,143
ray-project/ray
python/ray/data/_internal/planner/exchange/aggregate_task_spec.py
ray.data._internal.planner.exchange.aggregate_task_spec.SortAggregateTaskSpec
from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadataWithSchema, KeyType from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from typing import List, Tuple, Union from ray.data.aggregate import AggregateFn, AggregateFnV2, Count from ray.data._internal.planner.exchange.so...
class SortAggregateTaskSpec(ExchangeTaskSpec): ''' The implementation for sort-based aggregate tasks. Aggregate is done in 2 steps: partial aggregate of individual blocks, and final aggregate of sorted blocks. Partial aggregate (`map`): each block is sorted locally, then partitioned into smalle...
8
2
20
1
18
1
3
0.17
1
14
8
0
1
0
4
7
100
11
76
41
45
13
31
15
26
8
1
2
12
10,144
ray-project/ray
python/ray/data/_internal/planner/exchange/interfaces.py
ray.data._internal.planner.exchange.interfaces.ExchangeTaskScheduler
from ray.data._internal.stats import StatsDict from ray.data._internal.execution.interfaces import RefBundle import ray._private.worker from ray.data._internal.util import convert_bytes_to_human_readable_str from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from ray.data.context import DataConte...
class ExchangeTaskScheduler: ''' An interface to schedule exchange tasks (`exchange_spec`) for multi-nodes execution. ''' def __init__(self, exchange_spec: ExchangeTaskSpec): ''' Args: exchange_spec: The implementation of exchange tasks to execute. ''' p...
5
3
13
0
10
3
2
0.38
0
6
2
3
4
2
4
4
59
5
39
18
25
15
16
9
11
3
0
1
6
10,145
ray-project/ray
python/ray/data/_internal/planner/exchange/interfaces.py
ray.data._internal.planner.exchange.interfaces.ExchangeTaskSpec
from ray.air.util.data_batch_conversion import BatchFormat from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from ray.data.block import Block, BlockType class ExchangeTaskSpec: """ An interface to specify the exchange map and reduce tasks. Subclasses should implement the `map` and ...
class ExchangeTaskSpec: ''' An interface to specify the exchange map and reduce tasks. Subclasses should implement the `map` and `reduce` static methods. `map` method is to transform one input block into multiple output blocks. `reduce` is to combine multiple map output blocks. Both methods are ...
8
3
10
1
5
4
1
1.19
0
5
0
3
1
2
3
3
56
10
21
17
8
25
12
8
8
1
0
0
3
10,146
ray-project/ray
python/ray/data/_internal/planner/exchange/pull_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.pull_based_shuffle_task_scheduler.PullBasedShuffleTaskScheduler
from ray.data._internal.execution.interfaces import RefBundle, TaskContext from ray.data.block import BlockMetadataWithSchema, to_stats from typing import Any, Dict, List, Optional, Tuple from ray.data._internal.stats import StatsDict from ray.data._internal.planner.exchange.interfaces import ExchangeTaskScheduler, Exc...
class PullBasedShuffleTaskScheduler(ExchangeTaskScheduler): ''' The pull-based map-reduce shuffle scheduler. Map tasks are first scheduled to generate map output blocks. After all map output are generated, then reduce tasks are scheduled to combine map output blocks together. The concept here i...
2
1
120
17
98
5
12
0.14
1
10
3
0
1
0
1
5
133
20
99
28
89
14
53
20
51
12
1
2
12
10,147
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler.PushBasedShuffleTaskScheduler
from ray.data._internal.remote_fn import cached_remote_fn from ray.data._internal.stats import StatsDict from ray.data._internal.util import convert_bytes_to_human_readable_str, unzip from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata, BlockMetadataWithSchema, _take_first_non_empty_schema, t...
class PushBasedShuffleTaskScheduler(ExchangeTaskScheduler): ''' Push-based shuffle merges intermediate map outputs on the reducer nodes while other map tasks are executing. The merged outputs are merged again during a final reduce stage. This works as follows: 1. Submit rounds of concurrent map and...
10
2
63
7
47
9
5
0.29
1
21
13
0
1
0
4
8
416
51
283
94
248
82
162
66
155
17
1
3
32
10,148
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._MapStageIterator
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar, Union from ray.types import ObjectRef class _MapStageIterator: def __init__(self, input_blocks_list, shuffle_map, map_args): self._input_blocks_list = input_blocks_list self._shuffle_map = shuffle_map self._map_ar...
class _MapStageIterator: def __init__(self, input_blocks_list, shuffle_map, map_args): pass def __iter__(self): pass def __next__(self): pass def pop_map_results(self) -> List[List[ObjectRef]]: pass
5
0
8
1
6
1
1
0.19
0
2
1
0
4
5
4
4
36
5
26
14
21
5
22
14
17
2
0
1
5
10,149
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._MergeStageIterator
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar, Union from ray.types import ObjectRef class _MergeStageIterator: def __init__(self, map_stage_iter: _MapStageIterator, shuffle_merge, stage: _PushBasedShuffleStage, reduce_args): self._map_stage_iter = map_stage_iter self...
class _MergeStageIterator: def __init__(self, map_stage_iter: _MapStageIterator, shuffle_merge, stage: _PushBasedShuffleStage, reduce_args): pass def __next__(self): pass def pop_merge_results(self) -> List[List[ObjectRef]]: '''Return a nested list of merge task results. The list...
4
1
19
1
14
3
2
0.23
0
5
3
0
3
7
3
3
60
6
44
23
34
10
28
16
24
3
0
1
5
10,150
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._MergeTaskSchedule
class _MergeTaskSchedule: def __init__(self, output_num_blocks: int, num_merge_tasks_per_round: int): self.output_num_blocks = output_num_blocks self.num_merge_tasks_per_round = num_merge_tasks_per_round self.num_reducers_per_merger = output_num_blocks // num_merge_tasks_per_round s...
class _MergeTaskSchedule: def __init__(self, output_num_blocks: int, num_merge_tasks_per_round: int): pass def __repr__(self): pass def get_num_reducers_per_merge_idx(self, merge_idx: int) -> int: ''' Each intermediate merge task will produce outputs for a partition of P ...
6
2
15
1
12
3
2
0.21
0
2
0
0
5
4
5
5
82
7
62
17
56
13
43
17
37
5
0
3
12
10,151
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._PipelinedStageExecutor
import ray from ray.types import ObjectRef from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar, Union from ray.data._internal.progress_bar import ProgressBar class _PipelinedStageExecutor: def __init__(self, stage_iter, num_tasks_per_round: int, max_concurrent_rounds: int=1, progress_bar: ...
class _PipelinedStageExecutor: def __init__(self, stage_iter, num_tasks_per_round: int, max_concurrent_rounds: int=1, progress_bar: Optional[ProgressBar]=None): pass def __iter__(self): pass def __next__(self) -> List['BlockMetadataWithSchema']: ''' Submit one round of ta...
5
1
13
2
10
2
3
0.14
0
6
3
0
4
7
4
4
57
9
42
22
31
6
33
16
28
5
0
3
10
10,152
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._PushBasedShuffleStage
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar, Union from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy class _PushBasedShuffleStage: def __init__(self, output_num_blocks: int, num_rounds: int, num_map_tasks_per_round: int, merge_task_placement: List[str]): ...
class _PushBasedShuffleStage: def __init__(self, output_num_blocks: int, num_rounds: int, num_map_tasks_per_round: int, merge_task_placement: List[str]): pass def get_estimated_num_refs(self) -> int: pass def get_merge_task_options(self, merge_idx): pass def __repr__(self): ...
5
0
13
1
11
2
1
0.18
0
5
2
0
4
4
4
4
57
5
44
18
33
8
15
12
10
1
0
0
4
10,153
ray-project/ray
python/ray/data/_internal/planner/exchange/push_based_shuffle_task_scheduler.py
ray.data._internal.planner.exchange.push_based_shuffle_task_scheduler._ReduceStageIterator
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypeVar, Union from ray.types import ObjectRef class _ReduceStageIterator: def __init__(self, stage: _PushBasedShuffleStage, shuffle_reduce, all_merge_results: List[List[List[ObjectRef]]], ray_remote_args, reduce_args: List[Any], _debug_limit_exe...
class _ReduceStageIterator: def __init__(self, stage: _PushBasedShuffleStage, shuffle_reduce, all_merge_results: List[List[List[ObjectRef]]], ray_remote_args, reduce_args: List[Any], _debug_limit_execution_to_num_blocks: Optional[int]): pass def __iter__(self): pass def __next__(self): ...
5
0
16
2
14
1
2
0.07
0
6
2
0
4
6
4
4
68
9
55
26
42
4
32
18
27
4
0
1
8
10,154
ray-project/ray
python/ray/data/_internal/planner/exchange/shuffle_task_spec.py
ray.data._internal.planner.exchange.shuffle_task_spec.ShuffleTaskSpec
from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata, BlockMetadataWithSchema import numpy as np from ray.data.context import MAX_SAFE_BLOCK_SIZE_FACTOR import math from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder from ray.data._internal.planner.exchange.interface...
class ShuffleTaskSpec(ExchangeTaskSpec): ''' The implementation for shuffle tasks. This is used by random_shuffle() and repartition(). ''' def __init__(self, target_shuffle_max_block_size: int, random_shuffle: bool=False, random_seed: Optional[int]=None, upstream_map_fn: Optional[Callable[[Iterabl...
6
1
35
1
30
4
4
0.16
1
5
1
0
1
0
3
6
118
9
94
43
69
15
45
22
41
8
1
2
13
10,155
ray-project/ray
python/ray/data/_internal/planner/exchange/sort_task_spec.py
ray.data._internal.planner.exchange.sort_task_spec.SortKey
from typing import TYPE_CHECKING, List, Optional, Tuple, TypeVar, Union class SortKey: """SortKey class to convert between different sort args formats.""" def __init__(self, key: Optional[Union[str, List[str]]]=None, descending: Union[bool, List[bool]]=False, boundaries: Optional[List[T]]=None): if ke...
class SortKey: '''SortKey class to convert between different sort args formats.''' def __init__(self, key: Optional[Union[str, List[str]]]=None, descending: Union[bool, List[bool]]=False, boundaries: Optional[List[T]]=None): pass def get_columns(self) -> List[str]: pass def get_desce...
9
2
9
0
8
0
3
0.05
0
9
0
0
7
3
7
7
70
8
59
21
45
3
39
14
31
10
0
3
21
10,156
ray-project/ray
python/ray/data/_internal/planner/exchange/sort_task_spec.py
ray.data._internal.planner.exchange.sort_task_spec.SortTaskSpec
from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec from ray.data._internal.table_block import TableBlockAccessor from ray.data.block import Block, BlockAccessor, BlockExecStats from ray.types import ObjectRef from ray.data._internal.util import NULL_SENTINEL from typing import TYPE_CHECKING, Li...
class SortTaskSpec(ExchangeTaskSpec): ''' The implementation for distributed sort tasks. The algorithm is similar to [External Merge Sort] (https://en.wikipedia.org/wiki/External_sorting). Sorting is done in 3 steps: sampling, sorting individual blocks, and merging sorted blocks. Sampling (...
9
2
23
1
17
4
2
0.43
1
12
5
0
1
0
4
7
135
15
84
47
54
36
41
23
35
5
1
1
11
10,157
ray-project/ray
python/ray/data/_internal/planner/exchange/split_repartition_task_scheduler.py
ray.data._internal.planner.exchange.split_repartition_task_scheduler.SplitRepartitionTaskScheduler
from ray.data._internal.execution.interfaces import RefBundle, TaskContext from ray.data._internal.remote_fn import cached_remote_fn from ray.data._internal.planner.exchange.interfaces import ExchangeTaskScheduler from ray.data._internal.split import _split_at_indices import ray from ray.data.block import Block, BlockM...
class SplitRepartitionTaskScheduler(ExchangeTaskScheduler): ''' The split (non-shuffle) repartition scheduler. First, we calculate global splits needed to produce `output_num_blocks` blocks. After the split blocks are generated accordingly, reduce tasks are scheduled to combine split blocks togethe...
2
1
116
11
99
7
16
0.13
1
15
8
0
1
0
1
5
125
13
100
41
85
13
63
31
58
16
1
2
16
10,158
ray-project/ray
python/ray/data/_internal/planner/plan_expression/expression_evaluator.py
ray.data._internal.planner.plan_expression.expression_evaluator.ExpressionEvaluator
import pyarrow.dataset as ds import ast class ExpressionEvaluator: @staticmethod def get_filters(expression: str) -> ds.Expression: """Parse and evaluate the expression to generate a filter condition. Args: expression: A string representing the filter expression to parse. ...
class ExpressionEvaluator: @staticmethod def get_filters(expression: str) -> ds.Expression: '''Parse and evaluate the expression to generate a filter condition. Args: expression: A string representing the filter expression to parse. Returns: A PyArrow compute ex...
3
1
18
3
9
6
3
0.55
0
5
1
0
0
0
1
1
20
3
11
5
8
6
10
3
8
3
0
1
3
10,159
ray-project/ray
python/ray/data/_internal/planner/plan_expression/expression_evaluator.py
ray.data._internal.planner.plan_expression.expression_evaluator._ConvertToArrowExpressionVisitor
import pyarrow.dataset as ds import pyarrow.compute as pc import ast import pyarrow as pa class _ConvertToArrowExpressionVisitor(ast.NodeVisitor): def visit_Compare(self, node: ast.Compare) -> ds.Expression: """Handle comparison operations (e.g., a == b, a < b, a in b). Args: node: Th...
class _ConvertToArrowExpressionVisitor(ast.NodeVisitor): def visit_Compare(self, node: ast.Compare) -> ds.Expression: '''Handle comparison operations (e.g., a == b, a < b, a in b). Args: node: The AST node representing a comparison operation. Returns: An expression ...
9
8
24
3
12
9
4
0.82
1
2
0
0
7
0
7
10
183
30
85
21
77
70
57
21
49
12
2
3
29
10,160
ray-project/ray
python/ray/data/_internal/planner/plan_udf_map_op.py
ray.data._internal.planner.plan_udf_map_op._MapActorContext
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar from ray.data.block import BatchFormat, Block, BlockAccessor, CallableClass, DataBatch, UserDefinedFunction from threading import Thread from ray._common.utils import get_or_create_event_loop import asyncio class _MapActorContex...
class _MapActorContext: def __init__(self, udf_map_cls: UserDefinedFunction, udf_map_fn: Callable[[Any], Any], is_async: bool): pass def _init_async(self): pass def run_loop(): pass
4
0
10
1
8
0
1
0.04
0
3
0
0
2
5
2
2
28
4
23
16
14
1
18
11
14
2
0
1
4
10,161
ray-project/ray
python/ray/data/_internal/planner/planner.py
ray.data._internal.planner.planner.Planner
from typing import Callable, Dict, List, Optional, Tuple, Type, TypeVar from ray.data._internal.logical.interfaces import LogicalOperator, LogicalPlan, PhysicalPlan from ray.data._internal.logical.operators.input_data_operator import InputData from ray.data._internal.logical.operators.read_operator import Read from ray...
class Planner: '''The planner to convert optimized logical to physical operators. Note that planner is only doing operators conversion. Physical optimization work is done by physical optimizer. ''' def plan(self, logical_plan: LogicalPlan) -> PhysicalPlan: '''Convert logical to physical op...
4
3
16
2
11
3
3
0.34
0
5
4
0
3
1
3
3
56
9
35
15
29
12
27
13
23
7
0
2
9
10,162
ray-project/ray
python/ray/data/_internal/progress_bar.py
ray.data._internal.progress_bar.ProgressBar
from ray.experimental import tqdm_ray import ray import threading from typing import Any, List, Optional from ray.util.debug import log_once from ray.types import ObjectRef class ProgressBar: """Thin wrapper around tqdm to handle soft imports. If `total` is `None` known (for example, it is unknown because...
class ProgressBar: '''Thin wrapper around tqdm to handle soft imports. If `total` is `None` known (for example, it is unknown because no tasks have finished yet), doesn't display the full progress bar. Still displays basic progress stats from tqdm.''' def __init__(self, name: str, total: Optional[...
13
1
13
1
11
1
3
0.12
0
8
2
0
12
3
12
12
175
21
138
44
116
17
101
37
86
7
0
3
37
10,163
ray-project/ray
python/ray/data/_internal/row.py
ray.data._internal.row.TableRow
from typing import Any, Dict import abc from collections.abc import Mapping class TableRow(Mapping): """ A dict-like row of a tabular ``Dataset``. This implements the dictionary mapping interface, but provides more efficient access with less data copying than converting Arrow Tables or Pandas Data...
class TableRow(Mapping): ''' A dict-like row of a tabular ``Dataset``. This implements the dictionary mapping interface, but provides more efficient access with less data copying than converting Arrow Tables or Pandas DataFrames into per-row dicts. This class must be subclassed, with subclasses...
7
3
4
0
2
1
1
1.23
1
3
0
2
5
1
5
39
38
9
13
9
6
16
13
9
6
1
6
0
5
10,164
ray-project/ray
python/ray/data/_internal/size_estimator.py
ray.data._internal.size_estimator.RunningMean
class RunningMean: def __init__(self): self._weight = 0 self._mean = 0 def add(self, x: int, weight: int=1) -> None: if weight == 0: return n1 = self._weight n2 = weight n = n1 + n2 M = (n1 * self._mean + n2 * x) / n self._weight = n ...
class RunningMean: def __init__(self): pass def add(self, x: int, weight: int=1) -> None: pass @property def n(self) -> int: pass @property def mean(self) -> float: pass def __repr__(self): pass
8
0
4
0
4
0
1
0
0
2
0
0
5
2
5
5
25
4
21
14
13
0
19
12
13
2
0
1
6
10,165
ray-project/ray
python/ray/data/_internal/size_estimator.py
ray.data._internal.size_estimator.SizeEstimator
import ray from ray import cloudpickle from typing import Any, List class SizeEstimator: """Efficiently estimates the Ray serialized size of a stream of items. For efficiency, this only samples a fraction of the added items for real Ray-serialization. """ def __init__(self): self._running...
class SizeEstimator: '''Efficiently estimates the Ray serialized size of a stream of items. For efficiency, this only samples a fraction of the added items for real Ray-serialization. ''' def __init__(self): pass def add(self, item: Any) -> None: pass def add_block(self, ...
6
1
9
0
8
1
3
0.2
0
4
1
0
5
2
5
5
56
7
41
11
34
8
33
11
26
7
0
2
17
10,166
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats.DatasetStats
from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union class DatasetStats: """Holds the execution times for a given Dataset. This object contains a reference to the parent Dataset's stats as well, but not the Dataset object itself, to allow its blocks to be dropped from memory.""" ...
class DatasetStats: '''Holds the execution times for a given Dataset. This object contains a reference to the parent Dataset's stats as well, but not the Dataset object itself, to allow its blocks to be dropped from memory.''' def __init__(self, *, metadata: StatsDict, parent: Union[Optional['Data...
7
5
30
2
21
7
3
0.38
0
10
5
0
5
27
5
5
161
15
106
53
89
40
55
42
49
7
0
3
13
10,167
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats.DatasetStatsSummary
from dataclasses import dataclass, fields from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union import time from ray.data.context import DataContext from ray.util.annotations import DeveloperAPI @DeveloperAPI @dataclass class DatasetStatsSummary: operators_stats: List['OperatorStatsSummary'] ...
@DeveloperAPI @dataclass class DatasetStatsSummary: def to_string(self, already_printed: Optional[Set[str]]=None, include_parent: bool=True, add_global_stats=True) -> str: '''Return a human-readable summary of this Dataset's stats. Args: already_printed: Set of operator IDs that have al...
15
3
22
1
18
3
4
0.16
0
6
1
0
7
0
9
9
244
21
193
58
173
30
127
49
116
19
0
3
39
10,168
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats.IterStatsSummary
from ray.data.context import DataContext from dataclasses import dataclass, fields @dataclass class IterStatsSummary: wait_time: Timer get_time: Timer next_time: Timer format_time: Timer collate_time: Timer finalize_batch_time: Timer time_to_first_batch: Timer block_time: Timer user...
@dataclass class IterStatsSummary: def __str__(self) -> str: pass def to_string(self) -> str: pass def __repr__(self, level=0) -> str: pass
5
0
35
0
34
0
5
0.11
0
2
1
0
3
0
3
3
135
4
118
8
114
13
55
8
51
13
0
2
15
10,169
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats.OperatorStatsSummary
import numpy as np import collections from ray.data.block import BlockStats from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union from dataclasses import dataclass, fields @dataclass class OperatorStatsSummary: operator_name: str is_sub_operator: bool time_total_s: float earliest_sta...
@dataclass class OperatorStatsSummary: @classmethod def from_block_metadata(cls, operator_name: str, block_stats: List[BlockStats], is_sub_operator: bool) -> 'OperatorStatsSummary': '''Calculate the stats for a operator from a given list of blocks, and generates a `OperatorStatsSummary` object ...
6
3
100
8
80
12
9
0.18
0
5
0
0
2
0
3
3
332
28
257
54
247
47
117
48
113
13
0
3
26
10,170
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats.Timer
from contextlib import contextmanager import time class Timer: """Helper class for tracking accumulated time (in seconds).""" def __init__(self): self._total: float = 0 self._min: float = float('inf') self._max: float = 0 self._total_count: float = 0 @contextmanager de...
class Timer: '''Helper class for tracking accumulated time (in seconds).''' def __init__(self): pass @contextmanager def timer(self) -> None: pass def add(self, value: float) -> None: pass def get(self) -> float: pass def min(self) -> float: pass ...
9
1
4
0
4
0
1
0.04
0
1
0
0
7
4
7
7
36
7
28
14
19
1
26
13
18
3
0
1
10
10,171
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats._DatasetStatsBuilder
from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union from ray.data._internal.util import capfirst import time from ray.data._internal.block_list import BlockList class _DatasetStatsBuilder: """Helper class for building dataset stats. When this class is created, we record the start time. Wh...
class _DatasetStatsBuilder: '''Helper class for building dataset stats. When this class is created, we record the start time. When build() is called with the final blocks of the new dataset, the time delta is saved as part of the stats.''' def __init__(self, operator_name: str, parent: 'DatasetSta...
4
1
11
0
11
0
2
0.11
0
5
2
0
3
3
3
3
43
4
35
17
26
4
21
12
17
4
0
3
6
10,172
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats._StatsActor
from ray.data._internal.metadata_exporter import DatasetMetadata, Topology, get_dataset_metadata_exporter import copy from ray.data.context import DataContext import ray from ray.util.metrics import Counter, Gauge, Histogram, Metric from ray.data._internal.execution.interfaces.op_runtime_metrics import NODE_UNKNOWN, Me...
@ray.remote(num_cpus=0) class _StatsActor: '''Actor holding stats for blocks created by LazyBlockList. This actor is shared across all datasets created in the same cluster. In order to cap memory usage, we set a max number of stats to keep in the actor. When this limit is exceeded, the stats will be gar...
17
1
18
1
15
1
2
0.12
0
8
2
0
14
23
14
14
275
32
217
67
188
26
107
53
92
7
0
2
33
10,173
ray-project/ray
python/ray/data/_internal/stats.py
ray.data._internal.stats._StatsManager
from ray.data._internal.metadata_exporter import DatasetMetadata, Topology, get_dataset_metadata_exporter import ray from ray.actor import ActorHandle from dataclasses import dataclass, fields import time import threading from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union from collections import d...
class _StatsManager: '''A Class containing util functions that manage remote calls to _StatsActor. This class collects stats from execution and iteration codepaths and keeps track of the latest snapshot. An instance of this class runs a single background thread that periodically forwards the latest...
12
3
17
0
15
2
2
0.31
0
10
2
0
9
7
9
9
170
21
114
32
96
35
74
25
63
6
0
4
24
10,174
ray-project/ray
python/ray/data/_internal/table_block.py
ray.data._internal.table_block.TableBlockAccessor
from ray.data.block import Block, BlockAccessor, BlockColumnAccessor, BlockExecStats, BlockMetadataWithSchema, BlockType, KeyType, U from ray.data._internal.row import TableRow from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union import numpy as np import collections fr...
class TableBlockAccessor(BlockAccessor): def __init__(self, table: Any): pass def _get_row(self, index: int, copy: bool=False) -> Union[TableRow, np.ndarray]: pass @staticmethod def _munge_conflict(name, count): pass @staticmethod def _build_tensor_row(row: TableRow) -...
37
5
8
0
6
1
2
0.14
1
10
2
2
11
1
16
16
158
25
117
47
85
16
78
36
57
5
1
2
32
10,175
ray-project/ray
python/ray/data/_internal/table_block.py
ray.data._internal.table_block.TableBlockBuilder
from ray.data._internal.row import TableRow import collections from ray.data._internal.size_estimator import SizeEstimator from ray.air.constants import TENSOR_COLUMN_NAME from ray.data.block import Block, BlockAccessor, BlockColumnAccessor, BlockExecStats, BlockMetadataWithSchema, BlockType, KeyType, U from typing imp...
class TableBlockBuilder(BlockBuilder): def __init__(self, block_type): pass def add(self, item: Union[dict, TableRow, np.ndarray]) -> None: pass def add_block(self, block: Any) -> None: pass @staticmethod def _table_from_pydict(columns: Dict[str, List[Any]]) -> Block: ...
17
0
9
0
7
1
2
0.15
1
12
2
2
8
9
12
22
122
15
93
32
76
14
73
28
60
8
2
2
26
10,176
ray-project/ray
python/ray/data/_internal/torch_iterable_dataset.py
ray.data._internal.torch_iterable_dataset.TorchIterableDataset
from torch.utils.data import IterableDataset class TorchIterableDataset(IterableDataset): def __init__(self, generator_func): self.generator_func = generator_func def __iter__(self): it = self.generator_func() yield from it
class TorchIterableDataset(IterableDataset): def __init__(self, generator_func): pass def __iter__(self): pass
3
0
3
0
3
0
1
0
1
0
0
0
2
1
2
7
7
1
6
5
3
0
6
5
3
1
3
0
2
10,177
ray-project/ray
python/ray/data/_internal/util.py
ray.data._internal.util.RetryingContextManager
import pyarrow from ray.data.context import DEFAULT_READ_OP_MIN_NUM_BLOCKS, WARN_PREFIX, DataContext from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union class RetryingContextManager: def __init__(self, f: pyarrow.NativeFile, context: DataCont...
class RetryingContextManager: def __init__(self, f: pyarrow.NativeFile, context: DataContext, max_attempts: int=10, max_backoff_s: int=32): pass def __repr__(self): pass def _retry_operation(self, operation: Callable, description: str): '''Execute an operation with retries.''' ...
6
1
7
0
7
0
1
0.04
0
3
1
0
4
4
4
4
31
3
27
15
16
1
12
9
7
1
0
0
4
10,178
ray-project/ray
python/ray/data/_internal/util.py
ray.data._internal.util.RetryingPyFileSystem
from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union import pyarrow class RetryingPyFileSystem(pyarrow.fs.PyFileSystem): def __init__(self, handler: 'RetryingPyFileSystemHandler'): if not isinstance(handler, RetryingPyFileSystemHandler...
class RetryingPyFileSystem(pyarrow.fs.PyFileSystem): def __init__(self, handler: 'RetryingPyFileSystemHandler'): pass @property def retryable_errors(self) -> List[str]: pass def unwrap(self): pass @classmethod def wrap(cls, fs: 'pyarrow.fs.FileSystem', retryable_errors...
10
0
4
0
4
0
1
0.07
1
5
2
0
4
0
6
6
34
5
27
17
11
2
18
8
11
2
1
1
8
10,179
ray-project/ray
python/ray/data/_internal/util.py
ray.data._internal.util.RetryingPyFileSystemHandler
import pyarrow from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union class RetryingPyFileSystemHandler(pyarrow.fs.FileSystemHandler): """Wrapper for filesystem objects that adds retry functionality for file operations. This class wraps any ...
class RetryingPyFileSystemHandler(pyarrow.fs.FileSystemHandler): '''Wrapper for filesystem objects that adds retry functionality for file operations. This class wraps any filesystem object and adds automatic retries for common file operations that may fail transiently. ''' def __init__(self, fs: '...
20
16
7
0
6
2
1
0.3
1
5
2
0
20
4
20
20
174
25
115
43
76
34
45
25
24
1
1
0
20
10,180
ray-project/ray
python/ray/data/_internal/util.py
ray.data._internal.util._InterruptibleQueue
import threading from queue import Empty, Full, Queue from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union class _InterruptibleQueue(Queue): """Extension of Python's `queue.Queue` providing ability to get interrupt its method callers in oth...
class _InterruptibleQueue(Queue): '''Extension of Python's `queue.Queue` providing ability to get interrupt its method callers in other threads''' def __init__(self, max_size: int, interrupted_event: Optional[threading.Event]=None): pass def get(self, block=True, timeout=None): pass ...
4
1
17
1
10
5
4
0.55
1
5
0
0
3
1
3
17
59
8
33
8
27
18
27
6
23
5
1
2
11
10,181
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.AbsMax
from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.util.annotations import Deprecated, PublicAPI from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.data._internal.util import is_null @PublicAPI class AbsMax(AggregateFnV2): """Defines absolute max aggregation. ...
@PublicAPI class AbsMax(AggregateFnV2): '''Defines absolute max aggregation. Example: .. testcode:: import ray from ray.data.aggregate import AbsMax ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % ...
5
1
22
1
21
0
2
0.05
1
3
0
0
1
1
1
5
25
2
22
9
15
1
8
4
6
2
2
1
2
10,182
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.AggregateFn
from ray.util.annotations import Deprecated, PublicAPI from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U @Deprecated(message='AggregateFn is deprecated, please use AggregateFnV2') @PublicAPI class AggregateFn: """NOTE: THIS IS DE...
@Deprecated(message='AggregateFn is deprecated, please use AggregateFnV2') @PublicAPI class AggregateFn: '''NOTE: THIS IS DEPRECATED, PLEASE USE :class:`AggregateFnV2` INSTEAD Defines how to perform a custom aggregation in Ray Data. `AggregateFn` instances are passed to a Dataset's ``.aggregate(...)`` metho...
7
2
14
1
12
1
3
0.79
0
4
0
3
2
5
2
2
66
8
33
19
21
26
21
11
17
5
0
1
8
10,183
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Count
from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.util.annotations import Deprecated, PublicAPI @PublicAPI class Count(AggregateFnV2): """Defines count aggregation. Example: .. testcode:: impor...
@PublicAPI class Count(AggregateFnV2): '''Defines count aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Count ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % 3) ...
5
1
9
0
9
0
1
0.1
1
1
0
0
1
0
1
3
12
1
10
2
8
1
3
2
1
1
1
0
1
10,184
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Max
from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.util.annotations import Deprecated, PublicAPI from typing import TYPE_CHECKING, Any, Callable, List, Optional @PublicAPI class Max(AggregateFnV2): """Defines max aggregation. Example: .. testcode:: import ra...
@PublicAPI class Max(AggregateFnV2): '''Defines max aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Max ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % 3) ...
5
1
25
2
23
0
2
0.04
1
4
0
0
1
1
1
5
28
3
24
9
17
1
8
4
6
2
2
1
2
10,185
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Mean
from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.util.annotations import Deprecated, PublicAPI import numpy as np from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.data._internal.util import is_null @PublicAPI class Mean(AggregateFnV2): """Defines mean (averag...
@PublicAPI class Mean(AggregateFnV2): '''Defines mean (average) aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Mean ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % 3)...
6
1
25
2
22
2
3
0.09
1
3
0
0
1
1
1
5
42
4
35
13
27
3
17
8
14
3
2
1
5
10,186
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Min
from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.util.annotations import Deprecated, PublicAPI @PublicAPI class Min(AggregateFnV2): """Defines min aggregation. Example: .. testcode:: import ra...
@PublicAPI class Min(AggregateFnV2): '''Defines min aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Min ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % 3) ...
5
1
25
2
23
0
2
0.04
1
4
0
0
1
1
1
5
28
3
24
9
17
1
8
4
6
2
2
1
2
10,187
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Quantile
import math from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.util.annotations import Deprecated, PublicAPI from ray.data._internal.util import is_null from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U @PublicAPI class Quantile(AggregateFnV2): """Defines Quantile aggreg...
@PublicAPI class Quantile(AggregateFnV2): '''Defines Quantile aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Quantile ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % ...
7
1
29
3
26
1
4
0.03
1
6
0
0
1
2
1
5
76
10
65
24
53
2
48
18
42
8
2
2
16
10,188
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Std
import numpy as np from ray.data._internal.util import is_null from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.util.annotations import Deprecated, PublicAPI import math from typing import TYPE_CHECKING, Any, Callable, List, Optional @PublicAPI class Std(AggregateFnV2): """Defines s...
null
6
1
25
1
18
6
2
0.43
1
5
0
0
1
1
1
5
77
7
49
25
38
21
32
19
27
3
2
1
8
10,189
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Sum
from typing import TYPE_CHECKING, Any, Callable, List, Optional from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from ray.util.annotations import Deprecated, PublicAPI @PublicAPI class Sum(AggregateFnV2): """Defines sum aggregation. Example: .. testcode:: import ra...
@PublicAPI class Sum(AggregateFnV2): '''Defines sum aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Sum ds = ray.data.range(100) # Schema: {'id': int64} ds = ds.add_column("group_key", lambda x: x % 3) ...
5
1
25
2
23
0
2
0.04
1
3
0
0
1
1
1
5
28
3
24
9
17
1
8
4
6
2
2
1
2
10,190
ray-project/ray
python/ray/data/aggregate.py
ray.data.aggregate.Unique
from ray.util.annotations import Deprecated, PublicAPI from ray.data.block import AggType, Block, BlockAccessor, KeyType, T, U from typing import TYPE_CHECKING, Any, Callable, List, Optional @PublicAPI class Unique(AggregateFnV2): """Defines unique aggregation. Example: .. testcode:: imp...
@PublicAPI class Unique(AggregateFnV2): '''Defines unique aggregation. Example: .. testcode:: import ray from ray.data.aggregate import Unique ds = ray.data.range(100) ds = ds.add_column("group_key", lambda x: x % 3) # Calculating the unique va...
7
1
14
2
12
0
2
0.03
1
4
0
0
1
1
1
5
44
7
36
13
26
1
19
9
13
3
2
1
7
10,191
ray-project/ray
python/ray/data/block.py
ray.data.block.BlockAccessor
import collections import numpy as np from ray.data._internal.util import _check_pyarrow_version, _truncated_repr from ray.air.util.tensor_extensions.arrow import ArrowConversionError import pyarrow as pa from ray.util.annotations import DeveloperAPI from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List...
@DeveloperAPI class BlockAccessor: '''Provides accessor methods for a specific block. Ideally, we wouldn't need a separate accessor classes for blocks. However, this is needed if we want to support storing ``pyarrow.Table`` directly as a top-level Ray object, without a wrapping class (issue #17186). ...
47
39
7
1
5
2
2
0.38
0
17
7
0
22
0
29
29
257
47
152
64
89
58
91
37
54
7
0
4
44
10,192
ray-project/ray
python/ray/data/block.py
ray.data.block.BlockExecStats
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Protocol, Tuple, TypeVar, Union import ray from ray.util.annotations import DeveloperAPI @DeveloperAPI class BlockExecStats: """Execution stats for this block. Attributes: wall_time_s: The wall-clock time it took to compu...
@DeveloperAPI class BlockExecStats: '''Execution stats for this block. Attributes: wall_time_s: The wall-clock time it took to compute this block. cpu_time_s: The CPU time it took to compute this block. node_id: A unique id for the node that computed this block. max_uss_bytes: An...
6
1
7
0
7
1
1
0.36
0
3
1
0
2
8
3
3
34
4
22
13
17
8
14
12
10
1
0
0
3
10,193
ray-project/ray
python/ray/data/block.py
ray.data.block.BlockMetadata
from ray.util.annotations import DeveloperAPI from dataclasses import dataclass, fields from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Protocol, Tuple, TypeVar, Union @DeveloperAPI @dataclass class BlockMetadata(BlockStats): """Metadata about the block.""" input_files: Optiona...
@DeveloperAPI @dataclass class BlockMetadata(BlockStats): '''Metadata about the block.''' def to_stats(self): pass def __post_init__(self): pass
5
1
5
1
4
0
2
0.36
1
1
0
0
2
0
2
3
19
4
11
3
8
4
9
3
6
2
1
1
3
10,194
ray-project/ray
python/ray/data/block.py
ray.data.block.BlockStats
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Protocol, Tuple, TypeVar, Union from ray.util.annotations import DeveloperAPI from dataclasses import dataclass, fields @DeveloperAPI @dataclass class BlockStats: """Statistics about the block produced""" num_rows: Optional[int] ...
@DeveloperAPI @dataclass class BlockStats: '''Statistics about the block produced''' def __post_init__(self): pass
4
1
5
0
3
2
2
0.86
0
1
0
1
1
0
1
1
15
2
7
2
5
6
7
2
5
2
0
1
2
10,195
ray-project/ray
python/ray/data/block.py
ray.data.block.BlockType
from enum import Enum from ray.util.annotations import DeveloperAPI @DeveloperAPI class BlockType(Enum): ARROW = 'arrow' PANDAS = 'pandas'
@DeveloperAPI class BlockType(Enum): pass
2
0
0
0
0
0
0
0
1
0
0
0
0
0
0
49
3
0
3
3
2
0
3
3
2
0
4
0
0
10,196
ray-project/ray
python/ray/data/block.py
ray.data.block._BlockExecStatsBuilder
import time class _BlockExecStatsBuilder: """Helper class for building block stats. When this class is created, we record the start time. When build() is called, the time delta is saved as part of the stats. """ def __init__(self): self._start_time = time.perf_counter() self._star...
class _BlockExecStatsBuilder: '''Helper class for building block stats. When this class is created, we record the start time. When build() is called, the time delta is saved as part of the stats. ''' def __init__(self): pass def build(self) -> 'BlockExecStats': pass
3
1
12
1
10
2
2
0.35
0
3
1
0
2
4
2
2
31
4
20
9
17
7
17
9
14
2
0
1
3
10,197
ray-project/ray
python/ray/data/block.py
ray.data.block._CallableClassProtocol
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Protocol, Tuple, TypeVar, Union class _CallableClassProtocol(Protocol[T, U]): def __call__(self, __arg: T) -> Union[U, Iterator[U]]: ...
class _CallableClassProtocol(Protocol[T, U]): def __call__(self, __arg: T) -> Union[U, Iterator[U]]: pass
2
0
2
0
2
0
1
0
1
0
0
0
1
0
1
25
3
0
3
2
1
0
3
2
1
1
5
0
1
10,198
ray-project/ray
python/ray/data/context.py
ray.data.context.DataContext
from ray.util.scheduling_strategies import SchedulingStrategyT import ray import os from ray.util.annotations import DeveloperAPI from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union import warnings from dataclasses import dataclass, field import copy from ray.util.debug import log_once from ray.data._int...
@DeveloperAPI @dataclass class DataContext: '''Global settings for Ray Data. Configure this class to enable advanced features and tune performance. .. warning:: Apply changes before creating a :class:`~ray.data.Dataset`. Changes made after won't take effect. .. note:: This object...
18
8
15
2
7
6
2
1.26
0
6
1
0
7
3
9
9
320
40
124
63
108
156
81
59
69
3
0
2
15
10,199
ray-project/ray
python/ray/data/context.py
ray.data.context.ShuffleStrategy
from ray.util.annotations import DeveloperAPI import enum @DeveloperAPI(stability='alpha') class ShuffleStrategy(str, enum.Enum): """Shuffle strategy determines shuffling algorithm employed by operations like aggregate, repartition, etc""" SORT_SHUFFLE_PULL_BASED = 'sort_shuffle_pull_based' SORT_SHUFFL...
@DeveloperAPI(stability='alpha') class ShuffleStrategy(str, enum.Enum): '''Shuffle strategy determines shuffling algorithm employed by operations like aggregate, repartition, etc''' pass
2
1
0
0
0
0
0
0.67
2
0
0
0
0
0
0
115
6
1
3
3
2
2
3
3
2
0
4
0
0