docstr: Transform a sequence of documents to a document-term matrix.
  
  Transformation is done in parallel, and correctly handles dask
  collections.
  
  Parameters
  ----------
  raw_X : dask.bag.Bag or dask.dataframe.Series, length = n_samples
      Each sample must be a text document (either bytes or
      unicode strings, file name or file object depending on the
      constructor argument) which will be tokenized and hashed.
  
  Returns
  -------
  X : dask.array.Array, shape = (n_samples, self.n_features)
      Document-term matrix. Each block of the array is a scipy sparse
      matrix.
  
  Notes
  -----
  The returned dask Array is composed scipy sparse matrices. If you need
  to compute on the result immediately, you may need to convert the individual
  blocks to ndarrays or pydata/sparse matrices.
  
  >>> import sparse
  >>> X.map_blocks(sparse.COO.from_scipy_sparse, dtype=X.dtype)  # doctest: +SKIP
  
  See the :doc:`examples/text-vectorization` for more.
docstr_tok: ["Transform","a","sequence","of","documents","to","a","document-term","matrix",".","Transformation","is","done","in","parallel",",","and","correctly","handles","dask","collections",".","Parameters","--","--","--","--","--","raw_X",":","dask.bag.Bag","or","dask.dataframe.Series",",","length","=","n_samples","Each","sample","must","be","a","text","document","(","either","bytes","or","unicode","strings",",","file","name","or","file","object","depending","on","the","constructor","argument",")","which","will","be","tokenized","and","hashed",".","Returns","--","--","--","-","X",":","dask.array.Array",",","shape","=","(","n_samples",",","self.n_features",")","Document-term","matrix",".","Each","block","of","the","array","is","a","scipy","sparse","matrix",".","Notes","--","--","-","The","returned","dask","Array","is","composed","scipy","sparse","matrices",".","If","you","need","to","compute","on","the","result","immediately",",","you","may","need","to","convert","the","individual","blocks","to","ndarrays","or","pydata\/sparse","matrices",".",">",">",">","import","sparse",">",">",">","X.map_blocks","(","sparse.COO.from_scipy_sparse",",","dtype=X.dtype",")","#","doctest",":","+SKIP","See","the",":","doc",":","`","examples\/text-vectorization","`","for","more","."]
code: def transform(self, raw_X):
      """Transform a sequence of documents to a document-term matrix.
  
      Transformation is done in parallel, and correctly handles dask
      collections.
  
      Parameters
      ----------
      raw_X : dask.bag.Bag or dask.dataframe.Series, length = n_samples
          Each sample must be a text document (either bytes or
          unicode strings, file name or file object depending on the
          constructor argument) which will be tokenized and hashed.
  
      Returns
      -------
      X : dask.array.Array, shape = (n_samples, self.n_features)
          Document-term matrix. Each block of the array is a scipy sparse
          matrix.
  
      Notes
      -----
      The returned dask Array is composed scipy sparse matrices. If you need
      to compute on the result immediately, you may need to convert the individual
      blocks to ndarrays or pydata/sparse matrices.
  
      >>> import sparse
      >>> X.map_blocks(sparse.COO.from_scipy_sparse, dtype=X.dtype)  # doctest: +SKIP
  
      See the :doc:`examples/text-vectorization` for more.
      """
      return super().transform(raw_X)
  
imports: import itertools
  import dask
  import dask.array
  import dask.bag
  import dask.dataframe
  import distributed
  import numpy
  import scipy.sparse
  import sklearn.base
  import sklearn.feature_extraction.text
  from dask.delayed import Delayed
  from distributed import get_client, wait
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 2 for calling the HashingVectorizer obj's underlying member method code with example usage: obj.transform(raw_X) and returns: super