def METHOD_NAME(blocks, row_sizes=None, col_sizes=None):
    """
    Compose sparse matrices into a global sparse matrix.
    Parameters
    ----------
    blocks : sequence of sequences
        The sequence of sequences of equal lengths - the individual
        sparse matrix blocks. The integer 0 can be used to mark an all-zero
        block, if its size can be determined from the other blocks.
    row_sizes : sequence, optional
        The required row sizes of the blocks. It can be either a
        sequence of non-negative integers, or a sequence of slices with
        non-negative limits. In any case the sizes have to be compatible
        with the true block sizes. This allows to extend the matrix
        shape as needed and to specify sizes of all-zero blocks.
    col_sizes : sequence, optional
        The required column sizes of the blocks. See `row_sizes`.
    Returns
    -------
    mtx : coo_matrix
        The sparse matrix (COO format) composed from the given blocks.
    Examples
    --------
    Stokes-like problem matrix.
    >>> import scipy.sparse as sp
    >>> A = sp.csr_matrix([[1, 0], [0, 1]])
    >>> B = sp.coo_matrix([[1, 1]])
    >>> K = compose_sparse([[A, B.T], [B, 0]])
    >>> print K.todense()
    [[1 0 1]
     [0 1 1]
     [1 1 0]]
    """
    if not len(blocks):
        raise ValueError('no matrix blocks!')
    if row_sizes is None:
        row_sizes = nm.array([-1] * len(blocks))
    else:
        assert_(len(row_sizes) == len(blocks))
    if col_sizes is None:
        col_sizes = nm.array([-1] * len(blocks[0]))
    else:
        assert_(len(col_sizes) == len(blocks[0]))
    rs, is_slice_r = _normalize_sizes(row_sizes)
    cs, is_slice_c = _normalize_sizes(col_sizes)
    for ir, row in enumerate(blocks):
        for ic, mtx in enumerate(row):
            if isinstance(mtx, int) and (mtx == 0):
                continue
            if ic >= len(col_sizes):
                raise ValueError('invalid row size at (%d, %d)!' % (ir, ic))
            if rs[ir] == -1:
                rs[ir] = mtx.shape[0]
            elif rs[ir] != mtx.shape[0]:
                msg = 'incompatible matrix block row size at (%d, %d)!' \
                      % (ir, ic)
                raise ValueError(msg)
            if cs[ic] == -1:
                cs[ic] = mtx.shape[1]
            elif cs[ic] != mtx.shape[1]:
                msg = 'incompatible matrix block column size at (%d, %d)!' \
                      % (ic, ic)
                raise ValueError(msg)
    if nm.any(rs == -1):
        raise ValueError('incomplete row block sizes! (%s)' % row_sizes)
    if nm.any(cs == -1):
        raise ValueError('incomplete column block sizes! (%s)' % col_sizes)
    if is_slice_r:
        n_row = row_sizes[-1].stop
        row_offsets = nm.r_[[ii.start for ii in row_sizes], n_row]
    else:
        row_offsets = nm.cumsum(nm.r_[0, rs])
        n_row = row_offsets[-1]
    if is_slice_c:
        n_col = col_sizes[-1].stop
        col_offsets = nm.r_[[ii.start for ii in col_sizes], n_col]
    else:
        col_offsets = nm.cumsum(nm.r_[0, cs])
        n_col = col_offsets[-1]
    rows = []
    cols = []
    datas = []
    for ir, row in enumerate(blocks):
        for ic, mtx in enumerate(row):
            if isinstance(mtx, int) and (mtx == 0):
                continue
            aux = sp.coo_matrix(mtx)
            rows.append(aux.row + row_offsets[ir])
            cols.append(aux.col + col_offsets[ic])
            datas.append(aux.data)
    rows = nm.concatenate(rows)
    cols = nm.concatenate(cols)
    datas = nm.concatenate(datas)
    mtx = sp.coo_matrix((datas, (rows, cols)), shape=(n_row, n_col))
    return mtx