class_docstr: Suppress stderr. Useful as OpenCV (and dependencies) can produce a lot of output.
class_docstr_tok: ["Suppress","stderr",".","Useful","as","OpenCV","(","and","dependencies",")","can","produce","a","lot","of","output","."]
code: def __enter__(self):
      self.errnull_file = open(os.devnull, "w")
      self.old_stderr_fileno_undup = sys.stderr.fileno()
      self.old_stderr_fileno = os.dup(sys.stderr.fileno())
      self.old_stderr = sys.stderr
      os.dup2(self.errnull_file.fileno(), self.old_stderr_fileno_undup)
      sys.stderr = self.errnull_file
      return self
  
imports: from __future__ import annotations
  import os
  import sys
  import tempfile
  from collections.abc import Callable
  from typing import TYPE_CHECKING, Any
  import numpy
  from torch.utils.data import Dataset, IterableDataset
  from monai.utils.enums import ColorOrder
  from monai.utils.module import optional_import
label_desc: Use image node_id 1 for calling the SuppressStderr obj's underlying member method code with example usage: obj.__enter__() and returns: self