code: def data_hstack(blocks: Sequence[modALinput]) -> modALinput:
      """
      Stack horizontally sparse/dense arrays and pandas data frames.
  
      Args:
          blocks: Sequence of modALinput objects.
  
      Returns:
          New sequence of horizontally stacked elements.
      """
      if any([sp.issparse(b) for b in blocks]):
          return sp.hstack(blocks)
      elif isinstance(blocks[0], pd.DataFrame):
          pd.concat(blocks, axis=1)
      elif isinstance(blocks[0], np.ndarray):
          return np.hstack(blocks)
      elif isinstance(blocks[0], list):
          return np.hstack(blocks).tolist()
  
      try:
          if torch.is_tensor(blocks[0]):
              return torch.cat(blocks, dim=1)
      except:
          pass
  
      TypeError("%s datatype is not supported" % type(blocks[0]))
  
file_path: modAL/modAL/utils/data.py
imports: from typing import List, Sequence, Union
  import numpy
  import pandas
  import scipy.sparse
label_desc: Use image node_id 2 for calling a global function with example usage: data_hstack(blocks) and returns: sp, torch, np, np