<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mex_hat(x, sigma):
 r"""Mexican hat This method implements a Mexican hat (or Ricker) wavelet. Parameters x : float Input data point sigma : float Standard deviation (filter scale) Returns ------- float Mexican hat filtered data point Examples -------- -0.35213905225713371 """


    x = check_float(x)
    sigma = check_float(sigma)

    xs = (x / sigma) ** 2
    val = 2 * (3 * sigma) ** -0.5 * np.pi ** -0.25

    return val * (1 - xs) * np.exp(-0.5 * xs)