code: def _get_metadata(self, key):
          
          if not self.is_done():
              raise ValueError("Cannot get metadata for a program that isn't completed.")
  
          return self._raw.get("metadata", {}).get(key, None)
docs: If the server returned a metadata dictionary, retrieve a particular key from it. If no
          metadata exists, or the key does not exist, return None.
  
          :param key: Metadata key, e.g., "gate_depth"
          :return: The associated metadata.
          :rtype: Optional[Any]