MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _is_shell_block

Method _is_shell_block

src/harness/execution/response_parser.py:176–185  ·  view source on GitHub ↗

Check if a code block language indicates shell/bash content. Args: lang: The language specifier from the code block (e.g., "bash", "sh"). Returns: True if the language is a shell-like language or unspecified.

(self, lang: Optional[str])

Source from the content-addressed store, hash-verified

174 return raw_bash_block, inline_calls
175
176 def _is_shell_block(self, lang: Optional[str]) -> bool:
177 """Check if a code block language indicates shell/bash content.
178
179 Args:
180 lang: The language specifier from the code block (e.g., "bash", "sh").
181
182 Returns:
183 True if the language is a shell-like language or unspecified.
184 """
185 return not lang or lang.strip().lower() in SHELL_BLOCK_LANGS
186
187 def _looks_like_tool_call(self, content: str) -> bool:
188 """Check if content looks like a function/tool call.

Callers 4

_extract_inline_callsMethod · 0.95
test_shell_languagesMethod · 0.95
test_case_insensitiveMethod · 0.95

Calls

no outgoing calls

Tested by 3

test_shell_languagesMethod · 0.76
test_case_insensitiveMethod · 0.76