code: def _add_annots(self, layout, annots):
          
          if annots:
              for annot in resolve1(annots):
                  annot = resolve1(annot)
                  if annot.get('Rect') is not None:
                      annot['bbox'] = annot.pop('Rect')  # Rename key
                      annot = self._set_hwxy_attrs(annot)
                  try:
                      annot['URI'] = resolve1(annot['A'])['URI']
                  except KeyError:
                      pass
                  for k, v in six.iteritems(annot):
                      if not isinstance(v, six.string_types):
                          annot[k] = obj_to_string(v)
                  elem = parser.makeelement('Annot', annot)
                  layout.add(elem)
          return layout
docs: Adds annotations to the layout object