code: def _covar_func(x1, x2, nu=2.5, **params):
      x1_, x2_ = _lazify_and_expand_inputs(x1, x2)
  
      sq_distance = ((x1_ - x2_) ** 2).sum(-1)
      distance = (sq_distance + 1e-20).sqrt()
      # ^^ Need to add epsilon to prevent small negative values with the sqrt
      # backward pass (otherwise we get NaNs).
      # using .clamp(1e-20, math.inf) doesn't work in KeOps; it also creates NaNs
      exp_component = (-math.sqrt(nu * 2) * distance).exp()
  
      if nu == 0.5:
          constant_component = 1
      elif nu == 1.5:
          constant_component = (math.sqrt(3) * distance) + 1
      elif nu == 2.5:
          constant_component = (math.sqrt(5) * distance) + (
              1 + 5.0 / 3.0 * sq_distance
          )
  
      return constant_component * exp_component
  
imports: import math
  from linear_operator.operators import KernelLinearOperator
  from .keops_kernel import _lazify_and_expand_inputs, KeOpsKernel
label_desc: Use image node_id 1 for calling a global function with example usage: _covar_func(x1, x2, nu) and returns: unknown