slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.
438448
def slave_open(tty_name):
    """"""

    result = os.open(tty_name, os.O_RDWR)
    try:
        from fcntl import ioctl, I_PUSH
    except ImportError:
        return result
    try:
        ioctl(result, I_PUSH, "ptem")
        ioctl(result, I_PUSH, "ldterm")
    except OSError:
        pass
    return result
464897
def open_readable(self, name):
        
        # print("FTP open_readable({})".format(name))
        assert compat.is_native(name)
        out = SpooledTemporaryFile(max_size=self.MAX_SPOOL_MEM, mode="w+b")
        self.ftp.retrbinary(
            "RETR {}".format(name), out.write, FtpTarget.DEFAULT_BLOCKSIZE
        )
        out.seek(0)
        return out
786639
def open(self, fp, mode='r'):
        
        self._file = open(fp, mode=mode)
        return self._file
975787
def open(self):
        

        logger.debug('Connecting to device %s, vdom %s' % (self.hostname, self.vdom))

        self.ssh = paramiko.SSHClient()
        self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

        cfg = {
            'hostname': self.hostname,
            'timeout': self.timeout,
            'username': self.username,
            'password': self.password,
            'key_filename': self.keyfile
        }

        if os.path.exists(os.path.expanduser("~/.ssh/config")):
            ssh_config = paramiko.SSHConfig()
            user_config_file = os.path.expanduser("~/.ssh/config")
            with io.open(user_config_file, 'rt', encoding='utf-8') as f:
                ssh_config.parse(f)

            host_conf = ssh_config.lookup(self.hostname)
            if host_conf:
                if 'proxycommand' in host_conf:
                    cfg['sock'] = paramiko.ProxyCommand(host_conf['proxycommand'])
                if 'user' in host_conf:
                    cfg['username'] = host_conf['user']
                if 'identityfile' in host_conf:
                    cfg['key_filename'] = host_conf['identityfile']
                if 'hostname' in host_conf:
                    cfg['hostname'] = host_conf['hostname']

        self.ssh.connect(**cfg)
463326
def open(self, filename, mode='r', bufsize=-1):
        
        sftp_client = self.open_sftp()
        return sftp_client.open(filename, mode, bufsize)
392661
def open_file(filepath):
    
    if sys.platform.startswith('darwin'):
        subprocess.Popen(('open', filepath))
    elif os.name == 'nt':
        os.startfile(filepath)
    elif os.name == 'posix':
        subprocess.Popen(('xdg-open', filepath))
450482
def _asyncio_open_serial_unix(path):
    

    try:
        # wait for VM to create the pipe file.
        yield from wait_for_file_creation(path)
    except asyncio.TimeoutError:
        raise NodeError('Pipe file "{}" is missing'.format(path))

    output = SerialReaderWriterProtocol()
    try:
        yield from asyncio.get_event_loop().create_unix_connection(lambda: output, path)
    except ConnectionRefusedError:
        raise NodeError('Can\'t open pipe file "{}"'.format(path))
    return output
1349081
async def open_interface(self, conn_id, interface):
        

        resp = await self._execute(self._adapter.open_interface_sync, conn_id, interface)
        _raise_error(conn_id, 'open_interface', resp)
119420
def acquire(self):
        
        try:
            pidfile = open(self._pidfile, "a")
        except IOError as err:
            raise SystemExit(err)
        try:
            fcntl.flock(pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
        except IOError:
            raise SystemExit('Already running according to ' + self._pidfile)
        pidfile.seek(0)
        pidfile.truncate()
        pidfile.write(str(os.getpid()) + '\n')
        pidfile.flush()
        self.pidfile = pidfile
        atexit.register(self.release)
12152
function openSerialPortDevice(readFd) {
		//Save TTY streams
		self._readStream = new tty.ReadStream(readFd);
		self._readStream.setRawMode(true);
		self._writeStream = self._readStream;
		//Setup error handlers
		self._readStream.on("error", function(err) {
			self.emit("error", err);
		});
		//Setup read event handlers
		self._readStream.on("data", function(chunk) {
			self.push(chunk);
		});
		self._readStream.on("end", function() {
			self.push(null);
		});
		self._readStream.on("close", function() {
			self.emit("close");
		});
		//Emit open event
		self.emit("open",self._readStream);
	}
1225239
def openpty():
    """"""

    try:
        return os.openpty()
    except (AttributeError, OSError):
        pass
    master_fd, slave_name = _open_terminal()
    slave_fd = slave_open(slave_name)
    return master_fd, slave_fd
141584
def open(self):
        '''  '''
        self.fd = open('/dev/net/tun', 'rb+', buffering=0)
        tun_flags = IFF_TAP | IFF_NO_PI | IFF_PERSIST
        ifr = struct.pack('16sH', self.name, tun_flags)
        fcntl.ioctl(self.fd, TUNSETIFF, ifr)
        fcntl.ioctl(self.fd, TUNSETOWNER, os.getuid())
        self.ifflags = self.ifflags | IFF_RUNNING
1348896
def _get_slave_enabled(self, dpid, port):
        """"""
        slave = self._get_slave(dpid, port)
        if slave:
            return slave['enabled']
        else:
            return False
828840
def try_open (*args, **kwargs):
    
    try:
        return io.open (*args, **kwargs)
    except IOError as e:
        if e.errno == 2:
            return None
        raise
161826
async def open(self) -> '_BaseAgent':
        

        LOGGER.debug('_BaseAgent.open >>>')

        # Do not open pool independently: let relying party decide when to go on-line and off-line
        await self.wallet.open()

        LOGGER.debug('_BaseAgent.open <<<')
        return self
863601
def open(self, *args, **kwargs):
        
        with io_error_compat():
            return io.open(self, *args, **kwargs)
1189321
def ensure_process_group_controls_the_tty
      return unless STDIN.isatty

      tty_pgrp = Termios.tcgetpgrp(STDIN)
      while ![Process.pid, Process.getpgrp].include?(tty_pgrp)
        Termios.tcsetpgrp(STDIN, Process.pid)
        sleep 0.1
      end
    end