def rename_index(self, *args):
if len(args) == <NUM_LIT:1>:<EOL><INDENT>new_indices = args[<NUM_LIT:0>]<EOL>old_indices =force_list(self.indices.keys())<EOL><DEDENT>else:<EOL><INDENT>old_indices, new_indices = args<EOL>old_indices, single = convert_index_to_keys(self.indices, old_indices)<EOL>if single:<EOL><INDENT>old_indices, new_indices = [old_indices], [new_indices]<EOL><DEDENT><DEDENT>if len(new_indices) != len(old_indices):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(len(new_indices), len(old_indices)))<EOL><DEDENT>map(MI_check_index_name, new_indices)<EOL>if len(new_indices) != len(set(new_indices)):<EOL><INDENT>raise ValueError('<STR_LIT>' % (new_indices,))<EOL><DEDENT>od_replace_key(self.indices, old_indices, new_indices, multi=True)<EOL>
change the index name(s).

        * call with one argument:
            1. list of new index names (to replace all old names)

        * call with two arguments:
            1. old index name(s) (or index/indices)
            2. new index name(s)