code: def connect(self, hardware: hc.API):
          
          self._hw_manager.set_hw(hardware)
          self._hw_manager.hardware.cache_instruments()
docs: Connect to a running hardware API.
  
          This can be either a simulator or a full hardware controller.
  
          Note that there is no true disconnected state for a
          :py:class:`.ProtocolContext`; :py:meth:`disconnect` simply creates
          a new simulator and replaces the current hardware with it.