code: def open_dut(self, port=None):
          
          if port is not None:
              self.comport = port
  
          try:
              self.open_connection()
          except (DutConnectionError, ValueError) as err:
              self.close_dut(use_prepare=False)
              raise DutConnectionError(str(err))
          except KeyboardInterrupt:
              self.close_dut(use_prepare=False)
              self.close_connection()
              raise
docs: Open connection to dut.
  
          :param port: com port to use.
          :return: