code: def write_summary_string_to_file(
      pipeline,
      output_examples,
      input_pattern_list,
      dataset_name,
      output_pattern_prefix,
      output_filename,
  ):
      """Writes a file summarizing the PCollection of Examples.
  
      Args:
        pipeline: Beam pipeline object.
        output_examples: PCollection of examples.
        input_pattern_list: str. A comma-separated string of input files.
        dataset_name: str. The name of the dataset to be written in the output.
        output_pattern_prefix: str. The prefix of the sharded output files.
        output_filename: the output text file that contains the summary that can be
          parsed into DeepVariantDatasetConfig.
      """
  
      # Beam currently has no way to materialize pipeline values, so we have
      # to construct the file entirely in Beam pipeline operations.
      comment_str = pipeline | "CreateFileHeader" >> beam.Create(
          [
              COMMENT_HEADER.format(
                  input_pattern_list, output_pattern_prefix
              )
          ]
      )
      num_examples = (
          output_examples
          | "CountOutputExamples" >> beam.combiners.Count.Globally()
      )
      config_str = num_examples | "MakeConfigStr" >> beam.Map(
          lambda n: make_config_string(
              dataset_name, output_pattern_prefix, n
          )
      )
  
      num_examples_by_labels = count_records_per_label(output_examples)
      merged_strings = (
          comment_str,
          num_examples_by_labels,
          config_str,
      ) | "FlattenStrs" >> beam.Flatten()
      _ = (
          merged_strings
          | "Concat2" >> beam.CombineGlobally("".join)
          | "WriteToFile"
          >> beam.io.WriteToText(
              output_filename,
              shard_name_template="",
              header="# Generated by shuffle_tfrecords_beam.py",
          )
      )
  
file_path: deepvariant/tools/shuffle_tfrecords_beam.py
imports: import argparse
  import hashlib
  import logging
  import os
  import textwrap
  import apache_beam
  from apache_beam import coders
  from apache_beam.options.pipeline_options import PipelineOptions
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: write_summary_string_to_file(pipeline, output_examples, input_pattern_list, dataset_name, output_pattern_prefix, output_filename) without return types