code: def _metadata_exists(
      fs: fsspec.AbstractFileSystem, dirpath: str, metadata_fname: str
  ) -> bool:
      return fs.exists(os.path.join(dirpath, metadata_fname))
  
imports: import logging
  import os
  import re
  from typing import Any, Callable, cast, Dict, List, Optional, Pattern, Tuple, TypeVar
  import fsspec
  from pyre_extensions import none_throws
  from torch import distributed
  from torchtnt.framework.callbacks.checkpointer_types import RestoreOptions
  from torchtnt.framework.state import State
  from torchtnt.framework.unit import AppStateMixin
  from torchtnt.utils.distributed import get_global_rank, PGWrapper
  from torchtnt.utils.fsspec import get_filesystem
  from torchtnt.utils.stateful import Stateful
label_desc: Use image node_id 7 for calling a global function with example usage: _metadata_exists(fs, dirpath, metadata_fname) and returns: fs