def METHOD_NAME(self, hierarchy: Hierarchy):
    if self.contains_hierarchy(hierarchy.name):
        raise ValueError("Hierarchy: {} already exists in dimension: {}".format(hierarchy.name, self.name))
    self._hierarchies.append(hierarchy)