Copy from `paddle/fluid/operators/generator/parse_utils.py`
(s: str, sep=",")
| 23 | |
| 24 | |
| 25 | def parse_plain_list(s: str, sep=",") -> list[str]: |
| 26 | """Copy from `paddle/fluid/operators/generator/parse_utils.py`""" |
| 27 | if sep == ",": |
| 28 | pattern = re.compile(r',(?![^{]*\})') # support "int[] a={1,2}" |
| 29 | items = re.split(pattern, s.strip()) |
| 30 | items = [x.strip() for x in items] |
| 31 | return items |
| 32 | else: |
| 33 | return [item.strip() for item in s.strip().split(sep)] |
| 34 | |
| 35 | |
| 36 | def IsUsePredefinedOut(position_list: list) -> bool: |
no test coverage detected