MCPcopy Create free account
hub / github.com/microsoft/Webwright / extractPythonHeredocs

Function extractPythonHeredocs

assets/compare_trajectory/app.js:553–565  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

551}
552
553function extractPythonHeredocs(text) {
554 const blocks = [];
555 const regex = /(?:^|\n)[^\n]*\bpython(?:3(?:\.\d+)?)?\s+-\s*<<['"]?([A-Za-z_][A-Za-z0-9_]*)['"]?\n([\s\S]*?)\n\1(?=\n|$)/g;
556 let match = regex.exec(String(text || ''));
557 while (match) {
558 const body = String(match[2] || '').trim();
559 if (body && looksLikePython(body)) {
560 blocks.push({ title: 'python heredoc', text: body, sourceLabel: 'python heredoc' });
561 }
562 match = regex.exec(String(text || ''));
563 }
564 return blocks;
565}
566
567function extractPythonFromPatch(text) {
568 const lines = String(text || '').split(/\r?\n/);

Callers 1

extractPythonBlocksFunction · 0.85

Calls 1

looksLikePythonFunction · 0.85

Tested by

no test coverage detected