code: def get_clusters(self, platform, retry_contexts, all_clusters):
          ''' return clusters sorted by load. '''
  
          possible_cluster_info = {}
          candidates = set(copy.copy(all_clusters))
          while candidates and not possible_cluster_info:
              wait_for_any_cluster(retry_contexts)
  
              for cluster in sorted(candidates, key=attrgetter('priority')):
                  ctx = retry_contexts[cluster.name]
                  if ctx.in_retry_wait:
                      continue
                  if ctx.failed:
                      continue
                  try:
                      cluster_info = self.get_cluster_info(cluster, platform)
                      possible_cluster_info[cluster] = cluster_info
                  except OsbsException:
                      ctx.try_again_later(self.find_cluster_retry_delay)
              candidates -= set([c for c in candidates if retry_contexts[c.name].failed])
  
          ret = sorted(possible_cluster_info.values(), key=lambda c: c.cluster.priority)
          ret = sorted(ret, key=lambda c: c.load)
          return ref get_clusters(self, platform, retry_contexts, all_clusters):
          ''' return clusters sorted by load. '''
  
          possible_cluster_info = {}
          candidates = set(copy.copy(all_clusters))
          while candidates and not possible_cluster_info:
              wait_for_any_cluster(retry_contexts)
  
              for cluster in sorted(candidates, key=attrgetter('priority')):
                  ctx = retry_contexts[cluster.name]
                  if ctx.in_retry_wait:
                      continue
                  if ctx.failed:
                      continue
                  try:
                      cluster_info = self.get_cluster_info(cluster, platform)
                      possible_cluster_info[cluster] = cluster_info
                  except OsbsException:
                      ctx.try_again_later(self.find_cluster_retry_delay)
              candidates -= set([c for c in candidates if retry_contexts[c.name].failed])
  
          ret = sorted(possible_cluster_info.values(), key=lambda c: c.cluster.priority)
          ret = sorted(ret, key=lambda c: c.load)
          return ret
docs: return clusters sorted by load.