code: def load_svmlight_files(
      files,
      n_features=None,
      dtype=np.float64,
      multilabel=False,
      zero_based="auto",
      query_id=False,
  ):
      """Load dataset from multiple files in SVMlight format
  
      This function is equivalent to mapping load_svmlight_file over a list of
      files, except that the results are concatenated into a single, flat list
      and the samples vectors are constrained to all have the same number of
      features.
  
      In case the file contains a pairwise preference constraint (known
      as "qid" in the svmlight format) these are ignored unless the
      query_id parameter is set to True. These pairwise preference
      constraints can be used to constraint the combination of samples
      when using pairwise loss functions (as is the case in some
      learning to rank problems) so that only pairs with the same
      query_id value are considered.
  
      Parameters
      ----------
      files : iterable over {str, file-like, int}
          (Paths of) files to load. If a path ends in ".gz" or ".bz2", it will
          be uncompressed on the fly. If an integer is passed, it is assumed to
          be a file descriptor. File-likes and file descriptors will not be
          closed by this function. File-like objects must be opened in binary
          mode.
  
      n_features : int or None
          The number of features to use. If None, it will be inferred from the
          maximum column index occurring in any of the files.
  
          This can be set to a higher value than the actual number of features
          in any of the input files, but setting it to a lower value will cause
          an exception to be raised.
  
      multilabel : boolean, optional
          Samples may have several labels each (see
          http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multilabel.html)
  
      zero_based : boolean or "auto", optional
          Whether column indices in f are zero-based (True) or one-based
          (False). If column indices are one-based, they are transformed to
          zero-based to match Python/NumPy conventions.
          If set to "auto", a heuristic check is applied to determine this from
          the file contents. Both kinds of files occur "in the wild", but they
          are unfortunately not self-identifying. Using "auto" or True should
          always be safe.
  
      query_id : boolean, defaults to False
          If True, will return the query_id array for each file.
  
      dtype : numpy data type, default np.float64
          Data type of dataset to be loaded. This will be the data type of the
          output numpy arrays ``X`` and ``y``.
  
      Returns
      -------
      [X1, y1, ..., Xn, yn]
      where each (Xi, yi) pair is the result from load_svmlight_file(files[i]).
  
      If query_id is set to True, this will return instead [X1, y1, q1,
      ..., Xn, yn, qn] where (Xi, yi, qi) is the result from
      load_svmlight_file(files[i])
  
      Notes
      -----
      When fitting a model to a matrix X_train and evaluating it against a
      matrix X_test, it is essential that X_train and X_test have the same
      number of features (X_train.shape[1] == X_test.shape[1]). This may not
      be the case if you load the files individually with load_svmlight_file.
  
      See also
      --------
      load_svmlight_file
      """
      r = [
          _open_and_load(
              f, dtype, multilabel, bool(zero_based), bool(query_id)
          )
          for f in files
      ]
  
      if (
          zero_based is False
          or zero_based == "auto"
          and all(np.min(tmp[1]) > 0 for tmp in r)
      ):
          for ind in r:
              indices = ind[1]
              indices -= 1
  
      n_f = max(ind[1].max() for ind in r) + 1
      if n_features is None:
          n_features = n_f
      elif n_features < n_f:
          raise ValueError(
              "n_features was set to {},"
              " but input file contains {} features".format(
                  n_features, n_f
              )
          )
  
      result = []
      for data, indices, indptr, y, query_values in r:
          shape = (indptr.shape[0] - 1, n_features)
          X = sp.csr_matrix((data, indices, indptr), shape)
          X.sort_indices()
          result += X, y
          if query_id:
              result.append(query_values)
  
      return result
  
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 4 for calling a global function with example usage: load_svmlight_files(files, n_features, dtype, multilabel, zero_based, query_id) and returns: result