def __enter__(self):
    '\n        Enter the context\n        Args:\n            self: The class itself\n        '
    import sys
    self.sys = sys
    self.saved_streams = saved_streams = (sys.__stdout__, sys.__stderr__)
    self.fds = fds = [s.fileno() for s in saved_streams]
    self.saved_fds = map(os.dup, fds)
    for s in saved_streams:
        s.flush()
    if self.combine:
        null_streams = ([open(self.outfiles[0], self.mode, 0)] * 2)
        if (self.outfiles[0] != os.devnull):
            (sys.stdout, sys.stderr) = map(os.fdopen, fds, (['w'] * 2), ([0] * 2))
    else:
        null_streams = [open(f, self.mode, 0) for f in self.outfiles]
    self.null_fds = null_fds = [s.fileno() for s in null_streams]
    self.null_streams = null_streams
    map(os.dup2, null_fds, fds)
Enter the context
Args:
    self: The class itself
def __enter__(self):
    '\n        Enter the context\n        Args:\n            self: The class itself\n        '
    import sys
    self.sys = sys
    self.saved_streams = saved_streams = (sys.__stdout__, sys.__stderr__)
    self.fds = fds = [s.fileno() for s in saved_streams]
    self.saved_fds = map(os.dup, fds)
    for s in saved_streams:
        s.flush()
    if self.combine:
        null_streams = ([open(self.outfiles[0], self.mode, 0)] * 2)
        if (self.outfiles[0] != os.devnull):
            (sys.stdout, sys.stderr) = map(os.fdopen, fds, (['w'] * 2), ([0] * 2))
    else:
        null_streams = [open(f, self.mode, 0) for f in self.outfiles]
    self.null_fds = null_fds = [s.fileno() for s in null_streams]
    self.null_streams = null_streams
    map(os.dup2, null_fds, fds)