<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def valid_connection(*outer_args, **outer_kwargs):
 # pylint: disable=unused-argument, no-method-argument """Check if the daemon connection is established and valid"""

        def decorator(func):  # pylint: disable=missing-docstring
            def decorated(*args, **kwargs):  # pylint: disable=missing-docstring
                # outer_args and outer_kwargs are the decorator arguments
                # args and kwargs are the decorated function arguments
                link = args[0]
                if not link.con:
                    raise LinkError("The connection is not created for %s" % link.name)
                if not link.running_id:
                    raise LinkError("The connection is not initialized for %s" % link.name)

                return func(*args, **kwargs)
            return decorated
        return decorator