def _find_basic_palette(result):
pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.xterm_palette4<EOL>if env.SSH_CLIENT:  <EOL><INDENT>pal_name = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if os_name == '<STR_LIT>':<EOL><INDENT>if sys.getwindowsversion()[<NUM_LIT:2>] > <NUM_LIT>: <EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.cmd1709_palette4<EOL><DEDENT>else:<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.cmd_palette4<EOL><DEDENT><DEDENT>elif sys.platform == '<STR_LIT>':<EOL><INDENT>if env.TERM_PROGRAM == '<STR_LIT>':<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.termapp_palette4<EOL><DEDENT>elif env.TERM_PROGRAM == '<STR_LIT>':<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.iterm_palette4<EOL><DEDENT><DEDENT>elif os_name == '<STR_LIT>':<EOL><INDENT>if env.TERM in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = parse_vtrgb()<EOL><DEDENT>elif env.TERM.startswith('<STR_LIT>'):<EOL><INDENT>if '<STR_LIT>' in os.uname().release:<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.cmd1709_palette4<EOL>result = '<STR_LIT>'  <EOL><DEDENT>elif sys.platform.startswith('<STR_LIT>'):  <EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.vga_palette4<EOL><DEDENT>else:<EOL><INDENT>try:  <EOL><INDENT>if get_color('<STR_LIT:index>', <NUM_LIT:2>)[<NUM_LIT:0>][:<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>pal_name = '<STR_LIT>'<EOL>basic_palette = color_tables.tango_palette4<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT><DEDENT>except (IndexError, RuntimeError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:  <EOL><INDENT>log.warn('<STR_LIT>', os_name)<EOL><DEDENT><DEDENT>return result, pal_name, basic_palette<EOL>
Find the platform-dependent 16-color basic palette.

        This is used for "downgrading to the nearest color" support.