class_docstr: Schema for handling the request of clearing task instance of a Dag.
docstr: Validate clear task instance form.
code: def validate_form(self, data, **kwargs):
      """Validate clear task instance form."""
      if data["only_failed"] and data["only_running"]:
          raise ValidationError(
              "only_failed and only_running both are set to True"
          )
      if data["start_date"] and data["end_date"]:
          if data["start_date"] > data["end_date"]:
              raise ValidationError(
                  "end_date is sooner than start_date"
              )
      if data["start_date"] and data["end_date"] and data["dag_run_id"]:
          raise ValidationError(
              "Exactly one of dag_run_id or (start_date and end_date) must be provided"
          )
      if data["start_date"] and data["dag_run_id"]:
          raise ValidationError(
              "Exactly one of dag_run_id or start_date must be provided"
          )
      if data["end_date"] and data["dag_run_id"]:
          raise ValidationError(
              "Exactly one of dag_run_id or end_date must be provided"
          )
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, NamedTuple
  from marshmallow import Schema, ValidationError, fields, validate, validates_schema
  from marshmallow.utils import get_value
  from marshmallow_sqlalchemy import SQLAlchemySchema, auto_field
  from airflow.api_connexion.parameters import validate_istimezone
  from airflow.api_connexion.schemas.common_schema import JsonObjectField
  from airflow.api_connexion.schemas.enum_schemas import TaskInstanceStateField
  from airflow.api_connexion.schemas.job_schema import JobSchema
  from airflow.api_connexion.schemas.sla_miss_schema import SlaMissSchema
  from airflow.api_connexion.schemas.trigger_schema import TriggerSchema
  from airflow.models import TaskInstance
  from airflow.utils.helpers import exactly_one
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 1 for calling the ClearTaskInstanceFormSchema obj's underlying member method code with example usage: obj.validate_form(data) without return types