code: def get_csv_header(
      data_location: Text,
      delimiter: Text,
      compression_type: Text = CompressionTypes.AUTO,
  ) -> List[types.FeatureName]:
      """Gets the CSV header from the input files.
  
      This function assumes that the header is present as the first line in all
      the files in the input path.
  
      Args:
        data_location: Glob pattern(s) specifying the location of the input data
          files.
        delimiter: A one-character string used to separate fields in a CSV file.
        compression_type: Used to handle compressed input files. Default value is
          CompressionTypes.AUTO, in which case the file_path's extension will be
          used to detect the compression.
  
      Returns:
        The list of column names.
  
      Raises:
        ValueError: If any of the input files is not found or empty, or if the files
          have different headers.
      """
      matched_files = tf.io.gfile.glob(data_location)
      if not matched_files:
          raise ValueError(
              "No file found in the input data location: %s"
              % data_location
          )
  
      # detect compression base on file extension if it is `AUTO`.
      if compression_type == CompressionTypes.AUTO:
          compression_type = CompressionTypes.detect_compression_type(
              matched_files[0]
          )
  
      if compression_type == CompressionTypes.UNCOMPRESSED:
          read_csv_fn = _read_csv_uncompressed
      elif compression_type == CompressionTypes.GZIP:
          read_csv_fn = _read_csv_gzip
      else:
          raise ValueError(
              "Compression Type: `%s` is not supported for csv files."
              % compression_type
          )
  
      result = read_csv_fn(matched_files[0], delimiter)
  
      # Make sure that all files have the same header.
      for filename in matched_files[1:]:
          if read_csv_fn(filename, delimiter) != result:
              raise ValueError("Files have different headers.")
  
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import csv
  import gzip
  import io
  import multiprocessing
  import os
  import tempfile
  from typing import Any, List, Optional, Text, cast
  import apache_beam
  from apache_beam.io.filesystem import CompressionTypes
  from apache_beam.options.pipeline_options import PipelineOptions
  from joblib import delayed
  from joblib import Parallel
  import numpy
  from pandas import DataFrame
  import pyarrow
  import tensorflow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.api import stats_api
  from tensorflow_data_validation.coders import csv_decoder
  from tensorflow_data_validation.statistics import stats_impl
  from tensorflow_data_validation.statistics import stats_options
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import stats_util
  from tfx_bsl.arrow import table_util
  from tfx_bsl.tfxio import tf_example_record
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: get_csv_header(data_location, delimiter, compression_type) and returns: result