def check_missing_files(client):
    """Find missing files listed in datasets."""
    missing = defaultdict(list)

    for path, dataset in client.datasets.items():
        for file in dataset.files:
            filepath = (path.parent / file)
            if not filepath.exists():
                missing[str(
                    path.parent.relative_to(client.renku_datasets_path)
                )].append(
                    os.path.normpath(str(filepath.relative_to(client.path)))
                )

    if not missing:
        return True

    click.secho(
        WARNING + 'There are missing files in datasets.'
        # '\n  (use "renku dataset clean <name>" to clean them)'
    )

    for dataset, files in missing.items():
        click.secho(
            '\n\t' + click.style(dataset, fg='yellow') + ':\n\t  ' +
            '\n\t  '.join(click.style(path, fg='red') for path in files)
        )

    return False
Find missing files listed in datasets.