def get_date_property(self, prop, tail):
    """Returns date if property accepts '/w/time' as target."""
    if "target" not in prop:
      return None
    if prop.target.id != "/w/time":
      return None
    prop_id = self.get_frame_id(prop)
    if isinstance(tail, int):
      return (prop_id, tail)
    elif (isinstance(tail, sling.Frame) and "is" in tail and
          isinstance(tail["is"], int)):
      return (prop_id, tail["is"])
    return None
Returns date if property accepts '/w/time' as target.
language/labs/drkit/wikidata/preprocessing/distantly_supervise.py