INNER CODE UNIT · Python

_split_flow

christopherkarani/Wax · Resources/hermes/wax-memory-plugin/cli.py:60

def _split_flow(value: str) -> list[str]:
    value = value.strip()
    if len(value) >= 2 and (value[0], value[-1]) in {("{", "}"), ("[", "]")}:
        value = value[1:-1]
    parts: list[str] = []
    start = 0
    depth = 0
    quote = ""
    for index, character in enumerate(value):
        if character in {"'", '"'}:
            if not quote:
                quote = character
            elif quote == character:
                quote = ""
        elif not quote:
            if character in "{[":
                depth += 1
            elif character in "}]":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…