def adjust_spines(ax, spines):
for loc, spine in ax.spines.items():<EOL><INDENT>if loc in spines:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>spine.set_color('<STR_LIT:none>')  <EOL><DEDENT><DEDENT>if '<STR_LIT:left>' in spines:<EOL><INDENT>ax.yaxis.set_ticks_position('<STR_LIT:left>')<EOL><DEDENT>else:<EOL><INDENT>ax.yaxis.set_ticks([])<EOL><DEDENT>if '<STR_LIT>' in spines:<EOL><INDENT>ax.xaxis.set_ticks_position('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>ax.xaxis.set_ticks([])<EOL><DEDENT>
function for removing spines and ticks.

    :param ax: axes object
    :param spines: a list of spines names to keep. e.g [left, right, top, bottom]
                    if spines = []. remove all spines and ticks.