<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def source_extraction(in1, tolerance, mode="cpu", store_on_gpu=False, neg_comp=False):
 """ Convenience function for allocating work to cpu or gpu, depending on the selected mode. INPUTS: in1 (no default):
 Array containing the wavelet decomposition. tolerance (no default):
 Percentage of maximum coefficient at which objects are deemed significant. mode (default="cpu"):
Mode of operation - either "gpu" or "cpu". OUTPUTS: Array containing the significant wavelet coefficients of extracted sources. """


    if mode=="cpu":
        return cpu_source_extraction(in1, tolerance, neg_comp)
    elif mode=="gpu":
        return gpu_source_extraction(in1, tolerance, store_on_gpu, neg_comp)