import base64


def decode(b64):
    """
    Decode given attribute encoded by using Base64 encoding.

    The result is returned as regular Python string. Note that TypeError might
    be thrown when the input data are not encoded properly.
    """
    barray = base64.b64decode(b64)
    return barray.decode('ascii')