code: def _update_accumulator_with_sequence_lengths(
      accumulator: _PartialNLStats,
      sequence_length_excluded_int_tokens: Set[int],
      sequence_length_excluded_string_tokens: Set[Text],
      max_sequence_length: int,
      int_row: Optional[List[Union[int, Text]]],
      string_row: Optional[List[Union[Text, int]]],
  ):
      """Update sequence length quantiles in accumulator.
  
      We expect that int_row and string row preserve the position of the the token
      within the seqence and hence allow the lists to contain both ints and strings.
  
      Args:
        accumulator: The accumulator to update.
        sequence_length_excluded_int_tokens: The int tokens to not consider when
          calculating the length.
        sequence_length_excluded_string_tokens: The string tokens to not consider
          when calculating the length.
        max_sequence_length: The max sequence length to use if no excluded tokens
          are present.
        int_row: The row of integer tokens. Note: the row can include strings if
          there is an incomplete mapping from strings to ints (this preserves the
          position).
        string_row: The row of string tokens. Note: the row can include ints if if
          there is an incomplete mapping from ints to strings (this preserves the
          position).
      """
      sequence_length = max_sequence_length
      if int_row is not None:
          matches = [
              e
              for e in int_row
              if e in sequence_length_excluded_int_tokens
          ]
          sequence_length -= len(matches)
      if string_row is not None:
          matches = [
              e
              for e in string_row
              if e in sequence_length_excluded_string_tokens
          ]
          sequence_length -= len(matches)
      accumulator.sequence_length_quantiles.AddValues(
          pa.array([sequence_length])
      )
      accumulator.min_sequence_length = (
          sequence_length
          if not accumulator.min_sequence_length
          else min(accumulator.min_sequence_length, sequence_length)
      )
      accumulator.max_sequence_length = (
          sequence_length
          if not accumulator.max_sequence_length
          else max(accumulator.max_sequence_length, sequence_length)
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Dict, Iterable, List, Optional, Set, Text, Union
  import pyarrow
  import six
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import quantiles_util
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import vocab_util
  from tfx_bsl import sketches
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 5 for calling a global function with example usage: _update_accumulator_with_sequence_lengths(accumulator, sequence_length_excluded_int_tokens, sequence_length_excluded_string_tokens, max_sequence_length, int_row, string_row) without return types