def clean_names(lines, ensure_unique_names=False, strip_prefix=False,<EOL>make_database_safe=False):
names = {}<EOL>for row in lines:<EOL><INDENT>if strip_prefix:<EOL><INDENT>row['<STR_LIT:name>'] = row['<STR_LIT:name>'][row['<STR_LIT:name>'].find('<STR_LIT:->') + <NUM_LIT:1>:]<EOL>if row['<STR_LIT>'] is not None:<EOL><INDENT>row['<STR_LIT>'] = row['<STR_LIT>'][row['<STR_LIT>'].find(<EOL>'<STR_LIT:->') + <NUM_LIT:1>:]<EOL><DEDENT><DEDENT>if ensure_unique_names:<EOL><INDENT>i = <NUM_LIT:1><EOL>while (row['<STR_LIT:name>'] if i == <NUM_LIT:1> else<EOL>row['<STR_LIT:name>'] + "<STR_LIT:->" + str(i)) in names:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>names[row['<STR_LIT:name>'] if i == <NUM_LIT:1> else row['<STR_LIT:name>'] + "<STR_LIT:->" + str(i)] = <NUM_LIT:1><EOL>if i > <NUM_LIT:1>:<EOL><INDENT>row['<STR_LIT:name>'] = row['<STR_LIT:name>'] + "<STR_LIT:->" + str(i)<EOL><DEDENT><DEDENT>if make_database_safe:<EOL><INDENT>row['<STR_LIT:name>'] = row['<STR_LIT:name>'].replace("<STR_LIT:->", "<STR_LIT:_>")<EOL><DEDENT><DEDENT>return lines<EOL>
Clean the names.

Options to:
 - strip prefixes on names
 - enforce unique names
 - make database safe names by converting - to _