import base64


def is_base64(s):
    """Function to check whether a string is base64 encoded or not
    
    Parameters
    ----------
    s
        String to check

    """
    try:
        return base64.b64encode(base64.b64decode(s)) == s
    except Exception:
        return False