def METHOD_NAME(self, *args, **options):
    if options["args_from_database"]:
        options = self.get_args_from_database()
    log.info("The `clean_stale_certificate_available_dates` command is starting.")
    course_runs = options.get("course_runs")
    for run in course_runs:
        # verify that the course-key specified is valid
        logging.info(f"Checking that '{run}' is a parsable CourseKey")
        try:
            course_key = CourseKey.from_string(run)
        except InvalidKeyError as key_error:
            raise CommandError(f"{run} is not a parsable CourseKey") from key_error
        course = get_course_by_id(course_key)
        self.log_certificate_info_for_course(course, run)
        if options['delete']:
            if not course.self_paced:
                raise CommandError(
                    f"The course '{run}' is instructor-paced and the certificate availability date can be adjusted "
                    "via Studio in the UI. Aborting operation."
                )
            logging.info(f"Attempting to remove the certificate available date in course '{run}'")
            self.update_course_settings(course)