code: def _encode_univalent_feature(feature_array: pa.Array) -> List[Any]:
      """Encodes univalent feature values into a fixed length representation.
  
      Univalent features are cast into a Python list. They are not affected by the
      encoding with the exception of null values which are replaced by None.
  
      Args:
        feature_array: Arrow Array.
  
      Returns:
        A list containing the feature values where null values are replaced by None.
      """
      result = [[None] for _ in range(len(feature_array))]
      flattened, non_missing_parent_indices = array_util.flatten_nested(
          feature_array, True
      )
      non_missing_values = np.asarray(flattened)
      nan_mask = pd.isnull(non_missing_values)
      non_nan_pairs = np.stack(
          (non_missing_values, non_missing_parent_indices), axis=-1
      )[~nan_mask]
      for value, index in non_nan_pairs:
          result[int(index)] = [value]
      return result
  
imports: import collections
  from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
  from absl import logging
  import apache_beam
  import numpy
  import pandas
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import partitioned_stats_generator
  from tensorflow_data_validation.utils import feature_partition_util
  from tensorflow_data_validation.utils import mutual_information_util
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tfx_bsl.arrow import array_util
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: _encode_univalent_feature(feature_array) and returns: result