(string)
| 42 | return save_category |
| 43 | |
| 44 | def standardize(string): |
| 45 | res = re.compile("[^\\u4e00-\\u9fa5^a-z^A-Z^0-9^_]") |
| 46 | string = res.sub("_", string) |
| 47 | string = re.sub(r"(_)\1+","_", string).lower() |
| 48 | while True: |
| 49 | if len(string) == 0: |
| 50 | return string |
| 51 | if string[0] == "_": |
| 52 | string = string[1:] |
| 53 | else: |
| 54 | break |
| 55 | while True: |
| 56 | if len(string) == 0: |
| 57 | return string |
| 58 | if string[-1] == "_": |
| 59 | string = string[:-1] |
| 60 | else: |
| 61 | break |
| 62 | if string[0].isdigit(): |
| 63 | string = "get_" + string |
| 64 | return string |
| 65 | |
| 66 | def change_name(name): |
| 67 | change_list = ["from", "class", "return", "false", "true", "id", "and"] |
no outgoing calls
no test coverage detected