code: def url_from_resource(namespace: str, path: str) -> str:
      """Convert resource path to REST URL for Kubernetes API server.
  
      Args:
          namespace: The K8s namespace of the resource
          path: The part of the resource path that starts with the resource type.
              Supported resource types are "pods" and "rayclusters".
      """
      if path.startswith("pods"):
          api_group = "/api/v1"
      elif path.startswith("rayclusters"):
          api_group = "/apis/ray.io/" + KUBERAY_CRD_VER
      else:
          raise NotImplementedError(
              "Tried to access unknown entity at {}".format(path)
          )
      return (
          "https://kubernetes.default:443"
          + api_group
          + "/namespaces/"
          + namespace
          + "/"
          + path
      )
  
imports: import json
  import logging
  import os
  from collections import defaultdict
  from typing import Any, Dict, List, Optional, Tuple
  import requests
  from ray.autoscaler._private.constants import WORKER_LIVENESS_CHECK_KEY, WORKER_RPC_DRAIN_KEY
  from ray.autoscaler._private.util import NodeID, NodeIP, NodeKind, NodeStatus, NodeType
  from ray.autoscaler.batching_node_provider import BatchingNodeProvider, NodeData, ScaleRequest
  from ray.autoscaler.tags import NODE_KIND_HEAD, NODE_KIND_WORKER, STATUS_UP_TO_DATE, STATUS_UPDATE_FAILED, TAG_RAY_USER_NODE_TYPE
label_desc: Use image node_id 9 for calling a global function with example usage: url_from_resource(namespace, path) and returns: unknown