code: def get_feature_type_from_arrow_type(
      feature_path: types.FeaturePath, arrow_type: pa.DataType
  ) -> Optional[types.FeatureNameStatisticsType]:
      """Get feature type from Arrow type.
  
      Args:
        feature_path: path of the feature.
        arrow_type: Arrow DataType.
  
      Returns:
        A statistics_pb2.FeatureNameStatistics.Type value or None if arrow_type
        is null (which means it cannot be determined for now).
  
      Raises:
        TypeError: if the type is not supported.
      """
      if pa.types.is_null(arrow_type):
          return None
      if not array_util.is_list_like(arrow_type):
          raise TypeError(
              "Expected feature column to be a "
              "(Large)List<primitive|struct> or null, but feature {} "
              "was {}.".format(feature_path, arrow_type)
          )
  
      value_type = array_util.get_innermost_nested_type(arrow_type)
      if pa.types.is_integer(value_type):
          return statistics_pb2.FeatureNameStatistics.INT
      elif pa.types.is_floating(value_type):
          return statistics_pb2.FeatureNameStatistics.FLOAT
      elif arrow_util.is_binary_like(value_type):
          return statistics_pb2.FeatureNameStatistics.STRING
      elif pa.types.is_struct(value_type):
          return statistics_pb2.FeatureNameStatistics.STRUCT
      elif pa.types.is_null(value_type):
          return None
  
      raise TypeError(
          "Feature {} has unsupported arrow type: {}".format(
              feature_path, arrow_type
          )
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  from typing import Dict, Iterable, Optional, Sequence, Text, Tuple, Union
  import numpy
  import pyarrow
  import tensorflow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.arrow import arrow_util
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.utils import io_util
  from tfx_bsl import statistics
  from tfx_bsl.arrow import array_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: get_feature_type_from_arrow_type(feature_path, arrow_type) and returns: None, statistics_pb2, statistics_pb2, statistics_pb2, statistics_pb2, None