class_docstr: Read CSV files and transform to TF examples.
  
  Note that each input split will be transformed by this function separately.
code: def expand(
      self, pipeline: beam.Pipeline
  ) -> beam.pvalue.PCollection[tf.train.Example]:
      logging.info(
          "Processing input csv data %s to TFExample.",
          self._csv_pattern,
      )
  
      csv_files = fileio.glob(self._csv_pattern)
      if not csv_files:
          raise RuntimeError(
              "Split pattern {} does not match any files.".format(
                  self._csv_pattern
              )
          )
  
      column_names = io_utils.load_csv_column_names(csv_files[0])
      for csv_file in csv_files[1:]:
          if io_utils.load_csv_column_names(csv_file) != column_names:
              raise RuntimeError(
                  "Files in same split {} have different header.".format(
                      self._csv_pattern
                  )
              )
  
      # Read each CSV file while maintaining order. This is done in order to group
      # together multi-line string fields.
      parsed_csv_lines = (
          pipeline
          | "CreateFilenames" >> beam.Create(csv_files)
          | "ReadFromText" >> beam.ParDo(_ReadCsvRecordsFromTextFile())
          | "ParseCSVLine"
          >> beam.ParDo(csv_decoder.ParseCSVLine(delimiter=","))
          | "ExtractParsedCSVLines" >> beam.Keys()
      )
      column_infos = beam.pvalue.AsSingleton(
          parsed_csv_lines
          | "InferColumnTypes"
          >> beam.CombineGlobally(
              csv_decoder.ColumnTypeInferrer(
                  column_names, skip_blank_lines=True
              )
          )
      )
  
      return parsed_csv_lines | "ToTFExample" >> beam.ParDo(
          _ParsedCsvToTfExample(), column_infos
      )
  
imports: import os
  from typing import Any, Dict, Iterable, List
  from absl import logging
  import apache_beam
  import tensorflow
  from tfx.components.example_gen.base_example_gen_executor import BaseExampleGenExecutor
  from tfx.dsl.io import fileio
  from tfx.types import standard_component_specs
  from tfx.utils import io_utils
  from tfx_bsl.coders import csv_decoder
label_desc: Use image node_id 2 for calling the _CsvToExample obj's underlying member method code with example usage: obj.expand(pipeline) and returns: unknown