code: def build_anchor_generator(cfg, input_shape):
      """
      Built an anchor generator from `cfg.MODEL.ANCHOR_GENERATOR.NAME`.
      """
      anchor_generator = cfg.MODEL.ANCHOR_GENERATOR.NAME
      return ANCHOR_GENERATOR_REGISTRY.get(anchor_generator)(
          cfg, input_shape
      )
  
imports: import collections
  import math
  from typing import List
  import torch
  from torch import nn
  from detectron2.config import configurable
  from detectron2.layers import ShapeSpec, move_device_like
  from detectron2.structures import Boxes, RotatedBoxes
  from detectron2.utils.registry import Registry
label_desc: Use image node_id 3 for calling a global function with example usage: build_anchor_generator(cfg, input_shape) and returns: ANCHOR_GENERATOR_REGISTRY