'Return the number of seconds until this token expires.
If token_expiry is in the past, this method will return 0, meaning the
token has already expired.
If token_expiry is None, this method will return None. Note that returning
0 in such a case would not be fair: the token may still be valid;
we just don\'t know anything about it.'

def _expires_in(self):

    if self.token_expiry:
        now = datetime.datetime.utcnow()
        if (self.token_expiry > now):
            time_delta = (self.token_expiry - now)
            return ((time_delta.days * 86400) + time_delta.seconds)
        else:
            return 0
