def split_styles(mark):
markers = [mark._table[key] for key in mark._marker][<NUM_LIT:0>]<EOL>nstyles = []<EOL>for m in markers:<EOL><INDENT>msty = toyplot.style.combine({<EOL>"<STR_LIT>": m.mstyle['<STR_LIT>'],<EOL>"<STR_LIT>": m.mstyle['<STR_LIT>'],<EOL>"<STR_LIT>": m.mstyle["<STR_LIT>"],<EOL>}, m.mstyle)<EOL>msty = _color_fixup(msty)<EOL>nstyles.append(msty)<EOL><DEDENT>lstyles = []<EOL>for m in markers:<EOL><INDENT>lsty = toyplot.style.combine({<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": toyplot.color.black,<EOL>"<STR_LIT>": "<STR_LIT>" % (m.size * <NUM_LIT>),<EOL>"<STR_LIT>": "<STR_LIT:none>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>}, m.lstyle)<EOL>fonts = toyplot.font.ReportlabLibrary()<EOL>layout = toyplot.text.layout(m.label, lsty, fonts)<EOL>lsty = _color_fixup(layout.style)<EOL>lstyles.append(lsty)<EOL><DEDENT>nallkeys = set(itertools.chain(*[i.keys() for i in nstyles]))<EOL>lallkeys = set(itertools.chain(*[i.keys() for i in lstyles]))<EOL>nuniquekeys = []<EOL>nsharedkeys = []<EOL>for key in nallkeys:<EOL><INDENT>vals = [nstyles[i].get(key) for i in range(len(nstyles))]<EOL>if len(set(vals)) > <NUM_LIT:1>:<EOL><INDENT>nuniquekeys.append(key)<EOL><DEDENT>else:<EOL><INDENT>nsharedkeys.append(key)<EOL><DEDENT><DEDENT>luniquekeys = []<EOL>lsharedkeys = []<EOL>for key in lallkeys:<EOL><INDENT>vals = [lstyles[i].get(key) for i in range(len(lstyles))]<EOL>if len(set(vals)) > <NUM_LIT:1>:<EOL><INDENT>luniquekeys.append(key)<EOL><DEDENT>else:<EOL><INDENT>lsharedkeys.append(key)<EOL><DEDENT><DEDENT>repeated = set(lsharedkeys).intersection(set(nsharedkeys))<EOL>for repeat in repeated:<EOL><INDENT>lidx = lsharedkeys.index(repeat)<EOL>nidx = nsharedkeys.index(repeat)<EOL>if lsharedkeys[lidx] == nsharedkeys[nidx]:<EOL><INDENT>lsharedkeys.remove(repeat)<EOL><DEDENT>else:<EOL><INDENT>lsharedkeys.remove(repeat)<EOL>luniquekeys.append(repeat)<EOL>nsharedkeys.remove(repeat)<EOL>nuniquekeys.append(repeat)<EOL><DEDENT><DEDENT>natt = ["<STR_LIT>" % (key, nstyles[<NUM_LIT:0>][key]) for key in sorted(nsharedkeys)]<EOL>latt = ["<STR_LIT>" % (key, lstyles[<NUM_LIT:0>][key]) for key in sorted(lsharedkeys)]<EOL>shared_styles = "<STR_LIT:;>".join(natt+latt)<EOL>unique_styles = {<EOL>"<STR_LIT>": [{k:v for k,v in nstyles[idx].items() if k in nuniquekeys} for idx in range(len(markers))],<EOL>"<STR_LIT:text>": [{k:v for k,v in lstyles[idx].items() if k in luniquekeys} for idx in range(len(markers))]<EOL>}<EOL>return shared_styles, unique_styles<EOL>
get shared styles