<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blurring(data, ground_truth, mask=None, normalized=False, smoothness_factor=None):
 r"""Return weighted L2 distance, emphasizing regions defined by ``mask``. .. note:: If the mask argument is omitted, this FOM is equivalent to the mean squared error. Parameters data : `Tensor` or `array-like` Input data to compare to the ground truth. If not a `Tensor`, an unweighted tensor space will be assumed. ground_truth : `array-like` Reference to which ``data`` should be compared. mask : `array-like`, optional Binary mask to define ROI in which FOM evaluation is performed. normalized : bool, optional Boolean flag to switch between unormalized and normalized FOM. smoothness_factor : float, optional Positive real number. Higher value gives smoother weighting. Returns ------- blur : float FOM value, where a lower value means a better match. See Also -------- false_structures mean_squared_error Notes ----- The FOM evaluates .. math:: \mathrm{BLUR}(f, g) = \|\alpha (f - g) \|_2^2, or, in normalized form .. math:: \mathrm{BLUR_N}(f, g) = \frac{\|\alpha(f - g)\|^2_2} {\|\alpha f\|^2_2 + \|\alpha g\|^2_2}. The weighting function :math:`\alpha` is given as .. math:: \alpha(x) = e^{-\frac{1}{k} \beta_m(x)}, where :math:`\beta_m(x)` is the Euclidian distance transform of a given binary mask :math:`m`, and :math:`k` positive real number that controls the smoothness of the weighting function :math:`\alpha`. The weighting gives higher values to structures in the region of interest defined by the mask. The normalized variant takes values in :math:`[0, 1]`. """

    from scipy.ndimage.morphology import distance_transform_edt

    if not hasattr(data, 'space'):
        data = odl.vector(data)

    space = data.space
    ground_truth = space.element(ground_truth)

    if smoothness_factor is None:
        smoothness_factor = np.mean(data.shape) / 10

    if mask is not None:
        mask = distance_transform_edt(1 - mask)
        mask = np.exp(-mask / smoothness_factor)

    return mean_squared_error(data, ground_truth, mask, normalized)