code: def _call_modules_by_name(
      cls, module, module_dict: str, func: Callable, **kwargs
  ) -> int:
      for name, overwrite_with in module_dict.items():
          if module.__class__.__name__ == name:
              func(module, overwrite_with)
              return 1
  
      return sum(
          cls._call_modules_by_name(module, module_dict, func)
          for module in module.children()
      )
  
file_path: theta-layer-drugs/drugs/inject_mixin.py
imports: import types
  from typing import Callable, Optional, List
  import torch
  from transformers import PreTrainedModel
  from transformers.utils import logging
  from drugs.generation.utils import _update_model_kwargs_for_generation
  from drugs.models import *
label_desc: Use image node_id 2 for calling the InjectDrugsMixin obj's underlying member method code with example usage: obj._call_modules_by_name(cls, module, module_dict, func) and returns: sum, int