code: def chunk_iter(
      inputs, feature_extractor, chunk_len, stride_left, stride_right
  ):
      inputs_len = inputs.shape[0]
      step = chunk_len - stride_left - stride_right
      for i in range(0, inputs_len, step):
          # add start and end paddings to the chunk
          chunk = inputs[i : i + chunk_len]
          processed = feature_extractor(
              chunk,
              sampling_rate=feature_extractor.sampling_rate,
              return_tensors="pt",
          )
          _stride_left = 0 if i == 0 else stride_left
          is_last = i + step + stride_left >= inputs_len
          _stride_right = 0 if is_last else stride_right
          if chunk.shape[0] > _stride_left:
              yield {
                  "is_last": is_last,
                  "stride": (
                      chunk.shape[0],
                      _stride_left,
                      _stride_right,
                  ),
                  **processed,
              }
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/automatic_speech_recognition.py
imports: import inspect
  from collections import defaultdict
  from typing import TYPE_CHECKING, Dict, Optional, Union
  import numpy
  from ..utils import is_torch_available, logging
  from .audio_utils import ffmpeg_read
  from .base import ChunkPipeline
label_desc: Use image node_id 2 for calling a global function with example usage: chunk_iter(inputs, feature_extractor, chunk_len, stride_left, stride_right) without return types