code: def get_ndata(ofile):
      """Read the whole file to get number of data attributes."""
      data = [next(ofile)]
      loc = 1
      if data[0].strip()[0] == "{":
          raise ValueError(
              "This looks like a sparse ARFF: not supported yet"
          )
      for i in ofile:
          loc += 1
      return loc
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import itertools
  import datetime
  from functools import partial
  import numpy
  from scipy._lib.six import next
label_desc: Use image node_id 4 for calling a global function with example usage: get_ndata(ofile) and returns: loc