def urlsafe_base64_decode(s):
        """
        Decodes a base64 encoded string, adding back any trailing equal signs that
        might have been stripped.
        """
        s = s.encode('utf-8')  # base64encode should only return ASCII.
        try:
            return base64.urlsafe_b64decode(s.ljust(len(s) + len(s) % 4, b'='))
        except (LookupError, BinasciiError) as e:
            raise ValueError(e)
dataset/ETHPy150Open mishbahr/django-users2/users/compat.py/urlsafe_base64_decode/original