def get_parent_key(key):
    """
    Gets the key of the parent object. Assumes keys are formatted like

    param1__param2__param__3__...

    Parameters
    ----------
    key: str
        The key whose parent we want.

    Output
    ------
    parent_key: str
        The parent key
    """
    return '__'.join(key.split('__')[:-1])