def METHOD_NAME(
    tensors: List[TileableType], by: TileableType, ascending: bool = True
) -> List[TileableType]:
    # sort tensors by another tensor
    i_to_tensors = {i: t for i, t in enumerate(tensors)}
    if by not in tensors:
        by_name = len(i_to_tensors)
        i_to_tensors[by_name] = by
    else:
        by_name = tensors.index(by)
    df = DataFrame(i_to_tensors)
    sorted_df = df.sort_values(by_name, ascending=ascending)
    return [sorted_df[i].to_tensor() for i in range(len(tensors))]