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,500 | ray-project/ray | python/ray/_private/log.py | ray._private.log.PlainRayHandler | import logging
class PlainRayHandler(logging.StreamHandler):
"""A plain log handler.
This handler writes to whatever sys.stderr points to at emit-time,
not at instantiation time. See docs for logging._StderrHandler.
"""
def __init__(self):
super().__init__()
self.plain_handler = l... |
class PlainRayHandler(logging.StreamHandler):
'''A plain log handler.
This handler writes to whatever sys.stderr points to at emit-time,
not at instantiation time. See docs for logging._StderrHandler.
'''
def __init__(self):
pass
def emit(self, record: logging.LogRecord):
'''E... | 3 | 2 | 13 | 2 | 8 | 3 | 2 | 0.59 | 1 | 4 | 0 | 0 | 2 | 1 | 2 | 27 | 33 | 6 | 17 | 5 | 13 | 10 | 11 | 5 | 7 | 2 | 4 | 1 | 3 |
9,501 | ray-project/ray | python/ray/_private/log_monitor.py | ray._private.log_monitor.LogFileInfo | import os
class LogFileInfo:
def __init__(self, filename=None, size_when_last_opened=None, file_position=None, file_handle=None, is_err_file=False, job_id=None, worker_pid=None):
assert filename is not None and size_when_last_opened is not None and (file_position is not None)
self.filename = filen... |
class LogFileInfo:
def __init__(self, filename=None, size_when_last_opened=None, file_position=None, file_handle=None, is_err_file=False, job_id=None, worker_pid=None):
pass
def reopen_if_necessary(self):
'''Check if the file's inode has changed and reopen it if necessary.
There are a... | 4 | 1 | 18 | 0 | 16 | 2 | 2 | 0.1 | 0 | 1 | 0 | 0 | 3 | 9 | 3 | 3 | 58 | 3 | 50 | 24 | 37 | 5 | 25 | 15 | 21 | 4 | 0 | 2 | 6 |
9,502 | ray-project/ray | python/ray/_private/log_monitor.py | ray._private.log_monitor.LogMonitor | import time
from typing import Callable, List, Optional, Set
import shutil
import ray._private.ray_constants as ray_constants
import ray._private.services as services
from ray._raylet import GcsClient
import os
import errno
import glob
import ray._private.utils
class LogMonitor:
"""A monitor process for monitoring... |
class LogMonitor:
'''A monitor process for monitoring Ray log files.
This class maintains a list of open files and a list of closed log files. We
can't simply leave all files open because we'll run out of file
descriptors.
The "run" method of this class will cycle between doing several things:
... | 10 | 9 | 39 | 3 | 28 | 7 | 6 | 0.39 | 0 | 9 | 1 | 0 | 8 | 10 | 8 | 8 | 370 | 41 | 238 | 60 | 217 | 93 | 162 | 50 | 149 | 14 | 0 | 5 | 51 |
9,503 | ray-project/ray | python/ray/_private/memory_monitor.py | ray._private.memory_monitor.MemoryMonitor | import sys
import time
import psutil
import os
from ray._common.utils import get_system_memory
class MemoryMonitor:
"""Helper class for raising errors on low memory.
This presents a much cleaner error message to users than what would happen
if we actually ran out of memory.
The monitor tries to use t... |
class MemoryMonitor:
'''Helper class for raising errors on low memory.
This presents a much cleaner error message to users than what would happen
if we actually ran out of memory.
The monitor tries to use the cgroup memory limit and usage if it is set
and available so that it is more reasonable ins... | 4 | 1 | 17 | 1 | 15 | 1 | 3 | 0.29 | 0 | 5 | 1 | 0 | 3 | 5 | 3 | 3 | 69 | 11 | 45 | 14 | 40 | 13 | 30 | 13 | 25 | 4 | 0 | 2 | 9 |
9,504 | ray-project/ray | python/ray/_private/memory_monitor.py | ray._private.memory_monitor.RayOutOfMemoryError | import platform
import psutil
class RayOutOfMemoryError(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
@staticmethod
def get_message(used_gb, total_gb, threshold):
proc_str = get_top_n_memory_usage(n=10)
return 'More than {}% of the memory on '.format(int(100 *... |
class RayOutOfMemoryError(Exception):
def __init__(self, msg):
pass
@staticmethod
def get_message(used_gb, total_gb, threshold):
pass | 4 | 0 | 10 | 0 | 10 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 2 | 12 | 22 | 1 | 21 | 5 | 17 | 0 | 6 | 4 | 3 | 1 | 3 | 0 | 2 |
9,505 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.Component | from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, Metric as PrometheusMetric
from ray.core.generated.metrics_pb2 import Metric
import time
from typing import Any, Dict, List, Set, Tuple, Union
class Component:
def __init__(self, id: str):
"""Represent a comp... |
class Component:
def __init__(self, id: str):
'''Represent a component that requests to proxy export metrics
Args:
id: Id of this component.
'''
pass
@property
def metrics(self) -> Dict[str, OpencensusProxyMetric]:
'''Return the metrics requested to prox... | 7 | 3 | 10 | 1 | 5 | 4 | 2 | 0.61 | 0 | 2 | 1 | 0 | 4 | 3 | 4 | 4 | 44 | 7 | 23 | 14 | 16 | 14 | 19 | 12 | 14 | 3 | 0 | 2 | 6 |
9,506 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.Gauge | from opencensus.stats.view import View
from opencensus.tags import tag_key as tag_key_module, tag_map as tag_map_module, tag_value as tag_value_module
from opencensus.stats import aggregation, measure as measure_module
from typing import Any, Dict, List, Set, Tuple, Union
from ray.util.metrics import _is_invalid_metric... |
class Gauge(View):
'''Gauge representation of opencensus view.
This class is used to collect process metrics from the reporter agent.
Cpp metrics should be collected in a different way.
'''
def __init__(self, name, description, unit, tags: List[str]):
pass
@property
def measure(sel... | 10 | 1 | 3 | 0 | 3 | 0 | 1 | 0.25 | 1 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 25 | 5 | 16 | 10 | 8 | 4 | 11 | 7 | 6 | 1 | 1 | 0 | 4 |
9,507 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.MetricsAgent | import os
from opencensus.stats.view_manager import ViewManager
from ray.core.generated.metrics_pb2 import Metric
from opencensus.stats.base_exporter import StatsExporter
from opencensus.tags import tag_key as tag_key_module, tag_map as tag_map_module, tag_value as tag_value_module
from opencensus.stats.stats_recorder ... |
class MetricsAgent:
def __init__(self, view_manager: ViewManager, stats_recorder: StatsRecorder, stats_exporter: StatsExporter=None):
'''A class to record and export metrics.
The class exports metrics in 2 different ways.
- Directly record and export metrics using OpenCensus.
- Pro... | 7 | 4 | 17 | 2 | 9 | 6 | 2 | 0.67 | 0 | 7 | 2 | 0 | 6 | 6 | 6 | 6 | 110 | 18 | 55 | 27 | 43 | 37 | 46 | 22 | 39 | 3 | 0 | 2 | 13 |
9,508 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.OpenCensusProxyCollector | from opencensus.tags import tag_key as tag_key_module, tag_map as tag_map_module, tag_value as tag_value_module
from opencensus.metrics.export.value import ValueDouble
from typing import Any, Dict, List, Set, Tuple, Union
from ray._private.ray_constants import env_bool
from ray.core.generated.metrics_pb2 import Metric
... |
class OpenCensusProxyCollector:
def __init__(self, namespace: str, component_timeout_s: int=60):
'''Prometheus collector implementation for opencensus proxy export.
Prometheus collector requires to implement `collect` which is
invoked whenever Prometheus queries the endpoint.
The c... | 8 | 6 | 46 | 4 | 28 | 15 | 6 | 0.55 | 0 | 10 | 1 | 0 | 5 | 5 | 5 | 5 | 237 | 22 | 140 | 36 | 125 | 77 | 87 | 27 | 81 | 14 | 0 | 4 | 28 |
9,509 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.OpencensusProxyMetric | from typing import Any, Dict, List, Set, Tuple, Union
from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, Metric as PrometheusMetric
from opencensus.metrics.export.metric_descriptor import MetricDescriptorType
from ray.core.generated.metrics_pb2 import Metric
from opencensu... |
class OpencensusProxyMetric:
def __init__(self, name: str, desc: str, unit: str, label_keys: List[str]):
'''Represents the OpenCensus metrics that will be proxy exported.'''
pass
@property
def name(self):
pass
@property
def desc(self):
pass
@property
def uni... | 15 | 4 | 9 | 1 | 7 | 1 | 2 | 0.16 | 0 | 3 | 0 | 0 | 7 | 5 | 7 | 7 | 77 | 10 | 58 | 26 | 45 | 9 | 34 | 21 | 26 | 8 | 0 | 3 | 14 |
9,510 | ray-project/ray | python/ray/_private/metrics_agent.py | ray._private.metrics_agent.PrometheusServiceDiscoveryWriter | import os
import time
import threading
from ray._common.network_utils import build_address
from ray._raylet import GcsClient
import ray
import json
import traceback
class PrometheusServiceDiscoveryWriter(threading.Thread):
"""A class to support Prometheus service discovery.
It supports file-based service disc... |
class PrometheusServiceDiscoveryWriter(threading.Thread):
'''A class to support Prometheus service discovery.
It supports file-based service discovery. Checkout
https://prometheus.io/docs/guides/file-sd/ for more details.
Args:
gcs_address: Gcs address for this cluster.
temp_dir: Tempor... | 8 | 3 | 11 | 0 | 9 | 2 | 2 | 0.31 | 1 | 2 | 0 | 0 | 6 | 3 | 6 | 31 | 81 | 9 | 55 | 19 | 48 | 17 | 37 | 17 | 30 | 3 | 1 | 2 | 10 |
9,511 | ray-project/ray | python/ray/_private/node.py | ray._private.node.Node | from typing import IO, AnyStr, Dict, Optional, Tuple
from ray._common.utils import try_to_create_directory
import subprocess
from ray._private.resource_isolation_config import ResourceIsolationConfig
import time
from ray._private.resource_and_label_spec import ResourceAndLabelSpec
import ray
from filelock import FileLo... | null | 96 | 63 | 22 | 2 | 15 | 5 | 3 | 0.32 | 0 | 20 | 2 | 0 | 75 | 34 | 76 | 76 | 1,826 | 218 | 1,219 | 312 | 1,058 | 391 | 653 | 229 | 566 | 36 | 0 | 5 | 217 |
9,512 | ray-project/ray | python/ray/_private/parameter.py | ray._private.parameter.RayParams | import os
from ray._private.utils import get_ray_client_dependency_error
from typing import Dict, List, Optional
from ray._private.resource_isolation_config import ResourceIsolationConfig
import ray._private.ray_constants as ray_constants
class RayParams:
"""A class used to store the parameters used by Ray.
A... | null | 9 | 5 | 44 | 3 | 39 | 3 | 6 | 0.48 | 0 | 10 | 0 | 0 | 6 | 60 | 6 | 6 | 469 | 27 | 299 | 145 | 227 | 143 | 156 | 81 | 147 | 22 | 0 | 3 | 48 |
9,513 | ray-project/ray | python/ray/_private/profiling.py | ray._private.profiling.ChromeTracingCompleteEvent | from typing import Dict, List, Union
from dataclasses import asdict, dataclass
@dataclass(init=True)
class ChromeTracingCompleteEvent:
cat: str
name: str
pid: int
tid: int
ts: int
dur: int
cname: str
args: Dict[str, Union[str, int]]
ph: str = 'X' | @dataclass(init=True)
class ChromeTracingCompleteEvent:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 1.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0 | 10 | 2 | 9 | 13 | 10 | 2 | 9 | 0 | 0 | 0 | 0 |
9,514 | ray-project/ray | python/ray/_private/profiling.py | ray._private.profiling.ChromeTracingMetadataEvent | from typing import Dict, List, Union
from dataclasses import asdict, dataclass
@dataclass(init=True)
class ChromeTracingMetadataEvent:
name: str
args: Dict[str, str]
pid: int
tid: int = None
ph: str = 'M' | @dataclass(init=True)
class ChromeTracingMetadataEvent:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0.83 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 | 6 | 3 | 5 | 5 | 6 | 3 | 5 | 0 | 0 | 0 | 0 |
9,515 | ray-project/ray | python/ray/_private/profiling.py | ray._private.profiling._NullLogSpan | class _NullLogSpan:
"""A log span context manager that does nothing"""
def __enter__(self):
pass
def __exit__(self, type, value, tb):
pass | class _NullLogSpan:
'''A log span context manager that does nothing'''
def __enter__(self):
pass
def __exit__(self, type, value, tb):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.2 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 5 | 3 | 2 | 1 | 5 | 3 | 2 | 1 | 0 | 0 | 2 |
9,516 | ray-project/ray | python/ray/_private/prometheus_exporter.py | ray._private.prometheus_exporter.Collector | from prometheus_client.core import REGISTRY, CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, UnknownMetricFamily
from opencensus.stats import aggregation_data as aggregation_data_module, base_exporter
class Collector(object):
"""Collector represents the Prometheus Collector object"""
def __init... |
class Collector(object):
'''Collector represents the Prometheus Collector object'''
def __init__(self, options=Options(), view_name_to_data_map=None):
pass
@property
def options(self):
'''Options to be used to configure the exporter'''
pass
@property
def registry(self):... | 14 | 9 | 17 | 1 | 12 | 5 | 3 | 0.42 | 1 | 11 | 1 | 0 | 9 | 4 | 9 | 9 | 173 | 17 | 111 | 36 | 97 | 47 | 77 | 32 | 67 | 11 | 1 | 2 | 25 |
9,517 | ray-project/ray | python/ray/_private/prometheus_exporter.py | ray._private.prometheus_exporter.Options | from prometheus_client.core import REGISTRY, CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, UnknownMetricFamily
class Options(object):
"""Options contains options for configuring the exporter.
The address can be empty as the prometheus client will
assume it's localhost
:type namespace: ... |
class Options(object):
'''Options contains options for configuring the exporter.
The address can be empty as the prometheus client will
assume it's localhost
:type namespace: str
:param namespace: The prometheus namespace to be used. Defaults to ''.
:type port: int
:param port: The Promethe... | 10 | 5 | 3 | 0 | 3 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 5 | 4 | 5 | 5 | 41 | 5 | 18 | 14 | 8 | 18 | 14 | 10 | 8 | 1 | 1 | 0 | 5 |
9,518 | ray-project/ray | python/ray/_private/prometheus_exporter.py | ray._private.prometheus_exporter.PrometheusStatsExporter | from opencensus.common.transports import sync
from opencensus.stats import aggregation_data as aggregation_data_module, base_exporter
from prometheus_client import start_http_server
from prometheus_client.core import REGISTRY, CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, UnknownMetricFamily
class Pro... |
class PrometheusStatsExporter(base_exporter.StatsExporter):
'''Exporter exports stats to Prometheus, users need
to register the exporter as an HTTP Handler to be
able to export.
:type options:
:class:`~opencensus.ext.prometheus.stats_exporter.Options`
:param options: An options obje... | 14 | 8 | 6 | 0 | 3 | 2 | 1 | 1.03 | 1 | 3 | 1 | 0 | 9 | 4 | 9 | 9 | 82 | 11 | 36 | 23 | 20 | 37 | 30 | 17 | 20 | 3 | 1 | 2 | 13 |
9,519 | ray-project/ray | python/ray/_private/ray_experimental_perf.py | ray._private.ray_experimental_perf.DAGActor | import ray
import ray.experimental.channel as ray_channel
@ray.remote
class DAGActor:
def echo(self, x):
return x
def echo_multiple(self, *x):
return x | @ray.remote
class DAGActor:
def echo(self, x):
pass
def echo_multiple(self, *x):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 6 | 1 | 5 | 3 | 2 | 0 | 5 | 3 | 2 | 1 | 0 | 0 | 2 |
9,520 | ray-project/ray | python/ray/_private/ray_logging/__init__.py | ray._private.ray_logging.DedupState | from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
from dataclasses import dataclass
@dataclass
class DedupState:
timestamp: int
count: int
line: int
metadata: LogBatch
sources: Set[Tuple[str, int]]
def formatted(self) -> str:
return self.line + _color(... | @dataclass
class DedupState:
def formatted(self) -> str:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0.6 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 21 | 5 | 10 | 2 | 8 | 6 | 8 | 2 | 6 | 1 | 0 | 0 | 1 |
9,521 | ray-project/ray | python/ray/_private/ray_logging/__init__.py | ray._private.ray_logging.LogDeduplicator | import re
from ray._private.ray_constants import RAY_DEDUP_LOGS, RAY_DEDUP_LOGS_AGG_WINDOW_S, RAY_DEDUP_LOGS_ALLOW_REGEX, RAY_DEDUP_LOGS_SKIP_REGEX
import time
from ray.experimental.tqdm_ray import RAY_TQDM_MAGIC
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
class LogDeduplicator:... |
class LogDeduplicator:
def __init__(self, agg_window_s: int, allow_re: Optional[str], skip_re: Optional[str], *, _timesource=None):
pass
def deduplicate(self, batch: LogBatch) -> List[LogBatch]:
'''Rewrite a batch of lines to reduce duplicate log messages.
Args:
batch: The... | 4 | 2 | 39 | 3 | 27 | 8 | 6 | 0.29 | 0 | 4 | 1 | 0 | 3 | 5 | 3 | 3 | 119 | 12 | 83 | 26 | 72 | 24 | 58 | 19 | 54 | 12 | 0 | 3 | 19 |
9,522 | ray-project/ray | python/ray/_private/ray_logging/__init__.py | ray._private.ray_logging.WorkerStandardStreamDispatcher | import threading
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
class WorkerStandardStreamDispatcher:
def __init__(self):
self.handlers = []
self._lock = threading.Lock()
def add_handler(self, name: str, handler: Callable) -> None:
with self._lock:... |
class WorkerStandardStreamDispatcher:
def __init__(self):
pass
def add_handler(self, name: str, handler: Callable) -> None:
pass
def remove_handler(self, name: str) -> None:
pass
def emit(self, data):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 19 | 3 | 16 | 10 | 11 | 0 | 16 | 10 | 11 | 2 | 0 | 2 | 5 |
9,523 | ray-project/ray | python/ray/_private/ray_logging/constants.py | ray._private.ray_logging.constants.LogKey | from enum import Enum
class LogKey(str, Enum):
JOB_ID = 'job_id'
WORKER_ID = 'worker_id'
NODE_ID = 'node_id'
ACTOR_ID = 'actor_id'
TASK_ID = 'task_id'
ACTOR_NAME = 'actor_name'
TASK_NAME = 'task_name'
TASK_FUNCTION_NAME = 'task_func_name'
ASCTIME = 'asctime'
LEVELNAME = 'levelna... |
class LogKey(str, Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 21 | 2 | 16 | 16 | 15 | 3 | 16 | 16 | 15 | 0 | 4 | 0 | 0 |
9,524 | ray-project/ray | python/ray/_private/ray_logging/logging_config.py | ray._private.ray_logging.logging_config.DefaultLoggingConfigurator | from ray._common.filters import CoreContextFilter
from ray._common.formatters import JSONFormatter, TextFormatter
import logging
from typing import Set
class DefaultLoggingConfigurator(LoggingConfigurator):
def __init__(self):
self._encoding_to_formatter = {'TEXT': TextFormatter(), 'JSON': JSONFormatter()... |
class DefaultLoggingConfigurator(LoggingConfigurator):
def __init__(self):
pass
def get_supported_encodings(self) -> Set[str]:
pass
def configure(self, logging_config: 'LoggingConfig'):
pass | 4 | 0 | 10 | 1 | 8 | 0 | 1 | 0.04 | 1 | 4 | 2 | 0 | 3 | 1 | 3 | 25 | 32 | 5 | 26 | 11 | 22 | 1 | 22 | 11 | 18 | 2 | 5 | 1 | 4 |
9,525 | ray-project/ray | python/ray/_private/ray_logging/logging_config.py | ray._private.ray_logging.logging_config.LoggingConfig | from dataclasses import dataclass, field
from ray.util.annotations import PublicAPI
from ray._private.ray_logging.constants import LOGRECORD_STANDARD_ATTRS
@PublicAPI(stability='alpha')
@dataclass
class LoggingConfig:
encoding: str = 'TEXT'
log_level: str = 'INFO'
additional_log_standard_attrs: list = fiel... | @PublicAPI(stability='alpha')
@dataclass
class LoggingConfig:
def __post_init__(self):
pass
def _configure_logging(self):
'''Set up the logging configuration for the current process.'''
pass
def _apply(self):
'''Set up the logging configuration.'''
pass | 6 | 2 | 7 | 0 | 6 | 1 | 2 | 0.18 | 0 | 2 | 0 | 0 | 3 | 0 | 3 | 3 | 30 | 4 | 22 | 8 | 18 | 4 | 14 | 8 | 10 | 4 | 0 | 2 | 6 |
9,526 | ray-project/ray | python/ray/_private/ray_logging/logging_config.py | ray._private.ray_logging.logging_config.LoggingConfigurator | from typing import Set
from abc import ABC, abstractmethod
class LoggingConfigurator(ABC):
@abstractmethod
def get_supported_encodings(self) -> Set[str]:
raise NotImplementedError
@abstractmethod
def configure(self, logging_config: 'LoggingConfig'):
raise NotImplementedError |
class LoggingConfigurator(ABC):
@abstractmethod
def get_supported_encodings(self) -> Set[str]:
pass
@abstractmethod
def configure(self, logging_config: 'LoggingConfig'):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 2 | 0 | 2 | 22 | 8 | 1 | 7 | 5 | 2 | 0 | 5 | 3 | 2 | 1 | 4 | 0 | 2 |
9,527 | ray-project/ray | python/ray/_private/ray_perf.py | ray._private.ray_perf.Actor | import ray
@ray.remote(num_cpus=0)
class Actor:
def small_value(self):
return b'ok'
def small_value_arg(self, x):
return b'ok'
def small_value_batch(self, n):
ray.get([small_value.remote() for _ in range(n)]) | @ray.remote(num_cpus=0)
class Actor:
def small_value(self):
pass
def small_value_arg(self, x):
pass
def small_value_batch(self, n):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
9,528 | ray-project/ray | python/ray/_private/ray_perf.py | ray._private.ray_perf.AsyncActor | import ray
import asyncio
@ray.remote
class AsyncActor:
async def small_value(self):
return b'ok'
async def small_value_with_arg(self, x):
return b'ok'
async def small_value_batch(self, n):
await asyncio.wait([small_value.remote() for _ in range(n)]) | @ray.remote
class AsyncActor:
async def small_value(self):
pass
async def small_value_with_arg(self, x):
pass
async def small_value_batch(self, n):
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
9,529 | ray-project/ray | python/ray/_private/ray_perf.py | ray._private.ray_perf.Client | import ray
@ray.remote(num_cpus=0)
class Client:
def __init__(self, servers):
if not isinstance(servers, list):
servers = [servers]
self.servers = servers
def small_value_batch(self, n):
results = []
for s in self.servers:
results.extend([s.small_value.... | @ray.remote(num_cpus=0)
class Client:
def __init__(self, servers):
pass
def small_value_batch(self, n):
pass
def small_value_batch_arg(self, n):
pass | 5 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 3 | 1 | 3 | 3 | 18 | 2 | 16 | 12 | 12 | 0 | 16 | 10 | 12 | 2 | 0 | 1 | 6 |
9,530 | ray-project/ray | python/ray/_private/runtime_env/agent/runtime_env_agent.py | ray._private.runtime_env.agent.runtime_env_agent.CreatedEnvResult | from dataclasses import dataclass
@dataclass
class CreatedEnvResult:
success: bool
result: str
creation_time_ms: int | @dataclass
class CreatedEnvResult:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 4 | 1 | 3 | 4 | 4 | 1 | 3 | 0 | 0 | 0 | 0 |
9,531 | ray-project/ray | python/ray/_private/runtime_env/agent/runtime_env_agent.py | ray._private.runtime_env.agent.runtime_env_agent.ReferenceTable | from ray.runtime_env import RuntimeEnv, RuntimeEnvConfig
from collections import defaultdict
from typing import Callable, Dict, List, Set, Tuple
class ReferenceTable:
"""
The URI reference table which is used for GC.
When the reference count is decreased to zero,
the URI should be removed from this tab... |
class ReferenceTable:
'''
The URI reference table which is used for GC.
When the reference count is decreased to zero,
the URI should be removed from this table and
added to cache if needed.
'''
def __init__(self, uris_parser: Callable[[RuntimeEnv], Tuple[str, UriType]], unused_uris_callba... | 10 | 4 | 11 | 0 | 9 | 2 | 2 | 0.26 | 0 | 5 | 1 | 0 | 8 | 6 | 8 | 8 | 100 | 9 | 72 | 31 | 53 | 19 | 56 | 21 | 47 | 5 | 0 | 3 | 18 |
9,532 | ray-project/ray | python/ray/_private/runtime_env/agent/runtime_env_agent.py | ray._private.runtime_env.agent.runtime_env_agent.RuntimeEnvAgent | import traceback
from ray._private.runtime_env.pip import PipPlugin
from ray.runtime_env import RuntimeEnv, RuntimeEnvConfig
from ray._private.runtime_env.context import RuntimeEnvContext
from ray._private.runtime_env.nsight import NsightPlugin
from ray.core.generated.runtime_env_common_pb2 import RuntimeEnvState as Pr... |
class RuntimeEnvAgent:
'''An RPC server to create and delete runtime envs.
Attributes:
dashboard_agent: The DashboardAgent object contains global config.
'''
def __init__(self, runtime_env_dir, logging_params, gcs_client: GcsClient, temp_dir, address, runtime_env_agent_port):
pass
... | 12 | 3 | 49 | 3 | 39 | 6 | 4 | 0.16 | 0 | 27 | 16 | 0 | 8 | 21 | 8 | 8 | 432 | 39 | 339 | 99 | 311 | 54 | 173 | 80 | 161 | 10 | 0 | 3 | 43 |
9,533 | ray-project/ray | python/ray/_private/runtime_env/conda.py | ray._private.runtime_env.conda.CondaPlugin | from ray._private.runtime_env.conda_utils import create_conda_env_if_needed, delete_conda_env, get_conda_activate_commands, get_conda_envs, get_conda_info_json
from ray._private.runtime_env.packaging import Protocol, parse_uri
from ray._common.utils import get_or_create_event_loop, try_to_create_directory
from ray._pri... |
class CondaPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str):
pass
def _get_path_from_hash(self, hash: str) -> str:
'''Generate a path from the hash of a conda or pip spec.
The output path also functions as the name of the conda environment
when using the `--pre... | 8 | 3 | 27 | 4 | 20 | 4 | 2 | 0.26 | 1 | 5 | 0 | 0 | 6 | 3 | 6 | 31 | 148 | 24 | 101 | 42 | 79 | 26 | 68 | 27 | 60 | 5 | 5 | 3 | 17 |
9,534 | ray-project/ray | python/ray/_private/runtime_env/conda_utils.py | ray._private.runtime_env.conda_utils.ShellCommandException | class ShellCommandException(Exception):
pass | class ShellCommandException(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,535 | ray-project/ray | python/ray/_private/runtime_env/context.py | ray._private.runtime_env.context.RuntimeEnvContext | from ray._private.utils import update_envs
import os
import json
import sys
import shlex
from ray.util.annotations import DeveloperAPI
from typing import Dict, List, Optional
from ray._private.services import get_ray_jars_dir
import subprocess
from ray.core.generated.common_pb2 import Language
@DeveloperAPI
class Runt... | null | 8 | 1 | 17 | 2 | 13 | 3 | 3 | 0.23 | 0 | 2 | 0 | 0 | 3 | 5 | 4 | 4 | 91 | 12 | 64 | 26 | 50 | 15 | 44 | 18 | 38 | 9 | 0 | 2 | 13 |
9,536 | ray-project/ray | python/ray/_private/runtime_env/image_uri.py | ray._private.runtime_env.image_uri.ContainerPlugin | import logging
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from typing import List, Optional
from ray._private.runtime_env.context import RuntimeEnvContext
class ContainerPlugin(RuntimeEnvPlugin):
"""Starts worker in container."""
name = 'container'
def __init__(self, ray_tmp_dir: str):
... |
class ContainerPlugin(RuntimeEnvPlugin):
'''Starts worker in container.'''
def __init__(self, ray_tmp_dir: str):
pass
async def create(self, uri: Optional[str], runtime_env: 'RuntimeEnv', context: RuntimeEnvContext, logger: logging.Logger) -> float:
pass
def modify_context(self, uris... | 4 | 1 | 13 | 1 | 12 | 1 | 2 | 0.08 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 28 | 46 | 7 | 38 | 19 | 22 | 3 | 14 | 7 | 10 | 3 | 5 | 1 | 6 |
9,537 | ray-project/ray | python/ray/_private/runtime_env/image_uri.py | ray._private.runtime_env.image_uri.ImageURIPlugin | from typing import List, Optional
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
import logging
from ray._private.runtime_env.context import RuntimeEnvContext
class ImageURIPlugin(RuntimeEnvPlugin):
"""Starts worker in a container of a custom image."""
name = 'image_uri'
@staticmethod
de... |
class ImageURIPlugin(RuntimeEnvPlugin):
'''Starts worker in a container of a custom image.'''
@staticmethod
def get_compatible_keys():
pass
def __init__(self, ray_tmp_dir: str):
pass
async def create(self, uri: Optional[str], runtime_env: 'RuntimeEnv', context: RuntimeEnvContext, ... | 6 | 1 | 8 | 1 | 8 | 1 | 2 | 0.09 | 1 | 3 | 0 | 0 | 3 | 2 | 4 | 29 | 42 | 7 | 34 | 21 | 16 | 3 | 14 | 8 | 9 | 2 | 5 | 1 | 6 |
9,538 | ray-project/ray | python/ray/_private/runtime_env/java_jars.py | ray._private.runtime_env.java_jars.JavaJarsPlugin | from ray._private.runtime_env.context import RuntimeEnvContext
from ray._common.utils import try_to_create_directory
from ray._private.utils import get_directory_size_bytes
import os
from typing import Dict, List, Optional
from ray._raylet import GcsClient
from ray._private.runtime_env.packaging import delete_package, ... |
class JavaJarsPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str, gcs_client: GcsClient):
pass
def _get_local_dir_from_uri(self, uri: str):
pass
def delete_uri(self, uri: str, logger: Optional[logging.Logger]=default_logger) -> int:
'''Delete URI and return the numbe... | 8 | 2 | 11 | 0 | 10 | 0 | 2 | 0.04 | 1 | 8 | 2 | 0 | 7 | 2 | 7 | 32 | 84 | 11 | 71 | 37 | 47 | 3 | 42 | 19 | 34 | 4 | 5 | 2 | 14 |
9,539 | ray-project/ray | python/ray/_private/runtime_env/mpi.py | ray._private.runtime_env.mpi.MPIPlugin | from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from typing import List, Optional
import logging
import subprocess
from ray._private.runtime_env.context import RuntimeEnvContext
class MPIPlugin(RuntimeEnvPlugin):
"""Plugin for enabling MPI cluster functionality in runtime environments.
This plugi... |
class MPIPlugin(RuntimeEnvPlugin):
'''Plugin for enabling MPI cluster functionality in runtime environments.
This plugin enables an MPI cluster to run on top of Ray. It handles the setup
and configuration of MPI processes for distributed computing tasks.
To use this plugin, add "mpi" to the runtime env... | 2 | 1 | 44 | 4 | 35 | 8 | 3 | 0.74 | 1 | 4 | 1 | 0 | 1 | 0 | 1 | 26 | 74 | 11 | 38 | 14 | 30 | 28 | 17 | 8 | 15 | 3 | 5 | 1 | 3 |
9,540 | ray-project/ray | python/ray/_private/runtime_env/nsight.py | ray._private.runtime_env.nsight.NsightPlugin | import asyncio
from ray._common.utils import try_to_create_directory
import copy
from ray._private.runtime_env.context import RuntimeEnvContext
import os
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from ray.exceptions import RuntimeEnvSetupError
import sys
import subprocess
import logging
from pathlib ... |
class NsightPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str):
pass
async def _check_nsight_script(self, nsight_config: Dict[str, str]) -> Tuple[bool, str]:
'''
Function to validate if nsight_config is a valid nsight profile options
Args:
nsight_conf... | 5 | 1 | 25 | 2 | 20 | 4 | 3 | 0.17 | 1 | 8 | 2 | 0 | 4 | 2 | 4 | 29 | 104 | 11 | 81 | 33 | 62 | 14 | 44 | 19 | 39 | 6 | 5 | 2 | 12 |
9,541 | ray-project/ray | python/ray/_private/runtime_env/packaging.py | ray._private.runtime_env.packaging._AsyncFileLock | import asyncio
from filelock import FileLock
class _AsyncFileLock:
"""Asyncio version used to prevent blocking event loop."""
def __init__(self, lock_file: str):
self.file = FileLock(lock_file)
async def __aenter__(self):
while True:
try:
self.file.acquire(time... |
class _AsyncFileLock:
'''Asyncio version used to prevent blocking event loop.'''
def __init__(self, lock_file: str):
pass
async def __aenter__(self):
pass
async def __aexit__(self, exc_type, exc, tb):
pass | 4 | 1 | 4 | 0 | 4 | 0 | 2 | 0.08 | 0 | 2 | 0 | 0 | 3 | 1 | 3 | 3 | 16 | 3 | 12 | 5 | 8 | 1 | 12 | 5 | 8 | 3 | 0 | 2 | 5 |
9,542 | ray-project/ray | python/ray/_private/runtime_env/pip.py | ray._private.runtime_env.pip.PipPlugin | import asyncio
import shutil
from ray._private.runtime_env.packaging import Protocol, parse_uri
import os
import logging
from ray._private.utils import get_directory_size_bytes
from ray._private.runtime_env import dependency_utils, virtualenv_utils
from ray._common.utils import try_to_create_directory
from asyncio impo... |
class PipPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str):
pass
def _get_path_from_hash(self, hash_val: str) -> str:
'''Generate a path from the hash of a pip spec.
Example output:
/tmp/ray/session_2021-11-03_16-33-59_356303_41018/runtime_resources
... | 8 | 3 | 18 | 2 | 14 | 3 | 2 | 0.21 | 1 | 6 | 1 | 0 | 6 | 4 | 6 | 31 | 123 | 17 | 92 | 42 | 70 | 19 | 63 | 26 | 55 | 4 | 5 | 2 | 16 |
9,543 | ray-project/ray | python/ray/_private/runtime_env/pip.py | ray._private.runtime_env.pip.PipProcessor | from typing import Dict, List, Optional
import os
from ray._private.runtime_env.utils import check_output_cmd
import sys
from asyncio import create_task, get_running_loop
import shutil
import logging
from ray._private.runtime_env import dependency_utils, virtualenv_utils
class PipProcessor:
def __init__(self, tar... |
class PipProcessor:
def __init__(self, target_dir: str, runtime_env: 'RuntimeEnv', logger: Optional[logging.Logger]=default_logger):
pass
@classmethod
async def _ensure_pip_version(cls, path: str, pip_version: Optional[str], cwd: str, pip_env: Dict, logger: logging.Logger):
'''Run the pip ... | 8 | 2 | 27 | 1 | 22 | 4 | 2 | 0.18 | 0 | 6 | 0 | 0 | 4 | 5 | 6 | 6 | 169 | 13 | 134 | 54 | 98 | 24 | 56 | 26 | 48 | 2 | 0 | 2 | 10 |
9,544 | ray-project/ray | python/ray/_private/runtime_env/plugin.py | ray._private.runtime_env.plugin.PluginSetupContext | from ray._private.runtime_env.uri_cache import URICache
class PluginSetupContext:
def __init__(self, name: str, class_instance: RuntimeEnvPlugin, priority: int, uri_cache: URICache):
self.name = name
self.class_instance = class_instance
self.priority = priority
self.uri_cache = uri... |
class PluginSetupContext:
def __init__(self, name: str, class_instance: RuntimeEnvPlugin, priority: int, uri_cache: URICache):
pass | 2 | 0 | 11 | 0 | 11 | 0 | 1 | 0 | 0 | 4 | 2 | 0 | 1 | 4 | 1 | 1 | 12 | 0 | 12 | 12 | 4 | 0 | 6 | 6 | 4 | 1 | 0 | 0 | 1 |
9,545 | ray-project/ray | python/ray/_private/runtime_env/plugin.py | ray._private.runtime_env.plugin.RuntimeEnvPlugin | from ray.util.annotations import DeveloperAPI
from ray._private.runtime_env.context import RuntimeEnvContext
from ray._private.runtime_env.constants import RAY_RUNTIME_ENV_CLASS_FIELD_NAME, RAY_RUNTIME_ENV_PLUGIN_DEFAULT_PRIORITY, RAY_RUNTIME_ENV_PLUGIN_MAX_PRIORITY, RAY_RUNTIME_ENV_PLUGIN_MIN_PRIORITY, RAY_RUNTIME_ENV... | @DeveloperAPI
class RuntimeEnvPlugin(ABC):
'''Abstract base class for runtime environment plugins.'''
@staticmethod
def validate(runtime_env_dict: dict) -> None:
'''Validate user entry for this plugin.
The method is invoked upon installation of runtime env.
Args:
runtime_... | 8 | 5 | 13 | 2 | 4 | 7 | 1 | 1.46 | 1 | 4 | 0 | 23 | 4 | 0 | 5 | 25 | 78 | 16 | 26 | 21 | 7 | 38 | 13 | 8 | 7 | 1 | 4 | 0 | 5 |
9,546 | ray-project/ray | python/ray/_private/runtime_env/plugin.py | ray._private.runtime_env.plugin.RuntimeEnvPluginManager | import os
from ray._private.runtime_env.uri_cache import URICache
from typing import Any, Dict, List, Optional, Type
from ray._private.runtime_env.constants import RAY_RUNTIME_ENV_CLASS_FIELD_NAME, RAY_RUNTIME_ENV_PLUGIN_DEFAULT_PRIORITY, RAY_RUNTIME_ENV_PLUGIN_MAX_PRIORITY, RAY_RUNTIME_ENV_PLUGIN_MIN_PRIORITY, RAY_RUN... |
class RuntimeEnvPluginManager:
'''This manager is used to load plugins in runtime env agent.'''
def __init__(self):
pass
def validate_plugin_class(self, plugin_class: Type[RuntimeEnvPlugin]) -> None:
pass
def validate_priority(self, priority: Any) -> None:
pass
def load_... | 8 | 5 | 14 | 1 | 11 | 3 | 2 | 0.26 | 0 | 10 | 3 | 0 | 7 | 1 | 7 | 7 | 109 | 13 | 76 | 18 | 68 | 20 | 40 | 18 | 32 | 4 | 0 | 2 | 15 |
9,547 | ray-project/ray | python/ray/_private/runtime_env/plugin_schema_manager.py | ray._private.runtime_env.plugin_schema_manager.RuntimeEnvPluginSchemaManager | import jsonschema
import os
import json
from typing import List
from ray._private.runtime_env.constants import RAY_RUNTIME_ENV_PLUGIN_SCHEMA_SUFFIX, RAY_RUNTIME_ENV_PLUGIN_SCHEMAS_ENV_VAR
class RuntimeEnvPluginSchemaManager:
"""This manager is used to load plugin json schemas."""
default_schema_path = os.path.... |
class RuntimeEnvPluginSchemaManager:
'''This manager is used to load plugin json schemas.'''
@classmethod
def _load_schemas(cls, schema_paths: List[str]):
pass
@classmethod
def _load_default_schemas(cls):
pass
@classmethod
def _load_schemas_from_env_var(cls):
pass
... | 11 | 1 | 13 | 0 | 12 | 1 | 4 | 0.07 | 0 | 3 | 0 | 0 | 0 | 0 | 5 | 5 | 82 | 6 | 71 | 25 | 60 | 5 | 53 | 19 | 47 | 8 | 0 | 6 | 22 |
9,548 | ray-project/ray | python/ray/_private/runtime_env/protocol.py | ray._private.runtime_env.protocol.ProtocolsProvider | import os
from urllib.parse import urlparse
class ProtocolsProvider:
_MISSING_DEPENDENCIES_WARNING = 'Note that these must be preinstalled on all nodes in the Ray cluster; it is not sufficient to install them in the runtime_env.'
@classmethod
def get_protocols(cls):
return {'gcs', 'conda', 'pip', ... |
class ProtocolsProvider:
@classmethod
def get_protocols(cls):
pass
@classmethod
def get_remote_protocols(cls):
pass
@classmethod
def _handle_s3_protocol(cls):
'''Set up S3 protocol handling.
Returns:
tuple: (open_file function, transport_params)
... | 17 | 5 | 17 | 1 | 14 | 3 | 3 | 0.16 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 3 | 78 | 8 | 61 | 17 | 48 | 10 | 31 | 12 | 21 | 7 | 0 | 2 | 10 |
9,549 | ray-project/ray | python/ray/_private/runtime_env/py_executable.py | ray._private.runtime_env.py_executable.PyExecutablePlugin | import logging
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from typing import List, Optional
from ray._private.runtime_env.context import RuntimeEnvContext
class PyExecutablePlugin(RuntimeEnvPlugin):
"""This plugin allows running Ray workers with a custom Python executable.
You can use it wit... |
class PyExecutablePlugin(RuntimeEnvPlugin):
'''This plugin allows running Ray workers with a custom Python executable.
You can use it with
`ray.init(runtime_env={"py_executable": "<command> <args>"})`. If you specify
a `working_dir` in the runtime environment, the executable will have access
to the... | 4 | 1 | 6 | 0 | 6 | 1 | 1 | 0.57 | 1 | 4 | 1 | 0 | 3 | 0 | 3 | 28 | 36 | 5 | 21 | 17 | 5 | 12 | 9 | 5 | 5 | 1 | 5 | 0 | 3 |
9,550 | ray-project/ray | python/ray/_private/runtime_env/py_modules.py | ray._private.runtime_env.py_modules.PyModulesPlugin | import os
from ray._private.runtime_env.context import RuntimeEnvContext
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from ray._private.utils import get_directory_size_bytes
from typing import Any, Dict, List, Optional
from ray._private.runtime_env.working_dir import set_pythonpath_in_context
from ray._... |
class PyModulesPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str, gcs_client: GcsClient):
pass
def _get_local_dir_from_uri(self, uri: str):
pass
def delete_uri(self, uri: str, logger: Optional[logging.Logger]=default_logger) -> int:
'''Delete URI and return the numb... | 7 | 1 | 10 | 1 | 9 | 1 | 2 | 0.05 | 1 | 4 | 0 | 0 | 6 | 2 | 6 | 31 | 71 | 12 | 58 | 34 | 35 | 3 | 34 | 18 | 27 | 3 | 5 | 2 | 10 |
9,551 | ray-project/ray | python/ray/_private/runtime_env/uri_cache.py | ray._private.runtime_env.uri_cache.URICache | from typing import Callable, Optional, Set
import logging
class URICache:
"""Caches URIs up to a specified total size limit.
URIs are represented by strings. Each URI has an associated size on disk.
When a URI is added to the URICache, it is marked as "in use".
When a URI is no longer in use, the user... |
class URICache:
'''Caches URIs up to a specified total size limit.
URIs are represented by strings. Each URI has an associated size on disk.
When a URI is added to the URICache, it is marked as "in use".
When a URI is no longer in use, the user of this class should call
`mark_unused` to signal that... | 10 | 6 | 9 | 1 | 7 | 1 | 2 | 0.33 | 0 | 6 | 0 | 0 | 9 | 6 | 9 | 9 | 109 | 20 | 67 | 23 | 52 | 22 | 50 | 18 | 40 | 3 | 0 | 1 | 16 |
9,552 | ray-project/ray | python/ray/_private/runtime_env/utils.py | ray._private.runtime_env.utils.SubprocessCalledProcessError | import textwrap
import subprocess
class SubprocessCalledProcessError(subprocess.CalledProcessError):
"""The subprocess.CalledProcessError with stripped stdout."""
LAST_N_LINES = 50
def __init__(self, *args, cmd_index=None, **kwargs):
self.cmd_index = cmd_index
super().__init__(*args, **kwa... |
class SubprocessCalledProcessError(subprocess.CalledProcessError):
'''The subprocess.CalledProcessError with stripped stdout.'''
def __init__(self, *args, cmd_index=None, **kwargs):
pass
@staticmethod
def _get_last_n_line(str_data: str, last_n_lines: int) -> str:
pass
def __str__(... | 5 | 1 | 9 | 0 | 9 | 0 | 2 | 0.03 | 1 | 3 | 0 | 0 | 2 | 1 | 3 | 17 | 35 | 4 | 30 | 13 | 25 | 1 | 20 | 12 | 16 | 4 | 5 | 2 | 7 |
9,553 | ray-project/ray | python/ray/_private/runtime_env/uv.py | ray._private.runtime_env.uv.UvPlugin | from ray._private.runtime_env.plugin import RuntimeEnvPlugin
from asyncio import create_task, get_running_loop
import asyncio
from typing import Dict, List, Optional
import os
from ray._common.utils import try_to_create_directory
from ray._private.runtime_env.packaging import Protocol, parse_uri
from ray._private.runti... |
class UvPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str):
pass
def _get_path_from_hash(self, hash_val: str) -> str:
'''Generate a path from the hash of a uv spec.
Example output:
/tmp/ray/session_2021-11-03_16-33-59_356303_41018/runtime_resources
... | 8 | 3 | 18 | 2 | 14 | 3 | 2 | 0.21 | 1 | 6 | 1 | 0 | 6 | 4 | 6 | 31 | 123 | 17 | 92 | 42 | 70 | 19 | 63 | 26 | 55 | 4 | 5 | 2 | 16 |
9,554 | ray-project/ray | python/ray/_private/runtime_env/uv.py | ray._private.runtime_env.uv.UvProcessor | import shutil
from ray._private.runtime_env.utils import check_output_cmd
from typing import Dict, List, Optional
from ray._private.runtime_env import dependency_utils, virtualenv_utils
from asyncio import create_task, get_running_loop
import logging
import sys
import os
class UvProcessor:
def __init__(self, targ... |
class UvProcessor:
def __init__(self, target_dir: str, runtime_env: 'RuntimeEnv', logger: Optional[logging.Logger]=default_logger):
pass
async def _install_uv(self, path: str, cwd: str, pip_env: dict, logger: logging.Logger):
'''Before package install, make sure the required version `uv` (if ... | 9 | 5 | 22 | 2 | 16 | 4 | 2 | 0.24 | 0 | 7 | 0 | 0 | 7 | 6 | 7 | 7 | 173 | 20 | 125 | 50 | 99 | 30 | 70 | 34 | 60 | 4 | 0 | 2 | 15 |
9,555 | ray-project/ray | python/ray/_private/runtime_env/working_dir.py | ray._private.runtime_env.working_dir.WorkingDirPlugin | from ray._private.runtime_env.context import RuntimeEnvContext
from typing import Any, Callable, Dict, List, Optional
import ray._private.ray_constants as ray_constants
from ray._private.runtime_env.plugin import RuntimeEnvPlugin
import os
from ray._common.utils import try_to_create_directory
from contextlib import con... |
class WorkingDirPlugin(RuntimeEnvPlugin):
def __init__(self, resources_dir: str, gcs_client: GcsClient):
pass
def delete_uri(self, uri: str, logger: Optional[logging.Logger]=default_logger) -> int:
'''Delete URI and return the number of bytes deleted.'''
pass
def get_uris(self, r... | 8 | 2 | 17 | 1 | 13 | 3 | 2 | 0.21 | 1 | 5 | 0 | 0 | 6 | 2 | 6 | 31 | 113 | 13 | 84 | 38 | 60 | 18 | 49 | 21 | 42 | 4 | 5 | 3 | 14 |
9,556 | ray-project/ray | python/ray/_private/serialization.py | ray._private.serialization.DeserializationError | class DeserializationError(Exception):
pass | class DeserializationError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,557 | ray-project/ray | python/ray/_private/serialization.py | ray._private.serialization.SerializationContext | from ray.core.generated.common_pb2 import ErrorType, RayErrorInfo
import traceback
from ray.util import serialization_addons
from ray._raylet import DynamicObjectRefGenerator, MessagePackSerializedObject, MessagePackSerializer, Pickle5SerializedObject, Pickle5Writer, RawSerializedObject, SerializedRayObject, split_buff... |
class SerializationContext:
'''Initialize the serialization library.
This defines a custom serializer for object refs and also tells ray to
serialize several exception classes that we define for error handling.
'''
def __init__(self, worker):
pass
def actor_handle_reducer(obj)... | 30 | 6 | 17 | 1 | 14 | 2 | 3 | 0.18 | 0 | 41 | 30 | 0 | 19 | 2 | 19 | 19 | 435 | 45 | 330 | 72 | 295 | 60 | 213 | 62 | 186 | 35 | 0 | 4 | 84 |
9,558 | ray-project/ray | python/ray/_private/services.py | ray._private.services.ConsolePopen | import sys
import subprocess
import signal
import ray._private.ray_constants as ray_constants
import ray
import io
class ConsolePopen(subprocess.Popen):
if sys.platform == 'win32':
def terminate(self):
if isinstance(self.stdin, io.IOBase):
self.stdin.close()
if self... |
class ConsolePopen(subprocess.Popen):
def terminate(self):
pass
def __init__(self, *args, **kwargs):
pass | 3 | 0 | 11 | 0 | 9 | 3 | 3 | 0.26 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 41 | 26 | 2 | 19 | 7 | 16 | 5 | 18 | 7 | 15 | 3 | 1 | 1 | 6 |
9,559 | ray-project/ray | python/ray/_private/state.py | ray._private.state.GlobalState | from ray._private.protobuf_compat import message_to_dict
import json
from collections import defaultdict
from ray._private.utils import validate_actor_state_name
import ray
from ray._raylet import GlobalStateAccessor
import sys
from ray._common.utils import binary_to_hex, decode, hex_to_binary
from ray.core.generated i... |
class GlobalState:
'''A class used to interface with the Ray control state.
Attributes:
global_state_accessor: The client used to query gcs table from gcs
server.
'''
def __init__(self):
'''Create a GlobalState object.'''
pass
def _check_connected(self):
... | 38 | 30 | 22 | 3 | 14 | 6 | 3 | 0.43 | 0 | 8 | 0 | 0 | 32 | 2 | 32 | 32 | 828 | 123 | 493 | 123 | 451 | 213 | 278 | 116 | 241 | 11 | 0 | 3 | 88 |
9,560 | ray-project/ray | python/ray/_private/thirdparty/dacite/config.py | ray._private.thirdparty.dacite.config.Config | from dataclasses import dataclass, field
from typing import Dict, Any, Callable, Optional, Type, List
@dataclass
class Config:
type_hooks: Dict[Type, Callable[[Any], Any]] = field(default_factory=dict)
cast: List[Type] = field(default_factory=list)
forward_references: Optional[Dict[str, Any]] = None
ch... | @dataclass
class Config:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 | 7 | 7 | 6 | 0 | 7 | 7 | 6 | 0 | 0 | 0 | 0 |
9,561 | ray-project/ray | python/ray/_private/thirdparty/dacite/dataclasses.py | ray._private.thirdparty.dacite.dataclasses.DefaultValueNotFoundError | class DefaultValueNotFoundError(Exception):
pass | class DefaultValueNotFoundError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,562 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.DaciteError | class DaciteError(Exception):
pass | class DaciteError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,563 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.DaciteFieldError | from typing import Any, Type, Optional, Set, Dict
class DaciteFieldError(DaciteError):
def __init__(self, field_path: Optional[str]=None):
super().__init__()
self.field_path = field_path
def update_path(self, parent_field_path: str) -> None:
if self.field_path:
self.field_... |
class DaciteFieldError(DaciteError):
def __init__(self, field_path: Optional[str]=None):
pass
def update_path(self, parent_field_path: str) -> None:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 2 | 0 | 3 | 2 | 1 | 2 | 12 | 10 | 1 | 9 | 4 | 6 | 0 | 8 | 4 | 5 | 2 | 4 | 1 | 3 |
9,564 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.ForwardReferenceError | class ForwardReferenceError(DaciteError):
def __init__(self, message: str) -> None:
super().__init__()
self.message = message
def __str__(self) -> str:
return f'can not resolve forward reference: {self.message}' | class ForwardReferenceError(DaciteError):
def __init__(self, message: str) -> None:
pass
def __str__(self) -> str:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 12 | 7 | 1 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 4 | 0 | 2 |
9,565 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.MissingValueError | from typing import Any, Type, Optional, Set, Dict
class MissingValueError(DaciteFieldError):
def __init__(self, field_path: Optional[str]=None):
super().__init__(field_path=field_path)
def __str__(self) -> str:
return f'missing value for field "{self.field_path}"' |
class MissingValueError(DaciteFieldError):
def __init__(self, field_path: Optional[str]=None):
pass
def __str__(self) -> str:
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 14 | 6 | 1 | 5 | 3 | 2 | 0 | 5 | 3 | 2 | 1 | 5 | 0 | 2 |
9,566 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.StrictUnionMatchError | from typing import Any, Type, Optional, Set, Dict
class StrictUnionMatchError(DaciteFieldError):
def __init__(self, union_matches: Dict[Type, Any], field_path: Optional[str]=None) -> None:
super().__init__(field_path=field_path)
self.union_matches = union_matches
def __str__(self) -> str:
... |
class StrictUnionMatchError(DaciteFieldError):
def __init__(self, union_matches: Dict[Type, Any], field_path: Optional[str]=None) -> None:
pass
def __str__(self) -> str:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 1 | 2 | 14 | 8 | 1 | 7 | 5 | 4 | 0 | 7 | 5 | 4 | 1 | 5 | 0 | 2 |
9,567 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.UnexpectedDataError | from typing import Any, Type, Optional, Set, Dict
class UnexpectedDataError(DaciteError):
def __init__(self, keys: Set[str]) -> None:
super().__init__()
self.keys = keys
def __str__(self) -> str:
formatted_keys = ', '.join((f'"{key}"' for key in self.keys))
return f'can not ma... |
class UnexpectedDataError(DaciteError):
def __init__(self, keys: Set[str]) -> None:
pass
def __str__(self) -> str:
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 12 | 8 | 1 | 7 | 5 | 4 | 0 | 7 | 5 | 4 | 1 | 4 | 0 | 2 |
9,568 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.UnionMatchError | class UnionMatchError(WrongTypeError):
def __str__(self) -> str:
return f'can not match type "{_name(type(self.value))}" to any type of "{self.field_path}" union: {_name(self.field_type)}' | class UnionMatchError(WrongTypeError):
def __str__(self) -> str:
pass | 2 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 15 | 6 | 0 | 6 | 2 | 4 | 0 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
9,569 | ray-project/ray | python/ray/_private/thirdparty/dacite/exceptions.py | ray._private.thirdparty.dacite.exceptions.WrongTypeError | from typing import Any, Type, Optional, Set, Dict
class WrongTypeError(DaciteFieldError):
def __init__(self, field_type: Type, value: Any, field_path: Optional[str]=None) -> None:
super().__init__(field_path=field_path)
self.field_type = field_type
self.value = value
def __str__(self)... |
class WrongTypeError(DaciteFieldError):
def __init__(self, field_type: Type, value: Any, field_path: Optional[str]=None) -> None:
pass
def __str__(self) -> str:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 4 | 0 | 1 | 2 | 2 | 2 | 14 | 11 | 1 | 10 | 5 | 7 | 0 | 7 | 5 | 4 | 1 | 5 | 0 | 2 |
9,570 | ray-project/ray | python/ray/_private/thirdparty/pathspec/pathspec.py | ray._private.thirdparty.pathspec.pathspec.PathSpec | from .compat import Collection, iterkeys, izip_longest, string_types, unicode
from . import util
class PathSpec(object):
"""
The :class:`PathSpec` class is a wrapper around a list of compiled
:class:`.Pattern` instances.
"""
def __init__(self, patterns):
"""
Initializes the :class:... |
class PathSpec(object):
'''
The :class:`PathSpec` class is a wrapper around a list of compiled
:class:`.Pattern` instances.
'''
def __init__(self, patterns):
'''
Initializes the :class:`PathSpec` instance.
*patterns* (:class:`~collections.abc.Collection` or :class:`~col... | 13 | 12 | 16 | 2 | 5 | 9 | 2 | 1.82 | 1 | 4 | 0 | 0 | 10 | 1 | 11 | 11 | 196 | 38 | 56 | 25 | 43 | 102 | 52 | 24 | 40 | 4 | 1 | 1 | 22 |
9,571 | ray-project/ray | python/ray/_private/thirdparty/pathspec/pattern.py | ray._private.thirdparty.pathspec.pattern.Pattern | class Pattern(object):
"""
The :class:`Pattern` class is the abstract definition of a pattern.
"""
__slots__ = ('include',)
def __init__(self, include):
"""
Initializes the :class:`Pattern` instance.
*include* (:class:`bool` or :data:`None`) is whether the matched
f... | class Pattern(object):
'''
The :class:`Pattern` class is the abstract definition of a pattern.
'''
def __init__(self, include):
'''
Initializes the :class:`Pattern` instance.
*include* (:class:`bool` or :data:`None`) is whether the matched
files should be included (:... | 3 | 3 | 13 | 2 | 2 | 9 | 1 | 3.67 | 1 | 1 | 0 | 1 | 2 | 1 | 2 | 2 | 35 | 7 | 6 | 5 | 3 | 22 | 6 | 5 | 3 | 1 | 1 | 0 | 2 |
9,572 | ray-project/ray | python/ray/_private/thirdparty/pathspec/pattern.py | ray._private.thirdparty.pathspec.pattern.RegexPattern | from .compat import unicode
import re
class RegexPattern(Pattern):
"""
The :class:`RegexPattern` class is an implementation of a pattern
using regular expressions.
"""
__slots__ = ('regex',)
def __init__(self, pattern, include=None):
"""
Initializes the :class:`RegexPattern` in... |
class RegexPattern(Pattern):
'''
The :class:`RegexPattern` class is an implementation of a pattern
using regular expressions.
'''
def __init__(self, pattern, include=None):
'''
Initializes the :class:`RegexPattern` instance.
*pattern* (:class:`unicode`, :class:`bytes`, :cla... | 6 | 5 | 22 | 4 | 7 | 11 | 3 | 1.67 | 1 | 3 | 0 | 1 | 3 | 1 | 4 | 6 | 99 | 19 | 30 | 10 | 24 | 50 | 25 | 9 | 20 | 5 | 2 | 3 | 12 |
9,573 | ray-project/ray | python/ray/_private/thirdparty/pathspec/patterns/gitwildmatch.py | ray._private.thirdparty.pathspec.patterns.gitwildmatch.GitIgnorePattern | import warnings
class GitIgnorePattern(GitWildMatchPattern):
"""
The :class:`GitIgnorePattern` class is deprecated by :class:`GitWildMatchPattern`.
This class only exists to maintain compatibility with v0.4.
"""
def __init__(self, *args, **kw):
"""
Warn about deprecation.
"... |
class GitIgnorePattern(GitWildMatchPattern):
'''
The :class:`GitIgnorePattern` class is deprecated by :class:`GitWildMatchPattern`.
This class only exists to maintain compatibility with v0.4.
'''
def __init__(self, *args, **kw):
'''
Warn about deprecation.
'''
p... | 6 | 4 | 6 | 0 | 3 | 3 | 1 | 1.18 | 1 | 2 | 0 | 0 | 1 | 0 | 3 | 12 | 27 | 3 | 11 | 6 | 5 | 13 | 9 | 4 | 5 | 1 | 4 | 0 | 3 |
9,574 | ray-project/ray | python/ray/_private/thirdparty/pathspec/patterns/gitwildmatch.py | ray._private.thirdparty.pathspec.patterns.gitwildmatch.GitWildMatchPattern | import re
from ..compat import unicode
from ..pattern import RegexPattern
class GitWildMatchPattern(RegexPattern):
"""
The :class:`GitWildMatchPattern` class represents a compiled Git
wildmatch pattern.
"""
__slots__ = ()
@classmethod
def pattern_to_regex(cls, pattern):
"""
... |
class GitWildMatchPattern(RegexPattern):
'''
The :class:`GitWildMatchPattern` class represents a compiled Git
wildmatch pattern.
'''
@classmethod
def pattern_to_regex(cls, pattern):
'''
Convert the pattern into a regular expression.
*pattern* (:class:`unicode` or :class:... | 7 | 4 | 87 | 12 | 37 | 38 | 12 | 1.03 | 1 | 3 | 0 | 1 | 0 | 0 | 3 | 9 | 276 | 41 | 117 | 23 | 110 | 120 | 94 | 20 | 90 | 22 | 3 | 4 | 37 |
9,575 | ray-project/ray | python/ray/_private/thirdparty/pathspec/util.py | ray._private.thirdparty.pathspec.util.AlreadyRegisteredError | class AlreadyRegisteredError(Exception):
"""
The :exc:`AlreadyRegisteredError` exception is raised when a pattern
factory is registered under a name already in use.
"""
def __init__(self, name, pattern_factory):
"""
Initializes the :exc:`AlreadyRegisteredError` instance.
*n... | class AlreadyRegisteredError(Exception):
'''
The :exc:`AlreadyRegisteredError` exception is raised when a pattern
factory is registered under a name already in use.
'''
def __init__(self, name, pattern_factory):
'''
Initializes the :exc:`AlreadyRegisteredError` instance.
*na... | 8 | 5 | 7 | 1 | 3 | 4 | 1 | 1.33 | 1 | 1 | 0 | 0 | 4 | 0 | 4 | 14 | 41 | 6 | 15 | 8 | 7 | 20 | 9 | 5 | 4 | 1 | 3 | 0 | 4 |
9,576 | ray-project/ray | python/ray/_private/thirdparty/pathspec/util.py | ray._private.thirdparty.pathspec.util.MatchDetail | class MatchDetail(object):
"""
The :class:`.MatchDetail` class contains information about
"""
__slots__ = ('patterns',)
def __init__(self, patterns):
"""
Initialize the :class:`.MatchDetail` instance.
*patterns* (:class:`~collections.abc.Sequence` of :class:`~pathspec.patte... | class MatchDetail(object):
'''
The :class:`.MatchDetail` class contains information about
'''
def __init__(self, patterns):
'''
Initialize the :class:`.MatchDetail` instance.
*patterns* (:class:`~collections.abc.Sequence` of :class:`~pathspec.pattern.Pattern`)
contai... | 2 | 2 | 15 | 2 | 2 | 11 | 1 | 3.75 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 23 | 4 | 4 | 4 | 2 | 15 | 4 | 4 | 2 | 1 | 1 | 0 | 1 |
9,577 | ray-project/ray | python/ray/_private/thirdparty/pathspec/util.py | ray._private.thirdparty.pathspec.util.RecursionError | class RecursionError(Exception):
"""
The :exc:`RecursionError` exception is raised when recursion is
detected.
"""
def __init__(self, real_path, first_path, second_path):
"""
Initializes the :exc:`RecursionError` instance.
*real_path* (:class:`str`) is the real path that re... | class RecursionError(Exception):
'''
The :exc:`RecursionError` exception is raised when recursion is
detected.
'''
def __init__(self, real_path, first_path, second_path):
'''
Initializes the :exc:`RecursionError` instance.
*real_path* (:class:`str`) is the real path that rec... | 10 | 6 | 8 | 1 | 3 | 5 | 1 | 1.47 | 1 | 1 | 0 | 0 | 5 | 0 | 5 | 15 | 55 | 8 | 19 | 10 | 9 | 28 | 11 | 6 | 5 | 1 | 3 | 0 | 5 |
9,578 | ray-project/ray | python/ray/_private/thirdparty/pathspec/util.py | ray._private.thirdparty.pathspec.util.TreeEntry | import stat
class TreeEntry(object):
"""
The :class:`.TreeEntry` class contains information about a file-system
entry.
"""
__slots__ = ('_lstat', 'name', 'path', '_stat')
def __init__(self, name, path, lstat, stat):
"""
Initialize the :class:`.TreeEntry` instance.
*nam... |
class TreeEntry(object):
'''
The :class:`.TreeEntry` class contains information about a file-system
entry.
'''
def __init__(self, name, path, lstat, stat):
'''
Initialize the :class:`.TreeEntry` instance.
*name* (:class:`str`) is the base name of the entry.
*path* (... | 6 | 6 | 17 | 3 | 4 | 9 | 2 | 2.26 | 1 | 0 | 0 | 0 | 5 | 4 | 5 | 5 | 98 | 23 | 23 | 13 | 17 | 52 | 23 | 13 | 17 | 3 | 1 | 1 | 11 |
9,579 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_DriverNotLoaded | class ROCMLError_DriverNotLoaded(Exception):
pass | class ROCMLError_DriverNotLoaded(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,580 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_FunctionNotFound | class ROCMLError_FunctionNotFound(Exception):
pass | class ROCMLError_FunctionNotFound(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,581 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_LibraryNotFound | class ROCMLError_LibraryNotFound(Exception):
pass | class ROCMLError_LibraryNotFound(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,582 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_NotSupported | class ROCMLError_NotSupported(Exception):
pass | class ROCMLError_NotSupported(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,583 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_Uninitialized | class ROCMLError_Uninitialized(Exception):
pass | class ROCMLError_Uninitialized(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,584 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLError_Unknown | class ROCMLError_Unknown(Exception):
pass | class ROCMLError_Unknown(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
9,585 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.ROCMLState | from enum import IntEnum, auto
class ROCMLState(IntEnum):
UNINITIALIZED = auto()
'No attempt yet made to initialize PyROCML'
INITIALIZED = auto()
'PyROCML was successfully initialized'
DISABLED_PYROCML_NOT_AVAILABLE = auto()
'PyROCML not installed'
DISABLED_CONFIG = auto()
'PyROCML diag... |
class ROCMLState(IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.83 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 11 | 0 | 6 | 6 | 5 | 5 | 6 | 6 | 5 | 0 | 3 | 0 | 0 |
9,586 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_frequencies_t | class rsmi_frequencies_t(Structure):
_fields_ = [('num_supported', c_int32), ('current', c_uint32), ('frequency', c_uint64 * RSMI_MAX_NUM_FREQUENCIES)] | class rsmi_frequencies_t(Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 2 | 3 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
9,587 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_init_flags_t | class rsmi_init_flags_t(c_int):
RSMI_INIT_FLAG_ALL_GPUS = 1 | class rsmi_init_flags_t(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
9,588 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_io_link_type | class rsmi_io_link_type(c_int):
RSMI_IOLINK_TYPE_UNDEFINED = 0
RSMI_IOLINK_TYPE_HYPERTRANSPORT = 1
RSMI_IOLINK_TYPE_PCIEXPRESS = 2
RSMI_IOLINK_TYPE_AMBA = 3
RSMI_IOLINK_TYPE_MIPI = 4
RSMI_IOLINK_TYPE_QPI_1_1 = 5
RSMI_IOLINK_TYPE_RESERVED1 = 6
RSMI_IOLINK_TYPE_RESERVED2 = 7
RSMI_IOLIN... | class rsmi_io_link_type(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0 | 20 | 20 | 19 | 0 | 20 | 20 | 19 | 0 | 1 | 0 | 0 |
9,589 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_memory_type_t | class rsmi_memory_type_t(c_int):
RSMI_MEM_TYPE_FIRST = 0
RSMI_MEM_TYPE_VRAM = RSMI_MEM_TYPE_FIRST
RSMI_MEM_TYPE_VIS_VRAM = 1
RSMI_MEM_TYPE_GTT = 2
RSMI_MEM_TYPE_LAST = RSMI_MEM_TYPE_GTT | class rsmi_memory_type_t(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 6 | 6 | 5 | 0 | 6 | 6 | 5 | 0 | 1 | 0 | 0 |
9,590 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_pcie_bandwidth_t | class rsmi_pcie_bandwidth_t(Structure):
_fields_ = [('transfer_rate', rsmi_frequencies_t), ('lanes', c_uint32 * RSMI_MAX_NUM_FREQUENCIES)] | class rsmi_pcie_bandwidth_t(Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 2 | 2 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
9,591 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_process_info_t | class rsmi_process_info_t(Structure):
_fields_ = [('process_id', c_uint32), ('pasid', c_uint32), ('vram_usage', c_uint64), ('sdma_usage', c_uint64), ('cu_occupancy', c_uint32)] | class rsmi_process_info_t(Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 6 | 2 | 5 | 2 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
9,592 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_retired_page_record_t | class rsmi_retired_page_record_t(Structure):
_fields_ = [('page_address', c_uint64), ('page_size', c_uint64), ('status', c_int)] | class rsmi_retired_page_record_t(Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 2 | 3 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
9,593 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_status_t | class rsmi_status_t(c_int):
RSMI_STATUS_SUCCESS = 0
RSMI_STATUS_INVALID_ARGS = 1
RSMI_STATUS_NOT_SUPPORTED = 2
RSMI_STATUS_FILE_ERROR = 3
RSMI_STATUS_PERMISSION = 4
RSMI_STATUS_OUT_OF_RESOURCES = 5
RSMI_STATUS_INTERNAL_EXCEPTION = 6
RSMI_STATUS_INPUT_OUT_OF_BOUNDS = 7
RSMI_STATUS_INI... | class rsmi_status_t(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0 | 18 | 18 | 17 | 0 | 18 | 18 | 17 | 0 | 1 | 0 | 0 |
9,594 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_sw_component_t | class rsmi_sw_component_t(c_int):
RSMI_SW_COMP_FIRST = 0
RSMI_SW_COMP_DRIVER = RSMI_SW_COMP_FIRST
RSMI_SW_COMP_LAST = RSMI_SW_COMP_DRIVER | class rsmi_sw_component_t(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
9,595 | ray-project/ray | python/ray/_private/thirdparty/pyamdsmi/pyamdsmi.py | ray._private.thirdparty.pyamdsmi.pyamdsmi.rsmi_xgmi_status_t | class rsmi_xgmi_status_t(c_int):
RSMI_XGMI_STATUS_NO_ERRORS = 0
RSMI_XGMI_STATUS_ERROR = 1
RSMI_XGMI_STATUS_MULTIPLE_ERRORS = 2 | class rsmi_xgmi_status_t(c_int):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
9,596 | ray-project/ray | python/ray/_private/thirdparty/pynvml/pynvml.py | ray._private.thirdparty.pynvml.pynvml.NVMLError | class NVMLError(Exception):
_valClassMapping = dict()
_errcode_to_string = {NVML_ERROR_UNINITIALIZED: 'Uninitialized', NVML_ERROR_INVALID_ARGUMENT: 'Invalid Argument', NVML_ERROR_NOT_SUPPORTED: 'Not Supported', NVML_ERROR_NO_PERMISSION: 'Insufficient Permissions', NVML_ERROR_ALREADY_INITIALIZED: 'Already Initia... | class NVMLError(Exception):
def __new__(typ, value):
'''
Maps value to a proper subclass of NVMLError.
See _extractNVMLErrorsAsClasses function for more details
'''
pass
def __str__(self):
pass
def __eq__(self, other):
pass | 4 | 1 | 6 | 0 | 5 | 1 | 2 | 0.13 | 1 | 1 | 0 | 0 | 3 | 0 | 3 | 13 | 44 | 0 | 39 | 7 | 35 | 5 | 18 | 7 | 14 | 3 | 3 | 2 | 6 |
9,597 | ray-project/ray | python/ray/_private/thirdparty/pynvml/pynvml.py | ray._private.thirdparty.pynvml.pynvml._PrintableStructure | class _PrintableStructure(Structure):
"""
Abstract class that produces nicer __str__ output than ctypes.Structure.
e.g. instead of:
<class_name object at 0x7fdf82fef9e0>
this class will print
class_name(field_name: formatted_value, field_name: formatted_value)
_fmt_ dictionary of <str... | class _PrintableStructure(Structure):
'''
Abstract class that produces nicer __str__ output than ctypes.Structure.
e.g. instead of:
<class_name object at 0x7fdf82fef9e0>
this class will print
class_name(field_name: formatted_value, field_name: formatted_value)
_fmt_ dictionary of <str ... | 4 | 1 | 12 | 0 | 12 | 0 | 4 | 1.14 | 1 | 0 | 0 | 38 | 1 | 0 | 1 | 1 | 32 | 2 | 14 | 8 | 12 | 16 | 13 | 8 | 11 | 4 | 1 | 2 | 4 |
9,598 | ray-project/ray | python/ray/_private/thirdparty/pynvml/pynvml.py | ray._private.thirdparty.pynvml.pynvml.c_nvmlAccountingStats_t | class c_nvmlAccountingStats_t(_PrintableStructure):
_fields_ = [('gpuUtilization', c_uint), ('memoryUtilization', c_uint), ('maxMemoryUsage', c_ulonglong), ('time', c_ulonglong), ('startTime', c_ulonglong), ('isRunning', c_uint), ('reserved', c_uint * 5)] | class c_nvmlAccountingStats_t(_PrintableStructure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 10 | 0 | 10 | 2 | 9 | 0 | 2 | 2 | 1 | 0 | 2 | 0 | 0 |
9,599 | ray-project/ray | python/ray/_private/thirdparty/pynvml/pynvml.py | ray._private.thirdparty.pynvml.pynvml.c_nvmlBAR1Memory_t | class c_nvmlBAR1Memory_t(_PrintableStructure):
_fields_ = [('bar1Total', c_ulonglong), ('bar1Free', c_ulonglong), ('bar1Used', c_ulonglong)]
_fmt_ = {'<default>': '%d B'} | class c_nvmlBAR1Memory_t(_PrintableStructure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 7 | 0 | 7 | 3 | 6 | 0 | 3 | 3 | 2 | 0 | 2 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.