code: def test_version_hash(self):
      def _write_temp_file(user_module_dir, file_name, contents):
          with open(os.path.join(user_module_dir, file_name), "w") as f:
              f.write(contents)
  
      user_module_dir = tempfile.mkdtemp()
      _write_temp_file(user_module_dir, "a.py", "aa1")
      _write_temp_file(user_module_dir, "bb.py", "bbb2")
      _write_temp_file(user_module_dir, "ccc.py", "cccc3")
      _write_temp_file(user_module_dir, "dddd.py", "ddddd4")
  
      expected_plaintext = (
          # Length and encoding of "a.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x04a.py"
          # Length and encoding of contents of "a.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x03aa1"
          # Length and encoding of "ccc.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x06ccc.py"
          # Length and encoding of contents of "ccc.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x05cccc3"
          # Length and encoding of "dddd.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x07dddd.py"
          # Length and encoding of contents of "dddd.py".
          b"\x00\x00\x00\x00\x00\x00\x00\x06ddddd4"
      )
      h = hashlib.sha256()
      h.update(expected_plaintext)
      expected_version_hash = h.hexdigest()
      self.assertEqual(
          expected_version_hash,
          "4fecd9af212c76ee4097037caf78c6ba02a2e82584837f2031bcffa0f21df43e",
      )
      self.assertEqual(
          udf_utils._get_version_hash(
              user_module_dir, ["dddd.py", "a.py", "ccc.py"]
          ),
          expected_version_hash,
      )
  
imports: import hashlib
  import os
  import subprocess
  import sys
  import tempfile
  from unittest import mock
  import tensorflow
  from tfx.components.util import udf_utils
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_executor
  from tfx.dsl.components.base import executor_spec
  from tfx.types import component_spec
  from tfx.utils import import_utils
label_desc: Use image node_id 6 for calling the UdfUtilsTest obj's underlying member method code with example usage: obj.test_version_hash() without return types