<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(message, type):
 """Log notices to stdout and errors to stderr"""


    (sys.stdout if type == 'notice' else sys.stderr).write(message + "\n")