code: def adapt_types(
      args_types, kwargs_types, opt_kwargs_types, args, kwargs
  ):
      """Adapt the list of input input_types.
  
      Some functions are implemented with array-like arguments that can be either
      'vector' or 'matrix' depending on the value of the 'point_type'
      argument.
  
      This function reads the 'point_type' argument, and adapt the actual
      type of the input array-like arguments.
  
      Parameters
      ----------
      args_types : list
          Types of args.
      kwargs_types : list
          Types of kwargs.
      opt_kwargs_types : list
          Types of optional kwargs.
      args : tuple
          Args of a function.
      kwargs : dict
          Kwargs of a function.
  
      Returns
      -------
      args_types : list
          Adapted types of args.
      kwargs_types : list
          Adapted types of kwargs.
      """
      in_args = "point_type" in args_types
      in_kwargs = "point_type" in kwargs_types
      in_optional = "point_type" in opt_kwargs_types
  
      if in_args or in_kwargs or in_optional:
          if in_args:
              i_input_type = args_types.index("point_type")
              input_type = args[i_input_type]
          elif in_kwargs:
              input_type = kwargs["point_type"]
  
          elif in_optional:
              obj = args[0]
              input_type = obj.default_point_type
              kwargs["point_type"] = input_type
              kwargs_types.append("point_type")
  
          args_types = [
              input_type if pt == FLEXIBLE_TYPE else pt
              for pt in args_types
          ]
          kwargs_types = [
              input_type if pt == FLEXIBLE_TYPE else pt
              for pt in kwargs_types
          ]
      return args_types, kwargs_types, kwargs
  
file_path: geomstats/geomstats/vectorization.py
imports: import math
  import geomstats.backend
label_desc: Use image node_id 9 for calling a global function with example usage: adapt_types(args_types, kwargs_types, opt_kwargs_types, args, kwargs) and returns: args_types,  kwargs_types,  kwargs