MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / extract_args_section_google

Function extract_args_section_google

python/src/workflow/node.rs:695–721  ·  view source on GitHub ↗

Extract Args section from Google-style docstring

(docstring: &str)

Source from the content-addressed store, hash-verified

693
694/// Extract Args section from Google-style docstring
695fn extract_args_section_google(docstring: &str) -> Option<String> {
696 let lines: Vec<&str> = docstring.lines().collect();
697 let mut in_args_section = false;
698 let mut args_lines = Vec::new();
699
700 for line in lines {
701 let trimmed = line.trim();
702
703 if trimmed == "Args:" || trimmed == "Arguments:" || trimmed == "Parameters:" {
704 in_args_section = true;
705 continue;
706 }
707
708 if in_args_section {
709 if trimmed.ends_with(':') && !trimmed.contains(' ') && trimmed.len() > 1 {
710 break;
711 }
712 args_lines.push(line);
713 }
714 }
715
716 if args_lines.is_empty() {
717 None
718 } else {
719 Some(args_lines.join("\n"))
720 }
721}
722
723/// Parse a single parameter line from Google-style docstring
724fn parse_google_param_line(line: &str) -> Option<(String, String)> {

Callers 1

Calls 2

lenMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected