code: def rearrange(tensor: Tensor, pattern: str, **axes_lengths) -> Tensor:
      return reduce(
          tensor, pattern, reduction="rearrange", **axes_lengths
      )
  
file_path: einops/einops/array_api.py
imports: from typing import List, Tuple, Sequence
  from .einops import Tensor, Reduction, EinopsError, _prepare_transformation_recipe, _apply_recipe_array_api
  from .packing import analyze_pattern, prod
label_desc: Use image node_id 3 for calling a global function with example usage: rearrange(tensor, pattern) and returns: reduce