code: def data_rows_to_partial_examples(
      data_rows: List[PartialDataRow],
  ) -> List[squad_utils.PartialExample]:
      qas_id_to_data_rows = {}
      for i, data_row in enumerate(data_rows):
          data_row.unique_id = 1000000000 + i
          if data_row.qas_id not in qas_id_to_data_rows:
              qas_id_to_data_rows[data_row.qas_id] = []
          qas_id_to_data_rows[data_row.qas_id].append(data_row)
      partial_examples = []
      for qas_id in sorted(list(qas_id_to_data_rows.keys())):
          first_data_row = qas_id_to_data_rows[qas_id][0]
          partial_examples.append(
              squad_utils.PartialExample(
                  doc_tokens=first_data_row.doc_tokens,
                  qas_id=first_data_row.qas_id,
                  partial_features=[
                      squad_utils.PartialFeatures(
                          unique_id=data_row.unique_id,
                          tokens=data_row.tokens,
                          token_to_orig_map=data_row.token_to_orig_map,
                          token_is_max_context=data_row.token_is_max_context,
                      )
                      for data_row in qas_id_to_data_rows[qas_id]
                  ],
                  answers=first_data_row.answers,
              )
          )
      return partial_examples
  
imports: import json
  import numpy
  import torch
  from dataclasses import dataclass
  from typing import Union, List, Dict, Optional
  from transformers.models.bert.tokenization_bert import whitespace_tokenize
  from transformers.tokenization_utils_base import TruncationStrategy
  from jiant.tasks.lib.templates.squad_style import utils
  from jiant.shared.constants import PHASE
  from jiant.tasks.core import BaseExample, BaseDataRow, BatchMixin, Task, TaskTypes
  from jiant.utils.python.datastructures import ExtendedDataClassMixin
  from jiant.utils.display import maybe_tqdm
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: data_rows_to_partial_examples(data_rows) and returns: partial_examples