Convert a camel case name to snake case. If the name would shadow a Python builtin or keyword, then append an underscore.
(name)
| 148 | |
| 149 | |
| 150 | def snake_case(name): |
| 151 | """Convert a camel case name to snake case. |
| 152 | |
| 153 | If the name would shadow a Python builtin or keyword, then append an underscore. |
| 154 | """ |
| 155 | name = inflection.underscore(name) |
| 156 | if is_builtin(name) or keyword.iskeyword(name): |
| 157 | name += "_" |
| 158 | return name |
| 159 | |
| 160 | |
| 161 | def ref_to_python(ref): |
no test coverage detected