def _parse_expires(expires):
    # none is used to signify positive infinity
    if expires is None or expires in ('never', 'infinity'):
        return 'infinity'

    try:
        return dateutil.parser.parse(str(expires))
    except ValueError as exc:
        pass

    try:
        # use parsedatetime for "human readable" time specs
        exp = pdt.parse(expires)[0]
        # and convert to datetime
        return datetime.datetime.fromtimestamp(time.mktime(exp))
    except ValueError as exc:
        pass

    raise NipapValueError("Invalid date specification for expires")
Parse the 'expires' attribute, guessing what format it is in and
dataset/ETHPy150Open SpriteLink/NIPAP/nipap/nipap/backend.py/_parse_expires