<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sparse(self, rows: np.ndarray = None, cols: np.ndarray = None, layer: str = None) -> scipy.sparse.coo_matrix: 		""" 		Return the main matrix or specified layer as a scipy.sparse.coo_matrix, without loading dense matrix in RAM 		Args: 			rows:		Rows to include, or None to include all 			cols:		Columns to include, or None to include all 			layer:		Layer to return, or None to return the default layer 		Returns: 			Sparse matrix (:class:`scipy.sparse.coo_matrix`) 		"""

		if layer is None:
			return self.layers[""].sparse(rows=rows, cols=cols)
		else:
			return self.layers[layer].sparse(rows=rows, cols=cols)