def get_basename(obj, remove_namespace=True, remove_attribute=False):
    """
    Get the base name in a hierarchy name (a|b|c -> returns c)
    :param obj: str, name to get base name from
    :param remove_namespace: bool, Whether to remove or not namespace from the base name
    :param remove_attribute: bool, Whether to remove or not attribute from the base name
    :return: str
    """

    split_name = obj.split('|')
    base_name = split_name[-1]

    if remove_attribute:
        base_name_split = base_name.split('.')
        base_name = base_name_split[0]

    if remove_namespace:
        split_base_name = base_name.split(':')
        return split_base_name[-1]

    return base_name