<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def layerFromSource(source):
    '''
    Returns the layer from the current project with the passed source
    Raises WrongLayerSourceException if no layer with that source is found
    '''
    layers =_layerreg.mapLayers().values()
    for layer in layers:
        if layer.source() == source:
            return layer
    raise WrongLayerSourceException()