code: def _open_and_load(f, dtype, multilabel, zero_based, query_id):
      if hasattr(f, "read"):
          (
              actual_dtype,
              data,
              ind,
              indptr,
              labels,
              query,
          ) = _load_svmlight_file(
              f, dtype, multilabel, zero_based, query_id
          )
      # XXX remove closing when Python 2.7+/3.1+ required
      else:
          with closing(_gen_open(f)) as f:
              (
                  actual_dtype,
                  data,
                  ind,
                  indptr,
                  labels,
                  query,
              ) = _load_svmlight_file(
                  f, dtype, multilabel, zero_based, query_id
              )
  
      # convert from array.array, give data the right dtype
      if not multilabel:
          labels = frombuffer_empty(labels, np.float64)
      data = frombuffer_empty(data, actual_dtype)
      indices = frombuffer_empty(ind, np.intc)
      indptr = np.frombuffer(indptr, dtype=np.intc)  # never empty
      query = frombuffer_empty(query, np.int64)
  
      data = np.asarray(data, dtype=dtype)  # no-op for float{32,64}
      return data, indices, indptr, labels, query
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/datasets/svmlight_format.py
imports: from contextlib import closing
  import io
  import os.path
  import numpy
  import scipy.sparse
  from ._svmlight_format import _load_svmlight_file
  from ..None import __version__
  from ..externals import six
  from ..externals.six import u, b
  from ..externals.six.moves import range, zip
  from ..utils import check_array
  from ..utils.fixes import frombuffer_empty
label_desc: Use image node_id 3 for calling a global function with example usage: _open_and_load(f, dtype, multilabel, zero_based, query_id) and returns: data,  indices,  indptr,  labels,  query