MCPcopy
hub / github.com/google/adk-python / clear

Method clear

src/google/adk/cli/browser/chunk-LA76DWZL.js:6–6  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(e){this.unput(this.match.slice(e))},"less"),pastInput:l(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var e=this.pastInput(),s=new Array(e.length+1).join("-");return e+this.upcomingInput()+`
5`+s+"^"},"showPosition"),test_match:l(function(e,s){var i,h,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),h=e[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in f)this[n]=f[n];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,s,i,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),n=0;n<f.length;n++)if(i=this._input.match(this.rules[f[n]]),i&&(!s||i[0].length>s[0].length)){if(s=i,h=n,this.options.backtrack_lexer){if(e=this.test_match(i,f[n]),e!==!1)return e;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(e=this.test_match(s,f[h]),e!==!1?e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,i,h,f){var n=f;switch(h){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return M})();N.lexer=D;function $(){this.yy={}}return l($,"Parser"),$.prototype=N,N.Parser=$,new $})();et.parser=et;var vt=et,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{l(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,rt()}getRoot(){return this.root}addNode(t,d){let a=nt.sanitizeText(d,J());if(!this.root){this.baseLevel=t,this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],Q(a);return}let r=t-(this.baseLevel??0);for(r<=0&&(r=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=r;)this.stack.pop();let o=this.stack[this.stack.length-1].node,y={text:a,children:[]};o.children.push(y),this.stack.push({level:r,node:y})}getAccTitle(){return ot()}setAccTitle(t){lt(t)}getAccDescription(){return ct()}setAccDescription(t){ht(t)}getDiagramTitle(){return ut()}setDiagramTitle(t){Q(t)}},Et=14,j=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=l((t,d,a)=>{let r=t.node().getBBox(),o=r.width+d*2,y=r.height+d*2;at(t,y,o,a),t.attr("viewBox",`${r.x-d} ${r.y-d} ${o} ${y}`)},"applyPaddedViewBox"),Lt=l((t,d,a,r)=>{let y=r.db.getRoot();if(!y)return;let p=J(),{look:u,handDrawnSeed:w,themeVariables:c}=p,m=yt(p.fontSize)[0]??Et,k=u==="handDrawn",_=y.children??[],x=p.ishikawa?.diagramPadding??20,N=p.ishikawa?.useMaxWidth??!1,D=dt(d),$=D.append("g").attr("class","ishikawa"),M=k?ft.svg(D.node()):void 0,e=M?{roughSvg:M,seed:w??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${d}`;k||$.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,h=j,f=k?void 0:z($,i,h,i,h,"ishikawa-spine");if(Tt($,i,h,y.text,m,e),!_.length){k&&z($,i,h,i,h,"ishikawa-spine",e),kt(D,x,N);return}i-=20;let n=_.filter((g,E)=>E%2===0),v=_.filter((g,E)=>E%2===1),b=mt(n),I=mt(v),S=b.total+I.total,A=j,L=j;if(S>0){let g=j*2,E=j*.3;A=Math.max(E,g*(b.total/S)),L=Math.max(E,g*(I.total/S))}let O=m*2;A=Math.max(A,b.max*O),L=Math.max(L,I.max*O),h=Math.max(A,j),f&&f.attr("y1",h).attr("y2",h),$.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);let Z=Math.ceil(_.length/2);for(let g=0;g<Z;g++){let E=$.append("g").attr("class","ishikawa-pair");for(let[V,R,X]of[[_[g*2],-1,A],[_[g*2+1],1,L]])V&&Bt(E,V,i,h,R,X,m,e);i=E.selectAll("text").nodes().reduce((V,R)=>Math.min(V,R.getBBox().x),1/0)}if(k)z($,i,h,0,h,"ishikawa-spine",e);else{f.attr("x1",i);let g=`url(#${s})`;$.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",g)}kt(D,x,N)},"draw"),mt=l(t=>{let d=l(a=>a.children.reduce((r,o)=>r+1+d(o),0),"countDescendants");return t.reduce((a,r)=>{let o=d(r);return a.total+=o,a.max=Math.max(a.max,o),a},{total:0,max:0})},"sideStats"),Tt=l((t,d,a,r,o,y)=>{let p=Math.max(6,Math.floor(110/(o*.6))),u=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${d},${a})`),w=U(u,_t(r,p),0,0,"ishikawa-head-label","start",o),c=w.node().getBBox(),m=Math.max(60,c.width+6),k=Math.max(40,c.height*2+40),_=`M 0 ${-k/2} L 0 ${k/2} Q ${m*2.4} 0 0 ${-k/2} Z`;if(y){let x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});u.insert(()=>x,":first-child").attr("class","ishikawa-head")}else u.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);w.attr("transform",`translate(${(m-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Mt=l((t,d)=>{let a=[],r=[],o=l((y,p,u)=>{let w=d===-1?[...y].reverse():y;for(let c of w){let m=a.length,k=c.children??[];a.push({depth:u,text:_t(c.text,15),parentIndex:p,childCount:k.length}),u%2===0?(r.push(m),k.length&&o(k,m,u+1)):(k.length&&o(k,m,u+1),r.push(m))}},"walk");return o(t,-1,2),{entries:a,yOrder:r}},"flattenTree"),Pt=l((t,d,a,r,o,y,p)=>{let u=t.append("g").attr("class","ishikawa-label-group"),c=U(u,d,a,r+11*o,"ishikawa-label cause","middle",y).node().getBBox();if(p){let m=p.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});u.insert(()=>m,":first-child").attr("class","ishikawa-label-box")}else u.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),tt=l((t,d,a,r,o,y)=>{let p=Math.sqrt(r*r+o*o);if(p===0)return;let u=r/p,w=o/p,c=6,m=-w*c,k=u*c,_=d,x=a,N=`M ${_} ${x} L ${_-u*c*2+m} ${x-w*c*2+k} L ${_-u*c*2-m} ${x-w*c*2-k} Z`,D=y.roughSvg.path(N,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});t.append(()=>D)},"drawArrowMarker"),Bt=l((t,d,a,r,o,y,p,u)=>{let w=d.children??[],c=y*(w.length?1:.2),m=-pt*c,k=gt*c*o,_=a+m,x=r+k;if(z(t,a,r,_,x,"ishikawa-branch",u),u&&tt(t,a,r,a-_,r-x,u),Pt(t,d.text,_,x,o,p,u),!w.length)return;let{entries:N,yOrder:D}=Mt(w,o),$=N.length,M=new Array($);for(let[f,n]of D.entries())M[n]=r+k*((f+1)/($+1));let e=new Map;e.set(-1,{x0:a,y0:r,x1:_,y1:x,childCount:w.length,childrenDrawn:0});let s=-pt,i=gt*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(let[f,n]of N.entries()){let v=M[f],b=e.get(n.parentIndex),I=t.append("g").attr("class","ishikawa-sub-group"),S=0,A=0,L=0;if(n.depth%2===0){let O=b.y1-b.y0;S=wt(b.x0,b.x1,O?(v-b.y0)/O:.5),A=v,L=S-(n.childCount>0?At+n.childCount*It:$t),z(I,S,v,L,v,"ishikawa-sub-branch",u),u&&tt(I,S,v,1,0,u),U(I,n.text,L,v,"ishikawa-label align","end",p)}else{let O=b.childrenDrawn++;S=wt(b.x0,b.x1,(b.childCount-O)/(b.childCount+1)),A=b.y0,L=S+s*((v-A)/i),z(I,S,A,L,v,"ishikawa-sub-branch",u),u&&tt(I,S,A,S-L,A-v,u),U(I,n.text,L,v,h,"end",p)}n.childCount>0&&e.set(f,{x0:S,y0:A,x1:L,y1:v,childCount:n.childCount,childrenDrawn:0})}},"drawBranch"),Nt=l(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=l((t,d)=>{if(t.length<=d)return t;let a=[];for(let r of t.split(/\s+/)){let o=a.length-1;o>=0&&a[o].length+1+r.length<=d?a[o]+=" "+r:a.push(r)}return a.join(`
7`)},"wrapText"),U=l((t,d,a,r,o,y,p)=>{let u=Nt(d),w=p*1.05,c=t.append("text").attr("class",o).attr("text-anchor",y).attr("x",a).attr("y",r-(u.length-1)*w/2);for(let[m,k]of u.entries())c.append("tspan").attr("x",a).attr("dy",m===0?0:w).text(k);return c},"drawMultilineText"),wt=l((t,d,a)=>t+(d-t)*a,"lerp"),z=l((t,d,a,r,o,y,p)=>{if(p){let u=p.roughSvg.line(d,a,r,o,{roughness:1.5,seed:p.seed,stroke:p.lineColor,strokeWidth:2});t.append(()=>u).attr("class",y);return}return t.append("line").attr("class",y).attr("x1",d).attr("y1",a).attr("x2",r).attr("y2",o)},"drawLine"),Dt={draw:Lt},Ot=l(t=>`
8.ishikawa .ishikawa-spine,
9.ishikawa .ishikawa-branch,

Callers

nothing calls this directly

Calls 1

rtFunction · 0.70

Tested by

no test coverage detected