class_docstr: Base class for end-to-end testing of TFX templates.
docstr: Update given file by uncommenting a variable.
  
  The variable should be defined in following form.
  # ....
  # VARIABLE_NAME = ...
  #   long indented line
  #
  #   long indented line
  # OTHER STUFF
  
  Above comments will become
  
  # ....
  VARIABLE_NAME = ...
    long indented line
  
    long indented line
  # OTHER STUFF
  
  Args:
    filepath: file to modify.
    variables: List of variables.
  
  Returns:
    Absolute path of the modified file.
docstr_tok: ["Update","given","file","by","uncommenting","a","variable",".","The","variable","should","be","defined","in","following","form",".","#","....","#","VARIABLE_NAME","=","...","#","long","indented","line","#","#","long","indented","line","#","OTHER","STUFF","Above","comments","will","become","#","....","VARIABLE_NAME","=","...","long","indented","line","long","indented","line","#","OTHER","STUFF","Args",":","filepath",":","file","to","modify",".","variables",":","List","of","variables",".","Returns",":","Absolute","path","of","the","modified","file","."]
code: def _uncommentMultiLineVariables(
      self, filepath: str, variables: Iterable[str]
  ) -> str:
      """Update given file by uncommenting a variable.
  
      The variable should be defined in following form.
      # ....
      # VARIABLE_NAME = ...
      #   long indented line
      #
      #   long indented line
      # OTHER STUFF
  
      Above comments will become
  
      # ....
      VARIABLE_NAME = ...
        long indented line
  
        long indented line
      # OTHER STUFF
  
      Args:
        filepath: file to modify.
        variables: List of variables.
  
      Returns:
        Absolute path of the modified file.
      """
      path = os.path.join(self._project_dir, filepath)
      result = []
      commented_variables = [
          "# " + variable + " =" for variable in variables
      ]
      in_variable_definition = False
  
      with open(path) as fp:
          for line in fp:
              if in_variable_definition:
                  if re.match(r"# [\]\}\) ]", line):
                      result.append(line[2:])
                      continue
                  elif line == "#\n":
                      result.append(line[1:])
                      continue
                  else:
                      in_variable_definition = False
              for commented_var in commented_variables:
                  if line.startswith(commented_var):
                      in_variable_definition = True
                      result.append(line[2:])
                      break
              else:
                  # doesn't include a variable definition to uncomment.
                  result.append(line)
  
      io_utils.write_string_file(path, "".join(result))
      return path
  
imports: import os
  import re
  from typing import List, Iterable, Tuple
  from tfx.tools.cli.e2e import test_utils
  from tfx.utils import io_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 7 for calling the BaseEndToEndTest obj's underlying member method code with example usage: obj._uncommentMultiLineVariables(filepath, variables) and returns: path