code: def sort_by(
      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))]
  
imports: import math
  import numbers
  import warnings
  from typing import List
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from ...None import options
  from ...core import enter_mode
  from ...typing import TileableType
  from ...dataframe import DataFrame, Series
  from ...dataframe.core import DATAFRAME_TYPE, SERIES_TYPE
  from ...tensor import tensor
  from ...utils import parse_readable_size
label_desc: Use image node_id 6 for calling a global function with example usage: sort_by(tensors, by, ascending) and returns: unknown