def _get_metrics_name_by_indices(self, indices) -> list[str]:
        """Get the first available metrics names by index."""
        for v in self.nodes.values():
            if v.metrics:
                rls = []
                for index in indices:
                    if isinstance(index, str):
                        if index in self.objective_dict:
                            rls.append(index)
                        else:
                            logger.error("the metric %s is not in the metrics", index)
                    elif isinstance(index, int):
                        if index < len(self.objective_dict):
                            rls.append(list(self.objective_dict.keys())[index])
                        else:
                            logger.error("the index %s is out of range", index)
                if rls:
                    return rls
        return []
Get the first available metrics names by index.
olive/engine/footprint.py