class_docstr: Partial feature stats for natural language.
class_docstr_tok: ["Partial","feature","stats","for","natural","language","."]
docstr: Merge two partial natual language stats.
docstr_tok: ["Merge","two","partial","natual","language","stats","."]
code: def __iadd__(self, other: "_PartialNLStats") -> "_PartialNLStats":
      """Merge two partial natual language stats."""
      self.invalidate |= other.invalidate
  
      self.num_in_vocab_tokens += other.num_in_vocab_tokens
      self.total_num_tokens += other.total_num_tokens
      self.sum_in_vocab_token_lengths += (
          other.sum_in_vocab_token_lengths
      )
      self.num_examples += other.num_examples
      self.vocab_token_length_quantiles.Merge(
          other.vocab_token_length_quantiles
      )
      if self.min_sequence_length is None:
          self.min_sequence_length = other.min_sequence_length
      elif other.min_sequence_length is not None:
          self.min_sequence_length = min(
              self.min_sequence_length, other.min_sequence_length
          )
      if self.max_sequence_length is None:
          self.max_sequence_length = other.max_sequence_length
      elif other.max_sequence_length is not None:
          self.max_sequence_length = max(
              self.max_sequence_length, other.max_sequence_length
          )
  
      self.sequence_length_quantiles.Merge(
          other.sequence_length_quantiles
      )
      self.token_occurrence_counts.Merge(other.token_occurrence_counts)
  
      for t in other.token_statistics:
          if t not in self.token_statistics:
              self.token_statistics[t] = other.token_statistics[t]
          else:
              self.token_statistics[t] += other.token_statistics[t]
  
      for list_name in [
          "reported_sequences_coverage",
          "reported_sequences_avg_token_length",
      ]:
          cur_list = getattr(self, list_name)
          cur_list += getattr(other, list_name)
          cur_list = _sort_and_truncate_reported_sequence(cur_list)
          setattr(self, list_name, cur_list)
      return self
  
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 2 for calling the _PartialNLStats obj's underlying member method code with example usage: obj.__iadd__(other) and returns: self