INNER CODE UNIT · Python

indents

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

    indents = [len(line) - len(line.lstrip()) for line in lines if line.strip()]
    if not indents:
        return None
    entry_indent = min(indents)
    for index, line in enumerate(lines):
        if not line.strip() or len(line) - len(line.lstrip()) != entry_indent:
            continue
        pair = _mapping_pair(line.strip())
        if not pair or pair[0] != key:
            continue
        if pair[1]:
            return pair[1]
        nested = []
        for later in lines[index + 1:]:
            if later.strip() and len(later) - len(later.lstrip()) <= entry_indent:
                break
            nested.append(later)
        return "\n".join(nested)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…