code: def leadingones(self, x: tp.ArrayLike) -> float:
      diff = np.round(x) - (np.arange(len(x)) % self._arity)
      nonzeros = np.nonzero(diff)[0]
      return float(len(x) - nonzeros[0] if nonzeros.size else 0)
  
imports: from math import exp, sqrt, tanh
  import numpy
  import nevergrad.common.typing
  from nevergrad.common.decorators import Registry
label_desc: Use image node_id 4 for calling the DiscreteFunction obj's underlying member method code with example usage: obj.leadingones(x) and returns: float