code: def test_find_module_instances():
      net = nn.Sequential(
          nn.Linear(1, 1),
          nn.ModuleDict(
              {"ln": nn.LayerNorm(1), "linear": nn.Linear(1, 1)}
          ),
          nn.LayerNorm(1),
      )
      assert find_module_instances(net, nn.LayerNorm) == [
          ("1.ln.", net[1]["ln"]),
          ("2.", net[2]),
      ]
      assert find_module_instances(net, nn.Linear) == [
          ("0.", net[0]),
          ("1.linear.", net[1]["linear"]),
      ]
      assert find_module_instances(net, nn.Dropout) == []
      assert find_module_instances(net, nn.Sequential) == [("", net)]
  
imports: import torch
  from torch import nn
  from fairscale.internal.state_dict import find_module_instances, replace_by_prefix_
label_desc: Use image node_id 1 for calling a global function with example usage: test_find_module_instances() without return types