def METHOD_NAME(app_name, version_label):
    if version_label:
        app_versions = elasticbeanstalk.get_application_versions(app_name)['ApplicationVersions']
        if not any(version_label == app_version['VersionLabel'] for app_version in app_versions):
            raise ValidationError(strings['appversion.delete.notfound'].format(app_name, version_label))
        envs = elasticbeanstalk.get_app_environments(app_name)
        versions_in_use = [(e.version_label, e.name) for e in envs]
        used_envs = [version[1] for version in versions_in_use if version[0] == version_label]
        if used_envs:
            raise ValidationError(
                strings['appversion.delete.deployed'].format(
                    version_label,
                    ','.join(used_envs)
                )
            )
        should_delete = io.get_boolean_response(
            text=prompts['appversion.delete.validate'].format(version_label),
            default=True)
        if not should_delete:
            io.echo('Application Version will not be deleted.')
            delete_successful = False
        else:
            elasticbeanstalk.delete_application_version(app_name, version_label)
            io.echo('Application Version deleted successfully.')
            delete_successful = True
        return delete_successful
    else:
        raise NotFoundError(strings['appversion.delete.none'])