<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cost_method(self, *args, **kwargs):
 """Calculate sparsity component of the cost This method returns the l1 norm error of the weighted wavelet coefficients Returns ------- float sparsity cost component """


        cost_val = np.sum(np.abs(self.weights * self._linear.op(args[0])))

        if 'verbose' in kwargs and kwargs['verbose']:
            print(' - L1 NORM (X):', cost_val)

        return cost_val