def find_duplicates(files):

    primary = files[0]
    others = files[1:len(files)]

    for package in primary['packages'].copy():
        for other in others:
            otherpacks = other['packages']
            try:
                dupe = otherpacks[package]
            except __HOLE__:
                pass
            else:
                this = {
                    'file': primary['name'],
                    'package': package,
                    'version': primary['packages'][package]
                }
                that = {
                    'file': other['name'],
                    'package': package,
                    'version': other['packages'][package]
                }
                click.echo(
                    "Found {} in {} and {}".format(
                        package, this['file'], that['file']))
                value = click.prompt(
                    """[0]Keep both\n[1] Keep {} in {}\n[2] Keep {} in {}\n""".format(
                        this['version'],
                        this['file'],
                        that['version'],
                        that['file']),
                    type=int
                )
                if value == 1:
                    del otherpacks[package]
                    other['updated'].append(package)
                    other['removed'].append(package)
                elif value == 2:
                    del primary['packages'][package]
                    primary['updated'].append(package)
                    primary['removed'].append(package)
dataset/ETHPy150Open hactar-is/olaf/olaf/cli.py/find_duplicates