code: def check_targets(self, targets):
      # type: (Optional[List[Dict[str, Tensor]]]) -> None
      if targets is None:
          raise ValueError("targets should not be None")
      if not all(["boxes" in t for t in targets]):
          raise ValueError(
              "Every element of targets should have a boxes key"
          )
      if not all(["labels" in t for t in targets]):
          raise ValueError(
              "Every element of targets should have a labels key"
          )
      if self.has_mask():
          if not all(["masks" in t for t in targets]):
              raise ValueError(
                  "Every element of targets should have a masks key"
              )
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  import torchvision
  from torch import nn, Tensor
  from torchvision.ops import boxes, roi_align
  from .None import _utils
label_desc: Use image node_id 7 for calling the RoIHeads obj's underlying member method code with example usage: obj.check_targets(targets) without return types