code: def count_consecutive(v):
      # accumulate each time v[i] = v[i-1]+1
      return np.sum((v[1:] - v[:-1]) == 1)
  
file_path: cugraph/python/utils/analyse_mtx_sparsity.py
imports: import numpy
  import sys
  from scipy.io import mmread
  import scipy.sparse
  import networkx
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: count_consecutive(v) and returns: np