class_docstr: Data source for DPR (https://github.com/facebookresearch/DPR).
  
  Expects multiline json for lazy loading and improved memory usage.
  The original DPR files can be converted to multiline json using `jq -c .[]`
class_docstr_tok: ["Data","source","for","DPR","(","https",":","\/\/github.com\/facebookresearch\/DPR",")",".","Expects","multiline","json","for","lazy","loading","and","improved","memory","usage",".","The","original","DPR","files","can","be","converted","to","multiline","json","using","`","jq","-c",".","[","]","`"]
code: def read_file(self, fname):
      if self.use_cache and fname in self.cache:
          for row in self.cache[fname]:
              yield row
      else:
          with PathManager.open(fname) as infile:
              # Code pointer: https://fburl.com/yv8osgvo
              for line in infile:
                  row = json.loads(line)
  
                  if self.use_cache:
                      self.cache[fname] = self.cache.get(fname, [])
                      self.cache[fname].append(row)
  
                  yield row
  
file_path: pytext/pytext/data/sources/dense_retrieval.py
imports: import json
  import random
  from typing import List, Optional
  from pytext.data.sources.data_source import DataSource, generator_property
  from pytext.utils.file_io import PathManager
label_desc: Use image node_id 6 for calling the DenseRetrievalDataSource obj's underlying member method code with example usage: obj.read_file(fname) without return types