MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / parse_plain_list

Function parse_plain_list

paddle/phi/api/generator/api_base.py:25–33  ·  view source on GitHub ↗

Copy from `paddle/fluid/operators/generator/parse_utils.py`

(s: str, sep=",")

Source from the content-addressed store, hash-verified

23
24
25def 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
36def IsUsePredefinedOut(position_list: list) -> bool:

Callers 1

parse_data_transformMethod · 0.70

Calls 2

compileMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected