def get_name(self, x):
    """Return name for given wikidata id."""
    if x is None:
      return None
    if isinstance(x, int):
      date = sling.Date(x)
      return self.cal.str(date)
    elif not x.startswith("Q"):
      return None
    if isinstance(self.kb[x].name, bytes):
      return self.kb[x].name.decode("utf-8", errors="ignore")
    else:
      return self.kb[x].name
Return name for given wikidata id.
language/labs/drkit/wikidata/preprocessing/distantly_supervise.py