Open the connection with the device.
352949
def open(self):
        """"""
        try:
            self.device.open()
        except ConnectTimeoutError as cte:
            raise ConnectionException(cte.msg)
        self.device.timeout = self.timeout
        self.device._conn._session.transport.set_keepalive(self.keepalive)
        if hasattr(self.device, "cu"):
            # make sure to remove the cu attr from previous session
            # ValueError: requested attribute name cu already exists
            del self.device.cu
        self.device.bind(cu=Config)
        if not self.lock_disable and self.session_config_lock:
            self._lock()
544163
def open(self):
        """"""
        url = self.url
        try:
            request = urllib.request.Request(url)
            handle = urllib.request.build_opener()
        except IOError:
            return None
        return (request, handle)
82555
def open(self):
        
        self.device = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.device.settimeout(self.timeout)
        self.device.connect((self.host, self.port))

        if self.device is None:
            print("Could not open socket for {0}".format(self.host))
210890
def _on_connection_open(self, connection):
        
        _log.info("Successfully opened connection to %s", connection.params.host)
        self._channel = connection.channel(on_open_callback=self._on_channel_open)
881419
def open(self):
        
        self.device = serial.Serial(port=self.devfile, baudrate=self.baudrate, bytesize=self.bytesize, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=self.timeout, dsrdtr=True)

        if self.device is not None:
            print "Serial printer enabled"
        else:
            print "Unable to open serial printer on: %s" % self.devfile
728789
def open(self):
		
		if self.connection:
			# Nothing to do if the connection is already open.
			return False

		self.connection = self._get_twilio_client()
		return True
352242
def connect(self):
        '''
        
        '''
        if self._port:
            self._driver = MagDeckDriver()
            self._driver.connect(self._port)
            self._device_info = self._driver.get_device_info()
        else:
            # Sanity check: Should never happen, because connect should
            # never be called without a port on Module
            raise MissingDevicePortError(
                "MagDeck couldnt connect to port {}".format(self._port)
            )
1245705
def open
      context = LIBUSB::Context.new
      device = context.devices(:idVendor => LEGO_VENDOR_ID, :idProduct => NXT_PRODUCT_ID).first
      raise ::LegoNXT::NoDeviceError.new("Please make sure the device is plugged in and powered on") if device.nil?
      @handle = device.open
      @handle.claim_interface(0)
    end
847677
def open(self):
        
        handle = libusb1.libusb_device_handle_p()
        mayRaiseUSBError(libusb1.libusb_open(self.device_p, byref(handle)))
        result = USBDeviceHandle(self.__context, handle, self)
        self.__close_set.add(result)
        return result
838691
def open(self):
        
        LOGGER.debug('Connection Opening')
        self.set_state(self.OPENING)
        self._exceptions = []
        self._channels = {}
        self._last_channel_id = None
        self._io.open()
        self._send_handshake()
        self._wait_for_connection_state(state=Stateful.OPEN)
        self.heartbeat.start(self._exceptions)
        LOGGER.debug('Connection Opened')
527368
def open(cls, **kwargs):
    """"""
    handle_iter = cls.iter_open(**kwargs)

    try:
      handle = six.next(handle_iter)
    except StopIteration:
      # No matching interface, raise.
      raise usb_exceptions.DeviceNotFoundError(
          'Open failed with args: %s', kwargs)

    try:
      multiple_handle = six.next(handle_iter)
    except StopIteration:
      # Exactly one matching device, return it.
      return handle

    # We have more than one device, close the ones we opened and bail.
    handle.close()
    multiple_handle.close()
    raise usb_exceptions.MultipleInterfacesFoundError(kwargs)
1014858
def open_connection(self):
        
        if self.readthread is not None:
            raise DutConnectionError("Trying to open serial port which was already open")

        self.logger.info("Open Connection "
                         "for '%s' using '%s' baudrate: %d" % (self.dut_name,
                                                               self.comport,
                                                               self.serial_baudrate),
                         extra={'type': '<->'})
        if self.serial_xonxoff:
            self.logger.debug("Use software flow control for dut: %s" % self.dut_name)
        if self.serial_rtscts:
            self.logger.debug("Use hardware flow control for dut: %s" % self.dut_name)
        try:
            self.port = EnhancedSerial(self.comport)
            self.port.baudrate = self.serial_baudrate
            self.port.timeout = self.serial_timeout
            self.port.xonxoff = self.serial_xonxoff
            self.port.rtscts = self.serial_rtscts
            self.port.flushInput()
            self.port.flushOutput()
        except SerialException as err:
            self.logger.warning(err)
            raise DutConnectionError(str(err))
        except ValueError as err:
            self.logger.warning(err)
            raise ValueError(str(err))

        if self.ch_mode:
            self.logger.info("Use chunk-mode with size %d, delay: %.3f when write data" %
                             (self.ch_mode_chunk_size, self.ch_mode_ch_delay),
                             extra={'type': '<->'})
            time.sleep(self.ch_mode_start_delay)
        else:
            self.logger.info("Use normal serial write mode", extra={'type': '<->'})
        if self.params.reset:
            self.reset()
        # Start the serial reading thread
        self.readthread = Thread(name=self.name, target=self.run)
        self.readthread.start()
743578
protected void openToThePublic ()
    {
        if (getListenPorts().length != 0 && !_socketAcceptor.bind()) {
            queueShutdown();
        } else {
            _datagramReader.bind();
            _conmgr.start();
        }
    }
612992
def start(self):
        """"""
        connect_thread = threading.Thread(target=self._connect)
        connect_thread.start()
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
283611
def open_connection(request)
      connection = ConnectionAdapters.establish_connection(request, dispatcher)

      assign_connection_id connection
      register_user_connection connection

      connections[connection.id] = connection

      info "Connection opened: #{connection}"
      connection.rack_response
    end
1203920
def open(self):
        """"""
        if self.comm is None:
            state, buffer_paths, buffers = _remove_buffers(self.get_state())

            args = dict(target_name='jupyter.widget',
                        data={'state': state, 'buffer_paths': buffer_paths},
                        buffers=buffers,
                        metadata={'version': __protocol_version__}
                        )
            if self._model_id is not None:
                args['comm_id'] = self._model_id

            self.comm = Comm(**args)