def METHOD_NAME(
    args,
    max_workers,
    policies_manager=DEFAULT_SCAN_MANAGER,
    dry_run=False,
    allow_empty_source=False,
):
    if args.replaceNewer and args.skipNewer:
        raise CommandError('--skipNewer and --replaceNewer are incompatible')
    elif args.replaceNewer:
        newer_file_mode = NewerFileSyncMode.REPLACE
    elif args.skipNewer:
        newer_file_mode = NewerFileSyncMode.SKIP
    else:
        newer_file_mode = NewerFileSyncMode.RAISE_ERROR
    if args.delete and (args.keepDays is not None):
        raise CommandError('--delete and --keepDays are incompatible')
    if args.compareVersions == 'none':
        compare_version_mode = CompareVersionMode.NONE
    elif args.compareVersions == 'modTime':
        compare_version_mode = CompareVersionMode.MODTIME
    elif args.compareVersions == 'size':
        compare_version_mode = CompareVersionMode.SIZE
    elif args.compareVersions is None:
        compare_version_mode = CompareVersionMode.MODTIME
    else:
        raise CommandError('Invalid option for --compareVersions')
    compare_threshold = args.compareThreshold
    keep_days = None
    if args.delete:
        keep_days_or_delete = KeepOrDeleteMode.DELETE
    elif args.keepDays:
        keep_days_or_delete = KeepOrDeleteMode.KEEP_BEFORE_DELETE
        keep_days = args.keepDays
    else:
        keep_days_or_delete = KeepOrDeleteMode.NO_DELETE
    return Synchronizer(
        max_workers,
        policies_manager=policies_manager,
        dry_run=dry_run,
        allow_empty_source=allow_empty_source,
        newer_file_mode=newer_file_mode,
        keep_days_or_delete=keep_days_or_delete,
        compare_version_mode=compare_version_mode,
        compare_threshold=compare_threshold,
        keep_days=keep_days,
    )