code: def episode_metadata(
      mask: Mapping[str, List[str]], episode_key: str
  ) -> Dict[str, bool]:
      """Builds the metadata of an episode.
  
      Args:
        mask: A dict that maps flags to the list of episodes for which this flag is
          true.
        episode_key: The key of an episode.
  
      Returns:
        Dictionary that maps the flags to the value corresponding to the given
        episode.
      """
      metadata = {}
      for k in mask:
          metadata[k] = episode_key in mask[k]
      return metadata
  
imports: import dataclasses
  import enum
  from typing import Any, Dict, List, Mapping
  from etils import epath
  import h5py
  import numpy
  import tensorflow_datasets.public_api
  import tree
label_desc: Use image node_id 3 for calling a global function with example usage: episode_metadata(mask, episode_key) and returns: metadata