code: def test_Routine_argument_order():
      a, x, y, z = symbols("a x y z")
      expr = (x + y) * z
      raises(
          CodeGenArgumentListError,
          lambda: make_routine("test", expr, argument_sequence=[z, x]),
      )
      raises(
          CodeGenArgumentListError,
          lambda: make_routine(
              "test", Eq(a, expr), argument_sequence=[z, x, y]
          ),
      )
      r = make_routine(
          "test", Eq(a, expr), argument_sequence=[z, x, a, y]
      )
      assert [arg.name for arg in r.arguments] == [z, x, a, y]
      assert [type(arg) for arg in r.arguments] == [
          InputArgument,
          InputArgument,
          OutputArgument,
          InputArgument,
      ]
      r = make_routine("test", Eq(z, expr), argument_sequence=[z, x, y])
      assert [type(arg) for arg in r.arguments] == [
          InOutArgument,
          InputArgument,
          InputArgument,
      ]
  
      from sympy.tensor import IndexedBase, Idx
  
      A, B = map(IndexedBase, ["A", "B"])
      m = symbols("m", integer=True)
      i = Idx("i", m)
      r = make_routine(
          "test", Eq(A[i], B[i]), argument_sequence=[B, A, m]
      )
      assert [arg.name for arg in r.arguments] == [B.label, A.label, m]
  
      expr = Integral(x * y * z, (x, 1, 2), (y, 1, 3))
      r = make_routine(
          "test", Eq(a, expr), argument_sequence=[z, x, a, y]
      )
      assert [arg.name for arg in r.arguments] == [z, x, a, y]
  
imports: from io import StringIO
  from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy
  from sympy.core.relational import Equality
  from sympy.core.symbol import Symbol
  from sympy.functions.special.error_functions import erf
  from sympy.integrals.integrals import Integral
  from sympy.matrices import Matrix, MatrixSymbol
  from sympy.utilities.codegen import codegen, make_routine, CCodeGen, C89CodeGen, C99CodeGen, InputArgument, CodeGenError, FCodeGen, CodeGenArgumentListError, OutputArgument, InOutArgument
  from sympy.testing.pytest import raises
  from sympy.utilities.lambdify import implemented_function
label_desc: Use image node_id 2 for calling a global function with example usage: test_Routine_argument_order() without return types