class_docstr: Specification of a user module dependency.
class_docstr_tok: ["Specification","of","a","user","module","dependency","."]
code: def resolve(self, pipeline_root: str):
      # Package the given user module file as a Python wheel.
      module_file = self.component.spec.exec_properties[
          self.module_file_key
      ]
  
      # Perform validation on the given `module_file`.
      if not module_file:
          return None
      elif not isinstance(module_file, str):
          # TODO(b/187753042): Deprecate and remove usage of RuntimeParameters for
          # `module_file` parameters and remove this code path.
          logging.warning(
              "Module file %r for component %s is not a path string; "
              "skipping Python user module wheel packaging.",
              module_file,
              self.component,
          )
          return None
      elif not fileio.exists(module_file):
          raise ValueError(
              f"Specified module file {module_file!r} "
              f"for component {self.component} does not exist."
          )
  
      # Perform validation on the `pipeline_root`.
      if not pipeline_root:
          logging.warning(
              "No pipeline root provided; skipping Python user module "
              "wheel packaging for component %s.",
              self.component,
          )
          return None
      pipeline_root_exists = fileio.exists(pipeline_root)
      if not pipeline_root_exists:
          fileio.makedirs(pipeline_root)
  
      # Perform packaging of the user module.
      dist_file_path, user_module_path = package_user_module_file(
          self.component.id, module_file, pipeline_root
      )
  
      # Set the user module key to point to a module in this wheel, and clear the
      # module path key before returning.
      self.component.spec.exec_properties[
          self.module_path_key
      ] = user_module_path
      self.component.spec.exec_properties[self.module_file_key] = None
      return dist_file_path
  
imports: import hashlib
  import os
  import re
  import shutil
  import struct
  import subprocess
  import sys
  import tempfile
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from absl import logging
  from tfx.dsl.components.base import base_component
  from tfx.dsl.io import fileio
  from tfx.utils import import_utils
  from tfx.utils import io_utils
label_desc: Use image node_id 2 for calling the UserModuleFilePipDependency obj's underlying member method code with example usage: obj.resolve(pipeline_root) and returns: dist_file_path, None, None, None