class_docstr: This is a general feature extraction class for speech recognition.
  
  Args:
      feature_size (`int`):
          The feature dimension of the extracted features.
      sampling_rate (`int`):
          The sampling rate at which the audio files should be digitalized expressed in Hertz per second (Hz).
      padding_value (`float`):
          The value that is used to fill the padding values / vectors.
class_docstr_tok: ["This","is","a","general","feature","extraction","class","for","speech","recognition",".","Args",":","feature_size","(","`","int","`",")",":","The","feature","dimension","of","the","extracted","features",".","sampling_rate","(","`","int","`",")",":","The","sampling","rate","at","which","the","audio","files","should","be","digitalized","expressed","in","Hertz","per","second","(","Hz",")",".","padding_value","(","`","float","`",")",":","The","value","that","is","used","to","fill","the","padding","values","\/","vectors","."]
docstr: Find the correct padding strategy
docstr_tok: ["Find","the","correct","padding","strategy"]
code: def _get_padding_strategies(self, padding=False, max_length=None):
      """
      Find the correct padding strategy
      """
  
      # Get padding strategy
      if padding is not False:
          if padding is True:
              padding_strategy = (
                  PaddingStrategy.LONGEST
              )  # Default to pad to the longest sequence in the batch
          elif not isinstance(padding, PaddingStrategy):
              padding_strategy = PaddingStrategy(padding)
          elif isinstance(padding, PaddingStrategy):
              padding_strategy = padding
      else:
          padding_strategy = PaddingStrategy.DO_NOT_PAD
  
      # Set max length if needed
      if max_length is None:
          if padding_strategy == PaddingStrategy.MAX_LENGTH:
              raise ValueError(
                  f"When setting ``padding={PaddingStrategy.MAX_LENGTH}``, make sure that max_length is defined"
              )
  
      # Test if we have a padding value
      if padding_strategy != PaddingStrategy.DO_NOT_PAD and (
          self.padding_value is None
      ):
          raise ValueError(
              "Asking to pad but the feature_extractor does not have a padding value. Please select a value to use"
              " as `padding_value`. For example: `feature_extractor.padding_value = 0.0`."
          )
  
      return padding_strategy
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/feature_extraction_sequence_utils.py
imports: from typing import Dict, List, Optional, Union
  import numpy
  from .feature_extraction_utils import BatchFeature, FeatureExtractionMixin
  from .utils import PaddingStrategy, TensorType, is_tf_tensor, is_torch_tensor, logging, to_numpy
label_desc: Use image node_id 5 for calling the SequenceFeatureExtractor obj's underlying member method code with example usage: obj._get_padding_strategies(padding, max_length) and returns: padding_strategy