import click


def trim_dependent_repos(repos):
    """Remove dependent repos (an obsolete feature of this program).

    Repos with 'parent-repo' in their 'openedx-release' data are removed from
    the `repos` dict.  A new dict of repos is returned.

    """
    trimmed = {}

    for r, data in repos.items():
        if 'parent-repo' in data['openedx-release']:
            msg = f"Repo {r} is dependent: you can remove openedx-release from its openedx.yaml file"
            click.secho(msg, fg='yellow')
        else:
            trimmed[r] = data

    return trimmed