    def collect_anchor(self, anchor_name):
        """Create a TargetLookupItem for the given `anchor_name``."""
        if isinstance(anchor_name, str):
            if self.target_lookup_items.get(anchor_name) is not None:
                LOGGER.warning('Anchor defined twice: %r', anchor_name)
            else:
                self.target_lookup_items.setdefault(
                    anchor_name, TargetLookupItem())
Create a TargetLookupItem for the given `anchor_name``.
weasyprint/css/targets.py