code: def _WriteEvalConfig(  # pylint: disable=invalid-name
      evaluation: evaluator.Evaluation,
      eval_config: config_pb2.EvalConfig,
      output_path: str,
      output_file_format: str,
      data_location: str,
      data_file_format: str,
      model_locations: Dict[str, str],
      filename: str,
  ) -> Optional[beam.PCollection[str]]:
      """Writes EvalConfig to file.
  
      Args:
        evaluation: Evaluation data. This transform only makes use of the pipeline.
        eval_config: EvalConfig.
        output_path: Output path.
        output_file_format: Output file format.
        data_location: Path indicating where input data is read from.
        data_file_format: Format of the input data.
        model_locations: Dict of model locations keyed by model name.
        filename: Name of file to store the config as.
  
      Returns:
        A PCollection of the filename that was written or None, if no file was
        written.
      """
      pipeline = list(evaluation.values())[0].pipeline
  
      # Skip writing file if its output is disabled
      if (
          EVAL_CONFIG_FILE
          in eval_config.options.disabled_outputs.values
      ):
          return None
  
      if (
          output_file_format
          and output_file_format != EVAL_CONFIG_FILE_FORMAT
      ):
          raise ValueError(
              'only "{}" format is currently supported: output_file_format={}'.format(
                  EVAL_CONFIG_FILE_FORMAT, output_file_format
              )
          )
  
      return (
          pipeline
          | "CreateEvalConfig"
          >> beam.Create(
              [
                  _serialize_eval_run(
                      eval_config,
                      data_location,
                      data_file_format,
                      model_locations,
                  )
              ]
          )
          | "WriteEvalConfig"
          >> beam.io.WriteToText(
              os.path.join(output_path, filename),
              shard_name_template="",
          )
      )
  
file_path: model-analysis/tensorflow_model_analysis/writers/eval_config_writer.py
imports: import os
  import pickle
  from typing import Any, Dict, Optional, Tuple
  import apache_beam
  import six
  import tensorflow
  from tensorflow_model_analysis import version
  from tensorflow_model_analysis.evaluators import evaluator
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.writers import writer
  from google.protobuf import json_format
label_desc: Use image node_id 5 for calling a global function with example usage: _WriteEvalConfig(evaluation, eval_config, output_path, output_file_format, data_location, data_file_format, model_locations, filename) and returns: unknown, None