code: def __init__(
      self,
      pretrained=True,
      backbone="resnet18",
      norm_layer=nn.BatchNorm2d,
      **kwargs,
  ):
      super(ContextPath, self).__init__()
      if backbone == "resnet18":
          pretrained = resnet18(pretrained=pretrained, **kwargs)
      else:
          raise RuntimeError("unknown backbone: {}".format(backbone))
      self.conv1 = pretrained.conv1
      self.bn1 = pretrained.bn1
      self.relu = pretrained.relu
      self.maxpool = pretrained.maxpool
      self.layer1 = pretrained.layer1
      self.layer2 = pretrained.layer2
      self.layer3 = pretrained.layer3
      self.layer4 = pretrained.layer4
  
      inter_channels = 128
      self.global_context = _GlobalAvgPooling(
          512, inter_channels, norm_layer, **kwargs
      )
  
      self.arms = nn.ModuleList(
          [
              AttentionRefinmentModule(
                  512, inter_channels, norm_layer, **kwargs
              ),
              AttentionRefinmentModule(
                  256, inter_channels, norm_layer, **kwargs
              ),
          ]
      )
      self.refines = nn.ModuleList(
          [
              _ConvBNReLU(
                  inter_channels,
                  inter_channels,
                  3,
                  1,
                  1,
                  norm_layer=norm_layer,
                  **kwargs,
              ),
              _ConvBNReLU(
                  inter_channels,
                  inter_channels,
                  3,
                  1,
                  1,
                  norm_layer=norm_layer,
                  **kwargs,
              ),
          ]
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from pywick.models.segmentation.da_basenets.resnet import resnet18
label_desc: Use image node_id 1 to create a new ContextPath object from inherited base classes: nn with example: obj = ContextPath(pretrained, backbone, norm_layer)