code: def hstack(blocks, format=None, dtype=None):
      """
      Stack sparse matrices horizontally (column wise)
  
      Parameters
      ----------
      blocks
          sequence of sparse matrices with compatible shapes
      format : str
          sparse format of the result (e.g., "csr")
          by default an appropriate sparse matrix format is returned.
          This choice is subject to change.
      dtype : dtype, optional
          The data-type of the output matrix. If not given, the dtype is
          determined from that of `blocks`.
  
      Returns
      -------
      new_array : sparse matrix or array
          If any block in blocks is a sparse array, return a sparse array.
          Otherwise return a sparse matrix.
  
          If you want a sparse array built from blocks that are not sparse
          arrays, use `block(hstack(blocks))` or convert one block
          e.g. `blocks[0] = csr_array(blocks[0])`.
  
      See Also
      --------
      vstack : stack sparse matrices vertically (row wise)
  
      Examples
      --------
      >>> from scipy.sparse import coo_matrix, hstack
      >>> A = coo_matrix([[1, 2], [3, 4]])
      >>> B = coo_matrix([[5], [6]])
      >>> hstack([A,B]).toarray()
      array([[1, 2, 5],
             [3, 4, 6]])
  
      """
      blocks = np.asarray(blocks, dtype="object")
      if any(isinstance(b, sparray) for b in blocks.flat):
          return _block([blocks], format, dtype)
      else:
          return _block([blocks], format, dtype, return_spmatrix=True)
  
imports: import numbers
  import math
  import numpy
  from scipy._lib._util import check_random_state, rng_integers
  from ._sputils import upcast, get_index_dtype, isscalarlike
  from ._sparsetools import csr_hstack
  from ._bsr import bsr_matrix, bsr_array
  from ._coo import coo_matrix, coo_array
  from ._csc import csc_matrix, csc_array
  from ._csr import csr_matrix, csr_array
  from ._dia import dia_matrix, dia_array
  from ._base import issparse, sparray
label_desc: Use image node_id 12 for calling a global function with example usage: hstack(blocks, format, dtype) and returns: _block, _block