code: def check_norm_state(modules, train_state):
      """Check if norm layer is in correct train state."""
      for mod in modules:
          if isinstance(mod, _BatchNorm):
              if mod.training != train_state:
                  return False
      return True
  
file_path: mmdetection/tests/test_models/test_backbones/utils.py
imports: from torch.nn.modules import GroupNorm
  from torch.nn.modules.batchnorm import _BatchNorm
  from mmdet.models.backbones.res2net import Bottle2neck
  from mmdet.models.backbones.resnet import BasicBlock, Bottleneck
  from mmdet.models.backbones.resnext import Bottleneck
  from mmdet.models.layers import SimplifiedBasicBlock
label_desc: Use image node_id 3 for calling a global function with example usage: check_norm_state(modules, train_state) and returns: True, False