def _get_expiration_seconds(expiration):
 if isinstance(expiration, datetime.timedelta):
  now = _NOW().replace(tzinfo=UTC)
  expiration = (now + expiration)
 if isinstance(expiration, datetime.datetime):
  micros = _microseconds_from_datetime(expiration)
  expiration = (micros // (10 ** 6))
 if (not isinstance(expiration, six.integer_types)):
  raise TypeError(('Expected an integer timestamp, datetime, or timedelta. Got %s' % type(expiration)))
 return expiration

def _get_expiration_seconds ( expiration ) : if isinstance ( expiration , datetime . timedelta ) : now = _NOW ( ) . replace ( tzinfo = UTC ) expiration = ( now + expiration ) if isinstance ( expiration , datetime . datetime ) : micros = _microseconds_from_datetime ( expiration ) expiration = ( micros // ( 10 ** 6 ) ) if ( not isinstance ( expiration , six . integer_types ) ) : raise TypeError ( ( 'Expected an integer timestamp, datetime, or timedelta. Got %s' % type ( expiration ) ) ) return expiration
convert expiration to a number of seconds in the future .