code: def extractDirectorySpec(self, path):
      if fileio.isdir(path):
          result = {}
          for name in fileio.listdir(path):
              result[name] = self.extractDirectorySpec(
                  os.path.join(path, name)
              )
          return result
      elif fileio.exists(path):
          return file_io.FileIO(path, mode="r").read()
      else:
          raise ValueError(f"{path} does not exist.")
  
imports: import os
  from unittest import mock
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.utils import io_utils
  from tensorflow.python.lib.io import file_io
label_desc: Use image node_id 4 for calling the IoUtilsTest obj's underlying member method code with example usage: obj.extractDirectorySpec(path) and returns: result, file_io