def delete_repo(name, attributes):
    repo = {}
    repo_file = os.path.join(src_dir, name + '.list')

    # If the file already exists, load repo into a dict
    if os.path.isfile(repo_file):
        repo = _load_repo(repo_file)

    try:
        # baseurl attr is mandatory
        baseurl = attributes['baseurl']

        if len(baseurl.split()) == 1:
            url = baseurl
            distribution = attributes['distribution']

        elif 1 > len(baseurl.split()):
            url = baseurl.split()[0]
            distribution = baseurl.split()[1]

        # Build the new repo dict
        deleterepo = {'baseurl': url,
                      'distribution': distribution}

    except KeyError as err:
        raise ResourceException("Missing mandatory attribute [%s]" % err)

    if name in repo:
        for index, rep in enumerate(repo[name]):
            if (rep['baseurl'] == deleterepo['baseurl'] and
                rep['distribution'] == deleterepo['distribution']):

                del repo[name][index]

        if not len(repo[name]):
            os.remove(repo_file)
dataset/ETHPy150Open comodit/synapse-agent/synapse/resources/repos-plugin/apt-repos.py/delete_repo/swapped operands of `>`