def METHOD_NAME(self, *args, **options):
    course_id = options['course']
    org = options['org']
    from_mode = options['from_mode']
    to_mode = options['to_mode']
    commit = options['commit']
    course_keys = []
    if course_id:
        try:
            course_key = CourseKey.from_string(course_id)
        except InvalidKeyError:
            raise CommandError(f'Course ID {course_id} is invalid.')  # lint-amnesty, pylint: disable=raise-missing-from
        if modulestore().get_course(course_key) is None:
            raise CommandError(f'The given course {course_id} does not exist.')
        course_keys.append(course_key)
    else:
        course_keys = [course.id for course in CourseOverview.get_all_courses(orgs=[org])]
        if not course_keys:
            raise CommandError(f'No courses exist for the org "{org}".')
    for course_key in course_keys:
        self.move_users_for_course(course_key, from_mode, to_mode, commit)
    if not commit:
        logger.info('Dry run, changes have not been saved. Run again with "commit" argument to save changes')