original_docstring: 
          Connects to device using provided connection arguments
  
          Returns: True/False depending on the result of connection
          
docstring: Connects to device using provided connection arguments
  Returns: True/False depending on the result of connection
docstring_tokens: Connects to device using provided connection arguments Returns : True / False depending on the result of connection
code: def connect_device(self):
          """
          Connects to device using provided connection arguments
  
          Returns: True/False depending on the result of connection
          """
  
          self.client = mqtt.Client(clean_session=True, protocol=mqtt.MQTTv311, userdata=self)
          self.client.username_pw_set(self.serial_number, self._hashed_password())
          self.client.on_connect = self.on_connect
          self.client.on_disconnect = self.on_disconnect
          self.client.on_message = self.on_message
          self.client.connect(self.ip_address, port=self.port_number)
          self.client.loop_start()
  
          self._is_connected = self.connected.get(timeout=10)
  
          if self._is_connected:
              self._request_state()
  
              self.state_data = self.state_data_available.get(timeout=5)
              self.sensor_data = self.sensor_data_available.get(timeout=5)
  
              # Return True in case of successful connect and data retrieval
              return True
  
          # If any issue occurred return False
          self.client = None
          return False
code_tokens: def connect_device ( self ) : self . client = mqtt . Client ( clean_session = True , protocol = mqtt . MQTTv311 , userdata = self ) self . client . username_pw_set ( self . serial_number , self . _hashed_password ( ) ) self . client . on_connect = self . on_connect self . client . on_disconnect = self . on_disconnect self . client . on_message = self . on_message self . client . connect ( self . ip_address , port = self . port_number ) self . client . loop_start ( ) self . _is_connected = self . connected . get ( timeout = 10 ) if self . _is_connected : self . _request_state ( ) self . state_data = self . state_data_available . get ( timeout = 5 ) self . sensor_data = self . sensor_data_available . get ( timeout = 5 ) return True self . client = None return False
short_docstring: Connects to device using provided connection arguments
  Returns: True/False depending on the result of connection
short_docstring_tokens: Connects to device using provided connection arguments Returns : True / False depending on the result of connection
comment: """
          Connects to device using provided connection arguments
  
          Returns: True/False depending on the result of connection
          """$SEP$# Return True in case of successful connect and data retrieval$SEP$# If any issue occurred return False