code: def sort_device(self):
          
  
          self.devices.sort()
          # idx: the indices of order-sensitive models
          # names: an ordered list of order-sensitive models
          idx = []
          names = []
          for dev in order:
              # if ``dev`` in ``order`` is a model file name:
              #   initialize the models in alphabet order
              if dev in all_models:
                  all_dev = list(sorted(all_models[dev].keys()))
                  for item in all_dev:
                      if item in self.devices:
                          idx.append(self.devices.index(item))
                          names.append(item)
  
              # if ``dev`` presents as a model name
              elif dev in self.devices:
                  idx.append(self.devices.index(dev))
                  names.append(dev)
  
          idx = sorted(idx)
          for id, name in zip(idx, names):
              self.devices[id] = name
docs: Sort device to follow the order of initialization
  
          :return: None