code: def apply_with_stopping_condition(
      module,
      apply_fn,
      apply_condition=None,
      stopping_condition=None,
      **other_args,
  ):
      if stopping_condition(module):
          return
      if apply_condition(module):
          apply_fn(module, **other_args)
      for child in module.children():
          apply_with_stopping_condition(
              child,
              apply_fn,
              apply_condition=apply_condition,
              stopping_condition=stopping_condition,
              **other_args,
          )
  
file_path: NeMo/nemo/collections/multimodal/parts/utils.py
imports: import os
  from typing import Any, Callable, Tuple
  import torch
  from omegaconf import DictConfig, open_dict
  from PIL import Image
  from pytorch_lightning import Trainer
  from pytorch_lightning.plugins.environments import TorchElasticEnvironment
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy, NLPSaveRestoreConnector
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling a global function with example usage: apply_with_stopping_condition(module, apply_fn, apply_condition, stopping_condition) without return types