Rotates all source renditions if configured.
@param candidates Candidate renditions
@return Virtual-rotated and sorted candidate renditions
439621
private NavigableSet<RenditionMetadata> rotateSourceRenditions(Set<RenditionMetadata> candidates) {
    if (rotation == null) {
      return new TreeSet<>(candidates);
    }
    return candidates.stream()
        .map(rendition -> new VirtualTransformedRenditionMetadata(rendition.getRendition(),
            rotateMapWidth(rendition.getWidth(), rendition.getHeight()),
            rotateMapHeight(rendition.getWidth(), rendition.getHeight()),
            null, rotation))
        .collect(Collectors.toCollection(TreeSet::new));
  }
1012329
def process(self, candidates):
        
        return sorted(candidates, key=attrgetter('score'), reverse=self.reverse)
176144
public List<StepCandidate> prioritise(String stepAsText, List<StepCandidate> candidates) {
        return prioritisingStrategy.prioritise(stepAsText, candidates);
    }
672801
def _candidates_from_grid(self, n=1000):
        """"""
        used_vectors = set(tuple(v) for v in self.X)

        # if every point has been used before, gridding is done.
        grid_size = self.grid_width ** len(self.tunables)
        if len(used_vectors) == grid_size:
            return None

        all_vectors = set(itertools.product(*self._grid_axes))
        remaining_vectors = all_vectors - used_vectors
        candidates = np.array(list(map(np.array, remaining_vectors)))

        np.random.shuffle(candidates)
        return candidates[0:n]
605138
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) {
        return candidateConstructors(constructors, collectArgTypes(args));
    }
1195842
static Positions newPositions(Matches matches) {
		if (matches == null) throw new IllegalArgumentException("null matches");
		return new BitStorePositions(matches, false, 0);
	}
433144
@SuppressWarnings("unchecked")
    protected List getCompileSourceRoots()
    {
        List roots = new ArrayList();
        roots.add(fixtureSourceDirectory.getAbsolutePath());
        return roots;
    }
1308134
protected void swapCandidateWithBest() {
		List<Point> tempPts = candidatePoints;
		candidatePoints = bestFitPoints;
		bestFitPoints = tempPts;

		int tempIndex[] = matchToInput;
		matchToInput = bestMatchToInput;
		bestMatchToInput = tempIndex;

		Model m = candidateParam;
		candidateParam = bestFitParam;
		bestFitParam = m;
	}
1148865
public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType, String source)
    {
        Iteration iterationImpl = new Iteration(new TypedNamedFramesSelector(sourceType, source));
        iterationImpl.setPayloadManager(new TypedNamedIterationPayloadManager(sourceType,
                    singleVariableIterationName(source)));
        return iterationImpl;
    }
661064
public List<Stepdoc> stepdocs(List<CandidateSteps> candidateSteps) {
        List<Stepdoc> stepdocs = new LinkedList<>();
        for (StepCandidate candidate : collectCandidates(candidateSteps)) {
            stepdocs.add(new Stepdoc(candidate));
        }
        return stepdocs;
    }
234030
@Override
	public String playOrientations() {
		StringBuilder s = new StringBuilder();

		// draw footer
		s.append(drawFooter("Symmetry Helical", "white"));

		// draw polygon
		s.append(drawPolyhedron()); // draw invisibly
		s.append(showPolyhedron());

		// draw axes
		s.append(drawAxes());
		s.append(showAxes());

		// loop over all orientations with 4 sec. delay
		for (int i = 0; i < getOrientationCount(); i++) {
			s.append(deleteHeader());
			s.append(getOrientationWithZoom(i));
			s.append(drawHeader(getOrientationName(i), "white"));
			s.append("delay 4;");
		}

		// go back to first orientation
		s.append(deleteHeader());
		s.append(getOrientationWithZoom(0));
		s.append(drawHeader(getOrientationName(0), "white"));

		return s.toString();
	}
731238
private List<String> getRotatedList(List<String> strings) {
        int index = RANDOM.nextInt(strings.size());
        List<String> rotated = new ArrayList<String>();
        for (int i = 0; i < strings.size(); i++) {
            rotated.add(strings.get(index));
            index = (index + 1) % strings.size();
        }
        return rotated;
    }
802133
def _container_candidates(self):
        
        if not self._rectangles:
            return []

        if self._rotation:
            sides = sorted(side for rect in self._rectangles for side in rect)
            max_height = sum(max(r[0], r[1]) for r in self._rectangles)
            min_width = max(min(r[0], r[1]) for r in self._rectangles)
            max_width = max_height
        else:
            sides = sorted(r[0] for r in self._rectangles)
            max_height = sum(r[1] for r in self._rectangles)
            min_width = max(r[0] for r in self._rectangles)
            max_width = sum(sides)
        
        if self._max_width and self._max_width < max_width:
            max_width = self._max_width

        if self._max_height and self._max_height < max_height:
            max_height = self._max_height

        assert(max_width>min_width)
 
        # Generate initial container widths
        candidates = [max_width, min_width]

        width = 0
        for s in reversed(sides):
            width += s
            candidates.append(width)
        
        width = 0
        for s in sides:
            width += s
            candidates.append(width)

        candidates.append(max_width)
        candidates.append(min_width)
      
        # Remove duplicates and widths too big or small
        seen = set()
        seen_add = seen.add
        candidates = [x for x in candidates if not(x in seen or seen_add(x))] 
        candidates = [x for x in candidates if not(x>max_width or x<min_width)]
        
        # Remove candidates too small to fit all the rectangles
        min_area = sum(r[0]*r[1] for r in self._rectangles)
        return [(c, max_height) for c in candidates if c*max_height>=min_area]
1041436
protected void sortResolvedResources(List<HalResource<?>> resolvedResources) {
    Comparator<HalResource<?>> comparator = getResourceComparator();
    if (comparator != null) {
      Collections.sort(resolvedResources, comparator);
    }
  }
863497
public void addLocalCandidates(List<LocalCandidateWrapper> candidatesWrapper) {
		for (LocalCandidateWrapper candidateWrapper : candidatesWrapper) {
			addLocalCandidate(candidateWrapper, false);
		}
		sortCandidates();
	}
201116
public void addPrimaryQuerySources(Collection<AliasedQuerySource> sources) {
        for (AliasedQuerySource source : sources) {
            internalAddQuerySource(source);
            if (source.getResultType() instanceof ListType) {
                isSingularValue = false;
            }
        }
    }
651393
public List<CandidateAnswer> getAllCandidateAnswer() {
        //按CandidateAnswer的分值排序
        Collections.sort(candidateAnswers);
        Collections.reverse(candidateAnswers);
        return candidateAnswers;
    }