code: def filter_dataset_by_duration(
      entries: List[Dict[str, Any]],
      min_duration: float,
      max_duration: float,
  ):
      """
      Filter out manifest entries based on duration.
  
      Args:
          entries: List of manifest entry dictionaries.
          min_duration: Minimum duration below which entries are removed.
          max_duration: Maximum duration above which entries are removed.
  
      Returns:
          filtered_entries: List of manifest entries after filtering.
          total_hours: Total duration of original dataset, in hours
          filtered_hours: Total duration of dataset after filtering, in hours
      """
      filtered_entries = []
      total_duration = 0.0
      filtered_duration = 0.0
      for entry in entries:
          duration = entry["duration"]
          total_duration += duration
          if (min_duration and duration < min_duration) or (
              max_duration and duration > max_duration
          ):
              continue
  
          filtered_duration += duration
          filtered_entries.append(entry)
  
      total_hours = total_duration / 3600.0
      filtered_hours = filtered_duration / 3600.0
  
      return filtered_entries, total_hours, filtered_hours
  
imports: import functools
  import os
  import random
  import traceback
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import librosa
  import numpy
  import torch
  from einops import rearrange
  from scipy import ndimage
  from torch.special import gammaln
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
label_desc: Use image node_id 11 for calling a global function with example usage: filter_dataset_by_duration(entries, min_duration, max_duration) and returns: filtered_entries,  total_hours,  filtered_hours