def get_name_and_versions_to_delete(chart_response, keep=2):
    """
    Get name and unused versions from chart api response. Please see test if confusing about the input and output.
    If less than 1 to keep, return empty empty to delete
    :param chart_response: api response of charts
    :param keep: number of versions to keep. default only keep one
    :return: Dict(str, list) contains chart name and versions
    """
    name_and_versions = dict()

    if keep < 1:
        return name_and_versions

    for k, v in chart_response.items():
        name_and_versions[k] = list()
        count = 0

        for value in v:
            if count >= keep:
                name_and_versions[k].append(value['version'])
            else:
                count += 1
    return name_and_versions