code: def _check_arguments(args, nexpr, npar, **kwargs):
      """Checks the arguments and converts into tuples of the
      form (exprs, ranges, label, rendering_kw).
  
      Parameters
      ==========
  
      args
          The arguments provided to the plot functions
      nexpr
          The number of sub-expression forming an expression to be plotted.
          For example:
          nexpr=1 for plot.
          nexpr=2 for plot_parametric: a curve is represented by a tuple of two
              elements.
          nexpr=1 for plot3d.
          nexpr=3 for plot3d_parametric_line: a curve is represented by a tuple
              of three elements.
      npar
          The number of free symbols required by the plot functions. For example,
          npar=1 for plot, npar=2 for plot3d, ...
      **kwargs :
          keyword arguments passed to the plotting function. It will be used to
          verify if ``params`` has ben provided.
  
      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), None, None)]
  
         >>> _check_arguments([cos(x), sin(x), "test"], 2, 1)
         [(cos(x), sin(x), (x, -10, 10), 'test', None)]
  
         >>> _check_arguments([cos(x), sin(x), "test", {"a": 0, "b": 1}], 2, 1)
         [(cos(x), sin(x), (x, -10, 10), 'test', {'a': 0, 'b': 1})]
  
         >>> _check_arguments([x, x**2], 1, 1)
         [(x, (x, -10, 10), None, None), (x**2, (x, -10, 10), None, None)]
      """
      if not args:
          return []
      output = []
      params = kwargs.get("params", None)
  
      if all(
          isinstance(a, (Expr, Relational, BooleanFunction))
          for a in args[:nexpr]
      ):
          # In this case, with a single plot command, we are plotting either:
          #   1. one expression
          #   2. multiple expressions over the same range
  
          exprs, ranges, label, rendering_kw = _unpack_args(*args)
          free_symbols = set().union(*[e.free_symbols for e in exprs])
          ranges = _create_ranges(exprs, ranges, npar, label, params)
  
          if nexpr > 1:
              # in case of plot_parametric or plot3d_parametric_line, there will
              # be 2 or 3 expressions defining a curve. Group them together.
              if len(exprs) == nexpr:
                  exprs = (tuple(exprs),)
          for expr in exprs:
              # need this if-else to deal with both plot/plot3d and
              # plot_parametric/plot3d_parametric_line
              is_expr = isinstance(
                  expr, (Expr, Relational, BooleanFunction)
              )
              e = (expr,) if is_expr else expr
              output.append((*e, *ranges, label, rendering_kw))
  
      else:
          # In this case, we are plotting multiple expressions, each one with its
          # range. Each "expression" to be plotted has the following form:
          # (expr, range, label) where label is optional
  
          _, ranges, labels, rendering_kw = _unpack_args(*args)
          labels = [labels] if labels else []
  
          # number of expressions
          n = (
              len(ranges)
              + len(labels)
              + (len(rendering_kw) if rendering_kw is not None else 0)
          )
          new_args = args[:-n] if n > 0 else args
  
          # at this point, new_args might just be [expr]. But I need it to be
          # [[expr]] in order to be able to loop over
          # [expr, range [opt], label [opt]]
          if not isinstance(new_args[0], (list, tuple, Tuple)):
              new_args = [new_args]
  
          # Each arg has the form (expr1, expr2, ..., range1 [optional], ...,
          #   label [optional], rendering_kw [optional])
          for arg in new_args:
              # look for "local" range and label. If there is not, use "global".
              l = [a for a in arg if isinstance(a, str)]
              if not l:
                  l = labels
              r = [a for a in arg if _is_range(a)]
              if not r:
                  r = ranges.copy()
              rend_kw = [a for a in arg if isinstance(a, dict)]
              rend_kw = (
                  rendering_kw if len(rend_kw) == 0 else rend_kw[0]
              )
  
              # NOTE: arg = arg[:nexpr] may raise an exception if lambda
              # functions are used. Execute the following instead:
              arg = [arg[i] for i in range(nexpr)]
              free_symbols = set()
              if all(not callable(a) for a in arg):
                  free_symbols = free_symbols.union(
                      *[a.free_symbols for a in arg]
                  )
              if len(r) != npar:
                  r = _create_ranges(arg, r, npar, "", params)
  
              label = None if not l else l[0]
              output.append((*arg, *r, label, rend_kw))
      return output
  
file_path: sympy/sympy/plotting/utils.py
imports: from sympy.core.containers import Tuple
  from sympy.core.basic import Basic
  from sympy.core.expr import Expr
  from sympy.core.function import AppliedUndef
  from sympy.core.relational import Relational
  from sympy.core.symbol import Dummy
  from sympy.core.sympify import sympify
  from sympy.logic.boolalg import BooleanFunction
  from sympy.sets.fancysets import ImageSet
  from sympy.sets.sets import FiniteSet
  from sympy.tensor.indexed import Indexed
label_desc: Use image node_id 7 for calling a global function with example usage: _check_arguments(args, nexpr, npar) and returns: output, list