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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,900 | ray-project/ray | python/ray/dag/dag_node_operation.py | ray.dag.dag_node_operation._DAGNodeOperationType | from enum import Enum
class _DAGNodeOperationType(Enum):
"""
There are three types of operations that a DAG node can perform:
1. READ: Read from an input channel.
2. COMPUTE: Execute the method corresponding to the node.
3. WRITE: Write to an output channel.
"""
READ = 'READ'
COMPUTE = ... |
class _DAGNodeOperationType(Enum):
'''
There are three types of operations that a DAG node can perform:
1. READ: Read from an input channel.
2. COMPUTE: Execute the method corresponding to the node.
3. WRITE: Write to an output channel.
'''
def viz_str(self):
'''
A string r... | 2 | 2 | 13 | 1 | 8 | 4 | 4 | 0.83 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 50 | 25 | 3 | 12 | 5 | 10 | 10 | 10 | 5 | 8 | 4 | 4 | 1 | 4 |
9,901 | ray-project/ray | python/ray/dag/dag_node_operation.py | ray.dag.dag_node_operation._DAGOperationGraphNode | from functools import total_ordering
from typing import Dict, List, Optional, Set, Tuple
@total_ordering
class _DAGOperationGraphNode:
def __init__(self, operation: _DAGNodeOperation, task_idx: int, actor_handle: 'ray.actor.ActorHandle', requires_accelerator: bool):
"""
_DAGOperationGraphNode repr... | @total_ordering
class _DAGOperationGraphNode:
def __init__(self, operation: _DAGNodeOperation, task_idx: int, actor_handle: 'ray.actor.ActorHandle', requires_accelerator: bool):
'''
_DAGOperationGraphNode represents a node in the DAG operation graph.
It contains information about the node's... | 24 | 9 | 10 | 0 | 5 | 5 | 1 | 0.87 | 0 | 6 | 2 | 0 | 13 | 8 | 13 | 13 | 146 | 15 | 70 | 36 | 42 | 61 | 41 | 23 | 26 | 3 | 0 | 1 | 17 |
9,902 | ray-project/ray | python/ray/dag/dag_operation_future.py | ray.dag.dag_operation_future.DAGOperationFuture | from ray.util.annotations import DeveloperAPI
from typing import Any, Dict, Generic, TypeVar
from abc import ABC, abstractmethod
@DeveloperAPI
class DAGOperationFuture(ABC, Generic[T]):
"""
A future representing the result of a DAG operation.
This is an abstraction that is internal to each actor,
and ... | @DeveloperAPI
class DAGOperationFuture(ABC, Generic[T]):
'''
A future representing the result of a DAG operation.
This is an abstraction that is internal to each actor,
and is not exposed to the DAG caller.
'''
@abstractmethod
def wait(self):
'''
Wait for the future and retur... | 4 | 2 | 5 | 0 | 2 | 3 | 1 | 2 | 2 | 1 | 0 | 2 | 1 | 0 | 1 | 23 | 14 | 2 | 4 | 3 | 1 | 8 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
9,903 | ray-project/ray | python/ray/dag/dag_operation_future.py | ray.dag.dag_operation_future.GPUFuture | from ray.experimental.channel.accelerator_context import AcceleratorContext
from ray.util.annotations import DeveloperAPI
from typing import Any, Dict, Generic, TypeVar
@DeveloperAPI
class GPUFuture(DAGOperationFuture[Any]):
"""
A future for a GPU event on a CUDA stream.
This future wraps a buffer, and re... | @DeveloperAPI
class GPUFuture(DAGOperationFuture[Any]):
'''
A future for a GPU event on a CUDA stream.
This future wraps a buffer, and records an event on the given stream
when it is created. When the future is waited on, it makes the current
CUDA stream wait on the event, then returns the buffer.
... | 9 | 6 | 14 | 2 | 6 | 6 | 2 | 1.62 | 1 | 1 | 0 | 0 | 2 | 2 | 2 | 25 | 43 | 9 | 13 | 8 | 8 | 21 | 13 | 8 | 8 | 2 | 5 | 1 | 3 |
9,904 | ray-project/ray | python/ray/dag/dag_operation_future.py | ray.dag.dag_operation_future.ResolvedFuture | from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class ResolvedFuture(DAGOperationFuture):
"""
A future that is already resolved. Calling `wait()` on this will
immediately return the result without blocking.
"""
def __init__(self, result):
"""
Initialize a resolved futur... | @DeveloperAPI
class ResolvedFuture(DAGOperationFuture):
'''
A future that is already resolved. Calling `wait()` on this will
immediately return the result without blocking.
'''
def __init__(self, result):
'''
Initialize a resolved future.
Args:
result: The result... | 4 | 3 | 7 | 1 | 2 | 4 | 1 | 2.4 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 25 | 20 | 3 | 5 | 4 | 2 | 12 | 5 | 4 | 2 | 1 | 5 | 0 | 2 |
9,905 | ray-project/ray | python/ray/dag/function_node.py | ray.dag.function_node.FunctionNode | from ray.util.annotations import DeveloperAPI
from typing import Any, Dict, List
from ray.dag.dag_node import DAGNode
from ray.dag.format_utils import get_dag_node_str
import ray
@DeveloperAPI
class FunctionNode(DAGNode):
"""Represents a bound task node in a Ray task DAG."""
def __init__(self, func_body, func... | @DeveloperAPI
class FunctionNode(DAGNode):
'''Represents a bound task node in a Ray task DAG.'''
def __init__(self, func_body, func_args, func_kwargs, func_options, other_args_to_resolve=None):
pass
def _copy_impl(self, new_args: List[Any], new_kwargs: Dict[str, Any], new_options: Dict[str, Any], ... | 6 | 2 | 11 | 0 | 9 | 2 | 1 | 0.18 | 1 | 3 | 0 | 0 | 4 | 1 | 4 | 32 | 50 | 5 | 38 | 19 | 20 | 7 | 10 | 6 | 5 | 1 | 2 | 0 | 4 |
9,906 | ray-project/ray | python/ray/dag/input_node.py | ray.dag.input_node.DAGInputData | from typing import Any, Dict, List, Optional, Union
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class DAGInputData:
"""If user passed multiple args and kwargs directly to dag.execute(), we
generate this wrapper for all user inputs as one object, accessible via
list index or object attribute... | @DeveloperAPI
class DAGInputData:
'''If user passed multiple args and kwargs directly to dag.execute(), we
generate this wrapper for all user inputs as one object, accessible via
list index or object attribute key.
'''
def __init__(self, *args, **kwargs):
pass
def __getitem__(self, key... | 4 | 1 | 8 | 0 | 7 | 1 | 2 | 0.43 | 0 | 5 | 0 | 0 | 2 | 2 | 2 | 2 | 22 | 2 | 14 | 5 | 11 | 6 | 9 | 5 | 6 | 3 | 0 | 1 | 4 |
9,907 | ray-project/ray | python/ray/dag/input_node.py | ray.dag.input_node.InputAttributeNode | from ray.dag.format_utils import get_dag_node_str
from typing import Any, Dict, List, Optional, Union
from ray.dag import DAGNode
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class InputAttributeNode(DAGNode):
"""Represents partial access of user input based on an index (int),
object attribute ... | @DeveloperAPI
class InputAttributeNode(DAGNode):
'''Represents partial access of user input based on an index (int),
object attribute or dict key (str).
Examples:
.. code-block:: python
with InputNode() as dag_input:
a = dag_input[0]
b = dag_input.x
... | 9 | 3 | 13 | 1 | 10 | 3 | 2 | 0.6 | 1 | 7 | 2 | 0 | 6 | 3 | 6 | 34 | 112 | 16 | 60 | 24 | 40 | 36 | 25 | 11 | 18 | 6 | 2 | 3 | 12 |
9,908 | ray-project/ray | python/ray/dag/input_node.py | ray.dag.input_node.InputNode | from ray.experimental.gradio_utils import type_to_string
from typing import Any, Dict, List, Optional, Union
from ray.dag.format_utils import get_dag_node_str
from ray.util.annotations import DeveloperAPI
from ray.dag import DAGNode
@DeveloperAPI
class InputNode(DAGNode):
"""Ray dag node used in DAG building API t... | @DeveloperAPI
class InputNode(DAGNode):
'''Ray dag node used in DAG building API to mark entrypoints of a DAG.
Should only be function or class method. A DAG can have multiple
entrypoints, but only one instance of InputNode exists per DAG, shared
among all DAGNodes.
Example:
.. code-block::
... | 13 | 6 | 10 | 1 | 7 | 2 | 2 | 0.83 | 1 | 9 | 2 | 0 | 11 | 2 | 11 | 39 | 170 | 31 | 76 | 27 | 52 | 63 | 47 | 15 | 35 | 4 | 2 | 2 | 20 |
9,909 | ray-project/ray | python/ray/dag/output_node.py | ray.dag.output_node.MultiOutputNode | from ray.dag import DAGNode
from typing import Any, Dict, List, Tuple, Union
import ray
from ray.dag.format_utils import get_dag_node_str
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class MultiOutputNode(DAGNode):
"""Ray dag node used in DAG building API to mark the endpoint of DAG"""
def __in... | @DeveloperAPI
class MultiOutputNode(DAGNode):
'''Ray dag node used in DAG building API to mark the endpoint of DAG'''
def __init__(self, args: Union[List[DAGNode], Tuple[DAGNode]], other_args_to_resolve: Dict[str, Any]=None):
pass
def _execute_impl(self, *args, **kwargs) -> Union[ray.ObjectRef, 'r... | 6 | 2 | 8 | 0 | 7 | 0 | 2 | 0.07 | 1 | 7 | 0 | 0 | 4 | 0 | 4 | 32 | 36 | 4 | 30 | 17 | 13 | 2 | 13 | 5 | 8 | 3 | 2 | 1 | 6 |
9,910 | ray-project/ray | python/ray/dag/py_obj_scanner.py | ray.dag.py_obj_scanner._PyObjScanner | from typing import Any, Dict, Generic, List, Tuple, Type, TypeVar, Union
import io
from ray.dag.base import DAGNodeBase
import pickle
import ray
class _PyObjScanner(ray.cloudpickle.CloudPickler, Generic[SourceType, TransformedType]):
"""Utility to find and replace the `source_type` in Python objects.
`source_... |
class _PyObjScanner(ray.cloudpickle.CloudPickler, Generic[SourceType, TransformedType]):
'''Utility to find and replace the `source_type` in Python objects.
`source_type` can either be a single type or a tuple of multiple types.
The caller must first call `find_nodes()`, then compute a replacement table an... | 8 | 5 | 8 | 1 | 5 | 3 | 1 | 0.83 | 2 | 4 | 1 | 0 | 7 | 5 | 7 | 9 | 79 | 15 | 35 | 14 | 27 | 29 | 33 | 14 | 25 | 2 | 1 | 1 | 9 |
9,911 | ray-project/ray | python/ray/dag/utils.py | ray.dag.utils._DAGNodeNameGenerator | from typing import Dict
from ray.dag import ClassMethodNode, ClassNode, DAGNode, FunctionNode, InputAttributeNode, InputNode, MultiOutputNode
class _DAGNodeNameGenerator(object):
"""
Generate unique suffix for each given Node in the DAG.
Apply monotonic increasing id suffix for duplicated names.
"""
... |
class _DAGNodeNameGenerator(object):
'''
Generate unique suffix for each given Node in the DAG.
Apply monotonic increasing id suffix for duplicated names.
'''
def __init__(self):
pass
def get_node_name(self, node: DAGNode):
pass
def reset(self):
pass
def __en... | 6 | 1 | 9 | 1 | 7 | 1 | 3 | 0.29 | 1 | 12 | 7 | 0 | 5 | 1 | 5 | 5 | 53 | 8 | 35 | 9 | 29 | 10 | 27 | 9 | 21 | 9 | 1 | 1 | 13 |
9,912 | ray-project/ray | python/ray/dashboard/agent.py | ray.dashboard.agent.DashboardAgent | import ray.dashboard.utils as dashboard_utils
from ray._private.process_watcher import create_check_raylet_task
import sys
import ray.dashboard.consts as dashboard_consts
import os
import ray._private.ray_constants as ray_constants
import json
from ray._raylet import GcsClient
from ray._private.ray_constants import AGE... |
class DashboardAgent:
def __init__(self, node_ip_address, grpc_port, gcs_address, cluster_id_hex, minimal, metrics_export_port=None, node_manager_port=None, events_export_addr=None, listen_port=ray_constants.DEFAULT_DASHBOARD_AGENT_LISTEN_PORT, disable_metrics_collection: bool=False, *, object_store_name: str, ra... | 10 | 2 | 25 | 3 | 19 | 3 | 3 | 0.17 | 0 | 11 | 3 | 0 | 7 | 23 | 7 | 7 | 223 | 30 | 167 | 72 | 130 | 29 | 97 | 50 | 82 | 9 | 0 | 2 | 24 |
9,913 | ray-project/ray | python/ray/dashboard/dashboard.py | ray.dashboard.dashboard.Dashboard | from typing import Optional, Set
import ray.dashboard.head as dashboard_head
class Dashboard:
"""A dashboard process for monitoring Ray nodes.
This dashboard is made up of a REST API which collates data published by
Reporter processes on nodes into a json structure, and a webserver
which polls... |
class Dashboard:
'''A dashboard process for monitoring Ray nodes.
This dashboard is made up of a REST API which collates data published by
Reporter processes on nodes into a json structure, and a webserver
which polls said API for display purposes.
Args:
host: Host address of dashbo... | 3 | 1 | 17 | 0 | 17 | 0 | 1 | 0.47 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 54 | 4 | 34 | 19 | 16 | 16 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
9,914 | ray-project/ray | python/ray/dashboard/dashboard_metrics.py | ray.dashboard.dashboard_metrics.NullMetric | class NullMetric:
"""Mock metric class to be used in case of prometheus_client import error."""
def set(self, *args, **kwargs):
pass
def observe(self, *args, **kwargs):
pass
def inc(self, *args, **kwargs):
pass | class NullMetric:
'''Mock metric class to be used in case of prometheus_client import error.'''
def set(self, *args, **kwargs):
pass
def observe(self, *args, **kwargs):
pass
def inc(self, *args, **kwargs):
pass | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.14 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | 11 | 3 | 7 | 4 | 3 | 1 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
9,915 | ray-project/ray | python/ray/dashboard/head.py | ray.dashboard.head.DashboardHead | from typing import TYPE_CHECKING, List, Optional, Set, Tuple
from ray._raylet import GcsClient
import ray
import ray.dashboard.utils as dashboard_utils
from pathlib import Path
from ray._private.async_utils import enable_monitor_loop_lag
import ray.dashboard.consts as dashboard_consts
import os
from ray._private import... |
class DashboardHead:
def __init__(self, http_host: str, http_port: int, http_port_retries: int, gcs_address: str, cluster_id_hex: str, node_ip_address: str, log_dir: str, logging_level: int, logging_format: str, logging_filename: str, logging_rotate_bytes: int, logging_rotate_backup_count: int, temp_dir: str, ses... | 16 | 4 | 36 | 3 | 26 | 7 | 4 | 0.26 | 0 | 13 | 7 | 0 | 7 | 23 | 7 | 7 | 287 | 28 | 206 | 67 | 179 | 53 | 117 | 49 | 107 | 9 | 0 | 2 | 31 |
9,916 | ray-project/ray | python/ray/dashboard/http_server_agent.py | ray.dashboard.http_server_agent.HttpServerAgent | from ray._common.utils import get_or_create_event_loop
import ray.dashboard.optional_utils as dashboard_optional_utils
import random
import asyncio
from ray._common.network_utils import build_address, is_localhost
from ray.dashboard.optional_deps import aiohttp, aiohttp_cors, hdrs
from typing import List, Optional
from... |
class HttpServerAgent:
def __init__(self, ip: str, listen_port: int) -> None:
pass
async def _start_site_with_retry(self, max_retries: int=5, base_delay: float=0.1) -> aiohttp.web.TCPSite:
'''Start the TCP site with retry logic and exponential backoff.
Args:
max_retries: M... | 5 | 1 | 23 | 2 | 19 | 3 | 3 | 0.16 | 0 | 4 | 0 | 0 | 3 | 6 | 3 | 3 | 71 | 7 | 57 | 17 | 53 | 9 | 36 | 16 | 32 | 7 | 0 | 1 | 9 |
9,917 | ray-project/ray | python/ray/dashboard/http_server_head.py | ray.dashboard.http_server_head.HttpServerDashboardHead | import sys
import ray.dashboard.optional_utils as dashboard_optional_utils
from ray.dashboard.head import DashboardHeadModule
import pathlib
from ray.dashboard.optional_deps import aiohttp, hdrs
from ray._common.utils import get_or_create_event_loop
from packaging.version import Version
from ray import ray_constants
fr... |
class HttpServerDashboardHead:
def __init__(self, ip: str, http_host: str, http_port: int, http_port_retries: int, gcs_address: str, session_name: str, metrics: DashboardPrometheusMetrics):
pass
@routes.get('/')
async def get_index(self, req) -> aiohttp.web.FileResponse:
pass
@routes.g... | 19 | 0 | 18 | 1 | 16 | 2 | 3 | 0.1 | 0 | 10 | 2 | 0 | 11 | 9 | 11 | 11 | 219 | 19 | 181 | 58 | 153 | 19 | 102 | 37 | 90 | 6 | 0 | 2 | 28 |
9,918 | ray-project/ray | python/ray/dashboard/memory_utils.py | ray.dashboard.memory_utils.GroupByType | from enum import Enum
class GroupByType(Enum):
NODE_ADDRESS = 'node'
STACK_TRACE = 'stack_trace' |
class GroupByType(Enum):
pass | 1 | 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 |
9,919 | ray-project/ray | python/ray/dashboard/memory_utils.py | ray.dashboard.memory_utils.MemoryTable | from typing import List
from collections import defaultdict
class MemoryTable:
def __init__(self, entries: List[MemoryTableEntry], group_by_type: GroupByType=GroupByType.NODE_ADDRESS, sort_by_type: SortingType=SortingType.PID):
self.table = entries
self.group = {}
self.summary = defaultdic... |
class MemoryTable:
def __init__(self, entries: List[MemoryTableEntry], group_by_type: GroupByType=GroupByType.NODE_ADDRESS, sort_by_type: SortingType=SortingType.PID):
pass
def setup(self, group_by_type: GroupByType, sort_by_type: SortingType):
'''Setup memory table.
This will sort en... | 11 | 2 | 11 | 1 | 9 | 1 | 3 | 0.15 | 0 | 9 | 4 | 0 | 10 | 3 | 10 | 10 | 121 | 15 | 92 | 31 | 76 | 14 | 60 | 26 | 49 | 8 | 0 | 2 | 27 |
9,920 | ray-project/ray | python/ray/dashboard/memory_utils.py | ray.dashboard.memory_utils.MemoryTableEntry | import ray
class MemoryTableEntry:
def __init__(self, *, object_ref: dict, node_address: str, is_driver: bool, pid: int):
self.is_driver = is_driver
self.pid = pid
self.node_address = node_address
self.task_status = object_ref.get('taskStatus', '?')
if self.task_status == '... |
class MemoryTableEntry:
def __init__(self, *, object_ref: dict, node_address: str, is_driver: bool, pid: int):
pass
def is_valid(self) -> bool:
pass
def group_key(self, group_by_type: GroupByType) -> str:
pass
def _get_reference_type(self) -> str:
pass
def _is_o... | 9 | 0 | 13 | 1 | 11 | 1 | 3 | 0.12 | 0 | 7 | 2 | 0 | 8 | 13 | 8 | 8 | 114 | 11 | 92 | 29 | 81 | 11 | 53 | 27 | 44 | 6 | 0 | 1 | 21 |
9,921 | ray-project/ray | python/ray/dashboard/memory_utils.py | ray.dashboard.memory_utils.ReferenceType | from enum import Enum
class ReferenceType(Enum):
ACTOR_HANDLE = 'ACTOR_HANDLE'
PINNED_IN_MEMORY = 'PINNED_IN_MEMORY'
LOCAL_REFERENCE = 'LOCAL_REFERENCE'
USED_BY_PENDING_TASK = 'USED_BY_PENDING_TASK'
CAPTURED_IN_OBJECT = 'CAPTURED_IN_OBJECT'
UNKNOWN_STATUS = 'UNKNOWN_STATUS' |
class ReferenceType(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 8 | 0 | 7 | 7 | 6 | 1 | 7 | 7 | 6 | 0 | 4 | 0 | 0 |
9,922 | ray-project/ray | python/ray/dashboard/memory_utils.py | ray.dashboard.memory_utils.SortingType | from enum import Enum
class SortingType(Enum):
PID = 1
OBJECT_SIZE = 3
REFERENCE_TYPE = 4 |
class SortingType(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
9,923 | ray-project/ray | python/ray/dashboard/modules/dashboard_sdk.py | ray.dashboard.modules.dashboard_sdk.ClusterInfo | import dataclasses
from typing import Any, Dict, List, Optional, Union
@dataclasses.dataclass
class ClusterInfo:
address: str
cookies: Optional[Dict[str, Any]] = None
metadata: Optional[Dict[str, Any]] = None
headers: Optional[Dict[str, Any]] = None | @dataclasses.dataclass
class ClusterInfo:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 4 | 4 | 0 | 5 | 4 | 4 | 0 | 0 | 0 | 0 |
9,924 | ray-project/ray | python/ray/dashboard/modules/dashboard_sdk.py | ray.dashboard.modules.dashboard_sdk.SubmissionClient | import packaging.version
import os
from ray.dashboard.modules.job.common import uri_to_http_components
from pathlib import Path
from ray._private.runtime_env.packaging import create_package, get_uri_for_directory, get_uri_for_package
import tempfile
from typing import Any, Dict, List, Optional, Union
from ray._private.... |
class SubmissionClient:
def __init__(self, address: Optional[str]=None, create_cluster_if_needed: bool=False, cookies: Optional[Dict[str, Any]]=None, metadata: Optional[Dict[str, Any]]=None, headers: Optional[Dict[str, Any]]=None, verify: Optional[Union[str, bool]]=True):
pass
def _check_connection_a... | 17 | 1 | 16 | 1 | 14 | 1 | 2 | 0.05 | 0 | 10 | 0 | 3 | 12 | 6 | 12 | 12 | 220 | 20 | 190 | 75 | 134 | 10 | 87 | 33 | 72 | 6 | 0 | 3 | 31 |
9,925 | ray-project/ray | python/ray/dashboard/modules/data/data_head.py | ray.dashboard.modules.data.data_head.DataHead | from urllib.parse import quote
from ray.dashboard.modules.metrics.metrics_head import DEFAULT_PROMETHEUS_HEADERS, DEFAULT_PROMETHEUS_HOST, PROMETHEUS_HEADERS_ENV_VAR, PROMETHEUS_HOST_ENV_VAR, PrometheusQueryError, parse_prom_headers
from ray.dashboard.subprocesses.routes import SubprocessRouteTable as routes
from ray.d... |
class DataHead(SubprocessModule):
def __init__(self, *args, **kwargs):
pass
@routes.get('/api/data/datasets/{job_id}')
@optional_utils.init_ray_and_catch_exceptions()
async def get_datasets(self, req: Request) -> Response:
pass
async def _query_prometheus(self, query):
pas... | 6 | 0 | 22 | 1 | 19 | 2 | 4 | 0.12 | 1 | 7 | 2 | 0 | 4 | 2 | 5 | 42 | 117 | 8 | 97 | 26 | 87 | 12 | 51 | 22 | 44 | 13 | 5 | 6 | 18 |
9,926 | ray-project/ray | python/ray/dashboard/modules/data/data_head.py | ray.dashboard.modules.data.data_head.PrometheusQuery | from enum import Enum
class PrometheusQuery(Enum):
"""Enum to store types of Prometheus queries for a given metric and grouping."""
VALUE = ('value', "sum({}{{SessionName='{}'}}) by ({})")
MAX = ('max', "max_over_time(sum({}{{SessionName='{}'}}) by ({})[" + f'{MAX_TIME_WINDOW}:{SAMPLE_RATE}])') |
class PrometheusQuery(Enum):
'''Enum to store types of Prometheus queries for a given metric and grouping.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.14 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 9 | 1 | 7 | 3 | 6 | 1 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
9,927 | ray-project/ray | python/ray/dashboard/modules/event/event_agent.py | ray.dashboard.modules.event.event_agent.EventAgent | from ray.dashboard.modules.event.event_utils import monitor_events
import os
import asyncio
import ray._private.ray_constants as ray_constants
from ray.dashboard.utils import async_loop_forever, create_task
from ray.dashboard.modules.event import event_consts
import time
import ray.dashboard.consts as dashboard_consts
... |
class EventAgent(dashboard_utils.DashboardAgentModule):
def __init__(self, dashboard_agent):
pass
async def _get_dashboard_http_address(self):
'''
Lazily get the dashboard http address from InternalKV. If it's not set, sleep
and retry forever.
'''
pass
@asy... | 9 | 2 | 16 | 1 | 13 | 2 | 2 | 0.16 | 1 | 4 | 0 | 0 | 5 | 9 | 6 | 30 | 106 | 11 | 82 | 27 | 73 | 13 | 55 | 25 | 48 | 4 | 5 | 3 | 12 |
9,928 | ray-project/ray | python/ray/dashboard/modules/event/event_head.py | ray.dashboard.modules.event.event_head.EventHead | from ray.dashboard.subprocesses.module import SubprocessModule
from collections import OrderedDict, defaultdict
from ray.dashboard.subprocesses.routes import SubprocessRouteTable as routes
import time
from typing import Dict, List, Union
import ray
import ray.dashboard.optional_utils as dashboard_optional_utils
from ra... |
class EventHead(SubprocessModule, dashboard_utils.RateLimitedModule):
def __init__(self, *args, **kwargs):
pass
async def limit_handler_(self):
pass
def _update_events(self, event_list):
pass
@routes.post('/report_events')
async def report_events(self, request):
'... | 15 | 1 | 12 | 1 | 11 | 0 | 2 | 0.03 | 3 | 4 | 2 | 0 | 8 | 7 | 9 | 49 | 131 | 15 | 113 | 39 | 91 | 3 | 62 | 30 | 51 | 7 | 5 | 3 | 19 |
9,929 | ray-project/ray | python/ray/dashboard/modules/job/cli_utils.py | ray.dashboard.modules.job.cli_utils.BoolOrStringParam | import click
class BoolOrStringParam(click.ParamType):
"""A click parameter that can be either a boolean or a string."""
name = 'BOOL | TEXT'
def convert(self, value, param, ctx):
if isinstance(value, bool):
return value
else:
return bool_cast(value) |
class BoolOrStringParam(click.ParamType):
'''A click parameter that can be either a boolean or a string.'''
def convert(self, value, param, ctx):
pass | 2 | 1 | 5 | 0 | 5 | 0 | 2 | 0.14 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 10 | 2 | 7 | 3 | 5 | 1 | 6 | 3 | 4 | 2 | 0 | 1 | 2 |
9,930 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobDeleteResponse | from dataclasses import asdict, dataclass, replace
@dataclass
class JobDeleteResponse:
deleted: bool | @dataclass
class JobDeleteResponse:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 |
9,931 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobInfo | from dataclasses import asdict, dataclass, replace
from ray.util.annotations import PublicAPI
from typing import Any, Dict, Optional, Tuple, Union
import json
@PublicAPI(stability='stable')
@dataclass
class JobInfo:
"""A class for recording information associated with a job and its execution.
Please keep this... | @PublicAPI(stability='stable')
@dataclass
class JobInfo:
'''A class for recording information associated with a job and its execution.
Please keep this in sync with the JobsAPIInfo proto in src/ray/protobuf/gcs.proto.
'''
def __post_init__(self):
pass
def to_json(self) -> Dict[str, Any]:
... | 7 | 3 | 26 | 4 | 16 | 6 | 5 | 0.58 | 0 | 3 | 1 | 0 | 2 | 0 | 3 | 3 | 120 | 16 | 66 | 19 | 61 | 38 | 46 | 18 | 42 | 10 | 0 | 3 | 16 |
9,932 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobInfoStorageClient | import logging
import asyncio
from ray._private.event.export_event_logger import EventLogType, check_export_api_enabled, get_export_event_logger
from ray._raylet import GcsClient
from dataclasses import asdict, dataclass, replace
from ray._private import ray_constants
from ray.core.generated.export_submission_job_event... | null | 10 | 5 | 19 | 1 | 15 | 2 | 2 | 0.19 | 0 | 9 | 2 | 0 | 8 | 2 | 8 | 8 | 184 | 18 | 139 | 42 | 114 | 27 | 65 | 27 | 55 | 5 | 0 | 2 | 22 |
9,933 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobLogsResponse | from dataclasses import asdict, dataclass, replace
@dataclass
class JobLogsResponse:
logs: str | @dataclass
class JobLogsResponse:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 |
9,934 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobStatus | from ray.util.annotations import PublicAPI
from enum import Enum
@PublicAPI(stability='stable')
class JobStatus(str, Enum):
"""An enumeration for describing the status of a job."""
PENDING = 'PENDING'
RUNNING = 'RUNNING'
STOPPED = 'STOPPED'
SUCCEEDED = 'SUCCEEDED'
FAILED = 'FAILED'
def __s... | @PublicAPI(stability='stable')
class JobStatus(str, Enum):
'''An enumeration for describing the status of a job.'''
def __str__(self) -> str:
pass
def is_terminal(self) -> bool:
'''Return whether or not this status is terminal.
A terminal status is one that cannot transition to any... | 4 | 2 | 6 | 1 | 2 | 3 | 1 | 1.2 | 2 | 1 | 0 | 0 | 2 | 1 | 2 | 117 | 27 | 5 | 10 | 9 | 7 | 12 | 10 | 8 | 7 | 1 | 4 | 0 | 2 |
9,935 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobStopResponse | from dataclasses import asdict, dataclass, replace
@dataclass
class JobStopResponse:
stopped: bool | @dataclass
class JobStopResponse:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 |
9,936 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobSubmitRequest | from dataclasses import asdict, dataclass, replace
from typing import Any, Dict, Optional, Tuple, Union
@dataclass
class JobSubmitRequest:
entrypoint: str
submission_id: Optional[str] = None
job_id: Optional[str] = None
runtime_env: Optional[Dict[str, Any]] = None
metadata: Optional[Dict[str, str]]... | @dataclass
class JobSubmitRequest:
def __post_init__(self):
pass | 3 | 0 | 83 | 8 | 75 | 0 | 23 | 0.22 | 0 | 6 | 0 | 0 | 1 | 0 | 1 | 1 | 113 | 9 | 85 | 12 | 83 | 19 | 47 | 12 | 45 | 23 | 0 | 4 | 23 |
9,937 | ray-project/ray | python/ray/dashboard/modules/job/common.py | ray.dashboard.modules.job.common.JobSubmitResponse | from dataclasses import asdict, dataclass, replace
@dataclass
class JobSubmitResponse:
job_id: str
submission_id: str | @dataclass
class JobSubmitResponse:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0.33 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 3 | 1 | 2 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
9,938 | ray-project/ray | python/ray/dashboard/modules/job/job_agent.py | ray.dashboard.modules.job.job_agent.JobAgent | import ray.dashboard.utils as dashboard_utils
import ray
import traceback
import dataclasses
import ray.dashboard.optional_utils as optional_utils
from aiohttp.web import Request, Response
from ray.dashboard.modules.job.pydantic_models import JobType
from ray.dashboard.modules.job.utils import find_job_by_ids, parse_an... |
class JobAgent(dashboard_utils.DashboardAgentModule):
def __init__(self, dashboard_agent):
pass
@routes.post('/api/job_agent/jobs/')
@optional_utils.deny_browser_requests()
@optional_utils.init_ray_and_catch_exceptions()
async def submit_job(self, req: Request) -> Response:
pass
... | 23 | 0 | 18 | 1 | 17 | 0 | 3 | 0.01 | 1 | 11 | 7 | 0 | 8 | 1 | 9 | 33 | 185 | 21 | 163 | 37 | 140 | 1 | 74 | 31 | 64 | 4 | 5 | 1 | 24 |
9,939 | ray-project/ray | python/ray/dashboard/modules/job/job_head.py | ray.dashboard.modules.job.job_head.JobAgentSubmissionClient | from typing import AsyncIterator, Dict, Optional, Tuple
import aiohttp.web
from ray.dashboard.modules.job.common import JobDeleteResponse, JobInfoStorageClient, JobLogsResponse, JobStopResponse, JobSubmitRequest, JobSubmitResponse, http_uri_components_to_uri
import dataclasses
from aiohttp.client import ClientResponse
... |
class JobAgentSubmissionClient:
'''A local client for submitting and interacting with jobs on a specific node
in the remote cluster.
Submits requests over HTTP to the job agent on the specific node using the REST API.
'''
def __init__(self, dashboard_agent_address: str):
pass
async de... | 9 | 2 | 9 | 1 | 8 | 0 | 2 | 0.07 | 0 | 9 | 5 | 1 | 8 | 2 | 8 | 8 | 86 | 13 | 68 | 26 | 56 | 5 | 49 | 19 | 40 | 5 | 0 | 2 | 18 |
9,940 | ray-project/ray | python/ray/dashboard/modules/job/job_head.py | ray.dashboard.modules.job.job_head.JobHead | from typing import AsyncIterator, Dict, Optional, Tuple
import ray
import dataclasses
import aiohttp.web
from ray._common.utils import get_or_create_event_loop, load_class
import time
import asyncio
from ray.dashboard.modules.job.common import JobDeleteResponse, JobInfoStorageClient, JobLogsResponse, JobStopResponse, J... |
class JobHead(SubprocessModule):
'''Runs on the head node of a Ray cluster and handles Ray Jobs APIs.
NOTE(architkulkarni): Please keep this class in sync with the OpenAPI spec at
`doc/source/cluster/running-applications/job-submission/openapi.yml`.
We currently do not automatically check that the Open... | 31 | 4 | 21 | 2 | 16 | 2 | 3 | 0.19 | 1 | 23 | 8 | 1 | 20 | 2 | 21 | 58 | 485 | 59 | 358 | 82 | 323 | 68 | 178 | 69 | 156 | 6 | 5 | 2 | 60 |
9,941 | ray-project/ray | python/ray/dashboard/modules/job/job_log_storage_client.py | ray.dashboard.modules.job.job_log_storage_client.JobLogStorageClient | import os
import ray
from collections import deque
from typing import AsyncIterator, List, Tuple
from ray.dashboard.modules.job.common import JOB_LOGS_PATH_TEMPLATE
from ray.dashboard.modules.job.utils import file_tail_iterator
class JobLogStorageClient:
"""
Disk storage for stdout / stderr of driver script lo... |
class JobLogStorageClient:
'''
Disk storage for stdout / stderr of driver script logs.
'''
def get_logs(self, job_id: str) -> str:
pass
def tail_logs(self, job_id: str) -> AsyncIterator[List[str]]:
pass
async def get_last_n_log_lines(self, job_id: str, num_log_lines=NUM_LOG_L... | 5 | 3 | 10 | 1 | 6 | 3 | 2 | 0.67 | 0 | 2 | 0 | 0 | 4 | 0 | 4 | 4 | 52 | 7 | 27 | 13 | 20 | 18 | 21 | 10 | 16 | 4 | 0 | 3 | 8 |
9,942 | ray-project/ray | python/ray/dashboard/modules/job/job_manager.py | ray.dashboard.modules.job.job_manager.JobManager | from ray._raylet import GcsClient
from ray.job_submission import JobErrorType, JobStatus
from ray.exceptions import ActorDiedError, ActorUnschedulableError, RuntimeEnvSetupError
import asyncio
from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy, SchedulingStrategyT
from ray.dashboard.modules.job.j... |
class JobManager:
'''Provide python APIs for job submission and management.
It does not provide persistence, all info will be lost if the cluster
goes down.
'''
def __init__(self, gcs_client: GcsClient, logs_dir: str):
pass
def _get_job_driver_logger(self, job_id: str) -> logging.Logg... | 19 | 15 | 31 | 3 | 21 | 7 | 3 | 0.33 | 0 | 21 | 9 | 0 | 18 | 10 | 18 | 18 | 582 | 67 | 389 | 89 | 347 | 127 | 204 | 63 | 185 | 17 | 0 | 5 | 62 |
9,943 | ray-project/ray | python/ray/dashboard/modules/job/job_supervisor.py | ray.dashboard.modules.job.job_supervisor.JobSupervisor | import traceback
from ray._common.network_utils import build_address
from ray._private.accelerators.nvidia_gpu import NOSET_CUDA_VISIBLE_DEVICES_ENV_VAR
from ray.actor import ActorHandle
from ray.job_submission import JobErrorType, JobStatus
from asyncio.tasks import FIRST_COMPLETED
import sys
import signal
from ray._p... |
class JobSupervisor:
'''
Ray actor created by JobManager for each submitted job, responsible to
setup runtime_env, execute given shell command in subprocess, update job
status, persist job logs and manage subprocess group cleaning.
One job supervisor actor maps to one subprocess, for one job_id.
... | 12 | 10 | 36 | 2 | 26 | 9 | 3 | 0.35 | 0 | 20 | 7 | 0 | 11 | 8 | 11 | 11 | 424 | 37 | 287 | 74 | 261 | 101 | 148 | 59 | 136 | 14 | 0 | 4 | 37 |
9,944 | ray-project/ray | python/ray/dashboard/modules/job/sdk.py | ray.dashboard.modules.job.sdk.JobSubmissionClient | from ray.dashboard.utils import get_address_for_submission_client
from ray.util.annotations import PublicAPI
from ray.dashboard.modules.job.utils import strip_keys_with_value_none
import ray
import dataclasses
from typing import Any, AsyncIterator, Dict, List, Optional, Union
from ray.dashboard.modules.job.common impor... |
class JobSubmissionClient(SubmissionClient):
'''A local client for submitting and interacting with jobs on a remote cluster.
Submits requests over HTTP to the job server on the cluster using the REST API.
Args:
address: Either (1) the address of the Ray cluster, or (2) the HTTP address
... | 18 | 9 | 46 | 6 | 20 | 20 | 3 | 1.07 | 1 | 20 | 8 | 0 | 9 | 2 | 9 | 21 | 460 | 67 | 190 | 64 | 143 | 203 | 86 | 25 | 76 | 9 | 1 | 3 | 31 |
9,945 | ray-project/ray | python/ray/dashboard/modules/log/log_agent.py | ray.dashboard.modules.log.log_agent.LogAgent | import ray.dashboard.modules.log.log_utils as log_utils
import ray.dashboard.utils as dashboard_utils
class LogAgent(dashboard_utils.DashboardAgentModule):
def __init__(self, dashboard_agent):
super().__init__(dashboard_agent)
log_utils.register_mimetypes()
routes.static('/logs', self._das... |
class LogAgent(dashboard_utils.DashboardAgentModule):
def __init__(self, dashboard_agent):
pass
async def run(self, server):
pass
@staticmethod
def is_minimal_module():
pass | 5 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 3 | 27 | 12 | 2 | 10 | 5 | 5 | 0 | 9 | 4 | 5 | 1 | 5 | 0 | 3 |
9,946 | ray-project/ray | python/ray/dashboard/modules/log/log_agent.py | ray.dashboard.modules.log.log_agent.LogAgentV1Grpc | import ray.dashboard.modules.log.log_consts as log_consts
from pathlib import Path
from ray.core.generated import reporter_pb2, reporter_pb2_grpc
from typing import Optional
import ray.dashboard.utils as dashboard_utils
import os
class LogAgentV1Grpc(dashboard_utils.DashboardAgentModule):
def __init__(self, dashb... |
class LogAgentV1Grpc(dashboard_utils.DashboardAgentModule):
def __init__(self, dashboard_agent):
pass
async def run(self, server):
pass
@property
def node_id(self) -> Optional[str]:
pass
@staticmethod
def is_minimal_module():
pass
async def ListLogs(self, ... | 11 | 3 | 19 | 3 | 11 | 5 | 3 | 0.42 | 1 | 5 | 0 | 0 | 5 | 0 | 7 | 31 | 142 | 24 | 83 | 24 | 72 | 35 | 50 | 18 | 42 | 9 | 5 | 3 | 22 |
9,947 | ray-project/ray | python/ray/dashboard/modules/log/log_manager.py | ray.dashboard.modules.log.log_manager.LogsManager | from collections import defaultdict
from ray.util.state.common import DEFAULT_RPC_TIMEOUT, GetLogOptions, protobuf_to_task_state_dict
from ray.core.generated.gcs_pb2 import ActorTableData
from typing import AsyncIterable, Awaitable, Callable, Dict, List, Optional, Tuple
from ray.util.state.state_manager import StateDat... |
class LogsManager:
def __init__(self, data_source_client: StateDataSourceClient):
pass
@property
def data_source_client(self) -> StateDataSourceClient:
pass
async def ip_to_node_id(self, node_ip: Optional[str]) -> Optional[str]:
'''Resolve the node id in hex from a given node ... | 13 | 9 | 37 | 4 | 26 | 8 | 5 | 0.31 | 0 | 9 | 3 | 0 | 11 | 1 | 11 | 11 | 424 | 50 | 286 | 88 | 237 | 88 | 130 | 51 | 118 | 12 | 0 | 3 | 55 |
9,948 | ray-project/ray | python/ray/dashboard/modules/log/log_manager.py | ray.dashboard.modules.log.log_manager.ResolvedStreamFileInfo | from ray._common.pydantic_compat import BaseModel
from typing import AsyncIterable, Awaitable, Callable, Dict, List, Optional, Tuple
class ResolvedStreamFileInfo(BaseModel):
node_id: str
filename: str
start_offset: Optional[int]
end_offset: Optional[int] |
class ResolvedStreamFileInfo(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 3 | 5 | 1 | 4 | 6 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
9,949 | ray-project/ray | python/ray/dashboard/modules/metrics/dashboards/common.py | ray.dashboard.modules.metrics.dashboards.common.DashboardConfig | from ray.util.annotations import DeveloperAPI
from typing import List, Optional
from dataclasses import dataclass, field
@DeveloperAPI
@dataclass
class DashboardConfig:
name: str
default_uid: str
standard_global_filters: List[str]
base_json_file_name: str
panels: List[Panel] = field(default_factory... | @DeveloperAPI
@dataclass
class DashboardConfig:
def __post_init__(self):
pass | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0.83 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 | 6 | 1 | 5 | 5 | 6 | 1 | 5 | 0 | 0 | 0 | 0 |
9,950 | ray-project/ray | python/ray/dashboard/modules/metrics/dashboards/common.py | ray.dashboard.modules.metrics.dashboards.common.GridPos | from dataclasses import dataclass, field
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
@dataclass
class GridPos:
x: int
y: int
w: int
h: int | @DeveloperAPI
@dataclass
class GridPos:
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 0 | 0 | 0 |
9,951 | ray-project/ray | python/ray/dashboard/modules/metrics/dashboards/common.py | ray.dashboard.modules.metrics.dashboards.common.Panel | from dataclasses import dataclass, field
from typing import List, Optional
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
@dataclass
class Panel:
"""Defines a Grafana panel (graph) for the Ray dashboard page.
A panel contains one or more targets (time-series queries).
Attributes:
tit... | @DeveloperAPI
@dataclass
class Panel:
'''Defines a Grafana panel (graph) for the Ray dashboard page.
A panel contains one or more targets (time-series queries).
Attributes:
title: Short name of the graph. Note: please keep this in sync with the title
definitions in Metrics.tsx.
d... | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 1.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 3 | 10 | 5 | 9 | 12 | 10 | 5 | 9 | 0 | 0 | 0 | 0 |
9,952 | ray-project/ray | python/ray/dashboard/modules/metrics/dashboards/common.py | ray.dashboard.modules.metrics.dashboards.common.Target | from dataclasses import dataclass, field
from ray.util.annotations import DeveloperAPI
from typing import List, Optional
@DeveloperAPI
@dataclass
class Target:
"""Defines a Grafana target (time-series query) within a panel.
A panel will have one or more targets. By default, all targets are rendered as
sta... | @DeveloperAPI
@dataclass
class Target:
'''Defines a Grafana target (time-series query) within a panel.
A panel will have one or more targets. By default, all targets are rendered as
stacked area charts, with the exception of legend="MAX", which is rendered as
a blue dotted line. Any legend="FINISHED|FAI... | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 3 | 3 | 1 | 2 | 9 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
9,953 | ray-project/ray | python/ray/dashboard/modules/metrics/metrics_head.py | ray.dashboard.modules.metrics.metrics_head.MetricsHead | from ray.dashboard.subprocesses.routes import SubprocessRouteTable as routes
from urllib.parse import quote
import ray.dashboard.optional_utils as dashboard_optional_utils
import shutil
from ray.dashboard.subprocesses.module import SubprocessModule
from ray.dashboard.modules.metrics.grafana_dashboard_factory import gen... |
class MetricsHead(SubprocessModule):
def __init__(self, *args, **kwargs):
pass
@routes.get('/api/grafana_health')
async def grafana_health(self, req) -> aiohttp.web.Response:
'''
Endpoint that checks if Grafana is running
'''
pass
@routes.get('/api/prometheus_he... | 10 | 3 | 35 | 2 | 30 | 3 | 2 | 0.09 | 1 | 10 | 2 | 0 | 8 | 15 | 9 | 46 | 360 | 32 | 300 | 58 | 285 | 28 | 116 | 45 | 105 | 5 | 5 | 3 | 22 |
9,954 | ray-project/ray | python/ray/dashboard/modules/node/node_head.py | ray.dashboard.modules.node.node_head.NodeHead | import json
from itertools import chain
import ray.dashboard.utils as dashboard_utils
from collections import defaultdict, deque
from concurrent.futures import ThreadPoolExecutor
import grpc
from ray.dashboard.modules.node import actor_consts, node_consts
from ray.dashboard.subprocesses.routes import SubprocessRouteTab... |
class NodeHead(SubprocessModule):
def __init__(self, *args, **kwargs):
pass
def get_internal_states(self):
pass
async def _subscribe_for_node_updates(self) -> AsyncGenerator[dict, None]:
'''
Yields the initial state of all nodes, then yields the updated state of nodes.
... | 34 | 7 | 27 | 3 | 21 | 3 | 3 | 0.17 | 1 | 17 | 8 | 0 | 12 | 6 | 13 | 50 | 391 | 55 | 289 | 85 | 264 | 48 | 163 | 81 | 144 | 8 | 5 | 3 | 52 |
9,955 | ray-project/ray | python/ray/dashboard/modules/reporter/profile_manager.py | ray.dashboard.modules.reporter.profile_manager.CpuProfilingManager | import asyncio
import subprocess
import sys
from pathlib import Path
import shutil
class CpuProfilingManager:
def __init__(self, profile_dir_path: str):
self.profile_dir_path = Path(profile_dir_path)
self.profile_dir_path.mkdir(exist_ok=True)
self.profiler_name = 'py-spy'
async def tr... |
class CpuProfilingManager:
def __init__(self, profile_dir_path: str):
pass
async def trace_dump(self, pid: int, native: bool=False) -> (bool, str):
'''
Capture and dump a trace for a specified process.
Args:
pid: The process ID (PID) of the target process for trace... | 4 | 2 | 35 | 2 | 24 | 9 | 4 | 0.37 | 0 | 5 | 0 | 0 | 3 | 2 | 3 | 3 | 109 | 9 | 73 | 18 | 67 | 27 | 39 | 16 | 35 | 7 | 0 | 1 | 13 |
9,956 | ray-project/ray | python/ray/dashboard/modules/reporter/profile_manager.py | ray.dashboard.modules.reporter.profile_manager.MemoryProfilingManager | import shutil
import os
from datetime import datetime
from pathlib import Path
import subprocess
import asyncio
class MemoryProfilingManager:
def __init__(self, profile_dir_path: str):
self.profile_dir_path = Path(profile_dir_path) / 'memray'
self.profile_dir_path.mkdir(exist_ok=True)
self... |
class MemoryProfilingManager:
def __init__(self, profile_dir_path: str):
pass
async def get_profile_result(self, pid: int, profiler_filename: str, format: str='flamegraph', leaks: bool=False) -> (bool, str):
'''
Convert the Memray profile result to specified format.
Args:
... | 5 | 3 | 45 | 5 | 31 | 10 | 5 | 0.33 | 0 | 5 | 0 | 0 | 4 | 2 | 4 | 4 | 185 | 21 | 123 | 41 | 102 | 41 | 62 | 25 | 57 | 7 | 0 | 1 | 20 |
9,957 | ray-project/ray | python/ray/dashboard/modules/reporter/reporter_agent.py | ray.dashboard.modules.reporter.reporter_agent.ReporterAgent | from ray._private.metrics_agent import Gauge, MetricsAgent, Record
from grpc.aio import ServicerContext
from prometheus_client.parser import text_string_to_metric_families
import psutil
import sys
import ray._private.prometheus_exporter as prometheus_exporter
from ray._private import utils
from ray.dashboard.modules.re... |
class ReporterAgent(dashboard_utils.DashboardAgentModule, reporter_pb2_grpc.ReporterServiceServicer, metrics_service_pb2_grpc.MetricsServiceServicer):
'''A monitor process for monitoring Ray nodes.
Attributes:
dashboard_agent: The DashboardAgent object contains global config
'''
def __init__(s... | 49 | 12 | 30 | 2 | 24 | 4 | 4 | 0.17 | 2 | 25 | 7 | 0 | 21 | 17 | 30 | 54 | 972 | 105 | 746 | 224 | 697 | 125 | 408 | 207 | 374 | 17 | 5 | 4 | 111 |
9,958 | ray-project/ray | python/ray/dashboard/modules/reporter/reporter_head.py | ray.dashboard.modules.reporter.reporter_head.ReportHead | from ray._private.metrics_agent import PrometheusServiceDiscoveryWriter
from ray._private.ray_constants import DEBUG_AUTOSCALING_ERROR, DEBUG_AUTOSCALING_STATUS, DEBUG_AUTOSCALING_STATUS_LEGACY, GLOBAL_GRPC_OPTIONS, KV_NAMESPACE_CLUSTER, KV_NAMESPACE_DASHBOARD, env_integer
from pathlib import Path
from ray.dashboard.st... |
class ReportHead(SubprocessModule):
def __init__(self, *args, **kwargs):
pass
@routes.get('/api/v0/cluster_metadata')
async def get_cluster_metadata(self, req):
pass
@routes.get('/api/cluster_status')
async def get_cluster_status(self, req):
'''Returns status information ab... | 30 | 11 | 43 | 5 | 27 | 11 | 4 | 0.41 | 1 | 9 | 5 | 0 | 14 | 6 | 15 | 52 | 667 | 82 | 416 | 116 | 384 | 171 | 220 | 97 | 204 | 13 | 5 | 2 | 64 |
9,959 | ray-project/ray | python/ray/dashboard/modules/serve/sdk.py | ray.dashboard.modules.serve.sdk.ServeSubmissionClient | from ray._private.utils import split_address
from ray.dashboard.modules.dashboard_sdk import SubmissionClient
from typing import Any, Dict, Optional
class ServeSubmissionClient(SubmissionClient):
def __init__(self, dashboard_head_address: str, create_cluster_if_needed=False, cookies: Optional[Dict[str, Any]]=None... |
class ServeSubmissionClient(SubmissionClient):
def __init__(self, dashboard_head_address: str, create_cluster_if_needed=False, cookies: Optional[Dict[str, Any]]=None, metadata: Optional[Dict[str, Any]]=None, headers: Optional[Dict[str, Any]]=None):
pass
def get_serve_details(self) -> Dict:
pa... | 5 | 1 | 16 | 2 | 13 | 1 | 3 | 0.06 | 1 | 5 | 0 | 0 | 4 | 0 | 4 | 16 | 67 | 10 | 54 | 17 | 42 | 3 | 25 | 10 | 20 | 4 | 1 | 1 | 10 |
9,960 | ray-project/ray | python/ray/dashboard/modules/state/state_head.py | ray.dashboard.modules.state.state_head.StateHead | from ray.dashboard.state_api_utils import do_reply, handle_list_api, handle_summary_api, options_from_req
from ray.dashboard.modules.log.log_manager import LogsManager
from ray.dashboard.consts import RAY_STATE_SERVER_MAX_HTTP_REQUEST, RAY_STATE_SERVER_MAX_HTTP_REQUEST_ALLOWED, RAY_STATE_SERVER_MAX_HTTP_REQUEST_ENV_NAM... |
class StateHead(SubprocessModule, RateLimitedModule):
'''Module to obtain state information from the Ray cluster.
It is responsible for state observability APIs such as
ray.list_actors(), ray.get_actor(), ray.summary_actors().
'''
def __init__(self, *args, **kwargs):
'''Initialize for hand... | 49 | 5 | 14 | 1 | 11 | 2 | 2 | 0.17 | 2 | 15 | 8 | 0 | 19 | 4 | 20 | 60 | 335 | 38 | 253 | 77 | 194 | 44 | 136 | 52 | 112 | 4 | 5 | 2 | 39 |
9,961 | ray-project/ray | python/ray/dashboard/modules/train/train_head.py | ray.dashboard.modules.train.train_head.TrainHead | from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
from ray.util.annotations import DeveloperAPI
from ray.dashboard.subprocesses.utils import get_http_session_to_module
from ray.dashboard.subprocesses.module import SubprocessModule
from aiohttp.web import Request, Response
import ray
from ray.dashboard.modul... |
class TrainHead(SubprocessModule):
def __init__(self, *args, **kwargs):
pass
@routes.get('/api/train/v2/runs/v1')
@dashboard_optional_utils.init_ray_and_catch_exceptions()
@DeveloperAPI
async def get_train_v2_runs(self, req: Request) -> Response:
'''Get all TrainRuns for Ray Train ... | 20 | 5 | 30 | 3 | 24 | 3 | 3 | 0.12 | 1 | 10 | 8 | 0 | 5 | 3 | 6 | 43 | 189 | 23 | 148 | 40 | 129 | 18 | 66 | 31 | 56 | 6 | 5 | 3 | 18 |
9,962 | ray-project/ray | python/ray/dashboard/modules/usage_stats/usage_stats_head.py | ray.dashboard.modules.usage_stats.usage_stats_head.UsageStatsHead | import random
import ray._common.usage.usage_lib as ray_usage_lib
import os
import ray.dashboard.utils as dashboard_utils
from ray._common.utils import get_or_create_event_loop
import ray
import requests
from ray._common.network_utils import build_address
from ray.dashboard.utils import async_loop_forever
from concurre... |
class UsageStatsHead(dashboard_utils.DashboardHeadModule):
def __init__(self, config: dashboard_utils.DashboardHeadModuleConfig):
pass
@routes.get('/usage_stats_enabled')
async def get_usage_stats_enabled(self, req) -> aiohttp.web.Response:
pass
@routes.get('/cluster_id')
... | 18 | 1 | 13 | 1 | 11 | 1 | 2 | 0.11 | 1 | 5 | 2 | 0 | 12 | 10 | 13 | 50 | 197 | 32 | 149 | 48 | 127 | 16 | 111 | 40 | 93 | 5 | 5 | 2 | 28 |
9,963 | ray-project/ray | python/ray/dashboard/modules/version.py | ray.dashboard.modules.version.VersionResponse | from dataclasses import dataclass
@dataclass
class VersionResponse:
version: str
ray_version: str
ray_commit: str
session_name: str | @dataclass
class VersionResponse:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 0 | 0 | 0 |
9,964 | ray-project/ray | python/ray/dashboard/routes.py | ray.dashboard.routes.BaseRouteTable | from ray.dashboard.optional_deps import PathLike, RouteDef, aiohttp, hdrs
import abc
from typing import Any
class BaseRouteTable(abc.ABC):
"""A base class to bind http route to a target instance. Subclass should implement
the _register_route method. It should define how the handler interacts with
_BindInfo... |
class BaseRouteTable(abc.ABC):
'''A base class to bind http route to a target instance. Subclass should implement
the _register_route method. It should define how the handler interacts with
_BindInfo.instance.
Subclasses must declare their own _bind_map and _routes properties to avoid
conflicts.
... | 37 | 1 | 3 | 0 | 3 | 0 | 1 | 0.09 | 1 | 2 | 0 | 2 | 2 | 0 | 14 | 34 | 88 | 16 | 66 | 40 | 29 | 6 | 45 | 26 | 28 | 4 | 4 | 3 | 18 |
9,965 | ray-project/ray | python/ray/dashboard/state_aggregator.py | ray.dashboard.state_aggregator.StateAPIManager | from ray.util.state.state_manager import DataSourceUnavailable, StateDataSourceClient
from ray.runtime_env import RuntimeEnv
import asyncio
from concurrent.futures import ThreadPoolExecutor
from ray.util.state.common import RAY_MAX_LIMIT_FROM_API_SERVER, ActorState, ActorSummaries, JobState, ListApiOptions, ListApiResp... |
class StateAPIManager:
'''A class to query states from data source, caches, and post-processes
the entries.
'''
def __init__(self, state_data_source_client: StateDataSourceClient, thread_pool_executor: ThreadPoolExecutor):
pass
@property
def data_source_client(self):
pass
... | 25 | 9 | 38 | 3 | 30 | 5 | 2 | 0.18 | 0 | 28 | 19 | 0 | 14 | 2 | 14 | 14 | 588 | 62 | 447 | 107 | 418 | 79 | 223 | 102 | 199 | 10 | 0 | 2 | 55 |
9,966 | ray-project/ray | python/ray/dashboard/subprocesses/handle.py | ray.dashboard.subprocesses.handle.SubprocessModuleHandle | from ray.dashboard.subprocesses.utils import ResponseType, get_http_session_to_module, module_logging_filename
from ray.dashboard.subprocesses.module import SubprocessModule, SubprocessModuleConfig, run_module
import os
import ray.dashboard.consts as dashboard_consts
from typing import Optional, Union
import multiproce... |
class SubprocessModuleHandle:
'''
A handle to a module created as a subprocess. Can send messages to the module and
receive responses. It only acts as a proxy to the aiohttp server running in the
subprocess. On destruction, the subprocess is terminated.
Lifecycle:
1. In SubprocessModuleHandle c... | 14 | 11 | 19 | 1 | 14 | 4 | 2 | 0.42 | 0 | 19 | 10 | 0 | 12 | 11 | 16 | 16 | 370 | 35 | 236 | 72 | 195 | 99 | 140 | 46 | 122 | 7 | 0 | 2 | 37 |
9,967 | ray-project/ray | python/ray/dashboard/subprocesses/module.py | ray.dashboard.subprocesses.module.SubprocessModule | from ray import ray_constants
import multiprocessing
import abc
import asyncio
import inspect
from ray.dashboard.subprocesses.utils import get_named_pipe_path, get_socket_path, module_logging_filename
import multiprocessing.connection
import ray
import sys
from ray._private.gcs_utils import GcsChannel
import aiohttp
fr... |
class SubprocessModule(abc.ABC):
'''
A Dashboard Head Module that runs in a subprocess as a standalone aiohttp server.
'''
def __init__(self, config: SubprocessModuleConfig):
'''
Initialize current module when DashboardHead loading modules.
:param dashboard_head: The DashboardH... | 23 | 6 | 15 | 1 | 9 | 6 | 2 | 0.76 | 1 | 5 | 3 | 1 | 5 | 3 | 6 | 26 | 104 | 9 | 54 | 29 | 31 | 41 | 27 | 12 | 20 | 3 | 4 | 2 | 10 |
9,968 | ray-project/ray | python/ray/dashboard/subprocesses/module.py | ray.dashboard.subprocesses.module.SubprocessModuleConfig | from dataclasses import dataclass
@dataclass
class SubprocessModuleConfig:
"""
Configuration for a SubprocessModule.
Pickleable.
"""
cluster_id_hex: str
gcs_address: str
session_name: str
temp_dir: str
session_dir: str
logging_level: str
logging_format: str
log_dir: str
... | @dataclass
class SubprocessModuleConfig:
'''
Configuration for a SubprocessModule.
Pickleable.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.29 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 1 | 7 | 1 | 6 | 9 | 7 | 1 | 6 | 0 | 0 | 0 | 0 |
9,969 | ray-project/ray | python/ray/dashboard/subprocesses/routes.py | ray.dashboard.subprocesses.routes.SubprocessRouteTable | from ray.dashboard.subprocesses.utils import ResponseType
import inspect
from ray.dashboard.routes import BaseRouteTable
import collections
from ray.dashboard.optional_deps import aiohttp
class SubprocessRouteTable(BaseRouteTable):
"""
A route table to bind http route to SubprocessModuleHandle and SubprocessMo... |
class SubprocessRouteTable(BaseRouteTable):
'''
A route table to bind http route to SubprocessModuleHandle and SubprocessModule.
This class is used in cls object: all the decorator methods are @classmethod, and
the routes are binded to the cls object.
Note we have 2 handlers:
1. the child side ... | 8 | 2 | 29 | 2 | 24 | 3 | 2 | 0.6 | 1 | 11 | 8 | 0 | 0 | 0 | 4 | 38 | 221 | 31 | 119 | 45 | 89 | 71 | 62 | 23 | 52 | 6 | 5 | 3 | 20 |
9,970 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.Bunch | class Bunch(dict):
"""A dict with attribute-access."""
def __getattr__(self, key):
try:
return self.__getitem__(key)
except KeyError:
raise AttributeError(key)
def __setattr__(self, key, value):
self.__setitem__(key, value) | class Bunch(dict):
'''A dict with attribute-access.'''
def __getattr__(self, key):
pass
def __setattr__(self, key, value):
pass | 3 | 1 | 4 | 0 | 4 | 0 | 2 | 0.13 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 29 | 11 | 2 | 8 | 3 | 5 | 1 | 8 | 3 | 5 | 2 | 2 | 1 | 3 |
9,971 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.CustomEncoder | import json
from ray._common.utils import binary_to_hex
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, bytes):
return binary_to_hex(obj)
if isinstance(obj, Immutable):
return obj.mutable()
return json.JSONEncoder.default(self, obj) |
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
pass | 2 | 0 | 7 | 0 | 6 | 1 | 3 | 0.14 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 5 | 8 | 0 | 7 | 2 | 5 | 1 | 7 | 2 | 5 | 3 | 2 | 1 | 3 |
9,972 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.DashboardAgentModule | import abc
class DashboardAgentModule(abc.ABC):
def __init__(self, dashboard_agent):
"""
Initialize current module when DashboardAgent loading modules.
:param dashboard_agent: The DashboardAgent instance.
"""
self._dashboard_agent = dashboard_agent
self.session_name... |
class DashboardAgentModule(abc.ABC):
def __init__(self, dashboard_agent):
'''
Initialize current module when DashboardAgent loading modules.
:param dashboard_agent: The DashboardAgent instance.
'''
pass
@abc.abstractmethod
async def run(self, server):
'''
... | 9 | 3 | 5 | 0 | 2 | 4 | 1 | 1.17 | 1 | 0 | 0 | 7 | 3 | 2 | 4 | 24 | 29 | 3 | 12 | 10 | 3 | 14 | 8 | 7 | 3 | 1 | 4 | 0 | 4 |
9,973 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.DashboardHeadModule | import abc
from ray._common.utils import get_or_create_event_loop
from ray._raylet import GcsClient
import ray.experimental.internal_kv as internal_kv
from packaging.version import Version
from ray._private.gcs_utils import GcsChannel
class DashboardHeadModule(abc.ABC):
def __init__(self, config: DashboardHeadMod... |
class DashboardHeadModule(abc.ABC):
def __init__(self, config: DashboardHeadModuleConfig):
'''
Initialize current module when DashboardHead loading modules.
:param config: The DashboardHeadModuleConfig instance.
'''
pass
@property
def minimal(self):
pass
... | 31 | 3 | 5 | 0 | 4 | 1 | 1 | 0.24 | 1 | 4 | 2 | 13 | 16 | 5 | 17 | 37 | 116 | 17 | 82 | 41 | 46 | 20 | 56 | 25 | 37 | 3 | 4 | 2 | 24 |
9,974 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.DashboardHeadModuleConfig | from dataclasses import dataclass
@dataclass
class DashboardHeadModuleConfig:
minimal: bool
cluster_id_hex: str
session_name: str
gcs_address: str
log_dir: str
temp_dir: str
session_dir: str
ip: str
http_host: str
http_port: int | @dataclass
class DashboardHeadModuleConfig:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 | 12 | 1 | 11 | 3 | 12 | 1 | 11 | 0 | 0 | 0 | 0 |
9,975 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.FrontendNotFoundError | class FrontendNotFoundError(OSError):
pass | class FrontendNotFoundError(OSError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
9,976 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.Immutable | from abc import ABCMeta, abstractmethod
class Immutable(metaclass=ABCMeta):
@abstractmethod
def mutable(self):
pass |
class Immutable(metaclass=ABCMeta):
@abstractmethod
def mutable(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 2 | 1 | 0 | 1 | 21 | 4 | 0 | 4 | 3 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
9,977 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.ImmutableDict | from collections.abc import Mapping, Sequence
class ImmutableDict(Immutable, Mapping):
"""Makes a :class:`dict` immutable."""
__slots__ = ('_dict', '_proxy')
def __init__(self, dict_value):
if type(dict_value) not in (dict, ImmutableDict):
raise TypeError(f'{type(dict_value)} object is... |
class ImmutableDict(Immutable, Mapping):
'''Makes a :class:`dict` immutable.'''
def __init__(self, dict_value):
pass
def __reduce_ex__(self, protocol):
pass
def mutable(self):
pass
def get(self, key, default=None):
pass
def __eq__(self, other):
pass
... | 12 | 1 | 4 | 0 | 4 | 0 | 2 | 0.02 | 2 | 4 | 0 | 1 | 11 | 2 | 11 | 46 | 57 | 12 | 44 | 17 | 32 | 1 | 44 | 17 | 32 | 3 | 6 | 2 | 20 |
9,978 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.ImmutableList | from collections.abc import Mapping, Sequence
class ImmutableList(Immutable, Sequence):
"""Makes a :class:`list` immutable."""
__slots__ = ('_list', '_proxy')
def __init__(self, list_value):
if type(list_value) not in (list, ImmutableList):
raise TypeError(f'{type(list_value)} object i... |
class ImmutableList(Immutable, Sequence):
'''Makes a :class:`list` immutable.'''
def __init__(self, list_value):
pass
def __reduce_ex__(self, protocol):
pass
def mutable(self):
pass
def __eq__(self, other):
pass
def __ne__(self, other):
pass
def... | 10 | 1 | 4 | 0 | 4 | 0 | 2 | 0.03 | 2 | 2 | 0 | 0 | 9 | 2 | 9 | 45 | 45 | 10 | 34 | 14 | 24 | 1 | 34 | 14 | 24 | 3 | 6 | 1 | 15 |
9,979 | ray-project/ray | python/ray/dashboard/utils.py | ray.dashboard.utils.RateLimitedModule | from typing import TYPE_CHECKING, Any, Dict, List, Optional
import functools
import logging
import abc
from abc import ABCMeta, abstractmethod
class RateLimitedModule(abc.ABC):
"""Simple rate limiter
Inheriting from this class and decorate any class methods will
apply simple rate limit.
It will limit ... |
class RateLimitedModule(abc.ABC):
'''Simple rate limiter
Inheriting from this class and decorate any class methods will
apply simple rate limit.
It will limit the maximal number of concurrent invocations of **all** the
methods decorated.
The below Example class will only allow 10 concurrent cal... | 8 | 4 | 16 | 2 | 9 | 6 | 2 | 1.71 | 1 | 2 | 0 | 3 | 2 | 3 | 3 | 23 | 82 | 17 | 24 | 12 | 16 | 41 | 18 | 9 | 13 | 3 | 4 | 2 | 6 |
9,980 | ray-project/ray | python/ray/data/_internal/arrow_block.py | ray.data._internal.arrow_block.ArrowBlockAccessor | import random
from ray.data._internal.arrow_ops.transform_pyarrow import shuffle
from ray.air.constants import TENSOR_COLUMN_NAME
from ray.data.block import Block, BlockAccessor, BlockColumn, BlockColumnAccessor, BlockExecStats, BlockMetadataWithSchema, BlockType, U
import numpy as np
from ray.data._internal.arrow_ops ... |
class ArrowBlockAccessor(TableBlockAccessor):
def __init__(self, table: 'pyarrow.Table'):
pass
def column_names(self) -> List[str]:
pass
def fill_column(self, name: str, value: Any) -> Block:
pass
@classmethod
def from_bytes(cls, data: bytes) -> 'ArrowBlockAccessor':
... | 33 | 1 | 14 | 2 | 10 | 2 | 3 | 0.2 | 1 | 20 | 3 | 0 | 27 | 0 | 33 | 49 | 504 | 88 | 347 | 142 | 269 | 69 | 268 | 112 | 219 | 13 | 2 | 6 | 95 |
9,981 | ray-project/ray | python/ray/data/_internal/arrow_block.py | ray.data._internal.arrow_block.ArrowBlockBuilder | from ray.data.block import Block, BlockAccessor, BlockColumn, BlockColumnAccessor, BlockExecStats, BlockMetadataWithSchema, BlockType, U
from ray.data._internal.table_block import TableBlockAccessor, TableBlockBuilder
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, TypeV... |
class ArrowBlockBuilder(TableBlockBuilder):
def __init__(self):
pass
@staticmethod
def _table_from_pydict(columns: Dict[str, List[Any]]) -> Block:
pass
@staticmethod
def _combine_tables(tables: List[Block]) -> Block:
pass
@staticmethod
def _concat_would_copy() -> bo... | 11 | 0 | 4 | 1 | 3 | 0 | 1 | 0 | 1 | 7 | 0 | 0 | 2 | 0 | 6 | 28 | 31 | 8 | 23 | 14 | 12 | 0 | 19 | 10 | 12 | 2 | 3 | 1 | 8 |
9,982 | ray-project/ray | python/ray/data/_internal/arrow_block.py | ray.data._internal.arrow_block.ArrowRow | from ray.data._internal.row import TableRow
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
class ArrowRow(TableRow):
"""
Row of a tabular Dataset backed by a Arrow Table block.
"""
def __getitem__(self, key: Union[str, List[str]]) -> Any... |
class ArrowRow(TableRow):
'''
Row of a tabular Dataset backed by a Arrow Table 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__(self):... | 6 | 1 | 18 | 3 | 13 | 2 | 3 | 0.2 | 1 | 5 | 1 | 0 | 3 | 0 | 3 | 42 | 53 | 11 | 35 | 14 | 29 | 7 | 28 | 14 | 22 | 4 | 7 | 1 | 11 |
9,983 | ray-project/ray | python/ray/data/_internal/batcher.py | ray.data._internal.batcher.Batcher | from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray.data._internal.arrow_block import ArrowBlockAccessor
from typing import Optional
from ray.data.block import Block, BlockAccessor
from ray.data._internal.arrow_ops import transform_pyarrow
class Batcher(BatcherInterface):
"""Chu... |
class Batcher(BatcherInterface):
'''Chunks blocks into batches.'''
def __init__(self, batch_size: Optional[int], ensure_copy: bool=False):
'''
Construct a batcher that yields batches of batch_sizes rows.
Args:
batch_size: The size of batches to yield.
ensure_cop... | 7 | 7 | 16 | 1 | 9 | 5 | 2 | 0.67 | 1 | 4 | 2 | 0 | 6 | 5 | 6 | 11 | 108 | 13 | 57 | 19 | 50 | 38 | 51 | 19 | 44 | 8 | 1 | 3 | 14 |
9,984 | ray-project/ray | python/ray/data/_internal/batcher.py | ray.data._internal.batcher.BatcherInterface | from ray.data.block import Block, BlockAccessor
class BatcherInterface:
def add(self, block: Block):
"""Add a block to the block buffer.
Args:
block: Block to add to the block buffer.
"""
raise NotImplementedError()
def done_adding(self) -> bool:
"""Indica... |
class BatcherInterface:
def add(self, block: Block):
'''Add a block to the block buffer.
Args:
block: Block to add to the block buffer.
'''
pass
def done_adding(self) -> bool:
'''Indicate to the batcher that no more blocks will be added to the buffer.'''
... | 6 | 5 | 5 | 0 | 2 | 2 | 1 | 1 | 0 | 2 | 0 | 2 | 5 | 0 | 5 | 5 | 28 | 6 | 11 | 6 | 5 | 11 | 11 | 6 | 5 | 1 | 0 | 0 | 5 |
9,985 | ray-project/ray | python/ray/data/_internal/batcher.py | ray.data._internal.batcher.ShufflingBatcher | from ray.data.block import Block, BlockAccessor
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray.data._internal.arrow_ops.transform_pyarrow import try_combine_chunked_columns
from ray.data._internal.execution.util import memory_string
from ray.data._internal.arrow_block import Arr... |
class ShufflingBatcher(BatcherInterface):
'''Chunks blocks into shuffled batches, using a local in-memory shuffle buffer.'''
def __init__(self, batch_size: Optional[int], shuffle_buffer_min_size: int, shuffle_seed: Optional[int]=None):
'''Constructs a random-shuffling block batcher.
Args:
... | 14 | 12 | 17 | 1 | 11 | 5 | 2 | 0.61 | 1 | 5 | 2 | 0 | 11 | 11 | 11 | 16 | 215 | 24 | 119 | 36 | 100 | 72 | 70 | 29 | 58 | 6 | 1 | 3 | 24 |
9,986 | ray-project/ray | python/ray/data/_internal/block_batching/interfaces.py | ray.data._internal.block_batching.interfaces.Batch | from ray.data.block import Block, DataBatch
from dataclasses import dataclass
@dataclass
class Batch:
"""A batch of data.
Attributes:
metadata: Metadata associated with this batch.
data: The batch of data.
"""
metadata: BatchMetadata
data: DataBatch | @dataclass
class Batch:
'''A batch of data.
Attributes:
metadata: Metadata associated with this batch.
data: The batch of data.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 11 | 2 | 3 | 1 | 2 | 6 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
9,987 | ray-project/ray | python/ray/data/_internal/block_batching/interfaces.py | ray.data._internal.block_batching.interfaces.BlockPrefetcher | from ray.data.block import Block, DataBatch
import abc
from ray.types import ObjectRef
from typing import Any, List
class BlockPrefetcher(metaclass=abc.ABCMeta):
"""Interface for prefetching blocks."""
@abc.abstractmethod
def prefetch_blocks(self, blocks: List[ObjectRef[Block]]):
"""Prefetch the p... |
class BlockPrefetcher(metaclass=abc.ABCMeta):
'''Interface for prefetching blocks.'''
@abc.abstractmethod
def prefetch_blocks(self, blocks: List[ObjectRef[Block]]):
'''Prefetch the provided blocks to this node.'''
pass
def stop(self):
'''Stop prefetching and release resources.'... | 4 | 3 | 3 | 0 | 2 | 1 | 1 | 0.5 | 1 | 1 | 1 | 3 | 2 | 0 | 2 | 22 | 11 | 2 | 6 | 4 | 2 | 3 | 5 | 3 | 2 | 1 | 3 | 0 | 2 |
9,988 | ray-project/ray | python/ray/data/_internal/block_batching/interfaces.py | ray.data._internal.block_batching.interfaces.CollatedBatch | from typing import Any, List
class CollatedBatch(Batch):
"""A batch of collated data.
Attributes:
data: The batch of data which is the output of a user provided collate_fn
Therefore, the type of this data can be Any.
"""
data: Any |
class CollatedBatch(Batch):
'''A batch of collated data.
Attributes:
data: The batch of data which is the output of a user provided collate_fn
Therefore, the type of this data can be Any.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 3 | 1 | 2 | 7 | 3 | 1 | 2 | 0 | 1 | 0 | 0 |
9,989 | ray-project/ray | python/ray/data/_internal/block_batching/util.py | ray.data._internal.block_batching.util.ActorBlockPrefetcher | from ray.types import ObjectRef
from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
from ray.data.block import Block, BlockAccessor, DataBatch
from ray.data._internal.block_batching.interfaces import Batch, BatchMetadata, BlockPrefetcher, CollatedBatch
import ray
from typing import Any, Callable, ... |
class ActorBlockPrefetcher(BlockPrefetcher):
'''Block prefetcher using a local actor.'''
def __init__(self):
pass
@staticmethod
def _get_or_create_actor_prefetcher() -> 'ActorHandle':
pass
def prefetch_blocks(self, blocks: List[ObjectRef[Block]]):
pass | 5 | 1 | 4 | 0 | 4 | 0 | 1 | 0.07 | 1 | 3 | 3 | 0 | 2 | 1 | 3 | 25 | 19 | 3 | 15 | 8 | 10 | 1 | 9 | 7 | 5 | 1 | 4 | 0 | 3 |
9,990 | ray-project/ray | python/ray/data/_internal/block_batching/util.py | ray.data._internal.block_batching.util.WaitBlockPrefetcher | from ray.types import ObjectRef
from ray.data.block import Block, BlockAccessor, DataBatch
import threading
from typing import Any, Callable, Iterator, List, Optional, Tuple
from ray.data._internal.block_batching.interfaces import Batch, BatchMetadata, BlockPrefetcher, CollatedBatch
import ray
class WaitBlockPrefetche... |
class WaitBlockPrefetcher(BlockPrefetcher):
'''Block prefetcher using ray.wait.'''
def __init__(self):
pass
def _run(self):
pass
def prefetch_blocks(self, blocks: List[ObjectRef[Block]]):
pass
def stop(self):
pass
def __del__(self):
pass | 6 | 1 | 8 | 0 | 8 | 0 | 2 | 0.02 | 1 | 5 | 1 | 0 | 5 | 4 | 5 | 27 | 47 | 5 | 41 | 11 | 35 | 1 | 36 | 11 | 30 | 6 | 4 | 5 | 12 |
9,991 | ray-project/ray | python/ray/data/_internal/block_batching/util.py | ray.data._internal.block_batching.util._BlockPretcher | import ray
@ray.remote(num_cpus=0)
class _BlockPretcher:
"""Helper actor that prefetches blocks asynchronously."""
def prefetch(self, *blocks) -> None:
pass | @ray.remote(num_cpus=0)
class _BlockPretcher:
'''Helper actor that prefetches blocks asynchronously.'''
def prefetch(self, *blocks) -> None:
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 0 | 1 |
9,992 | ray-project/ray | python/ray/data/_internal/block_builder.py | ray.data._internal.block_builder.BlockBuilder | from ray.data.block import Block, BlockAccessor, BlockType, T
from typing import Generic
class BlockBuilder(Generic[T]):
"""A builder class for blocks."""
@staticmethod
def for_block(block: Block) -> 'BlockBuilder':
return BlockAccessor.for_block(block).builder()
def add(self, item: T) -> Non... |
class BlockBuilder(Generic[T]):
'''A builder class for blocks.'''
@staticmethod
def for_block(block: Block) -> 'BlockBuilder':
pass
def add(self, item: T) -> None:
'''Append a single row to the block being built.'''
pass
def add_block(self, block: Block) -> None:
'... | 10 | 8 | 3 | 0 | 2 | 1 | 1 | 0.44 | 1 | 3 | 0 | 2 | 7 | 0 | 8 | 10 | 34 | 8 | 18 | 10 | 8 | 8 | 17 | 9 | 8 | 1 | 1 | 0 | 8 |
9,993 | ray-project/ray | python/ray/data/_internal/block_list.py | ray.data._internal.block_list.BlockList | from ray.types import ObjectRef
from ray.data.block import Block, BlockMetadata, Schema
from ray.data._internal.memory_tracing import trace_allocation
from typing import Iterator, List, Optional, Tuple
class BlockList:
"""A list of blocks that may be computed or pending computation.
All blocks are known ahead... |
class BlockList:
'''A list of blocks that may be computed or pending computation.
All blocks are known ahead of time
'''
def __init__(self, blocks: List[ObjectRef[Block]], metadata: List[BlockMetadata], schema: Optional['Schema']=None, *, owned_by_consumer: bool):
pass
def __repr__(self):... | 14 | 12 | 6 | 0 | 4 | 2 | 1 | 0.53 | 0 | 6 | 1 | 0 | 12 | 5 | 12 | 12 | 91 | 16 | 49 | 27 | 28 | 26 | 36 | 19 | 23 | 2 | 0 | 1 | 14 |
9,994 | ray-project/ray | python/ray/data/_internal/compute.py | ray.data._internal.compute.ActorPoolStrategy | from typing import Any, Callable, Iterable, Optional, TypeVar, Union
class ActorPoolStrategy(ComputeStrategy):
"""Specify the compute strategy for a Dataset transform.
ActorPoolStrategy specifies that an autoscaling pool of actors should be used
for a given Dataset transform. This is useful for stateful s... |
class ActorPoolStrategy(ComputeStrategy):
'''Specify the compute strategy for a Dataset transform.
ActorPoolStrategy specifies that an autoscaling pool of actors should be used
for a given Dataset transform. This is useful for stateful setup of callable
classes.
For a fixed-sized pool of size ``n``... | 4 | 2 | 29 | 1 | 22 | 7 | 5 | 0.56 | 1 | 5 | 0 | 0 | 2 | 5 | 2 | 2 | 75 | 6 | 45 | 15 | 35 | 25 | 25 | 8 | 22 | 9 | 1 | 2 | 10 |
9,995 | ray-project/ray | python/ray/data/_internal/compute.py | ray.data._internal.compute.ComputeStrategy | from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class ComputeStrategy:
pass | @DeveloperAPI
class ComputeStrategy:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 |
9,996 | ray-project/ray | python/ray/data/_internal/compute.py | ray.data._internal.compute.TaskPoolStrategy | from ray.util.annotations import DeveloperAPI
from typing import Any, Callable, Iterable, Optional, TypeVar, Union
@DeveloperAPI
class TaskPoolStrategy(ComputeStrategy):
def __init__(self, size: Optional[int]=None):
"""Construct TaskPoolStrategy for a Dataset transform.
Args:
size: Sp... | @DeveloperAPI
class TaskPoolStrategy(ComputeStrategy):
def __init__(self, size: Optional[int]=None):
'''Construct TaskPoolStrategy for a Dataset transform.
Args:
size: Specify the maximum size of the task pool.
'''
pass
def __eq__(self, other: Any) -> bool:
... | 5 | 1 | 9 | 1 | 6 | 2 | 2 | 0.33 | 1 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 19 | 3 | 12 | 7 | 6 | 4 | 7 | 4 | 4 | 2 | 1 | 1 | 3 |
9,997 | ray-project/ray | python/ray/data/_internal/datasource/audio_datasource.py | ray.data._internal.datasource.audio_datasource.AudioDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
import io
from typing import TYPE_CHECKING, Iterator, List, Union
from ray.data._internal.util import _check_import
from ray.data.block import Block
class AudioDataso... |
class AudioDatasource(FileBasedDatasource):
def __init__(self, paths: Union[str, List[str]], **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str) -> Iterator[Block]:
pass | 3 | 0 | 11 | 2 | 8 | 2 | 1 | 0.08 | 1 | 3 | 1 | 0 | 2 | 0 | 2 | 18 | 45 | 6 | 36 | 12 | 28 | 3 | 13 | 8 | 9 | 1 | 2 | 0 | 2 |
9,998 | ray-project/ray | python/ray/data/_internal/datasource/avro_datasource.py | ray.data._internal.datasource.avro_datasource.AvroDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from typing import TYPE_CHECKING, Iterator, List, Union
from ray.data._internal.util import _check_import
from ray.data.block import Block
from ray.data.context import DataContext
from ray.data._internal.output_buffer import BlockOutputBuffer, Ou... |
class AvroDatasource(FileBasedDatasource):
'''A datasource that reads Avro files.'''
def __init__(self, paths: Union[str, List[str]], **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str) -> Iterator[Block]:
pass | 3 | 1 | 12 | 2 | 10 | 1 | 3 | 0.1 | 1 | 4 | 2 | 0 | 2 | 0 | 2 | 18 | 30 | 7 | 21 | 13 | 13 | 2 | 17 | 9 | 13 | 4 | 2 | 2 | 5 |
9,999 | ray-project/ray | python/ray/data/_internal/datasource/bigquery_datasink.py | ray.data._internal.datasource.bigquery_datasink.BigQueryDatasink | import logging
from ray.data.datasource.datasink import Datasink
from ray.data._internal.datasource import bigquery_datasource
from ray.data._internal.remote_fn import cached_remote_fn
import time
import uuid
from ray.data.block import Block, BlockAccessor
from typing import Iterable, Optional
import os
import tempfile... |
class BigQueryDatasink(Datasink[None]):
def __init__(self, project_id: str, dataset: str, max_retry_cnt: int=DEFAULT_MAX_RETRY_CNT, overwrite_table: Optional[bool]=True) -> None:
pass
def on_write_start(self) -> None:
pass
def write(self, blocks: Iterable[Block], ctx: TaskContext) -> Non... | 5 | 0 | 37 | 4 | 32 | 1 | 3 | 0.04 | 1 | 6 | 0 | 0 | 3 | 4 | 3 | 12 | 106 | 13 | 89 | 32 | 71 | 4 | 55 | 19 | 47 | 5 | 2 | 4 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.