<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _adapt_WSDateTime(dt):
 """Return unix timestamp of the datetime like input. If conversion overflows high, return sint64_max , if underflows, return 0 """

    try:
        ts = int(
            (dt.replace(tzinfo=pytz.utc)
            - datetime(1970,1,1,tzinfo=pytz.utc)
            ).total_seconds()
        )
    except (OverflowError,OSError):
        if dt < datetime.now():
            ts = 0
        else:
            ts = 2**63-1
    return ts