code: def _mathfun_n(f_real, f_complex):
      def f(*args, **kwargs):
          try:
              return f_real(*(float(x) for x in args))
          except (TypeError, ValueError):
              return f_complex(*(complex(x) for x in args))
  
      f.__name__ = f_real.__name__
      return f
  
imports: import operator
  import math
  import cmath
label_desc: Use image node_id 3 for calling a global function with example usage: _mathfun_n(f_real, f_complex) and returns: f, f_real, f_complex