code: def sample(f, *var_args):
      """
      Samples a 2d or 3d function over specified intervals and returns
      a dataset suitable for plotting with matlab (matplotlib) syntax.
      Wrapper for sample2d and sample3d.
  
      f is a function of one or two variables, such as x**2.
      var_args are intervals for each variable given in the form (var, min, max, n)
      """
      if len(var_args) == 1:
          return sample2d(f, var_args[0])
      elif len(var_args) == 2:
          return sample3d(f, var_args[0], var_args[1])
      else:
          raise ValueError(
              "Only 2d and 3d sampling are supported at this time."
          )
  
imports: from sympy.core.sympify import sympify, SympifyError
  from sympy.external import import_module
label_desc: Use image node_id 3 for calling a global function with example usage: sample(f) and returns: sample2d, sample3d