def METHOD_NAME(options):
    interactive = options["interactive"]
    facility_name = options["facility"]
    preset = options["preset"]
    language_id = options["language_id"]
    username = options["superusername"]
    password = options["superuserpassword"]
    if interactive:
        facility_name, preset, language_id, username, password = get_all_user_input(
            facility_name, preset, language_id, username, password
        )
    facility = get_facility_by_name(facility_name)
    if not facility and not facility_name:
        raise CommandError("No facility exists")
    try:
        device_settings = validate_device_settings(
            language_id=language_id, facility=facility, **options["device_settings"]
        )
    except ValueError as e:
        raise CommandError(str(e))
    try:
        facility_settings = validate_facility_settings(options["facility_settings"])
    except ValueError as e:
        raise CommandError(str(e))
    return (
        facility,
        facility_name,
        preset,
        facility_settings,
        device_settings,
        username,
        password,
    )