def METHOD_NAME(self):
    valid_yaml_string = _dedent(
        """\
        annotations_creators:
        - found
        language_creators:
        - found
        language:
        - en
        license:
        - unknown
        multilinguality:
        - monolingual
        pretty_name: Test Dataset
        size_categories:
        - 10K<n<100K
        source_datasets:
        - extended|other-yahoo-webscope-l6
        task_categories:
        - question-answering
        task_ids:
        - open-domain-qa
        """
    )
    assert DatasetCardData(**yaml.safe_load(valid_yaml_string)).to_dict()
    valid_yaml_with_optional_keys = _dedent(
        """\
        annotations_creators:
        - found
        language_creators:
        - found
        language:
        - en
        license:
        - unknown
        multilinguality:
        - monolingual
        pretty_name: Test Dataset
        size_categories:
        - 10K<n<100K
        source_datasets:
        - extended|other-yahoo-webscope-l6
        task_categories:
        - text-classification
        task_ids:
        - multi-class-classification
        paperswithcode_id:
        - squad
        configs:
        - en
        train-eval-index:
        - config: en
          task: text-classification
          task_id: multi_class_classification
          splits:
            train_split: train
            eval_split: test
          col_mapping:
            text: text
            label: target
          metrics:
            - type: accuracy
              name: Accuracy
        extra_gated_prompt: |
          By clicking on “Access repository” below, you also agree to ImageNet Terms of Access:
          [RESEARCHER_FULLNAME] (the "Researcher") has requested permission to use the ImageNet database (the "Database") at Princeton University and Stanford University. In exchange for such permission, Researcher hereby agrees to the following terms and conditions:
          1. Researcher shall use the Database only for non-commercial research and educational purposes.
        extra_gated_fields:
          Company: text
          Country: text
          I agree to use this model for non-commerical use ONLY: checkbox
        """
    )
    assert DatasetCardData(**yaml.safe_load(valid_yaml_with_optional_keys)).to_dict()