code: def test_replace_by_prefix():
      state_dict = {
          "layer.a": torch.tensor(1),
          "abc.layer.def": torch.tensor(2),
          "layer.b": torch.tensor(3),
      }
      replace_by_prefix_(state_dict, "layer.", "module.layer.")
      assert state_dict == {
          "module.layer.a": torch.tensor(1),
          "abc.layer.def": torch.tensor(2),
          "module.layer.b": torch.tensor(3),
      }
  
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 2 for calling a global function with example usage: test_replace_by_prefix() without return types