code: def ccode(expr, assign_to=None, standard="c99", **settings):
      """Converts an expr to a string of c code
  
      Parameters
      ==========
  
      expr : Expr
          A SymPy expression to be converted.
      assign_to : optional
          When given, the argument is used as the name of the variable to which
          the expression is assigned. Can be a string, ``Symbol``,
          ``MatrixSymbol``, or ``Indexed`` type. This is helpful in case of
          line-wrapping, or for expressions that generate multi-line statements.
      standard : str, optional
          String specifying the standard. If your compiler supports a more modern
          standard you may set this to 'c99' to allow the printer to use more math
          functions. [default='c89'].
      precision : integer, optional
          The precision for numbers such as pi [default=17].
      user_functions : dict, optional
          A dictionary where the keys are string representations of either
          ``FunctionClass`` or ``UndefinedFunction`` instances and the values
          are their desired C string representations. Alternatively, the
          dictionary value can be a list of tuples i.e. [(argument_test,
          cfunction_string)] or [(argument_test, cfunction_formater)]. See below
          for examples.
      dereference : iterable, optional
          An iterable of symbols that should be dereferenced in the printed code
          expression. These would be values passed by address to the function.
          For example, if ``dereference=[a]``, the resulting code would print
          ``(*a)`` instead of ``a``.
      human : bool, optional
          If True, the result is a single string that may contain some constant
          declarations for the number symbols. If False, the same information is
          returned in a tuple of (symbols_to_declare, not_supported_functions,
          code_text). [default=True].
      contract: bool, optional
          If True, ``Indexed`` instances are assumed to obey tensor contraction
          rules and the corresponding nested loops over indices are generated.
          Setting contract=False will not generate loops, instead the user is
          responsible to provide values for the indices in the code.
          [default=True].
  
      Examples
      ========
  
      >>> from sympy import ccode, symbols, Rational, sin, ceiling, Abs, Function
      >>> x, tau = symbols("x, tau")
      >>> expr = (2*tau)**Rational(7, 2)
      >>> ccode(expr)
      '8*M_SQRT2*pow(tau, 7.0/2.0)'
      >>> ccode(expr, math_macros={})
      '8*sqrt(2)*pow(tau, 7.0/2.0)'
      >>> ccode(sin(x), assign_to="s")
      's = sin(x);'
      >>> from sympy.codegen.ast import real, float80
      >>> ccode(expr, type_aliases={real: float80})
      '8*M_SQRT2l*powl(tau, 7.0L/2.0L)'
  
      Simple custom printing can be defined for certain types by passing a
      dictionary of {"type" : "function"} to the ``user_functions`` kwarg.
      Alternatively, the dictionary value can be a list of tuples i.e.
      [(argument_test, cfunction_string)].
  
      >>> custom_functions = {
      ...   "ceiling": "CEIL",
      ...   "Abs": [(lambda x: not x.is_integer, "fabs"),
      ...           (lambda x: x.is_integer, "ABS")],
      ...   "func": "f"
      ... }
      >>> func = Function('func')
      >>> ccode(func(Abs(x) + ceiling(x)), standard='C89', user_functions=custom_functions)
      'f(fabs(x) + CEIL(x))'
  
      or if the C-function takes a subset of the original arguments:
  
      >>> ccode(2**x + 3**x, standard='C99', user_functions={'Pow': [
      ...   (lambda b, e: b == 2, lambda b, e: 'exp2(%s)' % e),
      ...   (lambda b, e: b != 2, 'pow')]})
      'exp2(x) + pow(3, x)'
  
      ``Piecewise`` expressions are converted into conditionals. If an
      ``assign_to`` variable is provided an if statement is created, otherwise
      the ternary operator is used. Note that if the ``Piecewise`` lacks a
      default term, represented by ``(expr, True)`` then an error will be thrown.
      This is to prevent generating an expression that may not evaluate to
      anything.
  
      >>> from sympy import Piecewise
      >>> expr = Piecewise((x + 1, x > 0), (x, True))
      >>> print(ccode(expr, tau, standard='C89'))
      if (x > 0) {
      tau = x + 1;
      }
      else {
      tau = x;
      }
  
      Support for loops is provided through ``Indexed`` types. With
      ``contract=True`` these expressions will be turned into loops, whereas
      ``contract=False`` will just print the assignment expression that should be
      looped over:
  
      >>> from sympy import Eq, IndexedBase, Idx
      >>> len_y = 5
      >>> y = IndexedBase('y', shape=(len_y,))
      >>> t = IndexedBase('t', shape=(len_y,))
      >>> Dy = IndexedBase('Dy', shape=(len_y-1,))
      >>> i = Idx('i', len_y-1)
      >>> e=Eq(Dy[i], (y[i+1]-y[i])/(t[i+1]-t[i]))
      >>> ccode(e.rhs, assign_to=e.lhs, contract=False, standard='C89')
      'Dy[i] = (y[i + 1] - y[i])/(t[i + 1] - t[i]);'
  
      Matrices are also supported, but a ``MatrixSymbol`` of the same dimensions
      must be provided to ``assign_to``. Note that any expression that can be
      generated normally can also exist inside a Matrix:
  
      >>> from sympy import Matrix, MatrixSymbol
      >>> mat = Matrix([x**2, Piecewise((x + 1, x > 0), (x, True)), sin(x)])
      >>> A = MatrixSymbol('A', 3, 1)
      >>> print(ccode(mat, A, standard='C89'))
      A[0] = pow(x, 2);
      if (x > 0) {
         A[1] = x + 1;
      }
      else {
         A[1] = x;
      }
      A[2] = sin(x);
      """
      from sympy.printing.c import c_code_printers
  
      return c_code_printers[standard.lower()](settings).doprint(
          expr, assign_to
      )
  
imports: from __future__ import annotations
  from typing import Any
  from functools import wraps
  from sympy.core import Add, Mul, Pow, S, sympify, Float
  from sympy.core.basic import Basic
  from sympy.core.expr import UnevaluatedExpr
  from sympy.core.function import Lambda
  from sympy.core.mul import _keep_coeff
  from sympy.core.sorting import default_sort_key
  from sympy.core.symbol import Symbol
  from sympy.functions.elementary.complexes import re
  from sympy.printing.str import StrPrinter
  from sympy.printing.precedence import precedence, PRECEDENCE
label_desc: Use image node_id 2 for calling a global function with example usage: ccode(expr, assign_to, standard) and returns: c_code_printers