code: def _prepare_parent(parent: Union[str, Geocodes]) -> Optional[dict]:
      if not parent:
          return None
  
      if isinstance(parent, Geocodes):
          kind = RegionKind.region_ids
          value = parent.unique_ids()
  
      elif isinstance(parent, str):
          kind = RegionKind.region_name
          value = parent
  
      else:
          raise ValueError("Wrong parent type: " + parent.__str__())
  
      return {"type": kind.value, "data": value}
  
file_path: lets-plot/python-package/lets_plot/geo_data/livemap_helper.py
imports: from enum import Enum
  from typing import Union, Optional, List
  from pandas import DataFrame
  from .geocodes import Geocodes
label_desc: Use image node_id 1 for calling a global function with example usage: _prepare_parent(parent) and returns: dict, None