code: def teardown(self, np=np):
      
  
      if self.old_err is not None:
          np.seterr(**self.old_err)
  
      if self.old_opts is not None:
          np.set_printoptions(**self.old_opts)
docs: Lives in zipline.__init__ for doctests.