code: def count(y_true, y_score=None, countna=False):
      
      if not countna:
          return (~np.isnan(to_float(y_true))).sum()
      else:
          return len(y_true)
docs: Counts the number of examples. If countna is False then only count labeled examples,
      i.e. those with y_true not NaN