code: def _get_metadata_reconciled_max_sequence_length(
      preprocessing_parameters: Dict, vocabulary: Vocabulary
  ) -> Tuple[int, int]:
      """Reconciles the different ways sequence length can be specified in preprocessing parameters.
  
      If the max sequence length is explicitly specified, we use the minimum of the true maximum sequence length and
      the explicitly specified value. If the explicitly specified value is less than the true maximum sequence length, we
      log a warning.
  
      If the max sequence length is not specified, we use the true maximum sequence length.
  
      Returns:
          Tuple(max_sequence_length, sequence_length_99ptile).
      """
      # For sequence features with a fixed length specified by `sequence_length`, use this as the max_sequence_length.
      if preprocessing_parameters["sequence_length"] is not None:
          return (
              preprocessing_parameters["sequence_length"],
              preprocessing_parameters["sequence_length"],
          )
  
      # Max sequence length is explicitly set. Use this as the max_sequence_length.
      if preprocessing_parameters["max_sequence_length"] is not None:
          if (
              preprocessing_parameters["max_sequence_length"]
              < vocabulary.max_sequence_length
          ):
              logger.warning(
                  f"The max sequence length of the data, {vocabulary.max_sequence_length}, is longer than the max "
                  f"sequence length set in the config, {preprocessing_parameters['max_sequence_length']}. Note that this "
                  "will truncate all examples to max_sequence_length="
                  f"{preprocessing_parameters['max_sequence_length']}."
              )
          return (
              min(
                  vocabulary.max_sequence_length,
                  preprocessing_parameters["max_sequence_length"],
              ),
              min(
                  vocabulary.sequence_length_99ptile,
                  preprocessing_parameters["max_sequence_length"],
              ),
          )
  
      # Max sequence length is None. Use the max sequence length of the data.
      return (
          vocabulary.max_sequence_length,
          vocabulary.sequence_length_99ptile,
      )
  
imports: import logging
  from functools import partial
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from transformers import PreTrainedTokenizer
  from ludwig.constants import COLUMN, IGNORE_INDEX_TOKEN_ID, LAST_PREDICTIONS, LENGTHS, NAME, PREDICTIONS, PREPROCESSING, PROBABILITIES, PROBABILITY, PROC_COLUMN, RESPONSE, TEXT
  from ludwig.features.base_feature import BaseFeatureMixin, OutputFeature
  from ludwig.features.feature_utils import compute_sequence_probability, compute_token_probabilities
  from ludwig.features.sequence_feature import _SequencePostprocessing, _SequencePreprocessing, SequenceInputFeature, SequenceOutputFeature
  from ludwig.modules.metric_registry import get_metric_tensor_input
  from ludwig.schema.features.text_feature import TextInputFeatureConfig, TextOutputFeatureConfig
  from ludwig.types import FeatureMetadataDict, ModelConfigDict, PreprocessingConfigDict, TrainingSetMetadataDict
  from ludwig.utils.math_utils import softmax
  from ludwig.utils.strings_utils import build_sequence_matrix, create_vocabulary, get_tokenizer, SpecialSymbol, UNKNOWN_SYMBOL, Vocabulary
label_desc: Use image node_id 2 for calling a global function with example usage: _get_metadata_reconciled_max_sequence_length(preprocessing_parameters, vocabulary) and returns: vocabulary,  vocabulary, preprocessing_parameters,  preprocessing_parameters, min,  min