code: def valid_connection(*outer_args, **outer_kwargs):
          # pylint: disable=unused-argument, no-method-argument
          
          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
docs: Check if the daemon connection is established and valid