code: def _nonneg_int_or_fail(n, var_name, strict=True):
      try:
          if strict:
              # Raises an exception if float
              n = operator.index(n)
          elif n == floor(n):
              n = int(n)
          else:
              raise ValueError()
          if n < 0:
              raise ValueError()
      except (ValueError, TypeError) as err:
          raise err.__class__(
              "{} must be a non-negative integer".format(var_name)
          ) from err
      return n
  
imports: import operator
  import numpy
  import math
  from numpy import pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, inexact, nan, zeros, sinc
  from .None import _ufuncs
  from ._ufuncs import mathieu_a, mathieu_b, iv, jv, gamma, psi, hankel1, hankel2, yv, kv, ndtri, poch, binom, hyp0f1
  from .None import specfun
  from .None import orthogonal
  from ._comb import _comb_int
label_desc: Use image node_id 1 for calling a global function with example usage: _nonneg_int_or_fail(n, var_name, strict) and returns: n