def METHOD_NAME(self, *args, **options):
    from_user = fetch_user(options["from_user"])
    to_user = fetch_user(options["to_user"])
    keep_failed_enrollments = options["keep_failed_enrollments"]
    enrollment, enrolled_obj = self.fetch_enrollment(from_user, options)
    if options["program"]:
        to_user_existing_enrolled_run_ids = (
            CourseRunEnrollment.get_program_run_enrollments(
                user=to_user, program=enrolled_obj
            ).values_list("run__courseware_id", flat=True)
        )
        if len(to_user_existing_enrolled_run_ids) > 0:
            raise CommandError(
                "'to' user is already enrolled in program runs ({})".format(
                    list(to_user_existing_enrolled_run_ids)
                )
            )
        (
            new_program_enrollment,
            new_run_enrollments,
        ) = self.create_program_enrollment(
            enrollment,
            to_user=to_user,
            keep_failed_enrollments=keep_failed_enrollments,
        )
        if new_program_enrollment and new_run_enrollments:
            deactivate_program_enrollment(
                enrollment,
                change_status=ENROLL_CHANGE_STATUS_TRANSFERRED,
                keep_failed_enrollments=keep_failed_enrollments,
            )
    else:
        new_program_enrollment = None
        new_run_enrollment = self.create_run_enrollment(
            enrollment,
            to_user=to_user,
            keep_failed_enrollments=keep_failed_enrollments,
        )
        new_run_enrollments = []
        if new_run_enrollment:
            new_run_enrollments.append(new_run_enrollment)
            deactivate_run_enrollment(
                enrollment,
                change_status=ENROLL_CHANGE_STATUS_TRANSFERRED,
                keep_failed_enrollments=keep_failed_enrollments,
            )
    if new_program_enrollment or new_run_enrollments:
        self.stdout.write(
            self.style.SUCCESS(
                "Transferred enrollment – 'from' user: {} ({}), 'to' user: {} ({})\n"
                "Enrollments created/updated: {}".format(
                    from_user.username,
                    from_user.email,
                    to_user.username,
                    to_user.email,
                    enrollment_summaries(
                        filter(bool, [new_program_enrollment] + new_run_enrollments)
                    ),
                )
            )
        )
    else:
        self.stdout.write(
            self.style.ERROR(
                "Failed to transfer enrollment – 'from' user: {} ({}), 'to' user: {} ({})\n".format(
                    from_user.username,
                    from_user.email,
                    to_user.username,
                    to_user.email,
                )
            )
        )