<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_unique_element_id(cls, instance, element_id):
 """ Check for uniqueness of the given element_id for the current page. Return None if instance is not yet associated with a page. """

        try:
            element_ids = instance.placeholder.page.cascadepage.glossary.get('element_ids', {})
        except (AttributeError, ObjectDoesNotExist):
            pass
        else:
            if element_id:
                for key, value in element_ids.items():
                    if str(key) != str(instance.pk) and element_id == value:
                        msg = _("The element ID '{}' is not unique for this page.")
                        raise ValidationError(msg.format(element_id))