code: def adapt_result(result, initial_shapes, args_kwargs_types, is_scal):
      """Adapt shape of output.
  
      This function squeezes the dim 0 or 1 of the output, depending on:
  
      - the type of the output: scalar vs else,
      - the initial shapes or args and kwargs provided by the user.
  
      Parameters
      ----------
      result : unspecified
          Output of the function.
      initial_shapes : list
          Shapes of args and kwargs provided by the user.
      args_kwargs_types : list
          Types of args and kwargs.
      is_scal : bool
          Boolean determining if the output 'result' is a scalar.
  
      Returns
      -------
      result : unspecified
          Output of the function, with adapted shape.
      """
      if squeeze_output_dim_1(
          result, initial_shapes, args_kwargs_types, is_scal
      ):
          if result.shape[1] == 1:
              result = gs.squeeze(result, axis=1)
  
      if (
          squeeze_output_dim_0(
              result, initial_shapes, args_kwargs_types
          )
          and result.shape[0] == 1
      ):
          result = gs.squeeze(result, axis=0)
  
      return result
  
file_path: geomstats/geomstats/vectorization.py
imports: import math
  import geomstats.backend
label_desc: Use image node_id 13 for calling a global function with example usage: adapt_result(result, initial_shapes, args_kwargs_types, is_scal) and returns: result