def _get_arn_from_idempotency_token(self, token):
        """
        If token doesnt exist, return None, later it will be
        set with an expiry and arn.

        If token expiry has passed, delete entry and return None

        Else return ARN

        :param token: String token
        :return: None or ARN
        """
        now = datetime.datetime.now()
        if token in self._idempotency_tokens:
            if self._idempotency_tokens[token]['expires'] < now:
                # Token has expired, new request
                del self._idempotency_tokens[token]
                return None
            else:
                return self._idempotency_tokens[token]['arn']

        return None
def _get_arn_from_idempotency_token ( self , token ) : now = datetime . datetime . now ( ) if token in self . _idempotency_tokens : if self . _idempotency_tokens [ token ] [ 'expires' ] < now : del self . _idempotency_tokens [ token ] return None else : return self . _idempotency_tokens [ token ] [ 'arn' ] return None
If token doesnt exist, return None, later it will be
        set with an expiry and arn.

        If token expiry has passed, delete entry and return None

        Else return ARN

        :param token: String token
        :return: None or ARN