import six
import base64


def b64_decode(s):
    """Decode text as base64 using :func:`base64.b64decode`.

    Args:
        s (:obj:`str`):
            Text to base64 decode.

    Returns:
        :obj:`str`

    """
    s = six.ensure_binary(s)
    s = base64.b64decode(s)
    return six.ensure_str(s)