<s> import logging <EOL> import os <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> def create_definition ( name , command , cwd = os . path . abspath ( os . curdir ) , <EOL> stdout = None , stderr = None , daemon_log = None , redirect_stderr = None , <EOL> env = None ) : <EOL> env = env or { } <EOL> definition = { <EOL> '<STR_LIT:name>' : name , <EOL> '<STR_LIT>' : command , <EOL> '<STR_LIT>' : os . path . abspath ( cwd ) , <EOL> '<STR_LIT>' : env , <EOL> } <EOL> if stdout : <EOL> definition [ '<STR_LIT>' ] = stdout <EOL> if daemon_log : <EOL> definition [ '<STR_LIT>' ] = daemon_log <EOL> if redirect_stderr is not None : <EOL> definition [ '<STR_LIT>' ] = redirect_stderr <EOL> if stderr is not None : <EOL> definition [ '<STR_LIT>' ] = stderr <EOL> return definition </s>
