from datetime import datetime


def get_run_name(config):
    """Returns timestamped name for this run based on config file.

    Args:
        config (dict): Overall config dict.

    Returns:
        str: Timestamped name for this run.
    """
    dataset_name = config["dataset"]["name"]
    model_name = config["model"]["name"]
    metric_names = "-".join(list(config["metrics"].keys()))
    if config.get("unique"):
        timestamp = datetime.now().strftime("%y-%m-%d-%H-%M-%S")
        return "_".join([dataset_name, model_name, metric_names, timestamp])
    return "_".join([dataset_name, model_name, metric_names])