code: def omegaconf_filter_keys(d, fn=None):
      """Only keep keys where fn(key) is True. Support nested DictConfig."""
      if fn is None:
  
          def fn(_):
              return True
  
      if is_list(d):
          return ListConfig([omegaconf_filter_keys(v, fn) for v in d])
      elif is_dict(d):
          return DictConfig(
              {
                  k: omegaconf_filter_keys(v, fn)
                  for k, v in d.items()
                  if fn(k)
              }
          )
      else:
          return d
  
file_path: espnet/espnet2/asr/state_spaces/utils.py
imports: import functools
  from typing import Callable, Mapping, Sequence
  import hydra
  from omegaconf import DictConfig, ListConfig
label_desc: Use image node_id 8 for calling a global function with example usage: omegaconf_filter_keys(d, fn) and returns: ListConfig, True, DictConfig, d