code: def named_children(pipe_class):
      a = nn.Linear(1, 1)
      b = nn.Linear(1, 1)
  
      model = nn.Sequential(OrderedDict([("a", a), ("b", b)]))
      model = pipe_class(model, [1, 1], worker_map=get_worker_map())
  
      names = set(n for n, _ in model.named_modules())
      if model.group.rank() == 0:
          assert "0.a" in names
      else:
          assert "0.b" in names
  
      # MultiProcessPipe doesn't support __getattr__. Unlike nn.Sequential, MultiProcessPipe requires
      # several methods in its namespace.
      with pytest.raises(AttributeError):
          model.a
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import os
  import time
  import pytest
  import torch
  from torch import nn
  from fairscale.fair_dev.testing.testing import get_worker_map, torch_spawn
  from fairscale.internal import torch_version
  from fairscale.nn.model_parallel.initialize import get_pipeline_parallel_group
  from fairscale.nn.pipe import AsyncPipe
  from fairscale.nn.pipe.types import LazyModule
label_desc: Use image node_id 33 for calling a global function with example usage: named_children(pipe_class) without return types