code: def parse_placement_group_resource_str(
      placement_group_resource_str: str,
  ) -> Tuple[str, Optional[str]]:
      """Parse placement group resource in the form of following 3 cases:
      {resource_name}_group_{bundle_id}_{group_name};
      -> This case is ignored as it is duplicated to the case below.
      {resource_name}_group_{group_name};
      {resource_name}
  
      Returns:
          Tuple of (resource_name, placement_group_name, is_countable_resource).
          placement_group_name could be None if its not a placement group
          resource. is_countable_resource is True if the resource
          doesn't contain bundle index. We shouldn't count resources
          with bundle index because it will
          have duplicated resource information as
          wildcard resources (resource name without bundle index).
      """
      result = PLACEMENT_GROUP_INDEXED_BUNDLED_RESOURCE_PATTERN.match(
          placement_group_resource_str
      )
      if result:
          return (result.group(1), result.group(3), False)
      result = PLACEMENT_GROUP_WILDCARD_RESOURCE_PATTERN.match(
          placement_group_resource_str
      )
      if result:
          return (result.group(1), result.group(2), True)
      return (placement_group_resource_str, None, True)
  
imports: import collections
  import copy
  import hashlib
  import json
  import logging
  import os
  import threading
  from dataclasses import dataclass
  from datetime import datetime
  from io import StringIO
  from numbers import Number, Real
  from typing import Any, Dict, List, Optional, Tuple, Union
  import ray
  import ray._private.services
  from ray._private.utils import PLACEMENT_GROUP_INDEXED_BUNDLED_RESOURCE_PATTERN, PLACEMENT_GROUP_WILDCARD_RESOURCE_PATTERN
  from ray.autoscaler._private import constants
  from ray.autoscaler._private.cli_logger import cli_logger
  from ray.autoscaler._private.docker import validate_docker_config
  from ray.autoscaler._private.local.config import prepare_local
  from ray.autoscaler._private.providers import _get_default_config
  from ray.autoscaler.tags import NODE_TYPE_LEGACY_HEAD, NODE_TYPE_LEGACY_WORKER
label_desc: Use image node_id 16 for calling a global function with example usage: parse_placement_group_resource_str(placement_group_resource_str) and returns: placement_group_resource_str,  None,  True, result,  result,  False, result,  result,  True