def get_linked_entity(self, mention):
    """Returns the string ID of the linked entity for this mention."""
    if "evokes" not in mention.frame:
      return None
    if not isinstance(mention.frame["evokes"], sling.Frame):
      return None
    if "is" in mention.frame["evokes"]:
      if not isinstance(mention.frame["evokes"]["is"], sling.Frame):
        if ("isa" in mention.frame["evokes"] and
            mention.frame["evokes"]["isa"].id == "/w/time" and
            isinstance(mention.frame["evokes"]["is"], int)):
          return mention.frame["evokes"]["is"]
        else:
          return None
      else:
        return mention.frame["evokes"]["is"].id
    return mention.frame["evokes"].id
Returns the string ID of the linked entity for this mention.
language/labs/drkit/wikidata/preprocessing/distantly_supervise.py