This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_python_identifier(string, namespace=None, reserved_words=None, | |
| convert='drop', handle='force'): | |
| """ | |
| Takes an arbitrary string and creates a valid Python identifier. | |
| If the python identifier created is already in the namespace, | |
| or if the identifier is a reserved word in the reserved_words | |
| list, or is a python default reserved word, | |
| adds _1, or if _1 is in the namespace, _2, etc. | |
| Parameters |