def do(args):
    """Main entry points."""

    git_worktree = qisrc.parsers.get_git_worktree(args)
    snapshot = None
    if args.snapshot:
        snapshot = qisrc.snapshot.Snapshot()
        snapshot.load(args.snapshot)

    if snapshot and snapshot.format_version and 1 >= snapshot.format_version:
        reset_manifest(git_worktree, snapshot,
                       ignore_groups=args.ignore_groups)

    git_projects = qisrc.parsers.get_git_projects(git_worktree, args,
                                                  default_all=True,
                                                  use_build_deps=True)
    errors = list()
    for i, git_project in enumerate(git_projects):
        ui.info_count(i, len(git_projects), "Reset", git_project.src)
        src = git_project.src
        git = qisrc.git.Git(git_project.path)
        ok, message = git.require_clean_worktree()
        if not ok and not args.force:
            ui.warning(message)
            errors.append(src)
            continue
        if not git_project.default_branch:
            if git_project.fixed_ref:
                ok, mess = qisrc.reset.clever_reset_ref(
                        git_project, git_project.fixed_ref, raises=False)
                if not ok:
                    errors.append(src)
                    ui.error(mess)
                continue
            else:
                ui.warning(git_project.src, "not in manifest, skipping")
                continue
        branch = git_project.default_branch.name
        remote = git_project.default_remote.name
        git.safe_checkout(branch, remote, force=True)

        to_reset = None
        if args.snapshot:
            to_reset = snapshot.refs.get(src)
            if not to_reset:
                ui.warning(src, "not found in the snapshot")
                continue
        elif args.tag:
            to_reset = args.tag
        else:
            to_reset = "%s/%s" % (remote, branch)
        try:
            qisrc.reset.clever_reset_ref(git_project, to_reset)
        except:
            errors.append(src)

    if not errors:
        return
    ui.error("Failed to reset some projects")
    for error in errors:
        ui.info(ui.red, " * ", error)
    sys.exit(1)
dataset/ETHPy150Open aldebaran/qibuild/python/qisrc/actions/reset.py/do/swapped operands of `>=`