INNER CODE UNIT · Python

_yaml_key

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

def _yaml_key(value: str) -> str:
    value = value.strip()
    if len(value) >= 2 and value[0] == value[-1] and value[0] in {"'", '"'}:
        return value[1:-1]
    return value


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:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…