def list_resources(self, session, query='?*::INSTR'):
        """Returns a tuple of all connected devices matching query.

        :param query: regular expression used to match devices.
        """

        resources = []

        try:
            find_list, return_counter, instrument_description, err = self.find_resources(session, query)
        except errors.VisaIOError as e:
            if e.error_code == constants.StatusCode.error_resource_not_found:
                return tuple()
            raise e

        resources.append(instrument_description)
        for i in range(return_counter - 1):
            resources.append(self.find_next(find_list)[0])

        self.close(find_list)

        return tuple(resource for resource in resources)
dataset/ETHPy150Open hgrecco/pyvisa/pyvisa/ctwrapper/highlevel.py/NIVisaLibrary.list_resources/original