code: def get_only_uri_in_dir(dir_path: str) -> str:
      """Gets the only uri from given directory."""
  
      files = fileio.listdir(dir_path)
      if len(files) != 1:
          raise RuntimeError(
              "Only one file per dir is supported: {}.".format(dir_path)
          )
      filename = os.path.dirname(os.path.join(files[0], ""))
      return os.path.join(dir_path, filename)
  
imports: import os
  import re
  import tempfile
  from typing import List, TypeVar, Iterable
  from tfx.dsl.io import fileio
  from google.protobuf import json_format
  from google.protobuf import text_format
  from google.protobuf.message import Message
label_desc: Use image node_id 4 for calling a global function with example usage: get_only_uri_in_dir(dir_path) and returns: os