def _set_format(profile):
x = set()<EOL>for sample in profile:<EOL><INDENT>x = x.union(set(profile[sample].keys()))<EOL><DEDENT>if not x:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>end, start = max(x), min(x)<EOL>x = range(start, end, <NUM_LIT:4>)<EOL>scaled_profile = defaultdict(list)<EOL>for pos in x:<EOL><INDENT>for sample in profile:<EOL><INDENT>y = _get_closer(profile[sample], pos)<EOL>if y:<EOL><INDENT>scaled_profile[sample].append(profile[sample][y])<EOL><DEDENT>else:<EOL><INDENT>scaled_profile[sample].append(<NUM_LIT:0>)<EOL><DEDENT><DEDENT><DEDENT>return {'<STR_LIT:x>': list(x), '<STR_LIT:y>': scaled_profile, '<STR_LIT>': scaled_profile.keys()}<EOL>
Prepare dict to list of y values with same x