code: def _read_dataset(
      path: str,
  ) -> Union[hl.Table, hl.MatrixTable, hl.linalg.BlockMatrix]:
      if path.endswith(".ht"):
          return hl.read_table(path)
      elif path.endswith(".mt"):
          return hl.read_matrix_table(path)
      elif path.endswith(".bm"):
          return hl.linalg.BlockMatrix.read(path)
      raise ValueError(
          f"Invalid path: {path}. Can only load datasets with .ht, .mt, or .bm extensions."
      )
  
imports: import json
  import os
  from typing import Optional, Union
  import hail
  import pkg_resources
label_desc: Use image node_id 1 for calling a global function with example usage: _read_dataset(path) and returns: hl, hl, hl