code: def check_arguments(args, expr_len, nb_of_free_symbols):
      """
      Checks the arguments and converts into tuples of the
      form (exprs, ranges).
  
      Examples
      ========
  
      .. plot::
         :context: reset
         :format: doctest
         :include-source: True
  
         >>> from sympy import cos, sin, symbols
         >>> from sympy.plotting.plot import check_arguments
         >>> x = symbols('x')
         >>> check_arguments([cos(x), sin(x)], 2, 1)
             [(cos(x), sin(x), (x, -10, 10))]
  
         >>> check_arguments([x, x**2], 1, 1)
             [(x, (x, -10, 10)), (x**2, (x, -10, 10))]
      """
      if not args:
          return []
      if expr_len > 1 and isinstance(args[0], Expr):
          # Multiple expressions same range.
          # The arguments are tuples when the expression length is
          # greater than 1.
          if len(args) < expr_len:
              raise ValueError(
                  "len(args) should not be less than expr_len"
              )
          for i in range(len(args)):
              if isinstance(args[i], Tuple):
                  break
          else:
              i = len(args) + 1
  
          exprs = Tuple(*args[:i])
          free_symbols = list(
              set().union(*[e.free_symbols for e in exprs])
          )
          if len(args) == expr_len + nb_of_free_symbols:
              # Ranges given
              plots = [exprs + Tuple(*args[expr_len:])]
          else:
              default_range = Tuple(-10, 10)
              ranges = []
              for symbol in free_symbols:
                  ranges.append(Tuple(symbol) + default_range)
  
              for i in range(len(free_symbols) - nb_of_free_symbols):
                  ranges.append(Tuple(Dummy()) + default_range)
              plots = [exprs + Tuple(*ranges)]
          return plots
  
      if isinstance(args[0], Expr) or (
          isinstance(args[0], Tuple)
          and len(args[0]) == expr_len
          and expr_len != 3
      ):
          # Cannot handle expressions with number of expression = 3. It is
          # not possible to differentiate between expressions and ranges.
          # Series of plots with same range
          for i in range(len(args)):
              if (
                  isinstance(args[i], Tuple)
                  and len(args[i]) != expr_len
              ):
                  break
              if not isinstance(args[i], Tuple):
                  args[i] = Tuple(args[i])
          else:
              i = len(args) + 1
  
          exprs = args[:i]
          assert all(
              isinstance(e, Expr) for expr in exprs for e in expr
          )
          free_symbols = list(
              set().union(
                  *[e.free_symbols for expr in exprs for e in expr]
              )
          )
  
          if len(free_symbols) > nb_of_free_symbols:
              raise ValueError(
                  "The number of free_symbols in the expression "
                  "is greater than %d" % nb_of_free_symbols
              )
          if len(args) == i + nb_of_free_symbols and isinstance(
              args[i], Tuple
          ):
              ranges = Tuple(*list(args[i : i + nb_of_free_symbols]))
              plots = [expr + ranges for expr in exprs]
              return plots
          else:
              # Use default ranges.
              default_range = Tuple(-10, 10)
              ranges = []
              for symbol in free_symbols:
                  ranges.append(Tuple(symbol) + default_range)
  
              for i in range(nb_of_free_symbols - len(free_symbols)):
                  ranges.append(Tuple(Dummy()) + default_range)
              ranges = Tuple(*ranges)
              plots = [expr + ranges for expr in exprs]
              return plots
  
      elif (
          isinstance(args[0], Tuple)
          and len(args[0]) == expr_len + nb_of_free_symbols
      ):
          # Multiple plots with different ranges.
          for arg in args:
              for i in range(expr_len):
                  if not isinstance(arg[i], Expr):
                      raise ValueError(
                          "Expected an expression, given %s"
                          % str(arg[i])
                      )
              for i in range(nb_of_free_symbols):
                  if not len(arg[i + expr_len]) == 3:
                      raise ValueError(
                          "The ranges should be a tuple of "
                          "length 3, got %s" % str(arg[i + expr_len])
                      )
          return args
  
imports: from sympy.concrete.summations import Sum
  from sympy.core.containers import Tuple
  from sympy.core.expr import Expr
  from sympy.core.function import Function, AppliedUndef
  from sympy.core.symbol import Dummy, Symbol, Wild
  from sympy.external import import_module
  from sympy.functions import sign
  from sympy.plotting.backends.base_backend import Plot
  from sympy.plotting.backends.matplotlibbackend import MatplotlibBackend
  from sympy.plotting.backends.textbackend import TextBackend
  from sympy.plotting.series import LineOver1DRangeSeries, Parametric2DLineSeries, Parametric3DLineSeries, ParametricSurfaceSeries, SurfaceOver2DRangeSeries, ContourSeries
  from sympy.plotting.utils import _check_arguments, _plot_sympify
  from sympy.tensor.indexed import Indexed
  from sympy.plotting.plotgrid import PlotGrid
  from sympy.plotting.series import BaseSeries
  from sympy.plotting.series import Line2DBaseSeries
  from sympy.plotting.series import Line3DBaseSeries
  from sympy.plotting.series import SurfaceBaseSeries
  from sympy.plotting.series import List2DSeries
  from sympy.plotting.series import GenericDataSeries
  from sympy.plotting.series import centers_of_faces
  from sympy.plotting.series import centers_of_segments
  from sympy.plotting.series import flat
  from sympy.plotting.backends.base_backend import unset_show
  from sympy.plotting.backends.matplotlibbackend import _matplotlib_list
  from sympy.plotting.textplot import textplot
label_desc: Use image node_id 13 for calling a global function with example usage: check_arguments(args, expr_len, nb_of_free_symbols) and returns: list, plots, plots, plots, args