Fix method names to avoid '$' characters and reserved word conflicts. Args: name: string, method name. Returns: The name with '_' appended if the name is a reserved word and '$' and '-' replaced with '_'.
(name)
| 149 | |
| 150 | |
| 151 | def fix_method_name(name): |
| 152 | """Fix method names to avoid '$' characters and reserved word conflicts. |
| 153 | |
| 154 | Args: |
| 155 | name: string, method name. |
| 156 | |
| 157 | Returns: |
| 158 | The name with '_' appended if the name is a reserved word and '$' and '-' |
| 159 | replaced with '_'. |
| 160 | """ |
| 161 | name = name.replace("$", "_").replace("-", "_") |
| 162 | if keyword.iskeyword(name) or name in RESERVED_WORDS: |
| 163 | return name + "_" |
| 164 | else: |
| 165 | return name |
| 166 | |
| 167 | |
| 168 | def key2param(key): |
no outgoing calls
no test coverage detected
searching dependent graphs…