def set_default_names(data):
if com._all_not_none(*data.index.names):<EOL><INDENT>nms = data.index.names<EOL>if len(nms) == <NUM_LIT:1> and data.index.name == '<STR_LIT:index>':<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL><DEDENT>elif len(nms) > <NUM_LIT:1> and any(x.startswith('<STR_LIT>') for x in nms):<EOL><INDENT>warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return data<EOL><DEDENT>data = data.copy()<EOL>if data.index.nlevels > <NUM_LIT:1>:<EOL><INDENT>names = [name if name is not None else '<STR_LIT>'.format(i)<EOL>for i, name in enumerate(data.index.names)]<EOL>data.index.names = names<EOL><DEDENT>else:<EOL><INDENT>data.index.name = data.index.name or '<STR_LIT:index>'<EOL><DEDENT>return data<EOL>
Sets index names to 'index' for regular, or 'level_x' for Multi