<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_console(stream=STDOUT, foreground=None, background=None, style=None):
 """Set console foreground and background attributes."""

    if foreground is None:
        foreground = _default_foreground
    if background is None:
        background = _default_background
    if style is None:
        style = _default_style
    attrs = get_attrs(foreground, background, style)
    SetConsoleTextAttribute(stream, attrs)