def METHOD_NAME(parts: List[Parts]) -> List[Parts]:
    length = len(parts)
    for lower_index in range(length):
        lower = parts[lower_index]
        for higher_index in range(lower_index + 1, length):
            higher = parts[higher_index]
            if SingleHeaderFile.depends_on(lower, higher):
                parts.remove(higher)
                parts.insert(0, higher)
                return SingleHeaderFile.METHOD_NAME(parts)
    return parts