'Set up a new instance.'

def __init__(self, chroot_directory=None, working_directory='/', umask=0, uid=None, gid=None, detach_process=None, files_preserve=None, pidfile=None, stdin=None, stdout=None, stderr=None, signal_map=None):

    self.chroot_directory = chroot_directory
    self.working_directory = working_directory
    self.umask = umask
    self.files_preserve = files_preserve
    self.pidfile = pidfile
    self.stdin = stdin
    self.stdout = stdout
    self.stderr = stderr
    if (uid is None):
        uid = os.getuid()
    self.uid = uid
    if (gid is None):
        gid = os.getgid()
    self.gid = gid
    if (detach_process is None):
        detach_process = is_detach_process_context_required()
    self.detach_process = detach_process
    if (signal_map is None):
        signal_map = make_default_signal_map()
    self.signal_map = signal_map
    self._is_open = False
