code: def refresh_instruments(self):
          def list_access_nested_dict(dict, somelist):
              return reduce(operator.getitem, somelist, dict)
          def update(item):
              if item.isExpanded():
                  for index in range(item.childCount()):
                      child = item.child(index)
                      if child.childCount() == 0:
                          instrument, path_to_instrument = child.get_instrument()
                          path_to_instrument.reverse()
                          try:
                              value = instrument.read_probes(path_to_instrument[-1])
                          except AssertionError:
                              value = list_access_nested_dict(instrument.settings, path_to_instrument)
                          child.value = value
                      else:
                          update(child)
          self.tree_settings.blockSignals(True)
          for index in range(self.tree_settings.topLevelItemCount()):
              instrument = self.tree_settings.topLevelItem(index)
              update(instrument)
          self.tree_settings.blockSignals(False)