class_docstr: Loads the NQ Sample data for testing purposes.
class_docstr_tok: ["Loads","the","NQ","Sample","data","for","testing","purposes","."]
code: def __init__(self, opt, shared=None):
      build_sample(opt)
      self.use_html = opt.get("use_html", False)
      self.use_long_answer = opt.get("use_long_answer", False)
      self.use_context = opt.get("use_context", False)
      self.id = "natural_questions"
      self.opt = copy.deepcopy(opt)
      self.dtype = DatatypeHelper.fold(self.opt["datatype"])
      if self.dtype == "test":
          logging.error(
              "No test split for this teacher; overriding to valid"
          )
          self.dtype = "valid"
      self.dpath = os.path.join(
          self.opt["datapath"],
          f"{DATASET_NAME_LOCAL}_sample",
          self.dtype,
      )
      self.n_samples = None
      ChunkTeacher.__init__(self, self.opt, shared)
  
imports: import copy
  import os
  import json
  import jsonlines
  from typing import List, Optional, Tuple
  from parlai.core.teachers import ChunkTeacher, DialogTeacher
  from .build import build, DATASET_NAME_LOCAL, build_sample
  from .build_open import build
  from .utils.text_utils import simplify_nq_example
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.core.metrics import ExactMatchMetric, normalize_answer, AverageMetric
  from parlai.core.params import ParlaiParser
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  import parlai.utils.logging
label_desc: Use image node_id 1 to create a new NaturalQuestionsSampleTeacher object from inherited base classes: NaturalQuestionsTeacher with example: obj = NaturalQuestionsSampleTeacher(opt, shared)