class_docstr: Class for tracking options.
  
  Functions like a dict, but allows us to track the history of arguments as they are
  set.
class_docstr_tok: ["Class","for","tracking","options",".","Functions","like","a","dict",",","but","allows","us","to","track","the","history","of","arguments","as","they","are","set","."]
docstr: Override deepcopy so that history is copied over to new object.
docstr_tok: ["Override","deepcopy","so","that","history","is","copied","over","to","new","object","."]
code: def __deepcopy__(self, memo):
      """
      Override deepcopy so that history is copied over to new object.
      """
      # track location of deepcopy
      loc = traceback.format_stack(limit=3)[-3]
      self.deepcopies.append(loc)
      # copy all our children
      memo = Opt({k: copy.deepcopy(v) for k, v in self.items()})
      # deepcopy the history. history is only tuples, so we can do it shallow
      memo.history = copy.copy(self.history)
      # deepcopy the list of deepcopies. also shallow bc only strings
      memo.deepcopies = copy.copy(self.deepcopies)
      return memo
  
imports: from __future__ import annotations
  import copy
  import json
  import pickle
  import traceback
  import os
  import pkg_resources
  import parlai.utils.logging
  from typing import List
  from parlai.utils.io import PathManager
label_desc: Use image node_id 6 for calling the Opt obj's underlying member method code with example usage: obj.__deepcopy__(memo) and returns: memo