docstr: Overrides the default options for this interactor.
  
  Note! This method should only be used if you spawn your own Interactor; do not
  call it on ``defaultInteractor``. Instead, use ``defaultInteractor.optsContext``,
  which is guaranteed to revert to the default options when the context expires.
  
  Parameters
  ----------
  opts
      Keyword arguments to override the default options
  
  Returns
  -------
      dict of previous options that were overridden. This is useful for resetting
      the options afterward.
docstr_tok: ["Overrides","the","default","options","for","this","interactor",".","Note","!","This","method","should","only","be","used","if","you","spawn","your","own","Interactor",";","do","not","call","it","on","``","defaultInteractor","``",".","Instead",",","use","``","defaultInteractor.optsContext","``",",","which","is","guaranteed","to","revert","to","the","default","options","when","the","context","expires",".","Parameters","--","--","--","--","--","opts","Keyword","arguments","to","override","the","default","options","Returns","--","--","--","-","dict","of","previous","options","that","were","overridden",".","This","is","useful","for","resetting","the","options","afterward","."]
code: def setOpts(self, **opts):
      """
      Overrides the default options for this interactor.
  
      Note! This method should only be used if you spawn your own Interactor; do not
      call it on ``defaultInteractor``. Instead, use ``defaultInteractor.optsContext``,
      which is guaranteed to revert to the default options when the context expires.
  
      Parameters
      ----------
      opts
          Keyword arguments to override the default options
  
      Returns
      -------
          dict of previous options that were overridden. This is useful for resetting
          the options afterward.
      """
      oldOpts = self.getOpts()
      allowed = set(oldOpts)
      errors = set(opts).difference(allowed)
      if errors:
          raise KeyError(
              f"Unrecognized options: {errors}. Must be one of: {allowed}"
          )
  
      toReturn = {}
      toUse = {}
      for kk, vv in opts.items():
          toReturn[kk] = oldOpts[kk]
          toUse[kk] = vv
      self.__dict__.update(toUse)
      return toReturn
  
imports: import contextlib
  import functools
  import inspect
  import pydoc
  from .None import Parameter
  from .parameterTypes import ActionGroupParameter
  from ..None import functions
label_desc: Use image node_id 2 for calling the Interactor obj's underlying member method code with example usage: obj.setOpts() and returns: toReturn