Open the device.
508853
def open(self):
        """"""
        self._serial.port = self._port
        self._serial.baudrate = self._baud
        self._serial.timeout = self._timeout
        self._serial.open()
        self._serial.flushInput()
        self._serial.flushOutput()
13336
def main():
    
    try:
        # Retrieve the first USB device
        device = AlarmDecoder(SerialDevice(interface=SERIAL_DEVICE))

        # Set up an event handler and open the device
        device.on_alarm += handle_alarm
        with device.open(baudrate=BAUDRATE):
            while True:
                time.sleep(1)

    except Exception as ex:
        print('Exception:', ex)
1251724
def open(self):
        """"""
        filename = self.dialogs.getOpenFileName(filter="*.%s" % self.FTYPE)
        if filename:
            self.new(filename)
383451
def Start(self):
    """"""
    self.state.shadows = []
    self.state.raw_device = None

    self.CallClient(
        server_stubs.WmiQuery,
        query="SELECT * FROM Win32_ShadowCopy",
        next_state="ListDeviceDirectories")
179426
async def start(self):
        """"""
        _LOGGER.debug('Initializing pyEight Version: %s', __version__)
        await self.fetch_token()
        if self._token is not None:
            await self.fetch_device_list()
            await self.assign_users()
            return True
        else:
            # We couldn't authenticate
            return False
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
36013
def devices(self):
        """"""
        return [StartActionItem(
            self.start_action,
            i,
            self.state,
            self.path,
            self.raw) for i in range(
                len(self.raw[ROOT_START_ACTION]))]
735327
def open(self):
        """"""
        self._id = str(uuid.uuid4())
        self._client.open_connection(self._id, info=self._connection_args)
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)
1119631
def up(self):
        '''  '''

        # Get existing device flags
        ifreq = struct.pack('16sh', self.name, 0)
        flags = struct.unpack('16sh', fcntl.ioctl(sockfd, SIOCGIFFLAGS, ifreq))[1]

        # Set new flags
        flags = flags | IFF_UP
        ifreq = struct.pack('16sh', self.name, flags)
        fcntl.ioctl(sockfd, SIOCSIFFLAGS, ifreq)
39510
def start(self):
        ''''''
        self.update_device_info()
        self.get_device_status(0) # start addons.
        self.hook()
        self.thread = threading.Thread(target=self._run)
        self.thread.start()
        self.running = True
324506
def open(self):
        
        self.device = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.device.connect((self.host, self.port))

        if self.device is None:
            print "Could not open socket for %s" % self.host
750203
def open(self):
        """"""
        try:
            self.device.open()
        except ConnectTimeoutError as cte:
            raise ConnectionException(cte.message)
        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 self.config_lock:
            self._lock()
1336231
function Device (device, sp) {
  if (!(device && sp))
    throw new Error('a Device and a SerialPort must be passed');

  for (var i in device)
    this[i] = device[i];

  this._open = false;
  this._sp = sp;

  EventEmitter.call(this);
}
1289730
def open(self):
        
        self._sendCmd(self.REG_PWR_MGMT_1, 0x00)
        self._sendCmd(self.REG_PWR_MGMT_2, 0x00)
497118
def device(self):
		

		hdevice = self._libinput.libinput_event_get_device(self._hevent)
		return Device(hdevice, self._libinput)
1328995
def start(self):
        
        # open device
        openni2.initialize(PrimesenseSensor.OPENNI2_PATH)
        self._device = openni2.Device.open_any()

        # open depth stream
        self._depth_stream = self._device.create_depth_stream()
        self._depth_stream.configure_mode(PrimesenseSensor.DEPTH_IM_WIDTH,
                                          PrimesenseSensor.DEPTH_IM_HEIGHT,
                                          PrimesenseSensor.FPS,
                                          openni2.PIXEL_FORMAT_DEPTH_1_MM) 
        self._depth_stream.start()

        # open color stream
        self._color_stream = self._device.create_color_stream()
        self._color_stream.configure_mode(PrimesenseSensor.COLOR_IM_WIDTH,
                                          PrimesenseSensor.COLOR_IM_HEIGHT,
                                          PrimesenseSensor.FPS,
                                          openni2.PIXEL_FORMAT_RGB888) 
        self._color_stream.camera.set_auto_white_balance(self._auto_white_balance)
        self._color_stream.camera.set_auto_exposure(self._auto_exposure)
        self._color_stream.start()

        # configure device
        if self._registration_mode == PrimesenseRegistrationMode.DEPTH_TO_COLOR:
            self._device.set_image_registration_mode(openni2.IMAGE_REGISTRATION_DEPTH_TO_COLOR)
        else:
            self._device.set_image_registration_mode(openni2.IMAGE_REGISTRATION_OFF)

        self._device.set_depth_color_sync_enabled(self._enable_depth_color_sync)

        self._running = True