Home / Function/ r_sa_check() — langchain Function Reference

r_sa_check() — langchain Function Reference

Architecture documentation for the r_sa_check() function in mustache.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  eee11095_d17a_3de4_36db_e1eb77ac77ea["r_sa_check()"]
  88ae0419_8f6b_8b31_dd8f_a3bc6bbcb7b6["mustache.py"]
  eee11095_d17a_3de4_36db_e1eb77ac77ea -->|defined in| 88ae0419_8f6b_8b31_dd8f_a3bc6bbcb7b6
  ee317545_08fa_c1b5_d4bc_6d8f5e1e4e7c["tokenize()"]
  ee317545_08fa_c1b5_d4bc_6d8f5e1e4e7c -->|calls| eee11095_d17a_3de4_36db_e1eb77ac77ea
  style eee11095_d17a_3de4_36db_e1eb77ac77ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/utils/mustache.py lines 92–115

def r_sa_check(
    template: str,
    tag_type: str,
    is_standalone: bool,  # noqa: FBT001
) -> bool:
    """Do a final check to see if a tag could be a standalone.

    Args:
        template: The template.
        tag_type: The type of the tag.
        is_standalone: Whether the tag is standalone.

    Returns:
        Whether the tag could be a standalone.
    """
    # Check right side if we might be a standalone
    if is_standalone and tag_type not in {"variable", "no escape"}:
        on_newline = template.split("\n", 1)

        # If the stuff to the right of us are spaces we're a standalone
        return on_newline[0].isspace() or not on_newline[0]

    # If we're a tag can't be a standalone
    return False

Domain

Subdomains

Called By

Frequently Asked Questions

What does r_sa_check() do?
r_sa_check() is a function in the langchain codebase, defined in libs/core/langchain_core/utils/mustache.py.
Where is r_sa_check() defined?
r_sa_check() is defined in libs/core/langchain_core/utils/mustache.py at line 92.
What calls r_sa_check()?
r_sa_check() is called by 1 function(s): tokenize.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free