def execute(command, detach=False):
if detach:<EOL><INDENT>if not isinstance(command, str):<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>command)<EOL>logging.getLogger("<STR_LIT>").error(msg)<EOL>raise AttributeError(msg)<EOL><DEDENT>command = ["<STR_LIT>", "<STR_LIT>", command]<EOL><DEDENT>else:<EOL><INDENT>if isinstance(command, str):<EOL><INDENT>command = shlex.split(command)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>subprocess.Popen(command, stdin=subprocess.DEVNULL,<EOL>stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)<EOL><DEDENT>except OSError:<EOL><INDENT>logging.getLogger("<STR_LIT>").exception("<STR_LIT>")<EOL><DEDENT>except subprocess.CalledProcessError:<EOL><INDENT>logging.getLogger("<STR_LIT>").exception("<STR_LIT>")<EOL><DEDENT>
Runs a command in background. No output is retrieved. Useful for running GUI
applications that would block click events.

:param command: A string or a list of strings containing the name and
 arguments of the program.
:param detach: If set to `True` the program will be executed using the
 `i3-msg` command. As a result the program is executed independent of
 i3pystatus as a child of i3 process. Because of how i3-msg parses its
 arguments the type of `command` is limited to string in this mode.