import re


def _is_private_name(name):
    """ Return true if the given variable name is considered private.

    Parameters
    ----------
    name : str
        Variable name to check
    """
    # e.g. __name__ is considered public.
    is_reserved_public_name = re.match(r"__[a-zA-Z0-9_]+__$", name) is not None
    return name.startswith("_") and not is_reserved_public_name