{"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def update(self, **kwargs):\n consumer_id = load_consumer_id(self.context)\n if not consumer_id:\n self.prompt.render_failure_message(\"This consumer is not registered to the Pulp server.\")\n return\n\n delta = dict([(k, v) for k, v in kwargs.items() if v is not None])\n if 'note' in delta.keys():\n if delta['note']:\n delta['notes'] = args_to_notes_dict(kwargs['note'], include_none=False)\n delta.pop('note')\n # convert display-name to display_name\n key = 'display-name'\n if key in delta:\n v = delta.pop(key)\n key = key.replace('-', '_')\n delta[key] = v\n\n if kwargs.get(OPTION_EXCHANGE_KEYS.keyword):\n path = self.context.config['authentication']['rsa_pub']\n fp = open(path)\n try:\n delta['rsa_pub'] = fp.read()\n finally:\n fp.close()\n\n try:\n self.context.server.consumer.update(consumer_id, delta)\n self.prompt.render_success_message('Consumer [%s] successfully updated' % consumer_id)\n if not kwargs.get(OPTION_EXCHANGE_KEYS.keyword):\n return\n try:\n update_server_key(self.context.config)\n except Exception, e:\n msg = _('Download server RSA key failed [%(e)s]' % {'e': e})\n self.prompt.render_failure_message(msg)\n except NotFoundException:\n self.prompt.write('Consumer [%s] does not exist on the server' % consumer_id, tag='not-found') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: client_consumer/pulp/client/consumer/cli.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "7+train+pulp--pulp+CVE-2015-5263+vul.pkl", "func_name_": "update"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "361+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "setSortedState"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def left(self, count: int = 1) -> None:\n raise NotImplementedError \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: qutebrowser/browser/browsertab.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "111+train+qutebrowser--qutebrowser+CVE-2020-11054+clean.pkl", "func_name_": "left"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_tuple(self):\n x = ones((1, 1))\n x[:, (0,)] = 2.0\n assert_array_equal(x, array([[2.0]]))\n x = ones((1, 1, 1))\n x[:,:, (0,)] = 2.0\n assert_array_equal(x, array([[[2.0]]])) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n numpy/core/tests/test_multiarray.py::array\nnumpy/core/tests/test_multiarray.py::assert_array_equal\nnumpy/core/tests/test_multiarray.py::ones \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "228+train+numpy--numpy+CVE-2014-1858+clean.pkl", "func_name_": "test_tuple"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def block_card(request):\n card = request.session['card']\n request.db.execute(\"update cards set status = 'blocked' where id = %s\" % card['id'])\n request.db.commit() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: machine.py.\n//This function is called by other functions within the repository:\n machine.py::pin_view \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+viakondratiuk--cash-machine+CVE-2015-10069+vul.pkl", "func_name_": "block_card"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def serve_string_as_file(self, string, filename):\n content_disposition = 'attachment; filename=\"'+filename+'\"'\n cherrypy.response.headers[\"Content-Type\"] = \"application/x-download\"\n cherrypy.response.headers[\"Content-Disposition\"] = content_disposition\n return codecs.encode(string, \"UTF-8\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cherrymusicserver/httphandler.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "27+train+devsnd--cherrymusic+CVE-2015-8310+clean.pkl", "func_name_": "serve_string_as_file"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "133+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "detach"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_compile(self):\n # Test expression compilation\n e = self._makeEngine()\n for p in ('x', 'x/y', 'x/y/z'):\n e.compile(p)\n e.compile('path:a|b|c/d/e')\n e.compile('string:Fred')\n e.compile('string:A$B')\n e.compile('string:a ${x/y} b ${y/z} c')\n e.compile('python: 2 + 2')\n e.compile('python: 2 n+n 2n') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/Products/PageTemplates/tests/testExpressions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+zopefoundation--Zope+CVE-2021-32674+clean.pkl", "func_name_": "test_compile"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def setUp(self):\n self.d = array([0, 1])[0] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n numpy/core/tests/test_multiarray.py::ones \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "172+train+numpy--numpy+CVE-2014-1858+clean.pkl", "func_name_": "setUp"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(\n self,\n url: str,\n max_depth: Optional[int] = 2,\n use_async: Optional[bool] = None,\n extractor: Optional[Callable[[str], str]] = None,\n metadata_extractor: Optional[Callable[[str, str], str]] = None,\n exclude_dirs: Optional[Sequence[str]] = (),\n timeout: Optional[int] = 10,\n prevent_outside: Optional[bool] = True,\n link_regex: Union[str, re.Pattern, None] = None,\n headers: Optional[dict] = None,\n check_response_status: bool = False,\n ) -> None:\n \"\"\"Initialize with URL to crawl and any subdirectories to exclude.\n Args:\n url: The URL to crawl.\n max_depth: The max depth of the recursive loading.\n use_async: Whether to use asynchronous loading.\n If True, this function will not be lazy, but it will still work in the\n expected way, just not lazy.\n extractor: A function to extract document contents from raw html.\n When extract function returns an empty string, the document is\n ignored.\n metadata_extractor: A function to extract metadata from raw html and the\n source url (args in that order). Default extractor will attempt\n to use BeautifulSoup4 to extract the title, description and language\n of the page.\n exclude_dirs: A list of subdirectories to exclude.\n timeout: The timeout for the requests, in the unit of seconds. If None then\n connection will not timeout.\n prevent_outside: If True, prevent loading from urls which are not children\n of the root url.\n link_regex: Regex for extracting sub-links from the raw html of a web page.\n check_response_status: If True, check HTTP response status and skip\n URLs with error responses (400-599).\n \"\"\"\n\n self.url = url\n self.max_depth = max_depth if max_depth is not None else 2\n self.use_async = use_async if use_async is not None else False\n self.extractor = extractor if extractor is not None else lambda x: x\n self.metadata_extractor = (\n metadata_extractor\n if metadata_extractor is not None\n else _metadata_extractor\n )\n self.exclude_dirs = exclude_dirs if exclude_dirs is not None else ()\n\n if any(url.startswith(exclude_dir) for exclude_dir in self.exclude_dirs):\n raise ValueError(\n f\"Base url is included in exclude_dirs. Received base_url: {url} and \"\n f\"exclude_dirs: {self.exclude_dirs}\"\n )\n\n self.timeout = timeout\n self.prevent_outside = prevent_outside if prevent_outside is not None else True\n self.link_regex = link_regex\n self._lock = asyncio.Lock() if self.use_async else None\n self.headers = headers\n self.check_response_status = check_response_status \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: libs/langchain/langchain/document_loaders/recursive_url_loader.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+langchain-ai--langchain+CVE-2023-46229+vul.pkl", "func_name_": "__init__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def decorator(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n s = flask.session\n #: already authenticated?\n if is_authenticated(s):\n perms = parse_permissions(s)\n if perm not in perms or not perms[perm]:\n response = \"Forbidden\", 403\n else:\n response = func(*args, **kwargs)\n\n elif flask.request.headers.get(\"X-Requested-With\") == \"XMLHttpRequest\":\n response = \"Forbidden\", 403\n\n else:\n location = flask.url_for(\n \"app.login\",\n next=flask.request.url\n )\n response = flask.redirect(location)\n\n return response\n\n return wrapper \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/helpers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "24+train+pyload--pyload+CVE-2023-0227+clean.pkl", "func_name_": "decorator"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "177+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "getPosition"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _handle_client_error(self, ex):\n # Called for invalid client input\n # Returns the appropriate error response.\n if not isinstance(ex, ValueError):\n # XXX: Why not self._log_error to send it through the loop's\n # handle_error method?\n traceback.print_exc()\n if isinstance(ex, _InvalidClientRequest):\n # No formatting needed, that's already been handled. In fact, because the\n # formatted message contains user input, it might have a % in it, and attempting\n # to format that with no arguments would be an error.\n self.log_error(ex.formatted_message)\n else:\n self.log_error('Invalid request: %s', str(ex) or ex.__class__.__name__)\n return ('400', _BAD_REQUEST_RESPONSE) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/gevent/pywsgi.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/gevent/pywsgi.py::str\nsrc/gevent/pywsgi.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+gevent--gevent+CVE-2023-41419+vul.pkl", "func_name_": "_handle_client_error"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def find_id(self, elem_id, callback):\n js_code = javascript.assemble('webelem', 'find_id', elem_id)\n js_cb = functools.partial(self._js_cb_single, callback)\n self._tab.run_js_async(js_code, js_cb) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: qutebrowser/browser/webengine/webenginetab.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "87+train+qutebrowser--qutebrowser+CVE-2020-11054+clean.pkl", "func_name_": "find_id"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_entrance_exam_sttudent_delete_state(self):\n \"\"\" Test delete single student entrance exam state. \"\"\"\n url = reverse('reset_student_attempts_for_entrance_exam',\n kwargs={'course_id': unicode(self.course.id)})\n response = self.client.get(url, {\n 'unique_student_identifier': self.student.email,\n 'delete_module': True,\n })\n self.assertEqual(response.status_code, 200)\n # make sure the module has been deleted\n changed_modules = StudentModule.objects.filter(module_state_key__in=self.ee_modules)\n self.assertEqual(changed_modules.count(), 0) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "73+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_entrance_exam_sttudent_delete_state"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def project_clone(request):\n \"\"\"\n clone project from github\n :param request: request object\n :return: json\n \"\"\"\n if request.method == 'POST':\n data = json.loads(request.body)\n address = data.get('address')\n if not address.startswith('http'):\n return JsonResponse({'status': False})\n address = address + '.git' if not address.endswith('.git') else address\n cmd = 'git clone {address} {target}'.format(address=address, target=join(PROJECTS_FOLDER, Path(address).stem))\n logger.debug('clone cmd %s', cmd)\n p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)\n stdout, stderr = bytes2str(p.stdout.read()), bytes2str(p.stderr.read())\n logger.debug('clone run result %s', stdout)\n if stderr: logger.error(stderr)\n return JsonResponse({'status': True}) if not stderr else JsonResponse({'status': False}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: gerapy/server/core/views.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n gerapy/server/core/views.py::join\ngerapy/server/core/views.py::Popen\ngerapy/server/core/views.py::permission_classes\ngerapy/server/core/views.py::bytes2str\ngerapy/server/core/views.py::api_view\ngerapy/server/core/views.py::Path\ngerapy/server/core/views.py::JsonResponse \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+Gerapy--Gerapy+CVE-2021-43857+vul.pkl", "func_name_": "project_clone"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def received(self, s):\n # Returns the number of bytes consumed.\n if self.completed:\n return 0\n orig_size = len(s)\n while s:\n rm = self.chunk_remainder\n if rm > 0:\n # Receive the remainder of a chunk.\n to_write = s[:rm]\n self.buf.append(to_write)\n written = len(to_write)\n s = s[written:]\n self.chunk_remainder -= written\n elif not self.all_chunks_received:\n # Receive a control line.\n s = self.control_line + s\n pos = s.find(b\"\\n\")\n if pos < 0:\n # Control line not finished.\n self.control_line = s\n s = \"\"\n else:\n # Control line finished.\n line = s[:pos]\n s = s[pos + 1 :]\n self.control_line = b\"\"\n line = line.strip()\n if line:\n # Begin a new chunk.\n semi = line.find(b\";\")\n if semi >= 0:\n # discard extension info.\n line = line[:semi]\n try:\n sz = int(line.strip(), 16) # hexadecimal\n except ValueError: # garbage in input\n self.error = BadRequest(\"garbage in chunked encoding input\")\n sz = 0\n if sz > 0:\n # Start a new chunk.\n self.chunk_remainder = sz\n else:\n # Finished chunks.\n self.all_chunks_received = True\n # else expect a control line.\n else:\n # Receive the trailer.\n trailer = self.trailer + s\n if trailer.startswith(b\"\\r\\n\"):\n # No trailer.\n self.completed = True\n return orig_size - (len(trailer) - 2)\n elif trailer.startswith(b\"\\n\"):\n # No trailer.\n self.completed = True\n return orig_size - (len(trailer) - 1)\n pos = find_double_newline(trailer)\n if pos < 0:\n # Trailer not finished.\n self.trailer = trailer\n s = b\"\"\n else:\n # Finished the trailer.\n self.completed = True\n self.trailer = trailer[:pos]\n return orig_size - (len(trailer) - pos)\n return orig_size \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/receiver.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/receiver.py::find_double_newline\nwaitress/receiver.py::len\nwaitress/receiver.py::int\nwaitress/receiver.py::BadRequest \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "received"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_mpi_run_minimal(self):\n if not mpi_available():\n self.skipTest(\"MPI is not available\")\n\n cmd = ['cmd']\n settings = self.minimal_settings\n\n def mpi_impl_flags(tcp, env=None):\n return [\"--mock-mpi-impl-flags\"], [\"--mock-mpi-binding-args\"], None\n\n with mock.patch(\"horovod.runner.mpi_run._get_mpi_implementation_flags\", side_effect=mpi_impl_flags):\n with mock.patch(\"horovod.runner.mpi_run.safe_shell_exec.execute\", return_value=0) as execute:\n mpi_run(settings, None, {}, cmd)\n\n # call the mocked _get_mpi_implementation_flags method\n mpi_flags, binding_args, mpi = horovod.runner.mpi_run._get_mpi_implementation_flags(False)\n self.assertIsNotNone(mpi_flags)\n if _IMPI_IMPL == mpi:\n expected_cmd = ('mpirun '\n '-l -n 2 -hosts localhost '\n '{binding_args} '\n '{mpi_flags} '\n 'cmd').format(binding_args=' '.join(binding_args), mpi_flags=' '.join(mpi_flags))\n else:\n expected_cmd = ('mpirun '\n '--allow-run-as-root --tag-output '\n '-np 2 -H localhost:2 '\n '{binding_args} '\n '{mpi_flags} '\n 'cmd').format(binding_args=' '.join(binding_args), mpi_flags=' '.join(mpi_flags))\n\n # remove PYTHONPATH from execute's env\n # we cannot know the exact value of that env variable\n # we test right handling of PYTHONPATH in test_mpi_run_*pythonpath* below\n self.assertIn('env', execute.call_args.kwargs)\n if 'PYTHONPATH' in execute.call_args.kwargs['env']:\n execute.call_args.kwargs['env'].pop('PYTHONPATH')\n\n expected_env = {'PATH': os.environ.get('PATH')}\n execute.assert_called_once_with(expected_cmd, env=expected_env, stdout=None, stderr=None) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/single/test_run.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n test/single/test_run.py::mpi_run\ntest/single/test_run.py::mpi_available \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "12+train+horovod--horovod+CVE-2022-0315+clean.pkl", "func_name_": "test_mpi_run_minimal"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_12_overssh(self):\n \"\"\" U12 | command over ssh \"\"\"\n args = self.args + [\"--overssh=['exit']\", '-c exit']\n os.environ['SSH_CLIENT'] = '8.8.8.8 36000 22'\n if 'SSH_TTY' in os.environ:\n os.environ.pop('SSH_TTY')\n with self.assertRaises(SystemExit) as cm:\n CheckConfig(args).returnconf()\n return self.assertEqual(cm.exception.code, 0) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/test_unit.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n test/test_unit.py::CheckConfig \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "51+train+ghantoos--lshell+CVE-2016-6902+clean.pkl", "func_name_": "test_12_overssh"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __get__(self, obj, cls):\n if obj is None: return self\n key, storage = self.key, getattr(obj, self.attr)\n if key not in storage: storage[key] = self.getter(obj)\n return storage[key] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: bottle.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "99+train+bottlepy--bottle+CVE-2016-9964+clean.pkl", "func_name_": "__get__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def task_create(request):\n \"\"\"\n add task\n :param request: request object\n :return: Bool\n \"\"\"\n if request.method == 'POST':\n data = json.loads(request.body)\n task = Task.objects.create(clients=json.dumps(data.get('clients'), ensure_ascii=False),\n project=data.get('project'),\n name=data.get('name'),\n spider=data.get('spider'),\n trigger=data.get('trigger'),\n configuration=json.dumps(data.get('configuration'), ensure_ascii=False),\n modified=1)\n return JsonResponse({'result': '1', 'data': model_to_dict(task)}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: gerapy/server/core/views.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n gerapy/server/core/views.py::permission_classes\ngerapy/server/core/views.py::model_to_dict\ngerapy/server/core/views.py::api_view\ngerapy/server/core/views.py::JsonResponse \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+Gerapy--Gerapy+CVE-2021-43857+vul.pkl", "func_name_": "task_create"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *\ninstantiate(PyObject *cls, PyObject *args)\n{\n /* Caller must assure args are a tuple. Normally, args come from\n Pdata_poptuple which packs objects from the top of the stack\n into a newly created tuple. */\n assert(PyTuple_Check(args));\n if (!PyTuple_GET_SIZE(args) && PyType_Check(cls)) {\n _Py_IDENTIFIER(__getinitargs__);\n _Py_IDENTIFIER(__new__);\n PyObject *func;\n if (_PyObject_LookupAttrId(cls, &PyId___getinitargs__, &func) < 0) {\n return NULL;\n }\n if (func == NULL) {\n return _PyObject_CallMethodIdObjArgs(cls, &PyId___new__, cls, NULL);\n }\n Py_DECREF(func);\n }\n return PyObject_CallObject(cls, args);\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "148+train+python--cpython+CVE-2018-20406+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _get_element_ptr_array(parent, key, array_bounds_check):\n\n assert isinstance(parent.typ, ArrayLike)\n\n if not is_integer_type(key.typ):\n raise TypeCheckFailure(f\"{key.typ} used as array index\")\n\n subtype = parent.typ.subtype\n\n if parent.value == \"~empty\":\n if array_bounds_check:\n # this case was previously missing a bounds check. codegen\n # is a bit complicated when bounds check is required, so\n # block it. there is no reason to index into a literal empty\n # array anyways!\n raise TypeCheckFailure(\"indexing into zero array not allowed\")\n return IRnode.from_list(\"~empty\", subtype)\n\n if parent.value == \"multi\":\n assert isinstance(key.value, int)\n return parent.args[key.value]\n\n ix = unwrap_location(key)\n\n if array_bounds_check:\n # clamplt works, even for signed ints. since two's-complement\n # is used, if the index is negative, (unsigned) LT will interpret\n # it as a very large number, larger than any practical value for\n # an array index, and the clamp will throw an error.\n clamp_op = \"uclamplt\"\n is_darray = isinstance(parent.typ, DArrayType)\n bound = get_dyn_array_count(parent) if is_darray else parent.typ.count\n # NOTE: there are optimization rules for this when ix or bound is literal\n ix = IRnode.from_list([clamp_op, ix, bound], typ=ix.typ)\n\n if parent.encoding in (Encoding.ABI, Encoding.JSON_ABI):\n if parent.location == STORAGE:\n raise CompilerPanic(\"storage variables should not be abi encoded\") # pragma: notest\n\n member_abi_t = subtype.abi_type\n\n ofst = _mul(ix, member_abi_t.embedded_static_size())\n\n return _getelemptr_abi_helper(parent, subtype, ofst)\n\n if parent.location.word_addressable:\n element_size = subtype.storage_size_in_words\n elif parent.location.byte_addressable:\n element_size = subtype.memory_bytes_required\n else:\n raise CompilerPanic(\"unreachable\") # pragma: notest\n\n ofst = _mul(ix, element_size)\n\n if has_length_word(parent.typ):\n data_ptr = add_ofst(parent, parent.location.word_scale * DYNAMIC_ARRAY_OVERHEAD)\n else:\n data_ptr = parent\n\n return IRnode.from_list(add_ofst(data_ptr, ofst), typ=subtype, location=parent.location) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/core.py.\n//This function is called by other functions within the repository:\n vyper/codegen/core.py::get_element_ptr \n//This function itself calls other functions within the repository:\n vyper/codegen/core.py::has_length_word\nvyper/codegen/core.py::_mul\nvyper/codegen/core.py::add_ofst\nvyper/codegen/core.py::CompilerPanic\nvyper/codegen/core.py::get_dyn_array_count\nvyper/codegen/core.py::TypeCheckFailure\nvyper/codegen/core.py::_getelemptr_abi_helper\nvyper/codegen/core.py::isinstance\nvyper/codegen/core.py::is_integer_type\nvyper/codegen/core.py::unwrap_location \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+vyperlang--vyper+CVE-2022-24845+vul.pkl", "func_name_": "_get_element_ptr_array"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_init_arguments_and_types(cls: Any) -> List[Tuple[str, Tuple, Any]]:\n r\"\"\"Scans the class signature and returns argument names, types and default values.\n\n Returns:\n List with tuples of 3 values:\n (argument name, set with argument types, argument default value).\n\n Examples:\n\n >>> from pytorch_lightning import Trainer\n >>> args = get_init_arguments_and_types(Trainer)\n\n \"\"\"\n cls_default_params = inspect.signature(cls).parameters\n name_type_default = []\n for arg in cls_default_params:\n arg_type = cls_default_params[arg].annotation\n arg_default = cls_default_params[arg].default\n try:\n arg_types = tuple(arg_type.__args__)\n except (AttributeError, TypeError):\n arg_types = (arg_type,)\n\n name_type_default.append((arg, arg_types, arg_default))\n\n return name_type_default \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pytorch_lightning/utilities/argparse.py.\n//This function is called by other functions within the repository:\n pytorch_lightning/utilities/argparse.py::parse_argparser\npytorch_lightning/utilities/argparse.py::parse_env_variables\npytorch_lightning/utilities/argparse.py::add_argparse_args\npytorch_lightning/utilities/argparse.py::insert_env_defaults \n//This function itself calls other functions within the repository:\n pytorch_lightning/utilities/argparse.py::tuple \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "8+train+Lightning-AI--pytorch-lightning+CVE-2022-0845+clean.pkl", "func_name_": "get_init_arguments_and_types"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_superuser_can_add_users(self):\n # test for https://github.com/kiwitcms/Kiwi/issues/642\n self.client.login( # nosec:B106:hardcoded_password_funcarg\n username=self.admin.username, password=\"admin-password\"\n )\n response = self.client.get(\"/admin/auth/user/add/\")\n self.assertEqual(HTTPStatus.OK, response.status_code)\n\n response = self.client.post(\n \"/admin/auth/user/add/\",\n {\n \"username\": \"added-by-admin\",\n \"password1\": \"xo-xo-xo\",\n \"password2\": \"xo-xo-xo\",\n },\n follow=True,\n )\n self.assertEqual(HTTPStatus.OK, response.status_code)\n self.assertTrue(\n get_user_model().objects.filter(username=\"added-by-admin\").exists()\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tcms/kiwi_auth/tests/test_admin.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tcms/kiwi_auth/tests/test_admin.py::get_user_model \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+kiwitcms--Kiwi+CVE-2023-22451+vul.pkl", "func_name_": "test_superuser_can_add_users"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_mpi_implementation(self):\n def test(output, expected, exit_code=0):\n ret = (output, exit_code) if output is not None else None\n env = {'VAR': 'val'}\n with mock.patch(\"horovod.runner.mpi_run.tiny_shell_exec.execute\", return_value=ret) as m:\n implementation = _get_mpi_implementation(env)\n self.assertEqual(expected, implementation)\n m.assert_called_once_with('mpirun --version', env)\n\n test((\"mpirun (Open MPI) 2.1.1\\n\"\n \"Report bugs to http://www.open-mpi.org/community/help/\\n\"), _OMPI_IMPL)\n\n test(\"OpenRTE\", _OMPI_IMPL)\n\n test(\"IBM Spectrum MPI\", _SMPI_IMPL)\n\n test((\"HYDRA build details:\\n\"\n \" Version: 3.3a2\\n\"\n \" Configure options: 'MPICHLIB_CFLAGS=-g -O2'\\n\"), _MPICH_IMPL)\n \n test(\"Intel(R) MPI\", _IMPI_IMPL)\n\n test(\"Unknown MPI v1.00\", _UNKNOWN_IMPL)\n\n test(\"output\", exit_code=1, expected=_MISSING_IMPL)\n\n test(None, _MISSING_IMPL) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/single/test_run.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n test/single/test_run.py::test \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+horovod--horovod+CVE-2022-0315+vul.pkl", "func_name_": "test_get_mpi_implementation"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_next(it, opt=None):\n try:\n return next(it)\n except Exception:\n return opt \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/handlers/federation.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/handlers/federation.py::next \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "730+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_next"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def find_user(self, username=None, email=None):\n \"\"\"\n Generic function find a user by it's username or email\n \"\"\"\n raise NotImplementedError \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: flask_appbuilder/security/manager.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "27+train+dpgaspar--Flask-AppBuilder+CVE-2021-41265+clean.pkl", "func_name_": "find_user"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def recovery_parser(xml):\n parser = XMLParser(recover=True)\n return parse(BytesIO(xml), parser) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pikepdf/models/metadata.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+pikepdf--pikepdf+CVE-2021-29421+vul.pkl", "func_name_": "_load_from.recovery_parser"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static CYTHON_SMALL_CODE int __pyx_pymod_exec_bufferedwriter(PyObject *__pyx_pyinit_module)\n#endif\n#endif\n{\n PyObject *__pyx_t_1 = NULL;\n PyObject *__pyx_t_2 = NULL;\n __Pyx_RefNannyDeclarations\n #if CYTHON_PEP489_MULTI_PHASE_INIT\n if (__pyx_m) {\n if (__pyx_m == __pyx_pyinit_module) return 0;\n PyErr_SetString(PyExc_RuntimeError, \"Module 'bufferedwriter' has already been imported. Re-initialisation is not supported.\");\n return -1;\n }\n #elif PY_MAJOR_VERSION >= 3\n if (__pyx_m) return __Pyx_NewRef(__pyx_m);\n #endif\n #if CYTHON_REFNANNY\n__Pyx_RefNanny = __Pyx_RefNannyImportAPI(\"refnanny\");\nif (!__Pyx_RefNanny) {\n PyErr_Clear();\n __Pyx_RefNanny = __Pyx_RefNannyImportAPI(\"Cython.Runtime.refnanny\");\n if (!__Pyx_RefNanny)\n Py_FatalError(\"failed to import 'refnanny' module\");\n}\n#endif\n __Pyx_RefNannySetupContext(\"__Pyx_PyMODINIT_FUNC PyInit_bufferedwriter(void)\", 0);\n if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #ifdef __Pxy_PyFrame_Initialize_Offsets\n __Pxy_PyFrame_Initialize_Offsets();\n #endif\n __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)\n __pyx_empty_bytes = PyBytes_FromStringAndSize(\"\", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)\n __pyx_empty_unicode = PyUnicode_FromStringAndSize(\"\", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)\n #ifdef __Pyx_CyFunction_USED\n if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n #ifdef __Pyx_FusedFunction_USED\n if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n #ifdef __Pyx_Coroutine_USED\n if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n #ifdef __Pyx_Generator_USED\n if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n #ifdef __Pyx_AsyncGen_USED\n if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n #ifdef __Pyx_StopAsyncIteration_USED\n if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n /*--- Library function declarations ---*/\n /*--- Threads initialization code ---*/\n #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS\n #ifdef WITH_THREAD /* Python build with threading support? */\n PyEval_InitThreads();\n #endif\n #endif\n /*--- Module creation code ---*/\n #if CYTHON_PEP489_MULTI_PHASE_INIT\n __pyx_m = __pyx_pyinit_module;\n Py_INCREF(__pyx_m);\n #else\n #if PY_MAJOR_VERSION < 3\n __pyx_m = Py_InitModule4(\"bufferedwriter\", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);\n #else\n __pyx_m = PyModule_Create(&__pyx_moduledef);\n #endif\n if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)\n Py_INCREF(__pyx_d);\n __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)\n Py_INCREF(__pyx_b);\n __pyx_cython_runtime = PyImport_AddModule((char *) \"cython_runtime\"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)\n Py_INCREF(__pyx_cython_runtime);\n if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);\n /*--- Initialize various global constants etc. ---*/\n if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)\n if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n if (__pyx_module_is_main_clickhouse_driver__bufferedwriter) {\n if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n }\n #if PY_MAJOR_VERSION >= 3\n {\n PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)\n if (!PyDict_GetItemString(modules, \"clickhouse_driver.bufferedwriter\")) {\n if (unlikely(PyDict_SetItemString(modules, \"clickhouse_driver.bufferedwriter\", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)\n }\n }\n #endif\n /*--- Builtin init code ---*/\n if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;\n /*--- Constants init code ---*/\n if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;\n /*--- Global type/function init code ---*/\n (void)__Pyx_modinit_global_init_code();\n (void)__Pyx_modinit_variable_export_code();\n (void)__Pyx_modinit_function_export_code();\n if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;\n if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;\n (void)__Pyx_modinit_variable_import_code();\n (void)__Pyx_modinit_function_import_code();\n /*--- Execution code ---*/\n #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)\n if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n #endif\n\n /* \"clickhouse_driver/bufferedwriter.pyx\":5\n * from libc.string cimport memcpy\n * \n * from .varint import write_varint # <<<<<<<<<<<<<<\n * \n * \n */\n __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_INCREF(__pyx_n_s_write_varint);\n __Pyx_GIVEREF(__pyx_n_s_write_varint);\n PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_write_varint);\n __pyx_t_2 = __Pyx_Import(__pyx_n_s_varint, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_2);\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_write_varint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_varint, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;\n\n /* \"(tree fragment)\":1\n * def __pyx_unpickle_BufferedWriter(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<\n * cdef object __pyx_PickleError\n * cdef object __pyx_result\n */\n __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_17clickhouse_driver_14bufferedwriter_1__pyx_unpickle_BufferedWriter, NULL, __pyx_n_s_clickhouse_driver_bufferedwriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_2);\n if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BufferedWriter, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;\n\n /* \"(tree fragment)\":11\n * __pyx_unpickle_BufferedWriter__set_state( __pyx_result, __pyx_state)\n * return __pyx_result\n * cdef __pyx_unpickle_BufferedWriter__set_state(BufferedWriter __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<\n * __pyx_result.buffer = __pyx_state[0]; __pyx_result.buffer_size = __pyx_state[1]; __pyx_result.position = __pyx_state[2]\n * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):\n */\n __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_17clickhouse_driver_14bufferedwriter_3__pyx_unpickle_BufferedSocketWriter, NULL, __pyx_n_s_clickhouse_driver_bufferedwriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_2);\n if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BufferedSocketWri, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;\n\n /* \"(tree fragment)\":1\n * def __pyx_unpickle_CompressedBufferedWriter(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<\n * cdef object __pyx_PickleError\n * cdef object __pyx_result\n */\n __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_17clickhouse_driver_14bufferedwriter_5__pyx_unpickle_CompressedBufferedWriter, NULL, __pyx_n_s_clickhouse_driver_bufferedwriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_2);\n if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CompressedBuffere, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;\n\n /* \"clickhouse_driver/bufferedwriter.pyx\":1\n * from cpython cimport PyMem_Malloc, PyMem_Free, PyBytes_AsString, \\ # <<<<<<<<<<<<<<\n * PyBytes_Check, PyBytes_FromStringAndSize\n * from libc.string cimport memcpy\n */\n __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_2);\n if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;\n\n /*--- Wrapped vars code ---*/\n\n goto __pyx_L0;\n __pyx_L1_error:;\n __Pyx_XDECREF(__pyx_t_1);\n __Pyx_XDECREF(__pyx_t_2);\n if (__pyx_m) {\n if (__pyx_d) {\n __Pyx_AddTraceback(\"init clickhouse_driver.bufferedwriter\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n }\n Py_CLEAR(__pyx_m);\n } else if (!PyErr_Occurred()) {\n PyErr_SetString(PyExc_ImportError, \"init clickhouse_driver.bufferedwriter\");\n }\n __pyx_L0:;\n __Pyx_RefNannyFinishContext();\n #if CYTHON_PEP489_MULTI_PHASE_INIT\n return (__pyx_m != NULL) ? 0 : -1;\n #elif PY_MAJOR_VERSION >= 3\n return __pyx_m;\n #else\n return;\n #endif\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedwriter.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+mymarilyn--clickhouse-driver+CVE-2020-26759+vul.pkl", "func_name_": "__pyx_pymod_exec_bufferedwriter"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def update_metadata(cls, instance, meta_data_list: List, is_private: bool = False):\n if is_private:\n instance.store_value_in_private_metadata(\n {data.key: data.value for data in meta_data_list}\n )\n else:\n instance.store_value_in_metadata(\n {data.key: data.value for data in meta_data_list}\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/core/mutations.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "143+train+saleor--saleor+CVE-2023-26051+clean.pkl", "func_name_": "update_metadata"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _build_and_send_join_event(self, other_server, other_user, room_id):\n join_event = self.get_success(\n self.handler.on_make_join_request(other_server, room_id, other_user)\n )\n # the auth code requires that a signature exists, but doesn't check that\n # signature... go figure.\n join_event.signatures[other_server] = {\"x\": \"y\"}\n with LoggingContext(request=\"send_join\"):\n d = run_in_background(\n self.handler.on_send_join_request, other_server, join_event\n )\n self.get_success(d)\n\n # sanity-check: the room should show that the new user is a member\n r = self.get_success(self.store.get_current_state_ids(room_id))\n self.assertEqual(r[(EventTypes.Member, other_user)], join_event.event_id)\n\n return join_event \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/handlers/test_federation.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/handlers/test_federation.py::LoggingContext\ntests/handlers/test_federation.py::run_in_background \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "64+train+matrix-org--synapse+CVE-2020-26257+clean.pkl", "func_name_": "_build_and_send_join_event"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def load_module(self, fullname):\n if fullname in sys.modules: return sys.modules[fullname]\n modname = fullname.rsplit('.', 1)[1]\n realname = self.impmask % modname\n __import__(realname)\n module = sys.modules[fullname] = sys.modules[realname]\n setattr(self.module, modname, module)\n module.__loader__ = self\n return module \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: bottle.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n bottle.py::load\nbottle.py::dir\nbottle.py::getattr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "94+train+bottlepy--bottle+CVE-2016-9964+clean.pkl", "func_name_": "load_module"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "443+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "insertAtCursor"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_request_body_too_large_with_no_cl_http10(self):\n body = \"a\" * self.toobig\n to_send = \"GET / HTTP/1.0\\n\\n\"\n to_send += body\n to_send = tobytes(to_send)\n self.connect()\n self.sock.send(to_send)\n fp = self.sock.makefile(\"rb\", 0)\n line, headers, response_body = read_http(fp)\n self.assertline(line, \"200\", \"OK\", \"HTTP/1.0\")\n cl = int(headers[\"content-length\"])\n self.assertEqual(cl, len(response_body))\n # extra bytes are thrown away (no pipelining), connection closed\n self.send_check_error(to_send)\n self.assertRaises(ConnectionClosed, read_http, fp) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::tobytes\nwaitress/tests/test_functional.py::int\nwaitress/tests/test_functional.py::read_http\nwaitress/tests/test_functional.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "43+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_request_body_too_large_with_no_cl_http10"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def repair_catalog(self,catalog_path,code):\n \"\"\" Remove entry for code from catalog_path\n\n Occasionally catalog entries could get corrupted. An example\n would be when a module that had functions in the catalog was\n deleted or moved on the disk. The best current repair method is\n just to trash the entire catalog entry for this piece of code.\n This may loose function entries that are valid, but thats life.\n\n catalog_path must be writable for repair. If it isn't, the\n function exists with a warning.\n \"\"\"\n writable_cat = None\n if (catalog_path is not None) and (not os.path.exists(catalog_path)):\n return\n try:\n writable_cat = get_catalog(catalog_path,'w')\n except:\n print('warning: unable to repair catalog entryn %sn inn %s' % \n (code,catalog_path))\n # shelve doesn't guarantee flushing, so it's safest to explicitly\n # close the catalog\n writable_cat.close()\n return\n if code in writable_cat:\n print('repairing catalog by removing key')\n del writable_cat[code]\n\n # it is possible that the path key doesn't exist (if the function\n # registered was a built-in function), so we have to check if the path\n # exists before arbitrarily deleting it.\n path_key = self.path_key(code)\n if path_key in writable_cat:\n del writable_cat[path_key]\n writable_cat.close() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: scipy/weave/catalog.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n scipy/weave/catalog.py::print\nscipy/weave/catalog.py::get_catalog \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "46+train+scipy--scipy+CVE-2013-4251+clean.pkl", "func_name_": "repair_catalog"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get(self, key, default):\n for m in self.mappings:\n value = m.get(key, self)\n if value is not self:\n return value\n return default \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/Products/PageTemplates/Expressions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "103+train+zopefoundation--Zope+CVE-2021-32674+clean.pkl", "func_name_": "get"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _clone(\n self,\n src: \"DictionaryObject\",\n pdf_dest: PdfWriterProtocol,\n force_duplicate: bool,\n ignore_fields: Optional[Sequence[Union[str, int]]],\n ) -> None:\n \"\"\"\n Update the object from src.\n\n Args:\n src: \"DictionaryObject\":\n pdf_dest:\n force_duplicate:\n ignore_fields:\n \"\"\"\n # first we remove for the ignore_fields\n # that are for a limited number of levels\n x = 0\n assert ignore_fields is not None\n ignore_fields = list(ignore_fields)\n while x < len(ignore_fields):\n if isinstance(ignore_fields[x], int):\n if cast(int, ignore_fields[x]) <= 0:\n del ignore_fields[x]\n del ignore_fields[x]\n continue\n else:\n ignore_fields[x] -= 1 # type:ignore\n x += 1\n # First check if this is a chain list, we need to loop to prevent recur\n if any(\n field not in ignore_fields\n and field in src\n and isinstance(src.raw_get(field), IndirectObject)\n and isinstance(src[field], DictionaryObject)\n and (\n src.get(\"/Type\", None) is None\n or cast(DictionaryObject, src[field]).get(\"/Type\", None) is None\n or src.get(\"/Type\", None)\n == cast(DictionaryObject, src[field]).get(\"/Type\", None)\n )\n for field in [\"/Next\", \"/Prev\", \"/N\", \"/V\"]\n ):\n ignore_fields = list(ignore_fields)\n for lst in ((\"/Next\", \"/Prev\"), (\"/N\", \"/V\")):\n for k in lst:\n objs = []\n if (\n k in src\n and k not in self\n and isinstance(src.raw_get(k), IndirectObject)\n and isinstance(src[k], DictionaryObject)\n # IF need to go further the idea is to check\n # that the types are the same:\n and (\n src.get(\"/Type\", None) is None\n or cast(DictionaryObject, src[k]).get(\"/Type\", None) is None\n or src.get(\"/Type\", None)\n == cast(DictionaryObject, src[k]).get(\"/Type\", None)\n )\n ):\n cur_obj: Optional[DictionaryObject] = cast(\n \"DictionaryObject\", src[k]\n )\n prev_obj: Optional[DictionaryObject] = self\n while cur_obj is not None:\n clon = cast(\n \"DictionaryObject\",\n cur_obj._reference_clone(\n cur_obj.__class__(), pdf_dest, force_duplicate\n ),\n )\n objs.append((cur_obj, clon))\n assert prev_obj is not None\n prev_obj[NameObject(k)] = clon.indirect_reference\n prev_obj = clon\n try:\n if cur_obj == src:\n cur_obj = None\n else:\n cur_obj = cast(\"DictionaryObject\", cur_obj[k])\n except Exception:\n cur_obj = None\n for s, c in objs:\n c._clone(s, pdf_dest, force_duplicate, ignore_fields)\n\n for k, v in src.items():\n if k not in ignore_fields:\n if isinstance(v, StreamObject):\n if not hasattr(v, \"indirect_reference\"):\n v.indirect_reference = None\n vv = v.clone(pdf_dest, force_duplicate, ignore_fields)\n assert vv.indirect_reference is not None\n self[k.clone(pdf_dest)] = vv.indirect_reference # type: ignore[attr-defined]\n elif k not in self:\n self[NameObject(k)] = (\n v.clone(pdf_dest, force_duplicate, ignore_fields)\n if hasattr(v, \"clone\")\n else v\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pypdf/generic/_data_structures.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n pypdf/generic/_data_structures.py::list\npypdf/generic/_data_structures.py::super\npypdf/generic/_data_structures.py::cast\npypdf/generic/_data_structures.py::b_ \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+py-pdf--pypdf+CVE-2023-46250+vul.pkl", "func_name_": "_clone"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __repr__(self):\n return 'Importer' \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mitogen/core.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "163+train+mitogen-hq--mitogen+CVE-2019-15149+clean.pkl", "func_name_": "__repr__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n return `1 ${base} = ${c.amount(d.value, quote)}${day(d.date)}`;\n },\n });\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: frontend/src/charts/line.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+beancount--fava+CVE-2022-2589+vul.pkl", "func_name_": "c.amount"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def verify_is_group_owner(self, conn, gid):\n \"\"\"\n If we have been requested to by the isGroupOwner flag, verify the user\n is the owner of the provided group. If no group is provided the user's\n active session group ownership will be verified.\n \"\"\"\n if not self.isGroupOwner:\n return\n if gid is not None:\n if not conn.isLeader(gid):\n raise Http404\n else:\n if not conn.isLeader():\n raise Http404 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: omeroweb/decorators.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "189+train+ome--omero-web+CVE-2021-21376+clean.pkl", "func_name_": "verify_is_group_owner"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "116+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "convert"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def clean(self):\n super().clean()\n if self.key != \"\":\n check_if_key_is_graphql_safe(self.__class__.__name__, self.key) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/extras/models/customfields.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n nautobot/extras/models/customfields.py::ValidationError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "308+train+nautobot--nautobot+CVE-2023-48705+clean.pkl", "func_name_": "clean"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "180+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "standardize"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _get_object_element(dataset, seq_no, rel_path, download_link):\n \"\"\"If rel_path and download_link are not None, we are called from scope.\n Otherwise we are called from ID and need to run SQL query to fetch these attrs.\"\"\"\n\n if rel_path is None:\n query = \"SELECT rel_path, download_link FROM \" + \\\n dataset + \\\n \" WHERE sequence_no = %s\"\n\n cnx = mysql.connector.connect(user=DB_USER,\n password=DB_PASSWORD,\n host=DB_HOST,\n database=DB_DBNAME,\n port=DB_PORT)\n cursor = cnx.cursor()\n cursor.execute(query, (seq_no,))\n\n row = cursor.fetchone()\n\n if not row:\n return None\n\n rel_path, download_link = row[0], row[1]\n\n if LOCAL_OBJ_URI:\n src_uri = 'file://' + os.path.join(DATAROOT, dataset, rel_path)\n else:\n src_uri = url_for('.get_object_src_http', dataset=dataset, rel_path=rel_path)\n\n return '' \\\n .format(\n quoteattr(url_for('.get_object_id', dataset=dataset, seq_no=seq_no)),\n quoteattr(src_uri),\n quoteattr(download_link)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: opendiamond/dataretriever/yfcc100m_mysql_store.py.\n//This function is called by other functions within the repository:\n opendiamond/dataretriever/yfcc100m_mysql_store.py::generate\nopendiamond/dataretriever/yfcc100m_mysql_store.py::get_object_id \n//This function itself calls other functions within the repository:\n opendiamond/dataretriever/yfcc100m_mysql_store.py::url_for\nopendiamond/dataretriever/yfcc100m_mysql_store.py::quoteattr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "9+train+cmusatyalab--opendiamond+CVE-2022-31506+vul.pkl", "func_name_": "_get_object_element"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def identity_provider(self) -> IdentityProvider:\n if \"identity_provider\" not in self.settings:\n warnings.warn(\n \"The Tornado web application does not have an 'identity_provider' defined \"\n \"in its settings. In future releases of jupyter_server, this will \"\n \"be a required key for all subclasses of `JupyterHandler`. For an \"\n \"example, see the jupyter_server source code for how to \"\n \"add an identity provider to the tornado settings: \"\n \"https://github.com/jupyter-server/jupyter_server/blob/v2.0.0/\"\n \"jupyter_server/serverapp.py#L242\",\n stacklevel=2,\n )\n from jupyter_server.auth import IdentityProvider\n\n # no identity provider set, load default\n self.settings[\"identity_provider\"] = IdentityProvider(\n config=self.settings.get(\"config\", None)\n )\n return cast(\"IdentityProvider\", self.settings[\"identity_provider\"]) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: jupyter_server/base/handlers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n jupyter_server/base/handlers.py::IdentityProvider\njupyter_server/base/handlers.py::cast \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "69+train+jupyter-server--jupyter_server+CVE-2023-49080+clean.pkl", "func_name_": "identity_provider"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def close(self):\n return True \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: glance/tests/stubs.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "19+train+openstack--glance+CVE-2012-4573+clean.pkl", "func_name_": "close"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def sentences_stats(self, type, vId = None):\n return self.sql_execute(self.prop_sentences_stats(type, vId)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: core/db.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+jofpin--trape+CVE-2017-17713+vul.pkl", "func_name_": "sentences_stats"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "349+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "fireForParent"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i bool:\n \"\"\"Validates a given CSRF token.\n\n Args:\n user_id: str|None. The user_id to validate the CSRF token against.\n token: str. The CSRF token to validate.\n\n Returns:\n bool. Whether the given CSRF token is valid.\n \"\"\"\n try:\n parts = token.split('/')\n if len(parts) != 2:\n return False\n\n issued_on = int(parts[0])\n age = cls._get_current_time() - issued_on\n if age > cls._CSRF_TOKEN_AGE_SECS:\n return False\n\n authentic_token = cls._create_token(user_id, issued_on)\n if authentic_token == token:\n return True\n\n return False\n except Exception:\n return False \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: core/controllers/base.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n core/controllers/base.py::int\ncore/controllers/base.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+oppia--oppia+CVE-2023-40021+vul.pkl", "func_name_": "is_csrf_token_valid"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __repr__(self):\n return 'Waker(fd=%r/%r)' % (\n self.stream.receive_side and self.stream.receive_side.fd,\n self.stream.transmit_side and self.stream.transmit_side.fd,\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mitogen/core.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "45+train+mitogen-hq--mitogen+CVE-2019-15149+clean.pkl", "func_name_": "__repr__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_Guards__safer_getattr__1():\n \"\"\"It prevents using the format method of a string.\n\n format() is considered harmful:\n http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/\n \"\"\"\n glb = {\n '__builtins__': safe_builtins,\n }\n with pytest.raises(NotImplementedError) as err:\n restricted_exec(STRING_DOT_FORMAT_DENIED, glb)\n assert 'Using format() on a str is not safe.' == str(err.value) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_Guards.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_Guards.py::str\ntests/test_Guards.py::restricted_exec \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+zopefoundation--RestrictedPython+CVE-2023-41039+vul.pkl", "func_name_": "test_Guards__safer_getattr__1"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def start_server(app, svr, queue, **kwargs): # pragma: no cover\n \"\"\"Run a fixture application.\n \"\"\"\n logging.getLogger(\"waitress\").addHandler(NullHandler())\n try_register_coverage()\n svr(app, queue, **kwargs).run() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::try_register_coverage\nwaitress/tests/test_functional.py::svr\nwaitress/tests/test_functional.py::NullHandler \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "323+train+Pylons--waitress+CVE-2019-16785+clean.pkl", "func_name_": "start_server"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def on_get_missing_events(\n self,\n origin: str,\n room_id: str,\n earliest_events: List[str],\n latest_events: List[str],\n limit: int,\n ) -> Dict[str, list]:\n with (await self._server_linearizer.queue((origin, room_id))):\n origin_host, _ = parse_server_name(origin)\n await self.check_server_matches_acl(origin_host, room_id)\n\n logger.debug(\n \"on_get_missing_events: earliest_events: %r, latest_events: %r,\"\n \" limit: %d\",\n earliest_events,\n latest_events,\n limit,\n )\n\n missing_events = await self.handler.on_get_missing_events(\n origin, room_id, earliest_events, latest_events, limit\n )\n\n if len(missing_events) < 5:\n logger.debug(\n \"Returning %d events: %r\", len(missing_events), missing_events\n )\n else:\n logger.debug(\"Returning %d events\", len(missing_events))\n\n time_now = self._clock.time_msec()\n\n return {\"events\": [ev.get_pdu_json(time_now) for ev in missing_events]} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/federation_server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "601+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "on_get_missing_events"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_topo_token_is_accepted(self):\n token = \"t1-0_0_0_0_0_0_0_0_0\"\n request, channel = self.make_request(\n \"GET\", \"/rooms/%s/messages?access_token=x&from=%s\" % (self.room_id, token)\n )\n self.assertEquals(200, channel.code)\n self.assertTrue(\"start\" in channel.json_body)\n self.assertEquals(token, channel.json_body[\"start\"])\n self.assertTrue(\"chunk\" in channel.json_body)\n self.assertTrue(\"end\" in channel.json_body) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/rest/client/v1/test_rooms.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "728+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "test_topo_token_is_accepted"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _report_progress_do_percent(self, params):\n \"\"\"\n Progress reporting function\n At the moment this only logs the progress.\n :param params: dict with parameters:\n done: how much items processed\n total: total of items to process\n msg: message for progress report\n recur_depth: recursion depth\n cancellable: indicates whether the operation is cancellable\n :return: None\n \"\"\"\n # check the time from last progress report\n global last_report_time, first_report_time, progress_data\n code = params.get('code')\n precise_code = self._get_precise_code(params)\n time_now = datetime.now()\n with lock:\n first_ts = first_report_time.get(code)\n if not first_ts:\n first_report_time[code] = time_now\n last_ts = last_report_time.get(code)\n if not last_ts:\n last_ts = (time_now - timedelta(seconds=self._progress_period_secs + 1))\n progress_data[precise_code] = dict(params)\n progress_total = self._get_progress_total(params)\n self._set_attrib_for_all(params, 'progress_total', progress_total)\n period_sec = (time_now - last_ts).total_seconds()\n # report progress every time period\n if period_sec >= self._progress_period_secs:\n if params.get('cancellable', True):\n user_id = self._check_cancelled(params)\n if user_id:\n raise CancelledProgress(_(\"Operation has been cancelled by\") + \" \" + user_id.sudo().name)\n time_left, time_total, time_elapsed = self._get_time_left(params, time_now, first_ts)\n if time_left:\n self._set_attrib_for_all(params, 'time_left', time_left)\n if time_total:\n self._set_attrib_for_all(params, 'time_total', time_total)\n if time_elapsed:\n self._set_attrib_for_all(params, 'time_elapsed', time_elapsed)\n self._report_progress_store(params)\n with lock:\n last_report_time[code] = time_now \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: web_progress/models/web_progress.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n web_progress/models/web_progress.py::timedelta\nweb_progress/models/web_progress.py::_\nweb_progress/models/web_progress.py::dict\nweb_progress/models/web_progress.py::CancelledProgress \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+gmarczynski--odoo-web-progress+CVE-2023-40954+clean.pkl", "func_name_": "_report_progress_do_percent"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def remove_auth_hashes(input: Optional[str]):\n if not input:\n return input\n # If there are no hashes, skip the RE for performance.\n if not any([pw_hash in input for pw_hash in PASSWORD_HASHERS_ALL.keys()]):\n return input\n return re_remove_passwords.sub(r'\\1 %s # Filtered for security' % PASSWORD_HASH_DUMMY_VALUE, input) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: irrd/utils/text.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n irrd/utils/text.py::any \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+irrdnet--irrd+CVE-2022-24798+vul.pkl", "func_name_": "remove_auth_hashes"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def call_registration_cmd(registration_cmd):\n \"\"\"Wrapper for run_subprocess that avoids leaking password in the log.\"\"\"\n loggerinst.debug(\"Calling command '%s'\" % hide_password(\" \".join(registration_cmd)))\n return utils.run_subprocess(registration_cmd, print_cmd=False) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: convert2rhel/subscription.py.\n//This function is called by other functions within the repository:\n convert2rhel/subscription.py::register_system \n//This function itself calls other functions within the repository:\n convert2rhel/subscription.py::hide_password \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+oamg--convert2rhel+CVE-2022-0852+vul.pkl", "func_name_": "call_registration_cmd"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_file_insert_submit_value(self, driver, live_server, upload_file, freeze):\n driver.get(live_server + self.url)\n file_input = driver.find_element(By.XPATH, \"//input[@name='file']\")\n file_input.send_keys(upload_file)\n assert file_input.get_attribute(\"name\") == \"file\"\n save_button = driver.find_element(By.XPATH, \"//input[@name='save']\")\n with wait_for_page_load(driver, timeout=10):\n save_button.click()\n assert \"save\" in driver.page_source\n\n driver.get(live_server + self.url)\n file_input = driver.find_element(By.XPATH, \"//input[@name='file']\")\n file_input.send_keys(upload_file)\n assert file_input.get_attribute(\"name\") == \"file\"\n save_button = driver.find_element(By.XPATH, \"//button[@name='save_continue']\")\n with wait_for_page_load(driver, timeout=10):\n save_button.click()\n assert \"save_continue\" in driver.page_source\n assert \"continue_value\" in driver.page_source \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_forms.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_forms.py::wait_for_page_load \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "9+train+codingjoe--django-s3file+CVE-2022-24840+vul.pkl", "func_name_": "test_file_insert_submit_value"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def create_test_model(self) -> str:\n\n constant_node = onnx.helper.make_node(\n 'Constant',\n inputs=[],\n outputs=['values'],\n value=self.create_external_data_tensor(self.attribute_value, \"attribute_value\")\n )\n\n initializers = [self.create_external_data_tensor(self.initializer_value, \"input_value\")]\n inputs = [helper.make_tensor_value_info(\"input_value\",\n onnx.TensorProto.FLOAT,\n self.initializer_value.shape)]\n\n graph = helper.make_graph([constant_node], \"test_graph\",\n inputs=inputs, outputs=[],\n initializer=initializers)\n model = helper.make_model(graph)\n\n model_filename = os.path.join(self.temp_dir, \"model.onnx\")\n with open(model_filename, \"wb\") as model_file:\n model_file.write(model.SerializeToString())\n\n return model_filename \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: onnx/test/test_external_data.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n onnx/test/test_external_data.py::getattr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+onnx--onnx+CVE-2022-25882+vul.pkl", "func_name_": "create_test_model"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def ignore_global(self, ctx, command: str.lower):\r\n \"\"\"\r\n Globally ignore or unignore the specified action.\r\n\r\n The bot will no longer respond to these actions.\r\n \"\"\"\r\n try:\r\n await self.config.get_raw(\"custom\", command)\r\n except KeyError:\r\n await self.config.set_raw(\"custom\", command, value=None)\r\n else:\r\n await self.config.clear_raw(\"custom\", command)\r\n await ctx.tick()\r \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: act/act.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+Zephyrkul--FluffyCogs+CVE-2020-15172+vul.pkl", "func_name_": "ignore_global"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_catalog(module_path,mode='r'):\n \"\"\" Return a function catalog (shelve object) from the path module_path\n\n If module_path is a directory, the function catalog returned is\n from that directory. If module_path is an actual module_name,\n then the function catalog returned is from its parent directory.\n mode uses the standard 'c' = create, 'n' = new, 'r' = read,\n 'w' = write file open modes available for anydbm databases.\n\n Well... it should be. Stuck with dumbdbm for now and the modes\n almost don't matter. We do some checking for 'r' mode, but that\n is about it.\n\n See catalog_path() for more information on module_path.\n \"\"\"\n if mode not in ['c','r','w','n']:\n msg = \" mode must be 'c', 'n', 'r', or 'w'. See anydbm for more info\"\n raise ValueError(msg)\n catalog_file = catalog_path(module_path)\n if (catalog_file is not None) \n and ((dumb and os.path.exists(catalog_file+'.dat')) \n or os.path.exists(catalog_file)):\n sh = shelve.open(catalog_file,mode)\n else:\n if mode=='r':\n sh = None\n else:\n sh = shelve.open(catalog_file,mode)\n return sh \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: scipy/weave/catalog.py.\n//This function is called by other functions within the repository:\n scipy/weave/catalog.py::get_existing_files\nscipy/weave/catalog.py::get_cataloged_functions\nscipy/weave/catalog.py::repair_catalog\nscipy/weave/catalog.py::add_function_persistent \n//This function itself calls other functions within the repository:\n scipy/weave/catalog.py::catalog_path\nscipy/weave/catalog.py::ValueError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "45+train+scipy--scipy+CVE-2013-4251+clean.pkl", "func_name_": "get_catalog"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i \"DictionaryObject\":\n \"\"\"Clone object into pdf_dest.\"\"\"\n try:\n if self.indirect_reference.pdf == pdf_dest and not force_duplicate: # type: ignore\n return self\n except Exception:\n pass\n\n d__ = cast(\n \"DictionaryObject\",\n self._reference_clone(self.__class__(), pdf_dest, force_duplicate),\n )\n if ignore_fields is None:\n ignore_fields = []\n if len(d__.keys()) == 0:\n d__._clone(self, pdf_dest, force_duplicate, ignore_fields)\n return d__ \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pypdf/generic/_data_structures.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n pypdf/generic/_data_structures.py::cast \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+py-pdf--pypdf+CVE-2023-46250+vul.pkl", "func_name_": "clone"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _ssl_wrap_socket(\n sock, key_file, cert_file, disable_validation, ca_certs, ssl_version, hostname, key_password\n):\n if disable_validation:\n cert_reqs = ssl.CERT_NONE\n else:\n cert_reqs = ssl.CERT_REQUIRED\n if ssl_version is None:\n ssl_version = ssl.PROTOCOL_SSLv23\n\n if hasattr(ssl, \"SSLContext\"): # Python 2.7.9\n context = ssl.SSLContext(ssl_version)\n context.verify_mode = cert_reqs\n context.check_hostname = cert_reqs != ssl.CERT_NONE\n if cert_file:\n if key_password:\n context.load_cert_chain(cert_file, key_file, key_password)\n else:\n context.load_cert_chain(cert_file, key_file)\n if ca_certs:\n context.load_verify_locations(ca_certs)\n return context.wrap_socket(sock, server_hostname=hostname)\n else:\n if key_password:\n raise NotSupportedOnThisPlatform(\"Certificate with password is not supported.\")\n return ssl.wrap_socket(\n sock,\n keyfile=key_file,\n certfile=cert_file,\n cert_reqs=cert_reqs,\n ca_certs=ca_certs,\n ssl_version=ssl_version,\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: python2/httplib2/__init__.py.\n//This function is called by other functions within the repository:\n python2/httplib2/__init__.py::connect \n//This function itself calls other functions within the repository:\n python2/httplib2/__init__.py::hasattr\npython2/httplib2/__init__.py::NotSupportedOnThisPlatform \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "19+train+httplib2--httplib2+CVE-2021-21240+vul.pkl", "func_name_": "_ssl_wrap_socket"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def auth(self) -> typing.Any:\n assert (\n \"auth\" in self.scope\n ), \"AuthenticationMiddleware must be installed to access request.auth\"\n return self.scope[\"auth\"] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: starlette/requests.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "17+train+encode--starlette+CVE-2023-30798+clean.pkl", "func_name_": "auth"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __getattr__( self, name ):\n rval = self.metadata.get( name, None )\n if name in self.metadata.spec:\n if rval is None:\n rval = self.metadata.spec[name].no_value\n rval = self.metadata.spec[name].param.to_string( rval )\n # Store this value, so we don't need to recalculate if needed\n # again\n setattr( self, name, rval )\n return rval \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/tools/wrappers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+blankenberg--galaxy-data-resource+CVE-2015-10062+vul.pkl", "func_name_": "__getattr__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def gzip_compress(bs):\n # gzipobj = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS | 16)\n # result = gzipobj.compress(text) + gzipobj.flush()\n buf = six.BytesIO()\n gf = gzip.GzipFile(fileobj=buf, mode=\"wb\", compresslevel=6)\n gf.write(bs)\n gf.close()\n return buf.getvalue() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "63+train+httplib2--httplib2+CVE-2021-21240+clean.pkl", "func_name_": "gzip_compress"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def put_file(self, in_path, out_path):\n ''' transfer a file from local to chroot '''\n\n if not out_path.startswith(os.path.sep):\n out_path = os.path.join(os.path.sep, out_path)\n normpath = os.path.normpath(out_path)\n out_path = os.path.join(self.chroot, normpath[1:])\n\n vvv(\"PUT %s TO %s\" % (in_path, out_path), host=self.chroot)\n if not os.path.exists(in_path):\n raise errors.AnsibleFileNotFound(\"file or module does not exist: %s\" % in_path)\n try:\n shutil.copyfile(in_path, out_path)\n except shutil.Error:\n traceback.print_exc()\n raise errors.AnsibleError(\"failed to copy: %s and %s are the same\" % (in_path, out_path))\n except IOError:\n traceback.print_exc()\n raise errors.AnsibleError(\"failed to transfer file to %s\" % out_path) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/ansible/plugins/connections/chroot.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lib/ansible/plugins/connections/chroot.py::vvv \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+ansible--ansible+CVE-2015-6240+vul.pkl", "func_name_": "put_file"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def renew_group_attestation(self, destination, group_id, user_id, content):\n \"\"\"Sent by either a group server or a user's server to periodically update\n the attestations\n \"\"\"\n\n path = _create_v1_path(\"/groups/%s/renew_attestation/%s\", group_id, user_id)\n\n return self.client.post_json(\n destination=destination, path=path, data=content, ignore_backoff=True\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/transport/client.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/federation/transport/client.py::_create_v1_path \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "632+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "renew_group_attestation"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _score(self):\n \"\"\" Return a score out of 10 or Unrated if no votes \"\"\"\n if self.votes > 0:\n return (self.recommendations / self.votes) * 10\n else:\n return _('Unrated') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: helpdesk/models.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n helpdesk/models.py::_ \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "7+train+django-helpdesk--django-helpdesk+CVE-2021-3994+clean.pkl", "func_name_": "_score"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def on_make_leave_request(\n self, origin: str, room_id: str, user_id: str\n ) -> Dict[str, Any]:\n origin_host, _ = parse_server_name(origin)\n await self.check_server_matches_acl(origin_host, room_id)\n pdu = await self.handler.on_make_leave_request(origin, room_id, user_id)\n\n room_version = await self.store.get_room_version_id(room_id)\n\n time_now = self._clock.time_msec()\n return {\"event\": pdu.get_pdu_json(time_now), \"room_version\": room_version} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/federation_server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "93+train+matrix-org--synapse+CVE-2020-26257+clean.pkl", "func_name_": "on_make_leave_request"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)\n{\n PyObject **new_memo;\n Py_ssize_t new_memo_size = 0;\n Py_ssize_t i;\n\n if (obj == NULL) {\n PyErr_SetString(PyExc_TypeError,\n \"attribute deletion is not supported\");\n return -1;\n }\n\n if (Py_TYPE(obj) == &UnpicklerMemoProxyType) {\n UnpicklerObject *unpickler =\n ((UnpicklerMemoProxyObject *)obj)->unpickler;\n\n new_memo_size = unpickler->memo_size;\n new_memo = _Unpickler_NewMemo(new_memo_size);\n if (new_memo == NULL)\n return -1;\n\n for (i = 0; i < new_memo_size; i++) {\n Py_XINCREF(unpickler->memo[i]);\n new_memo[i] = unpickler->memo[i];\n }\n }\n else if (PyDict_Check(obj)) {\n Py_ssize_t i = 0;\n PyObject *key, *value;\n\n new_memo_size = PyDict_GET_SIZE(obj);\n new_memo = _Unpickler_NewMemo(new_memo_size);\n if (new_memo == NULL)\n return -1;\n\n while (PyDict_Next(obj, &i, &key, &value)) {\n Py_ssize_t idx;\n if (!PyLong_Check(key)) {\n PyErr_SetString(PyExc_TypeError,\n \"memo key must be integers\");\n goto error;\n }\n idx = PyLong_AsSsize_t(key);\n if (idx == -1 && PyErr_Occurred())\n goto error;\n if (idx < 0) {\n PyErr_SetString(PyExc_ValueError,\n \"memo key must be positive integers.\");\n goto error;\n }\n if (_Unpickler_MemoPut(self, idx, value) < 0)\n goto error;\n }\n }\n else {\n PyErr_Format(PyExc_TypeError,\n \"'memo' attribute must be an UnpicklerMemoProxy object\"\n \"or dict, not %.200s\", Py_TYPE(obj)->tp_name);\n return -1;\n }\n\n _Unpickler_MemoCleanup(self);\n self->memo_size = new_memo_size;\n self->memo = new_memo;\n\n return 0;\n\n error:\n if (new_memo_size) {\n i = new_memo_size;\n while (--i >= 0) {\n Py_XDECREF(new_memo[i]);\n }\n PyMem_FREE(new_memo);\n }\n return -1;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+python--cpython+CVE-2018-20406+vul.pkl", "func_name_": "Unpickler_set_memo"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "325+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "chains"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_rescore_entrance_exam_all_student_and_single(self):\n \"\"\" Test re-scoring with both all students and single student parameters. \"\"\"\n url = reverse('rescore_entrance_exam', kwargs={'course_id': unicode(self.course.id)})\n response = self.client.get(url, {\n 'unique_student_identifier': self.student.email,\n 'all_students': True,\n })\n self.assertEqual(response.status_code, 400) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "62+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_rescore_entrance_exam_all_student_and_single"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _create_token(cls, user_id: Optional[str], issued_on: float) -> str:\n \"\"\"Creates a new CSRF token.\n\n Args:\n user_id: str|None. The user_id for which the token is generated.\n issued_on: float. The timestamp at which the token was issued.\n\n Returns:\n str. The generated CSRF token.\n \"\"\"\n cls.init_csrf_secret()\n\n # The token has 4 parts: hash of the actor user id, hash of the page\n # name, hash of the time issued and plain text of the time issued.\n\n if user_id is None:\n user_id = cls._USER_ID_DEFAULT\n\n # Round time to seconds.\n issued_on_str = str(int(issued_on))\n\n digester = hmac.new(\n key=CSRF_SECRET.value.encode('utf-8'),\n digestmod='md5'\n )\n digester.update(user_id.encode('utf-8'))\n digester.update(b':')\n digester.update(issued_on_str.encode('utf-8'))\n\n digest = digester.digest()\n # The b64encode returns bytes, so we first need to decode the returned\n # bytes to string.\n token = '%s/%s' % (\n issued_on_str, base64.urlsafe_b64encode(digest).decode('utf-8'))\n\n return token \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: core/controllers/base.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n core/controllers/base.py::int\ncore/controllers/base.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+oppia--oppia+CVE-2023-40021+vul.pkl", "func_name_": "_create_token"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_rename_experiment(mlflow_client):\n experiment_id = mlflow_client.create_experiment(\"BadName\")\n assert mlflow_client.get_experiment(experiment_id).name == \"BadName\"\n mlflow_client.rename_experiment(experiment_id, \"GoodName\")\n assert mlflow_client.get_experiment(experiment_id).name == \"GoodName\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/tracking/test_rest_tracking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "79+train+mlflow--mlflow+CVE-2023-6909+clean.pkl", "func_name_": "test_rename_experiment"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_my_name(self):\n yield defer.ensureDeferred(\n self.store.set_profile_displayname(self.frank.localpart, \"Frank\")\n )\n\n displayname = yield defer.ensureDeferred(\n self.handler.get_displayname(self.frank)\n )\n\n self.assertEquals(\"Frank\", displayname) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/handlers/test_profile.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "32+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "test_get_my_name"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _makeEngine(self):\n class DummyEngine:\n pass\n return DummyEngine() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/Products/PageTemplates/tests/testExpressions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/Products/PageTemplates/tests/testExpressions.py::DummyEngine \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "51+train+zopefoundation--Zope+CVE-2021-32633+clean.pkl", "func_name_": "_makeEngine"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def read(self, length=None):\n if length is not None:\n return bytes(length)\n else:\n return b\"\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: py7zr/helpers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n py7zr/helpers.py::bytes \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "36+train+miurahr--py7zr+CVE-2022-44900+clean.pkl", "func_name_": "read"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def setUp(self):\n self.data = {\n \"username\": \"test_user\",\n \"password1\": \"password\",\n \"password2\": \"password\",\n \"email\": \"new-tester@example.com\",\n } \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tcms/kiwi_auth/tests/test_forms.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+kiwitcms--Kiwi+CVE-2023-22451+vul.pkl", "func_name_": "setUp"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_it_strips_neighboring_slashes(self):\n assert join('/', '/foo', '/', '/bar') == '/foo/bar' \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/bundles/controller/test_utils.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/bundles/controller/test_utils.py::join \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "23+train+briancappello--flask-unchained+CVE-2021-23393+clean.pkl", "func_name_": "test_it_strips_neighboring_slashes"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s'\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/components/test_component.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/components/test_component.py::setattr\ntests/components/test_component.py::Meta\ntests/components/test_component.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+adamghill--django-unicorn+CVE-2021-42134+vul.pkl", "func_name_": "test_get_frontend_context_variables_safe"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def evaluate(self, node):\n validate_call_args(node, 1)\n if isinstance(node.args[0], vy_ast.Bytes):\n value = node.args[0].value\n elif isinstance(node.args[0], vy_ast.Str):\n value = node.args[0].value.encode()\n elif isinstance(node.args[0], vy_ast.Hex):\n length = len(node.args[0].value) // 2 - 1\n value = int(node.args[0].value, 16).to_bytes(length, \"big\")\n else:\n raise UnfoldableNode\n\n hash_ = f\"0x{hashlib.sha256(value).hexdigest()}\"\n return vy_ast.Hex.from_node(node, value=hash_) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/builtins/functions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n vyper/builtins/functions.py::InvalidType\nvyper/builtins/functions.py::type_from_annotation\nvyper/builtins/functions.py::DecimalT \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "39+train+vyperlang--vyper+CVE-2023-37902+clean.pkl", "func_name_": "evaluate"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def valid_mcast_address(cls, addr, prev_value_list=[]):\n \"\"\"\n Check whether the address is already in use and whether the address is for multicast\n \"\"\"\n cls_inst = cls(addr, prev_value_list)\n cls_inst._is_mcast_addr() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: crmsh/bootstrap.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n crmsh/bootstrap.py::cls \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "67+train+ClusterLabs--crmsh+CVE-2021-3020+clean.pkl", "func_name_": "valid_mcast_address"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *\n_Pickle_FastCall(PyObject *func, PyObject *obj)\n{\n PyObject *result;\n\n result = PyObject_CallFunctionObjArgs(func, obj, NULL);\n Py_DECREF(obj);\n return result;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "162+train+python--cpython+CVE-2018-20406+clean.pkl", "func_name_": null} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {\n return 0;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/varint.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "115+train+mymarilyn--clickhouse-driver+CVE-2020-26759+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def get_user_list(\n *, client: Client, an_enum_value: List[AnEnum], some_date: Union[date, datetime],\n) -> Union[\n List[AModel], HTTPValidationError, \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: end_to_end_tests/golden-master/my_test_api_client/async_api/tests.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+openapi-generators--openapi-python-client+CVE-2020-15142+vul.pkl", "func_name_": "get_user_list"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_info(path: str, root: pathlib.Path) -> typing.Tuple[\n pathlib.Path,\n dict]: \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: xhu.py.\n//This function is called by other functions within the repository:\n xhu.py::head_file\nxhu.py::get_file \n//This function itself calls other functions within the repository:\n xhu.py::load_metadata\nxhu.py::get_paths\nxhu.py::sanitized_join \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+horazont--xmpp-http-upload+CVE-2020-15239+vul.pkl", "func_name_": "get_info"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def create_code_for_user(cls, user, next=None):\n if not user.is_active:\n return None\n\n code = cls.generate_code()\n login_code = LoginCode(user=user, code=code)\n if next is not None:\n login_code.next = next\n login_code.save()\n return login_code \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nopassword/models.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n nopassword/models.py::LoginCode \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+relekang--django-nopassword+CVE-2019-10682+vul.pkl", "func_name_": "create_code_for_user"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {\n Py_ssize_t i, n;\n assert(PyExceptionClass_Check(exc_type));\n n = PyTuple_GET_SIZE(tuple);\n#if PY_MAJOR_VERSION >= 3\n for (i=0; i {\n errorCountEl.classList.toggle(\"hidden\", errorCount_val === 0);\n const span = errorCountEl.querySelector(\"span\");\n if (span) {\n span.innerHTML = `${errorCount_val}`;\n }\n });\n }\n\n const asideButton = document.getElementById(\"aside-button\");\n if (asideButton instanceof HTMLButtonElement) {\n asideButton.addEventListener(\"click\", () => {\n document.querySelector(\"aside\")?.classList.toggle(\"active\");\n asideButton.classList.toggle(\"active\");\n });\n }\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: frontend/src/sidebar/index.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "13+train+beancount--fava+CVE-2022-2589+vul.pkl", "func_name_": "initSidebar"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i v1.0, so we have to leave support for\n # TLSv1.0 enabled.\n ssl_context.set_options(m2.SSL_OP_NO_SSLv2 | m2.SSL_OP_NO_SSLv3)\n\n if self.pulp_connection.verify_ssl:\n ssl_context.set_verify(SSL.verify_peer, depth=100)\n # We need to stat the ca_path to see if it exists (error if it doesn't), and if so\n # whether it is a file or a directory. m2crypto has different directives depending on\n # which type it is.\n if os.path.isfile(self.pulp_connection.ca_path):\n ssl_context.load_verify_locations(cafile=self.pulp_connection.ca_path)\n elif os.path.isdir(self.pulp_connection.ca_path):\n ssl_context.load_verify_locations(capath=self.pulp_connection.ca_path)\n else:\n # If it's not a file and it's not a directory, it's not a valid setting\n raise exceptions.MissingCAPathException(self.pulp_connection.ca_path)\n ssl_context.set_session_timeout(self.pulp_connection.timeout)\n\n if self.pulp_connection.username and self.pulp_connection.password:\n raw = ':'.join((self.pulp_connection.username, self.pulp_connection.password))\n encoded = base64.encodestring(raw)[:-1]\n headers['Authorization'] = 'Basic ' + encoded\n elif self.pulp_connection.cert_filename:\n ssl_context.load_cert(self.pulp_connection.cert_filename)\n\n # oauth configuration. This block is only True if oauth is not None, so it won't run on RHEL\n # 5.\n if self.pulp_connection.oauth_key and self.pulp_connection.oauth_secret and oauth:\n oauth_consumer = oauth.Consumer(\n self.pulp_connection.oauth_key,\n self.pulp_connection.oauth_secret)\n oauth_request = oauth.Request.from_consumer_and_token(\n oauth_consumer,\n http_method=method,\n http_url='https://%s:%d%s' % (self.pulp_connection.host, self.pulp_connection.port,\n url))\n oauth_request.sign_request(oauth.SignatureMethod_HMAC_SHA1(), oauth_consumer, None)\n oauth_header = oauth_request.to_header()\n # unicode header values causes m2crypto to do odd things.\n for k, v in oauth_header.items():\n oauth_header[k] = encode_unicode(v)\n headers.update(oauth_header)\n headers['pulp-user'] = self.pulp_connection.oauth_user\n\n connection = httpslib.HTTPSConnection(\n self.pulp_connection.host, self.pulp_connection.port, ssl_context=ssl_context)\n\n try:\n # Request against the server\n connection.request(method, url, body=body, headers=headers)\n response = connection.getresponse()\n except SSL.SSLError, err:\n # Translate stale login certificate to an auth exception\n if 'sslv3 alert certificate expired' == str(err):\n raise exceptions.ClientCertificateExpiredException(\n self.pulp_connection.cert_filename)\n elif 'certificate verify failed' in str(err):\n raise exceptions.CertificateVerificationException()\n else:\n raise exceptions.ConnectionException(None, str(err), None)\n\n # Attempt to deserialize the body (should pass unless the server is busted)\n response_body = response.read()\n\n try:\n response_body = json.loads(response_body)\n except:\n pass\n return response.status, response_body \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: bindings/pulp/bindings/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "10+train+pulp--pulp+CVE-2015-5263+clean.pkl", "func_name_": "request"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def check(self, module, perms_required=False):\n \"\"\"Ensure the resource is in its desired state.\"\"\"\n messages = self.assertonly(module)\n return len(messages) == 0 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_certificate.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n plugins/modules/x509_certificate.py::super\nplugins/modules/x509_certificate.py::to_native \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "45+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "check"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "241+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "e.parse"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _generic_element_getter(op):\n def f(index):\n return IRnode.from_list(\n [op, [\"add\", \"_sub\", [\"add\", 32, [\"mul\", 32, index]]]], typ=INT128_T\n )\n\n return f \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/builtins/functions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "41+train+vyperlang--vyper+CVE-2023-30629+clean.pkl", "func_name_": "_generic_element_getter"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;sthis.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "441+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "sort"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_markdown(self):\n return get_markdown(self.description) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: helpdesk/models.py.\n//This function is called by other functions within the repository:\n helpdesk/models.py::get_markdown\nhelpdesk/models.py::get_resolution_markdown \n//This function itself calls other functions within the repository:\n helpdesk/models.py::get_markdown \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "18+train+django-helpdesk--django-helpdesk+CVE-2021-3994+clean.pkl", "func_name_": "get_markdown"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def open_url(self, url):\n \"\"\"Open the given URL in a new browser window.\n\n Display an error dialog if everything fails.\n \"\"\"\n (r, w) = os.pipe()\n if os.fork() > 0:\n os.close(w)\n status = os.wait()[1]\n if status:\n title = _(\"Unable to start web browser\")\n error = _(\"Unable to start web browser to open %s.\" % url)\n message = os.fdopen(r).readline()\n if message:\n error += \"\\n\" + message\n self.ui_error_message(title, error)\n try:\n os.close(r)\n except OSError:\n pass\n return\n\n os.setsid()\n os.close(r)\n\n try:\n try:\n run_as_real_user([\"xdg-open\", url])\n except OSError:\n # fall back to webbrowser\n webbrowser.open(url, new=True, autoraise=True)\n sys.exit(0)\n except Exception as error: # pylint: disable=broad-except\n os.write(w, str(error))\n sys.exit(1)\n os._exit(0) # pylint: disable=protected-access \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: apport/ui.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n apport/ui.py::_\napport/ui.py::str\napport/ui.py::run_as_real_user \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+canonical--apport+CVE-2023-1326+vul.pkl", "func_name_": "open_url"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def parser(self):\n \"\"\"Provide a function to get a parsed dirbrowser document.\"\"\"\n def parse(path):\n html = filescheme.dirbrowser_html(path).decode('utf-8')\n soup = bs4.BeautifulSoup(html, 'html.parser')\n print(soup.prettify())\n container = soup('div', id='dirbrowserContainer')[0]\n\n parent_elem = container('ul', class_='parent')\n if not parent_elem:\n parent = None\n else:\n parent = parent_elem[0].li.a.string\n\n folders = []\n files = []\n\n for li in container('ul', class_='folders')[0]('li'):\n item = self.Item(link=li.a['href'], text=str(li.a.string))\n folders.append(item)\n\n for li in container('ul', class_='files')[0]('li'):\n item = self.Item(link=li.a['href'], text=str(li.a.string))\n files.append(item)\n\n return self.Parsed(parent=parent, folders=folders, files=files)\n\n return parse \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/unit/browser/webkit/network/test_filescheme.py.\n//This function is called by other functions within the repository:\n tests/unit/browser/webkit/network/test_filescheme.py::test_empty\ntests/unit/browser/webkit/network/test_filescheme.py::test_files\ntests/unit/browser/webkit/network/test_filescheme.py::test_html_special_chars\ntests/unit/browser/webkit/network/test_filescheme.py::test_dirs\ntests/unit/browser/webkit/network/test_filescheme.py::test_mixed\ntests/unit/browser/webkit/network/test_filescheme.py::test_root_dir \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "45+train+qutebrowser--qutebrowser+CVE-2018-10895+clean.pkl", "func_name_": "parser"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_chrom_info( self, dbkey, trans=None, custom_build_hack_get_len_from_fasta_conversion=True ):\n # FIXME: flag to turn off custom_build_hack_get_len_from_fasta_conversion should not be required \n chrom_info = None\n db_dataset = None\n # Collect chromInfo from custom builds\n if trans:\n db_dataset = trans.db_dataset_for( dbkey )\n if db_dataset:\n chrom_info = db_dataset.file_name\n else:\n # Do Custom Build handling\n if trans.user and ( 'dbkeys' in trans.user.preferences ) and ( dbkey in loads( trans.user.preferences[ 'dbkeys' ] ) ):\n custom_build_dict = loads( trans.user.preferences[ 'dbkeys' ] )[ dbkey ]\n # HACK: the attempt to get chrom_info below will trigger the\n # fasta-to-len converter if the dataset is not available or,\n # which will in turn create a recursive loop when\n # running the fasta-to-len tool. So, use a hack in the second\n # condition below to avoid getting chrom_info when running the\n # fasta-to-len converter.\n if 'fasta' in custom_build_dict and custom_build_hack_get_len_from_fasta_conversion:\n # Build is defined by fasta; get len file, which is obtained from converting fasta.\n build_fasta_dataset = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'fasta' ] )\n chrom_info = build_fasta_dataset.get_converted_dataset( trans, 'len' ).file_name\n elif 'len' in custom_build_dict:\n # Build is defined by len file, so use it.\n chrom_info = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( custom_build_dict[ 'len' ] ).file_name\n # Check Data table\n if not chrom_info:\n dbkey_table = self._app.tool_data_tables.get( self._data_table_name, None )\n if dbkey_table is not None:\n chrom_info = dbkey_table.get_entry( 'value', dbkey, 'len_path', default=None )\n # use configured server len path\n if not chrom_info:\n # Default to built-in build.\n chrom_info = os.path.join( self._static_chrom_info_path, \"%s.len\" % dbkey )\n chrom_info = os.path.abspath( chrom_info )\n return ( chrom_info, db_dataset ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/util/dbkeys.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lib/galaxy/util/dbkeys.py::loads \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "8+train+blankenberg--galaxy-data-resource+CVE-2015-10062+vul.pkl", "func_name_": "get_chrom_info"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_persist_instance_data_writes_network_json_when_set(self):\n \"\"\"When network_data.json class attribute is set, persist to json.\"\"\"\n tmp = self.tmp_dir()\n cloud_dir = os.path.join(tmp, \"cloud\")\n util.ensure_dir(cloud_dir)\n paths = Paths({\"run_dir\": tmp, \"cloud_dir\": cloud_dir})\n datasource = DataSourceTestSubclassNet(\n self.sys_cfg,\n self.distro,\n paths,\n )\n datasource.get_data()\n json_file = paths.get_runpath(\"instance_data\")\n instance_data = util.load_json(util.load_file(json_file))\n self.assertNotIn(\"network_json\", instance_data[\"ds\"])\n datasource.network_json = {\"network_json\": \"is good\"}\n datasource.persist_instance_data()\n instance_data = util.load_json(util.load_file(json_file))\n self.assertEqual(\n {\"network_json\": \"is good\"}, instance_data[\"ds\"][\"network_json\"]\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/unittests/sources/test_init.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/unittests/sources/test_init.py::Paths\ntests/unittests/sources/test_init.py::DataSourceTestSubclassNet \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "70+train+canonical--cloud-init+CVE-2023-1786+clean.pkl", "func_name_": "test_persist_instance_data_writes_network_json_when_set"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s str:\n if isinstance(obj, datetime.datetime):\n return obj.isoformat()\n msg = f\"{obj!r} is not JSON-serializable\"\n raise TypeError(msg) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: remarshal.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n remarshal.py::isinstance\nremarshal.py::TypeError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+remarshal-project--remarshal+CVE-2023-47163+clean.pkl", "func_name_": "json_default"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_long_body(self):\n # check server doesnt close connection when body is too short\n # for cl header\n to_send = tobytes(\n \"GET /long_body HTTP/1.0\\n\"\n \"Connection: Keep-Alive\\n\"\n \"Content-Length: 0\\n\"\n \"\\n\"\n )\n self.connect()\n self.sock.send(to_send)\n fp = self.sock.makefile(\"rb\", 0)\n line = fp.readline() # status line\n version, status, reason = (x.strip() for x in line.split(None, 2))\n headers = parse_headers(fp)\n content_length = int(headers.get(\"content-length\")) or None\n response_body = fp.read(content_length)\n self.assertEqual(int(status), 200)\n self.assertEqual(content_length, len(response_body))\n self.assertEqual(response_body, tobytes(\"abcdefgh\"))\n # remote does not close connection (keepalive header)\n self.sock.send(to_send)\n fp = self.sock.makefile(\"rb\", 0)\n line = fp.readline() # status line\n version, status, reason = (x.strip() for x in line.split(None, 2))\n headers = parse_headers(fp)\n content_length = int(headers.get(\"content-length\")) or None\n response_body = fp.read(content_length)\n self.assertEqual(int(status), 200) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::tobytes\nwaitress/tests/test_functional.py::int\nwaitress/tests/test_functional.py::read_http\nwaitress/tests/test_functional.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "15+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_long_body"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_accept_redirect_unsafe(self):\n # Pre-accept terms 2 and 3\n UserTermsAndConditions.objects.create(user=self.user1, terms=self.terms2)\n UserTermsAndConditions.objects.create(user=self.user1, terms=self.terms3)\n\n LOGGER.debug(\"Test /terms/accept/contrib-terms/3/ post\")\n accept_response = self.client.post(\n \"/terms/accept/\", {\"terms\": 3, \"returnTo\": \"http://attacker/\"}, follow=False\n )\n self.assertRedirects(accept_response, \"/\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: termsandconditions/tests.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+cyface--django-termsandconditions+CVE-2022-4589+vul.pkl", "func_name_": "test_accept_redirect_unsafe"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _get_obj_absolute_path(obj_path):\n return os.path.join(DATAROOT, obj_path) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: opendiamond/dataretriever/diamond_store.py.\n//This function is called by other functions within the repository:\n opendiamond/dataretriever/diamond_store.py::get_object_meta\nopendiamond/dataretriever/diamond_store.py::_get_object_element\nopendiamond/dataretriever/diamond_store.py::_get_object_src_uri\nopendiamond/dataretriever/diamond_store.py::get_object_src_http \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+cmusatyalab--opendiamond+CVE-2022-31506+vul.pkl", "func_name_": "_get_obj_absolute_path"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def extension_element_from_string(xml_string):\n element_tree = ElementTree.fromstring(xml_string)\n return _extension_element_from_element_tree(element_tree) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/saml2/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/saml2/__init__.py::_extension_element_from_element_tree \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+IdentityPython--pysaml2+CVE-2016-10127+vul.pkl", "func_name_": "extension_element_from_string"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_it_works_with_garbage(self):\n assert join(None) == '/'\n assert join(None, None, '', 0) == '/' \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/bundles/controller/test_utils.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/bundles/controller/test_utils.py::join \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "33+train+briancappello--flask-unchained+CVE-2021-23393+clean.pkl", "func_name_": "test_it_works_with_garbage"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_customer_change_default_address(user_api_client, address_other_country):\n user = user_api_client.user\n assert user.default_billing_address\n assert user.default_billing_address\n address = user.default_shipping_address\n assert address in user.addresses.all()\n assert address_other_country not in user.addresses.all()\n\n user.default_shipping_address = address_other_country\n user.save()\n user.refresh_from_db()\n assert address_other_country not in user.addresses.all()\n\n query = ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION\n mutation_name = \"accountSetDefaultAddress\"\n\n variables = {\n \"id\": graphene.Node.to_global_id(\"Address\", address.id),\n \"type\": AddressType.SHIPPING.upper(),\n }\n response = user_api_client.post_graphql(query, variables)\n content = get_graphql_content(response)\n data = content[\"data\"][mutation_name]\n assert not data[\"errors\"]\n\n user.refresh_from_db()\n assert user.default_shipping_address == address\n assert address_other_country in user.addresses.all() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::get_graphql_content \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "32+train+saleor--saleor+CVE-2023-26051+clean.pkl", "func_name_": "test_customer_change_default_address"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __read_chunk_length(self, rfile):\n # Read and return the next integer chunk length. If no\n # chunk length can be read, raises _InvalidClientInput.\n\n # Here's the production for a chunk:\n # (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html)\n # chunk = chunk-size [ chunk-extension ] CRLF\n # chunk-data CRLF\n # chunk-size = 1*HEX\n # chunk-extension= *( \";\" chunk-ext-name [ \"=\" chunk-ext-val ] )\n # chunk-ext-name = token\n # chunk-ext-val = token | quoted-string\n\n # To cope with malicious or broken clients that fail to send valid\n # chunk lines, the strategy is to read character by character until we either reach\n # a ; or newline. If at any time we read a non-HEX digit, we bail. If we hit a\n # ;, indicating an chunk-extension, we'll read up to the next\n # MAX_REQUEST_LINE characters\n # looking for the CRLF, and if we don't find it, we bail. If we read more than 16 hex characters,\n # (the number needed to represent a 64-bit chunk size), we bail (this protects us from\n # a client that sends an infinite stream of `F`, for example).\n\n buf = BytesIO()\n while 1:\n char = rfile.read(1)\n if not char:\n self._chunked_input_error = True\n raise _InvalidClientInput(\"EOF before chunk end reached\")\n if char == b'r':\n break\n if char == b';':\n break\n\n if char not in _HEX:\n self._chunked_input_error = True\n raise _InvalidClientInput(\"Non-hex data\", char)\n buf.write(char)\n if buf.tell() > 16:\n self._chunked_input_error = True\n raise _InvalidClientInput(\"Chunk-size too large.\")\n\n if char == b';':\n i = 0\n while i < MAX_REQUEST_LINE:\n char = rfile.read(1)\n if char == b'r':\n break\n i += 1\n else:\n # we read more than MAX_REQUEST_LINE without\n # hitting CR\n self._chunked_input_error = True\n raise _InvalidClientInput(\"Too large chunk extension\")\n\n if char == b'r':\n # We either got here from the main loop or from the\n # end of an extension\n char = rfile.read(1)\n if char != b'n':\n self._chunked_input_error = True\n raise _InvalidClientInput(\"Line didn't end in CRLF\")\n return int(buf.getvalue(), 16) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/gevent/pywsgi.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/gevent/pywsgi.py::_InvalidClientInput\nsrc/gevent/pywsgi.py::int\nsrc/gevent/pywsgi.py::BytesIO \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "42+train+gevent--gevent+CVE-2023-41419+clean.pkl", "func_name_": "__read_chunk_length"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(self, module):\n if module.params['create_subject_key_identifier']:\n module.fail_json(msg='You cannot use create_subject_key_identifier with the pyOpenSSL backend!')\n for o in ('subject_key_identifier', 'authority_key_identifier', 'authority_cert_issuer', 'authority_cert_serial_number'):\n if module.params[o] is not None:\n module.fail_json(msg='You cannot use {0} with the pyOpenSSL backend!'.format(o))\n super(CertificateSigningRequestPyOpenSSL, self).__init__(module) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/openssl_csr.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n plugins/modules/openssl_csr.py::super \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "135+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "__init__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def do_template(self, data, preserve_trailing_newlines=True, escape_backslashes=True, fail_on_undefined=None, overrides=None, disable_lookups=False):\n # For preserving the number of input newlines in the output (used\n # later in this method)\n data_newlines = _count_newlines_from_end(data)\n\n if fail_on_undefined is None:\n fail_on_undefined = self._fail_on_undefined_errors\n\n try:\n # allows template header overrides to change jinja2 options.\n if overrides is None:\n myenv = self.environment.overlay()\n else:\n myenv = self.environment.overlay(overrides)\n\n # Get jinja env overrides from template\n if data.startswith(JINJA2_OVERRIDE):\n eol = data.find('\\n')\n line = data[len(JINJA2_OVERRIDE):eol]\n data = data[eol+1:]\n for pair in line.split(','):\n (key,val) = pair.split(':')\n key = key.strip()\n setattr(myenv, key, ast.literal_eval(val.strip()))\n\n # Adds Ansible custom filters and tests\n myenv.filters.update(self._get_filters())\n myenv.tests.update(self._get_tests())\n\n if escape_backslashes:\n # Allow users to specify backslashes in playbooks as \"\\\\\" instead of as \"\\\\\\\\\".\n data = _escape_backslashes(data, myenv)\n\n try:\n t = myenv.from_string(data)\n except TemplateSyntaxError as e:\n raise AnsibleError(\"template error while templating string: %s. String: %s\" % (to_native(e), to_native(data)))\n except Exception as e:\n if 'recursion' in to_native(e):\n raise AnsibleError(\"recursive loop detected in template string: %s\" % to_native(data))\n else:\n return data\n\n if disable_lookups:\n t.globals['lookup'] = self._fail_lookup\n else:\n t.globals['lookup'] = self._lookup\n\n t.globals['finalize'] = self._finalize\n\n jvars = AnsibleJ2Vars(self, t.globals)\n\n new_context = t.new_context(jvars, shared=True)\n rf = t.root_render_func(new_context)\n\n try:\n res = j2_concat(rf)\n if new_context.unsafe:\n res = wrap_var(res)\n except TypeError as te:\n if 'StrictUndefined' in to_native(te):\n errmsg = \"Unable to look up a name or access an attribute in template string (%s).\\n\" % to_native(data)\n errmsg += \"Make sure your variable name does not contain invalid characters like '-': %s\" % to_native(te)\n raise AnsibleUndefinedVariable(errmsg)\n else:\n display.debug(\"failing because of a type error, template data is: %s\" % to_native(data))\n raise AnsibleError(\"Unexpected templating type error occurred on (%s): %s\" % (to_native(data),to_native(te)))\n\n if preserve_trailing_newlines:\n # The low level calls above do not preserve the newline\n # characters at the end of the input data, so we use the\n # calculate the difference in newlines and append them\n # to the resulting output for parity\n #\n # jinja2 added a keep_trailing_newline option in 2.7 when\n # creating an Environment. That would let us make this code\n # better (remove a single newline if\n # preserve_trailing_newlines is False). Once we can depend on\n # that version being present, modify our code to set that when\n # initializing self.environment and remove a single trailing\n # newline here if preserve_newlines is False.\n res_newlines = _count_newlines_from_end(res)\n if data_newlines > res_newlines:\n res += self.environment.newline_sequence * (data_newlines - res_newlines)\n return res\n except (UndefinedError, AnsibleUndefinedVariable) as e:\n if fail_on_undefined:\n raise AnsibleUndefinedVariable(e)\n else:\n #TODO: return warning about undefined var\n return data \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/ansible/template/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lib/ansible/template/__init__.py::_escape_backslashes\nlib/ansible/template/__init__.py::len\nlib/ansible/template/__init__.py::AnsibleUndefinedVariable\nlib/ansible/template/__init__.py::wrap_var\nlib/ansible/template/__init__.py::AnsibleError\nlib/ansible/template/__init__.py::AnsibleJ2Vars\nlib/ansible/template/__init__.py::j2_concat\nlib/ansible/template/__init__.py::_count_newlines_from_end\nlib/ansible/template/__init__.py::setattr\nlib/ansible/template/__init__.py::to_native \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+ansible--ansible+CVE-2017-7481+vul.pkl", "func_name_": "do_template"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "289+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "disableSelect"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _validate_csr_subject(self):\n pass \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_certificate.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "160+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "_validate_csr_subject"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_unicode_url():\n mw = _get_mw()\n req = SplashRequest(\n # note unicode URL\n u\"http://example.com/\", endpoint='execute')\n req2 = mw.process_request(req, None)\n res = {'html': 'Hello'}\n res_body = json.dumps(res)\n response = TextResponse(\"http://mysplash.example.com/execute\",\n # Scrapy doesn't pass request to constructor\n # request=req2,\n headers={b'Content-Type': b'application/json'},\n body=res_body.encode('utf8'))\n response2 = mw.process_response(req2, response, None)\n assert response2.url == \"http://example.com/\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_middleware.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_middleware.py::_get_mw\ntests/test_middleware.py::SplashRequest\ntests/test_middleware.py::TextResponse \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "14+train+scrapy-plugins--scrapy-splash+CVE-2021-41124+vul.pkl", "func_name_": "test_unicode_url"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_rename_experiment_cli(mlflow_client, cli_env):\n bad_experiment_name = \"CLIBadName\"\n good_experiment_name = \"CLIGoodName\"\n\n invoke_cli_runner(\n mlflow.experiments.commands, [\"create\", \"-n\", bad_experiment_name], env=cli_env\n )\n experiment_id = mlflow_client.get_experiment_by_name(bad_experiment_name).experiment_id\n assert mlflow_client.get_experiment(experiment_id).name == bad_experiment_name\n invoke_cli_runner(\n mlflow.experiments.commands,\n [\"rename\", \"--experiment-id\", str(experiment_id), \"--new-name\", good_experiment_name],\n env=cli_env,\n )\n assert mlflow_client.get_experiment(experiment_id).name == good_experiment_name \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/tracking/test_rest_tracking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/tracking/test_rest_tracking.py::invoke_cli_runner\ntests/tracking/test_rest_tracking.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "69+train+mlflow--mlflow+CVE-2023-2780+clean.pkl", "func_name_": "test_rename_experiment_cli"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "438+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "Events.definePseudo"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_convert_model_to_external_data_from_one_file_with_location(self) -> None:\n model_file_path = self.get_temp_model_filename()\n external_data_file = str(uuid.uuid4())\n\n convert_model_to_external_data(self.model, size_threshold=0, all_tensors_to_one_file=True, location=external_data_file)\n onnx.save_model(self.model, model_file_path)\n\n self.assertTrue(Path.isfile(os.path.join(self.temp_dir, external_data_file)))\n\n model = onnx.load_model(model_file_path)\n\n # test convert model from external data\n convert_model_from_external_data(model)\n model_file_path = self.get_temp_model_filename()\n onnx.save_model(model, model_file_path)\n model = onnx.load_model(model_file_path)\n initializer_tensor = model.graph.initializer[0]\n self.assertFalse(len(initializer_tensor.external_data))\n self.assertEqual(initializer_tensor.data_location, TensorProto.DEFAULT)\n self.assertTrue(np.allclose(to_array(initializer_tensor), self.initializer_value))\n\n attribute_tensor = model.graph.node[0].attribute[0].t\n self.assertFalse(len(attribute_tensor.external_data))\n self.assertEqual(attribute_tensor.data_location, TensorProto.DEFAULT)\n self.assertTrue(np.allclose(to_array(attribute_tensor), self.attribute_value)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: onnx/test/test_external_data.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n onnx/test/test_external_data.py::len\nonnx/test/test_external_data.py::to_array\nonnx/test/test_external_data.py::convert_model_to_external_data\nonnx/test/test_external_data.py::convert_model_from_external_data\nonnx/test/test_external_data.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+onnx--onnx+CVE-2022-25882+vul.pkl", "func_name_": "test_convert_model_to_external_data_from_one_file_with_location"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def main():\n module = AnsibleModule(\n argument_spec=dict(\n state=dict(type='str', default='present', choices=['present', 'absent']),\n mode=dict(type='str', default='generate', choices=['generate', 'update']),\n force=dict(type='bool', default=False),\n backup=dict(type='bool', default=False),\n path=dict(type='path', required=True),\n format=dict(type='str', default='pem', choices=['pem', 'der']),\n privatekey_path=dict(type='path'),\n privatekey_content=dict(type='str'),\n privatekey_passphrase=dict(type='str', no_log=True),\n issuer=dict(type='dict'),\n last_update=dict(type='str', default='+0s'),\n next_update=dict(type='str'),\n digest=dict(type='str', default='sha256'),\n ignore_timestamps=dict(type='bool', default=False),\n return_content=dict(type='bool', default=False),\n revoked_certificates=dict(\n type='list',\n elements='dict',\n options=dict(\n path=dict(type='path'),\n content=dict(type='str'),\n serial_number=dict(type='int'),\n revocation_date=dict(type='str', default='+0s'),\n issuer=dict(type='list', elements='str'),\n issuer_critical=dict(type='bool', default=False),\n reason=dict(\n type='str',\n choices=[\n 'unspecified', 'key_compromise', 'ca_compromise', 'affiliation_changed',\n 'superseded', 'cessation_of_operation', 'certificate_hold',\n 'privilege_withdrawn', 'aa_compromise', 'remove_from_crl'\n ]\n ),\n reason_critical=dict(type='bool', default=False),\n invalidity_date=dict(type='str'),\n invalidity_date_critical=dict(type='bool', default=False),\n ),\n required_one_of=[['path', 'content', 'serial_number']],\n mutually_exclusive=[['path', 'content', 'serial_number']],\n ),\n ),\n required_if=[\n ('state', 'present', ['privatekey_path', 'privatekey_content'], True),\n ('state', 'present', ['issuer', 'next_update', 'revoked_certificates'], False),\n ],\n mutually_exclusive=(\n ['privatekey_path', 'privatekey_content'],\n ),\n supports_check_mode=True,\n add_file_common_args=True,\n )\n\n if not CRYPTOGRAPHY_FOUND:\n module.fail_json(msg=missing_required_lib('cryptography >= {0}'.format(MINIMAL_CRYPTOGRAPHY_VERSION)),\n exception=CRYPTOGRAPHY_IMP_ERR)\n\n try:\n crl = CRL(module)\n\n if module.params['state'] == 'present':\n if module.check_mode:\n result = crl.dump(check_mode=True)\n result['changed'] = module.params['force'] or not crl.check() or not crl.check(ignore_conversion=False)\n module.exit_json(**result)\n\n crl.generate()\n else:\n if module.check_mode:\n result = crl.dump(check_mode=True)\n result['changed'] = os.path.exists(module.params['path'])\n module.exit_json(**result)\n\n crl.remove()\n\n result = crl.dump()\n module.exit_json(**result)\n except OpenSSLObjectError as exc:\n module.fail_json(msg=to_native(exc)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_crl.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n plugins/modules/x509_crl.py::dict\nplugins/modules/x509_crl.py::AnsibleModule\nplugins/modules/x509_crl.py::missing_required_lib\nplugins/modules/x509_crl.py::CRL\nplugins/modules/x509_crl.py::to_native \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+ansible-collections--community.crypto+CVE-2020-25646+vul.pkl", "func_name_": "main"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *__pyx_pw_17clickhouse_driver_14bufferedreader_1__pyx_unpickle_BufferedReader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v___pyx_type = 0;\n long __pyx_v___pyx_checksum;\n PyObject *__pyx_v___pyx_state = 0;\n PyObject *__pyx_r = 0;\n __Pyx_RefNannyDeclarations\n __Pyx_RefNannySetupContext(\"__pyx_unpickle_BufferedReader (wrapper)\", 0);\n {\n static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};\n PyObject* values[3] = {0,0,0};\n if (unlikely(__pyx_kwds)) {\n Py_ssize_t kw_args;\n const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);\n switch (pos_args) {\n case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);\n CYTHON_FALLTHROUGH;\n case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);\n CYTHON_FALLTHROUGH;\n case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);\n CYTHON_FALLTHROUGH;\n case 0: break;\n default: goto __pyx_L5_argtuple_error;\n }\n kw_args = PyDict_Size(__pyx_kwds);\n switch (pos_args) {\n case 0:\n if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;\n else goto __pyx_L5_argtuple_error;\n CYTHON_FALLTHROUGH;\n case 1:\n if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;\n else {\n __Pyx_RaiseArgtupleInvalid(\"__pyx_unpickle_BufferedReader\", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)\n }\n CYTHON_FALLTHROUGH;\n case 2:\n if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;\n else {\n __Pyx_RaiseArgtupleInvalid(\"__pyx_unpickle_BufferedReader\", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)\n }\n }\n if (unlikely(kw_args > 0)) {\n if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, \"__pyx_unpickle_BufferedReader\") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)\n }\n } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {\n goto __pyx_L5_argtuple_error;\n } else {\n values[0] = PyTuple_GET_ITEM(__pyx_args, 0);\n values[1] = PyTuple_GET_ITEM(__pyx_args, 1);\n values[2] = PyTuple_GET_ITEM(__pyx_args, 2);\n }\n __pyx_v___pyx_type = values[0];\n __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)\n __pyx_v___pyx_state = values[2];\n }\n goto __pyx_L4_argument_unpacking_done;\n __pyx_L5_argtuple_error:;\n __Pyx_RaiseArgtupleInvalid(\"__pyx_unpickle_BufferedReader\", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)\n __pyx_L3_error:;\n __Pyx_AddTraceback(\"clickhouse_driver.bufferedreader.__pyx_unpickle_BufferedReader\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n __Pyx_RefNannyFinishContext();\n return NULL;\n __pyx_L4_argument_unpacking_done:;\n __pyx_r = __pyx_pf_17clickhouse_driver_14bufferedreader___pyx_unpickle_BufferedReader(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);\n\n /* function exit code */\n __Pyx_RefNannyFinishContext();\n return __pyx_r;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedreader.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "440+train+mymarilyn--clickhouse-driver+CVE-2020-26759+clean.pkl", "func_name_": null} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def set_upstream_branch(self):\n self._run_git(self._git_path, 'branch {0} --set-upstream-to origin/{1}'.format(app.BRANCH, app.BRANCH)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: medusa/updater/github_updater.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "20+train+pymedusa--Medusa+CVE-2023-28627+clean.pkl", "func_name_": "set_upstream_branch"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def set_captcha_result(self, tid, result):\n \"\"\"\n Set result for a captcha task.\n\n :param tid: task id\n :param result: captcha result\n \"\"\"\n self.pyload.last_client_connected = time.time()\n task = self.pyload.captcha_manager.get_task_by_id(tid)\n if task:\n task.set_result(result)\n self.pyload.captcha_manager.remove_task(task) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/core/api/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/pyload/core/api/__init__.py::permission\nsrc/pyload/core/api/__init__.py::legacy \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "12+train+pyload--pyload+CVE-2023-0227+clean.pkl", "func_name_": "set_captcha_result"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def validate_path_is_safe(path):\n \"\"\"\n Validates that the specified path is safe to join with a trusted prefix. This is a security\n measure to prevent path traversal attacks.\n A valid path should:\n not contain separators other than '/'\n not contain .. to navigate to parent dir in path\n not be an absolute path\n \"\"\"\n from mlflow.utils.file_utils import local_file_uri_to_path\n\n exc = MlflowException(f\"Invalid path: {path}\", error_code=INVALID_PARAMETER_VALUE)\n if any((s in path) for s in (\"#\", \"%23\")):\n raise exc\n\n if is_file_uri(path):\n path = local_file_uri_to_path(path)\n if (\n any((s in path) for s in _OS_ALT_SEPS)\n or \"..\" in path.split(\"/\")\n or pathlib.PureWindowsPath(path).is_absolute()\n or pathlib.PurePosixPath(path).is_absolute()\n or (is_windows() and len(path) >= 2 and path[1] == \":\")\n ):\n raise exc \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/utils/uri.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n mlflow/utils/uri.py::len\nmlflow/utils/uri.py::is_file_uri\nmlflow/utils/uri.py::is_windows\nmlflow/utils/uri.py::MlflowException\nmlflow/utils/uri.py::any\nmlflow/utils/uri.py::local_file_uri_to_path \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+mlflow--mlflow+CVE-2023-6909+vul.pkl", "func_name_": "validate_path_is_safe"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_default_args(func: Callable) -> list[Any]:\n signature = inspect.signature(func)\n return [\n v.default if v.default is not inspect.Parameter.empty else None\n for v in signature.parameters.values()\n ] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: gradio/utils.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "35+train+gradio-app--gradio+CVE-2023-51449+clean.pkl", "func_name_": "get_default_args"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def show_student_extensions(request, course_id):\n \"\"\"\n Shows all of the due date extensions granted to a particular student in a\n particular course.\n \"\"\"\n student = require_student_from_identifier(request.GET.get('student'))\n course = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(course_id))\n return JsonResponse(dump_student_extensions(course, student)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/views/api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lms/djangoapps/instructor/views/api.py::cache_control\nlms/djangoapps/instructor/views/api.py::JsonResponse\nlms/djangoapps/instructor/views/api.py::require_student_from_identifier\nlms/djangoapps/instructor/views/api.py::dump_student_extensions\nlms/djangoapps/instructor/views/api.py::require_query_params\nlms/djangoapps/instructor/views/api.py::require_level\nlms/djangoapps/instructor/views/api.py::get_course_by_id \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "106+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "show_student_extensions"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_convert_model_to_external_data_one_file_per_tensor_without_attribute(self) -> None:\n model_file_path = self.get_temp_model_filename()\n\n convert_model_to_external_data(self.model, size_threshold=0, all_tensors_to_one_file=False, convert_attribute=False)\n onnx.save_model(self.model, model_file_path)\n\n self.assertTrue(Path.isfile(model_file_path))\n self.assertTrue(Path.isfile(os.path.join(self.temp_dir, \"input_value\")))\n self.assertFalse(Path.isfile(os.path.join(self.temp_dir, \"attribute_value\"))) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: onnx/test/test_external_data.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n onnx/test/test_external_data.py::convert_model_to_external_data \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+onnx--onnx+CVE-2022-25882+vul.pkl", "func_name_": "test_convert_model_to_external_data_one_file_per_tensor_without_attribute"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "247+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "store"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_render_idn(self):\n w = widgets.AdminURLFieldWidget()\n self.assertHTMLEqual(\n conditional_escape(w.render('test', 'http://example-\u00e4\u00fc\u00f6.com')),\n '

Currently:http://example-\u00e4\u00fc\u00f6.com
Change:

'\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/admin_widgets/tests.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/admin_widgets/tests.py::conditional_escape \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+django--django+CVE-2013-4249+vul.pkl", "func_name_": "test_render_idn"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n dateSuchAs:\"Please enter a valid date such as {date}\",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. \"12/31/1999\")',email:'Please enter a valid email address. For example \"fred@domain.com\".',url:\"Please enter a valid URL such as http://www.example.com.\",currencyDollar:\"Please enter a valid $ amount. For example $100.00 .\",oneRequired:\"Please enter something for at least one of these inputs.\",errorPrefix:\"Error: \",warningPrefix:\"Warning: \",noSpace:\"There can be no spaces in this input.\",reqChkByNode:\"No items are selected.\",requiredChk:\"This field is required.\",reqChkByName:\"Please select a {label}.\",match:\"This field needs to match the {matchName} field\",startDate:\"the start date\",endDate:\"the end date\",currentDate:\"the current date\",afterDate:\"The date should be the same or after {label}.\",beforeDate:\"The date should be the same or before {label}.\",startMonth:\"Please select a start month\",sameMonth:\"These two dates must be in the same month - you must change one or the other.\",creditcard:\"The credit card number entered is invalid. Please check the number and try again. {length} digits entered.\"}),window.Form||(window.Form={});var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:\"Validation failed.\",test:Function.convert(!0)},initialize:function(e,t){this.setOptions(t),this.className=e},test:function(e,t){return!!(e=document.id(e))&&this.options.test(e,t||this.getProps(e))},getError:function(e,t){e=document.id(e);var i=this.options.errorMsg;return\"function\"==typeOf(i)&&(i=i(e,t||this.getProps(e))),i},getProps:function(e){return e=document.id(e),e?e.get(\"validatorProps\"):{}}});Element.Properties.validators={get:function(){return(this.get(\"data-validators\")||this.className).clean().replace(/'(\\\\.|[^'])*'|\"(\\\\.|[^\"])*\"/g,function(e){return e.replace(\" \",\"\\\\x20\")}).split(\" \")}},Element.Properties.validatorProps={set:function(e){return this.eliminate(\"$moo:validatorProps\").store(\"$moo:validatorProps\",e)},get:function(e){if(e&&this.set(e),this.retrieve(\"$moo:validatorProps\"))return this.retrieve(\"$moo:validatorProps\");if(this.getProperty(\"data-validator-properties\")||this.getProperty(\"validatorProps\"))try{this.store(\"$moo:validatorProps\",JSON.decode(this.getProperty(\"validatorProps\")||this.getProperty(\"data-validator-properties\"),!1))}catch(e){return{}}else{var t=this.get(\"validators\").filter(function(e){return e.test(\":\")});t.length?(e={},t.each(function(t){var i=t.split(\":\");if(i[1])try{e[i[0]]=JSON.decode(i[1],!1)}catch(e){}}),this.store(\"$moo:validatorProps\",e)):this.store(\"$moo:validatorProps\",{})}return this.retrieve(\"$moo:validatorProps\")}},Form.Validator=new Class({Implements:[Options,Events],options:{fieldSelectors:\"input, select, textarea\",ignoreHidden:!0,ignoreDisabled:!0,useTitles:!1,evaluateOnSubmit:!0,evaluateFieldsOnBlur:!0,evaluateFieldsOnChange:!0,serial:!0,stopOnFailure:!0,warningPrefix:function(){return Form.Validator.getMsg(\"warningPrefix\")||\"Warning: \"},errorPrefix:function(){return Form.Validator.getMsg(\"errorPrefix\")||\"Error: \"}},initialize:function(e,t){this.setOptions(t),this.element=document.id(e),this.warningPrefix=Function.convert(this.options.warningPrefix)(),this.errorPrefix=Function.convert(this.options.errorPrefix)(),this._bound={onSubmit:this.onSubmit.bind(this),blurOrChange:function(e,t){this.validationMonitor(t,!0)}.bind(this)},this.enable()},toElement:function(){return this.element},getFields:function(){return this.fields=this.element.getElements(this.options.fieldSelectors)},enable:function(){this.element.store(\"validator\",this),this.options.evaluateOnSubmit&&this.element.addEvent(\"submit\",this._bound.onSubmit),this.options.evaluateFieldsOnBlur&&this.element.addEvent(\"blur:relay(input,select,textarea)\",this._bound.blurOrChange),this.options.evaluateFieldsOnChange&&this.element.addEvent(\"change:relay(input,select,textarea)\",this._bound.blurOrChange)},disable:function(){this.element.eliminate(\"validator\"),this.element.removeEvents({submit:this._bound.onSubmit,\"blur:relay(input,select,textarea)\":this._bound.blurOrChange,\"change:relay(input,select,textarea)\":this._bound.blurOrChange})},validationMonitor:function(){clearTimeout(this.timer),this.timer=this.validateField.delay(50,this,arguments)},onSubmit:function(e){this.validate(e)&&this.reset()},reset:function(){return this.getFields().each(this.resetField,this),this},validate:function(e){var t=this.getFields().map(function(e){return this.validateField(e,!0)},this).every(function(e){return e});return this.fireEvent(\"formValidate\",[t,this.element,e]),this.options.stopOnFailure&&!t&&e&&e.preventDefault(),t},validateField:function(e,t){if(this.paused)return!0;e=document.id(e);var i,n,s=!e.hasClass(\"validation-failed\");if(this.options.serial&&!t&&(i=this.element.getElement(\".validation-failed\"),n=this.element.getElement(\".warning\")),e&&(!i||t||e.hasClass(\"validation-failed\")||i&&!this.options.serial)){var a=e.get(\"validators\"),r=a.some(function(e){return this.getValidator(e)},this),o=[];if(a.each(function(t){t&&!this.test(t,e)&&o.include(t)},this),s=0===o.length,r&&!this.hasValidator(e,\"warnOnly\")&&(s?(e.addClass(\"validation-passed\").removeClass(\"validation-failed\"),this.fireEvent(\"elementPass\",[e])):(e.addClass(\"validation-failed\").removeClass(\"validation-passed\"),this.fireEvent(\"elementFail\",[e,o]))),!n){a.some(function(e){return e.test(\"^warn\")?this.getValidator(e.replace(/^warn-/,\"\")):null},this);e.removeClass(\"warning\");a.map(function(t){return t.test(\"^warn\")?this.test(t.replace(/^warn-/,\"\"),e,!0):null},this)}}return s},test:function(e,t,i){if(t=document.id(t),this.options.ignoreHidden&&!t.isVisible()||this.options.ignoreDisabled&&t.get(\"disabled\"))return!0;var n=this.getValidator(e);null!=i&&(i=!1),this.hasValidator(t,\"warnOnly\")&&(i=!0);var s=t.hasClass(\"ignoreValidation\")||!n||n.test(t);return n&&this.fireEvent(\"elementValidate\",[s,t,e,i]),!!i||s},hasValidator:function(e,t){return e.get(\"validators\").contains(t)},resetField:function(e){return e=document.id(e),e&&e.get(\"validators\").each(function(t){t.test(\"^warn-\")&&(t=t.replace(/^warn-/,\"\")),e.removeClass(\"validation-failed\"),e.removeClass(\"warning\"),e.removeClass(\"validation-passed\")},this),this},stop:function(){return this.paused=!0,this},start:function(){return this.paused=!1,this},ignoreField:function(e,t){return e=document.id(e),e&&(this.enforceField(e),t?e.addClass(\"warnOnly\"):e.addClass(\"ignoreValidation\")),this},enforceField:function(e){return e=document.id(e),e&&e.removeClass(\"warnOnly\").removeClass(\"ignoreValidation\"),this}}),Form.Validator.getMsg=function(e){return Locale.get(\"FormValidator.\"+e)},Form.Validator.adders={validators:{},add:function(e,t){this.validators[e]=new InputValidator(e,t),this.initialize||this.implement({validators:this.validators})},addAllThese:function(e){Array.convert(e).each(function(e){this.add(e[0],e[1])},this)},getValidator:function(e){return this.validators[e.split(\":\")[0]]}},Object.append(Form.Validator,Form.Validator.adders),Form.Validator.implement(Form.Validator.adders),Form.Validator.add(\"IsEmpty\",{errorMsg:!1,test:function(e){return\"select-one\"==e.type||\"select\"==e.type?!(e.selectedIndex>=0&&\"\"!=e.options[e.selectedIndex].value):null==e.get(\"value\")||0==e.get(\"value\").length}}),Form.Validator.addAllThese([[\"required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e){return!Form.Validator.getValidator(\"IsEmpty\").test(e)}}],[\"length\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.length)?Form.Validator.getMsg(\"length\").substitute({length:t.length,elLength:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.length)||(e.get(\"value\").length==t.length||0==e.get(\"value\").length)}}],[\"minLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.minLength)?Form.Validator.getMsg(\"minLength\").substitute({minLength:t.minLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.minLength)||e.get(\"value\").length>=(t.minLength||0)}}],[\"maxLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.maxLength)?Form.Validator.getMsg(\"maxLength\").substitute({maxLength:t.maxLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return e.get(\"value\").length<=(t.maxLength||1e4)}}],[\"validate-integer\",{errorMsg:Form.Validator.getMsg.pass(\"integer\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(-?[1-9]\\d*|0)$/.test(e.get(\"value\"))}}],[\"validate-numeric\",{errorMsg:Form.Validator.getMsg.pass(\"numeric\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^-?(?:0$0(?=\\d*\\.)|[1-9]|0)\\d*(\\.\\d+)?$/.test(e.get(\"value\"))}}],[\"validate-digits\",{errorMsg:Form.Validator.getMsg.pass(\"digits\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[\\d() .:\\-\\+#]+$/.test(e.get(\"value\"))}}],[\"validate-alpha\",{errorMsg:Form.Validator.getMsg.pass(\"alpha\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[a-zA-Z]+$/.test(e.get(\"value\"))}}],[\"validate-alphanum\",{errorMsg:Form.Validator.getMsg.pass(\"alphanum\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||!/\\W/.test(e.get(\"value\"))}}],[\"validate-date\",{errorMsg:function(e,t){if(Date.parse){var i=t.dateFormat||\"%x\";return Form.Validator.getMsg(\"dateSuchAs\").substitute({date:(new Date).format(i)})}return Form.Validator.getMsg(\"dateInFormatMDY\")},test:function(e,t){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var i=Locale.get(\"Date\"),n=new RegExp([i.days,i.days_abbr,i.months,i.months_abbr,i.AM,i.PM].flatten().join(\"|\"),\"i\"),s=e.get(\"value\"),a=s.match(/[a-z]+/gi);if(a&&!a.every(n.exec,n))return!1;var r=Date.parse(s);if(!r)return!1;var o=t.dateFormat||\"%x\",l=r.format(o);return\"invalid date\"!=l&&e.set(\"value\",l),r.isValid()}}],[\"validate-email\",{errorMsg:Form.Validator.getMsg.pass(\"email\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(?:[a-z0-9!#$%&'*+\\/=?^_`{|}~-]\\.?){0,63}[a-z0-9!#$%&'*+\\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\])$/i.test(e.get(\"value\"))}}],[\"validate-url\",{errorMsg:Form.Validator.getMsg.pass(\"url\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(https?|ftp|rmtp|mms):\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(:(\\d+))?\\/?/i.test(e.get(\"value\"))}}],[\"validate-currency-dollar\",{errorMsg:Form.Validator.getMsg.pass(\"currencyDollar\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^\\$?\\-?([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}\\d*(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$/.test(e.get(\"value\"))}}],[\"validate-one-required\",{errorMsg:Form.Validator.getMsg.pass(\"oneRequired\"),test:function(e,t){return(document.id(t[\"validate-one-required\"])||e.getParent(t[\"validate-one-required\"])).getElements(\"input\").some(function(e){return[\"checkbox\",\"radio\"].contains(e.get(\"type\"))?e.get(\"checked\"):e.get(\"value\")})}}]]),Element.Properties.validator={set:function(e){this.get(\"validator\").setOptions(e)},get:function(){var e=this.retrieve(\"validator\");return e||(e=new Form.Validator(this),this.store(\"validator\",e)),e}},Element.implement({validate:function(e){return e&&this.set(\"validator\",e),this.get(\"validator\").validate()}}),function(){function e(e,t,i,n){if(t&&e[t])return e[t];var s=document.id(e[i]);return s?s.getElements(n):[]}Form.Validator.addAllThese([[\"validate-enforce-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-ignore-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toIgnore\",\"ignoreChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?(n.ignoreField(e),n.resetField(e)):n.enforceField(e)}),!0)}}],[\"validate-enforce-onselect-value\",{test:function(t,i){if(!i.value)return!0;var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){i.value==t.value?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-nospace\",{errorMsg:function(){return Form.Validator.getMsg(\"noSpace\")},test:function(e,t){return!e.get(\"value\").test(/\\s/)}}],[\"validate-toggle-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");if(!n)return!0;var s=e(i,\"toToggle\",\"toToggleChildrenOf\",\"input, select, textarea\");return t.checked?s.each(function(e){n.enforceField(e)}):s.each(function(e){n.ignoreField(e),n.resetField(e)}),!0}}],[\"validate-reqchk-bynode\",{errorMsg:function(){return Form.Validator.getMsg(\"reqChkByNode\")},test:function(t,i){return e(i,!1,\"nodeId\",i.selector||\"input[type=checkbox], input[type=radio]\").some(function(e){return e.checked})}}],[\"validate-required-check\",{errorMsg:function(e,t){return t.useTitle?e.get(\"title\"):Form.Validator.getMsg(\"requiredChk\")},test:function(e,t){return!!e.checked}}],[\"validate-reqchk-byname\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"reqChkByName\").substitute({label:t.label||e.get(\"type\")})},test:function(e,t){var i=t.groupName||e.get(\"name\"),n=$$(\"[name=\"+i+\"]\"),s=n.some(function(e,t){return e.checked}),a=e.getParent(\"form\").retrieve(\"validator\");return s&&a&&n.each(function(e,t){a.resetField(e)}),s}}],[\"validate-match\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"match\").substitute({matchName:decodeURIComponent((t.matchName+\"\").replace(/\\+/g,\"%20\"))||document.id(t.matchInput).get(\"name\")})},test:function(e,t){var i=e.get(\"value\"),n=document.id(t.matchInput)&&document.id(t.matchInput).get(\"value\");return!i||!n||i==n}}],[\"validate-after-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"afterDate\").substitute({label:t.afterLabel||(t.afterElement?Form.Validator.getMsg(\"startDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=document.id(t.afterElement)?Date.parse(document.id(t.afterElement).get(\"value\")):new Date,n=Date.parse(e.get(\"value\"));return!n||!i||n>=i}}],[\"validate-before-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"beforeDate\").substitute({label:t.beforeLabel||(t.beforeElement?Form.Validator.getMsg(\"endDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=document.id(t.beforeElement)?Date.parse(document.id(t.beforeElement).get(\"value\")):new Date;return!n||!i||n>=i}}],[\"validate-custom-required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e,t){return e.get(\"value\")!=t.emptyValue}}],[\"validate-same-month\",{errorMsg:function(e,t){var i=document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\");if(\"\"!=e.get(\"value\"))return Form.Validator.getMsg(i?\"sameMonth\":\"startMonth\")},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=Date.parse(document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\"));return!i||!n||i.format(\"%B\")==n.format(\"%B\")}}],[\"validate-cc-num\",{errorMsg:function(e){var t=e.get(\"value\").replace(/[^0-9]/g,\"\");return Form.Validator.getMsg(\"creditcard\").substitute({length:t.length})},test:function(e){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var t=e.get(\"value\");t=t.replace(/[^0-9]/g,\"\");var i=!1;if(t.test(/^4[0-9]{12}([0-9]{3})?$/)?i=\"Visa\":t.test(/^5[1-5]([0-9]{14})$/)?i=\"Master Card\":t.test(/^3[47][0-9]{13}$/)?i=\"American Express\":t.test(/^6(?:011|5[0-9]{2})[0-9]{12}$/)?i=\"Discover\":t.test(/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/)&&(i=\"Diners Club\"),i){for(var n=0,s=0,a=t.length-1;a>=0;--a)0!=(s=t.charAt(a).toInt())&&((t.length-a)%2==0&&(s+=s),s>9&&(s=s.toString().charAt(0).toInt()+s.toString().charAt(1).toInt()),n+=s);if(n%10==0)return!0}for(var r=\"\";\"\"!=t;)r+=\" \"+t.substr(0,4),t=t.substr(4);return e.getParent(\"form\").retrieve(\"validator\").ignoreField(e),e.set(\"value\",r.clean()),e.getParent(\"form\").retrieve(\"validator\").enforceField(e),!1}}]])}(),Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(e){e.reveal?e.reveal():e.setStyle(\"display\",\"block\")},hideError:function(e){e.dissolve?e.dissolve():e.setStyle(\"display\",\"none\")},scrollToErrorsOnSubmit:!0,scrollToErrorsOnBlur:!1,scrollToErrorsOnChange:!1,scrollFxOptions:{transition:\"quad:out\",offset:{y:-20}}},initialize:function(e,t){this.parent(e,t),this.addEvent(\"onElementValidate\",function(e,t,i,n){var s=this.getValidator(i);if(!e&&s.getError(t)){n&&t.addClass(\"warning\");var a=this.makeAdvice(i,t,s.getError(t),n);this.insertAdvice(a,t),this.showAdvice(i,t)}else this.hideAdvice(i,t)})},makeAdvice:function(e,t,i,n){var s=n?this.warningPrefix:this.errorPrefix;s+=this.options.useTitles?t.title||i:i;var a=n?\"warning-advice\":\"validation-advice\",r=this.getAdvice(e,t);return r=r?r.set(\"html\",s):new Element(\"div\",{html:s,styles:{display:\"none\"},id:\"advice-\"+e.split(\":\")[0]+\"-\"+this.getFieldId(t)}).addClass(a),t.store(\"$moo:advice-\"+e,r),r},getFieldId:function(e){return e.id?e.id:e.id=\"input_\"+e.name},showAdvice:function(e,t){var i=this.getAdvice(e,t);!i||t.retrieve(\"$moo:\"+this.getPropName(e))||\"none\"!=i.getStyle(\"display\")&&\"hidden\"!=i.getStyle(\"visibility\")&&0!=i.getStyle(\"opacity\")||(t.store(\"$moo:\"+this.getPropName(e),!0),this.options.showError(i),this.fireEvent(\"showAdvice\",[t,i,e]))},hideAdvice:function(e,t){var i=this.getAdvice(e,t);i&&t.retrieve(\"$moo:\"+this.getPropName(e))&&(t.store(\"$moo:\"+this.getPropName(e),!1),this.options.hideError(i),this.fireEvent(\"hideAdvice\",[t,i,e]))},getPropName:function(e){return\"advice\"+e},resetField:function(e){return(e=document.id(e))?(this.parent(e),e.get(\"validators\").each(function(t){this.hideAdvice(t,e)},this),this):this},getAllAdviceMessages:function(e,t){var i=[];if(e.hasClass(\"ignoreValidation\")&&!t)return i;e.get(\"validators\").some(function(t){var n=t.test(\"^warn-\")||e.hasClass(\"warnOnly\");n&&(t=t.replace(/^warn-/,\"\"));var s=this.getValidator(t);s&&i.push({message:s.getError(e),warnOnly:n,passed:s.test(),validator:s})},this);return i},getAdvice:function(e,t){return t.retrieve(\"$moo:advice-\"+e)},insertAdvice:function(e,t){var i=t.get(\"validatorProps\");i.msgPos&&document.id(i.msgPos)?document.id(i.msgPos).grab(e):t.type&&\"radio\"==t.type.toLowerCase()?t.getParent().adopt(e):e.inject(document.id(t),\"after\")},validateField:function(e,t,i){var n=this.parent(e,t);if((this.options.scrollToErrorsOnSubmit&&null==i||i)&&!n){for(var s=document.id(this).getElement(\".validation-failed\"),a=document.id(this).getParent();a!=document.body&&a.getScrollSize().y==a.getSize().y;)a=a.getParent();var r=a.retrieve(\"$moo:fvScroller\");!r&&window.Fx&&Fx.Scroll&&(r=new Fx.Scroll(a,this.options.scrollFxOptions),a.store(\"$moo:fvScroller\",r)),s&&(r?r.toElement(s):a.scrollTo(a.getScroll().x,s.getPosition(a).y-20))}return n},watchFields:function(e){e.each(function(e){this.options.evaluateFieldsOnBlur&&e.addEvent(\"blur\",this.validationMonitor.pass([e,!1,this.options.scrollToErrorsOnBlur],this)),this.options.evaluateFieldsOnChange&&e.addEvent(\"change\",this.validationMonitor.pass([e,!0,this.options.scrollToErrorsOnChange],this))},this)}}),function(){var e=this.OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:[\"reposition\",\"assert\",\"focus\",\"hide\"],options:{element:\"label\",labelClass:\"overTxtLabel\",positionOptions:{position:\"upperLeft\",edge:\"upperLeft\",offset:{x:4,y:2}},poll:!1,pollInterval:250,wrap:!1},property:\"OverText\",initialize:function(t,i){if(t=this.element=document.id(t),this.occlude())return this.occluded;this.setOptions(i),this.attach(t),e.instances.push(this),this.options.poll&&this.poll()},toElement:function(){return this.element},attach:function(){var e=this.element,t=this.options,i=t.textOverride||e.get(\"alt\")||e.get(\"title\");if(!i)return this;var n=this.text=new Element(t.element,{class:t.labelClass,styles:{lineHeight:\"normal\",position:\"absolute\",cursor:\"text\"},html:i,events:{click:this.hide.pass(\"label\"==t.element,this)}}).inject(e,\"after\");return\"label\"==t.element&&(e.get(\"id\")||e.set(\"id\",\"input_\"+String.uniqueID()),n.set(\"for\",e.get(\"id\"))),t.wrap&&(this.textHolder=new Element(\"div.overTxtWrapper\",{styles:{lineHeight:\"normal\",position:\"relative\"}}).grab(n).inject(e,\"before\")),this.enable()},destroy:function(){return this.element.eliminate(this.property),this.disable(),this.text&&this.text.destroy(),this.textHolder&&this.textHolder.destroy(),this},disable:function(){return this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.removeEvent(\"resize\",this.reposition),this.hide(!0,!0),this},enable:function(){return this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.addEvent(\"resize\",this.reposition),this.reposition(),this},wrap:function(){\"label\"==this.options.element&&(this.element.get(\"id\")||this.element.set(\"id\",\"input_\"+String.uniqueID()),this.text.set(\"for\",this.element.get(\"id\")))},startPolling:function(){return this.pollingPaused=!1,this.poll()},poll:function(e){return this.poller&&!e?this:(e?clearInterval(this.poller):this.poller=function(){this.pollingPaused||this.assert(!0)}.periodical(this.options.pollInterval,this),this)},stopPolling:function(){return this.pollingPaused=!0,this.poll(!0)},focus:function(){return!this.text||this.text.isDisplayed()&&!this.element.get(\"disabled\")?this.hide():this},hide:function(e,t){if(this.text&&this.text.isDisplayed()&&(!this.element.get(\"disabled\")||t)&&(this.text.hide(),this.fireEvent(\"textHide\",[this.text,this.element]),this.pollingPaused=!0,!e))try{this.element.fireEvent(\"focus\"),this.element.focus()}catch(e){}return this},show:function(){return document.id(this.text)&&!this.text.isDisplayed()&&(this.text.show(),this.reposition(),this.fireEvent(\"textShow\",[this.text,this.element]),this.pollingPaused=!1),this},test:function(){return!this.element.get(\"value\")},assert:function(e){return this[this.test()?\"show\":\"hide\"](e)},reposition:function(){return this.assert(!0),this.element.isVisible()?(this.text&&this.test()&&this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element})),this):this.stopPolling().hide()}})}(),OverText.instances=[],Object.append(OverText,{each:function(e){return OverText.instances.each(function(t,i){t.element&&t.text&&e.call(OverText,t,i)})},update:function(){return OverText.each(function(e){return e.reposition()})},hideAll:function(){return OverText.each(function(e){return e.hide(!0,!0)})},showAll:function(){return OverText.each(function(e){return e.show()})}}),Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(e,t){this.elements=this.subject=$$(e),this.parent(t)},compute:function(e,t,i){var n={};for(var s in e){var a=e[s],r=t[s],o=n[s]={};for(var l in a)o[l]=this.parent(a[l],r[l],i)}return n},set:function(e){for(var t in e)if(this.elements[t]){var i=e[t];for(var n in i)this.render(this.elements[t],n,i[n],this.options.unit)}return this},start:function(e){if(!this.check(e))return this;var t={},i={};for(var n in e)if(this.elements[n]){var s=e[n],a=t[n]={},r=i[n]={};for(var o in s){var l=this.prepare(this.elements[n],o,s[o]);a[o]=l.from,r[o]=l.to}}return this.parent(t,i)}}),Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:!1,fixedWidth:!1,display:0,show:!1,height:!0,width:!1,opacity:!0,alwaysHide:!1,trigger:\"click\",initialDisplayFx:!0,resetHeight:!0,keepOpen:!1},initialize:function(){var e=function(e){return null!=e},t=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:e,elements:e});this.parent(t.elements,t.options);var i=this.options,n=this.togglers=$$(t.togglers);this.previous=-1,this.internalChain=new Chain,i.alwaysHide&&(this.options.link=\"chain\"),(i.show||0===this.options.show)&&(i.display=!1,this.previous=i.show),i.start&&(i.display=!1,i.show=!1);var s=this.effects={};i.opacity&&(s.opacity=\"fullOpacity\"),i.width&&(s.width=i.fixedWidth?\"fullWidth\":\"offsetWidth\"),i.height&&(s.height=i.fixedHeight?\"fullHeight\":\"scrollHeight\");for(var a=0,r=n.length;a=0?n-1:0).chain(a):a(),this},detach:function(e){var t=function(e){e.removeEvent(this.options.trigger,e.retrieve(\"accordion:display\"))}.bind(this);return e?t(e):this.togglers.each(t),this},display:function(e,t){if(!this.check(e,t))return this;var i={},n=this.elements,s=this.options,a=this.effects,r=s.keepOpen,o=s.alwaysHide;if(null==t&&(t=!0),\"element\"==typeOf(e)&&(e=n.indexOf(e)),e==this.current&&!o&&!r)return this;if(s.resetHeight){var l=n[this.current];if(l&&!this.selfHidden)for(var h in a)l.setStyle(h,l[a[h]])}return this.timer&&\"chain\"==s.link?this:(null!=this.current&&(this.previous=this.current),this.current=e,this.selfHidden=!1,n.each(function(n,l){i[l]={};var h,u;if(!r||l==e){l==e&&(u=n.offsetHeight>0&&s.height||n.offsetWidth>0&&s.width),l!=e?h=!0:(o||r)&&u&&(h=!0,this.selfHidden=!0),this.fireEvent(h?\"background\":\"active\",[this.togglers[l],n]);for(var d in a)i[l][d]=h?0:n[a[d]];t||h||!s.resetHeight||(i[l].height=\"auto\")}},this),this.internalChain.clearChain(),this.internalChain.chain(function(){if(s.resetHeight&&!this.selfHidden){var t=n[e];t&&t.setStyle(\"height\",\"auto\")}}.bind(this)),t?this.start(i):this.set(i).internalChain.callChain())}}),Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:\"center\",edge:!1,offset:{x:0,y:0}},start:function(e){var t=this.element,i=t.getStyles(\"top\",\"left\");return\"auto\"!=i.top&&\"auto\"!=i.left||t.setPosition(t.getPosition(t.getOffsetParent())),this.parent(t.position(Object.merge({},this.options,e,{returnPos:!0})))}}),Element.Properties.move={set:function(e){return this.get(\"move\").cancel().setOptions(e),this},get:function(){var e=this.retrieve(\"move\");return e||(e=new Fx.Move(this,{link:\"cancel\"}),this.store(\"move\",e)),e}},Element.implement({move:function(e){return this.get(\"move\").start(e),this}}),function(){function e(e){return/^(?:body|html)$/i.test(e.tagName)}Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:!0},initialize:function(e,t){if(this.element=this.subject=document.id(e),this.parent(t),\"element\"!=typeOf(this.element)&&(this.element=document.id(this.element.getDocument().body)),this.options.wheelStops){var i=this.element,n=this.cancel.pass(!1,this);this.addEvent(\"start\",function(){i.addEvent(\"mousewheel\",n)},!0),this.addEvent(\"complete\",function(){i.removeEvent(\"mousewheel\",n)},!0)}},set:function(){var e=Array.flatten(arguments);return this.element.scrollTo(e[0],e[1]),this},compute:function(e,t,i){return[0,1].map(function(n){return Fx.compute(e[n],t[n],i)})},start:function(e,t){if(!this.check(e,t))return this;var i=this.element.getScroll();return this.parent([i.x,i.y],[e,t])},calculateScroll:function(e,t){var i=this.element,n=i.getScrollSize(),s=i.getScroll(),a=i.getSize(),r=this.options.offset,o={x:e,y:t};for(var l in o)o[l]||0===o[l]||(o[l]=s[l]),\"number\"!=typeOf(o[l])&&(o[l]=n[l]-a[l]),o[l]+=r[l];return[o.x,o.y]},toTop:function(){return this.start.apply(this,this.calculateScroll(!1,0))},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,!1))},toRight:function(){return this.start.apply(this,this.calculateScroll(\"right\",!1))},toBottom:function(){return this.start.apply(this,this.calculateScroll(!1,\"bottom\"))},toElement:function(t,i){i=i?Array.convert(i):[\"x\",\"y\"];var n=e(this.element)?{x:0,y:0}:this.element.getScroll(),s=Object.map(document.id(t).getPosition(this.element),function(e,t){return!!i.contains(t)&&e+n[t]});return this.start.apply(this,this.calculateScroll(s.x,s.y))},toElementEdge:function(e,t,i){t=t?Array.convert(t):[\"x\",\"y\"],e=document.id(e);var n={},s=e.getPosition(this.element),a=e.getSize(),r=this.element.getScroll(),o=this.element.getSize(),l={x:s.x+a.x,y:s.y+a.y};return[\"x\",\"y\"].each(function(e){t.contains(e)&&(l[e]>r[e]+o[e]&&(n[e]=l[e]-o[e]),s[e] String[200]:\n return concat(self.greeting, greet)\n\n@external\ndef hithere(name: String[100]) -> String[200]:\n d: String[200] = self.construct(name)\n return d\n \"\"\"\n\n c = get_contract_with_gas_estimation(private_test_code)\n assert c.hithere(\"bob\") == \"Hello bob\"\n assert c.hithere(\"alice\") == \"Hello alice\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/parser/types/test_string.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/parser/types/test_string.py::get_contract_with_gas_estimation \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "29+train+vyperlang--vyper+CVE-2022-24787+clean.pkl", "func_name_": "test_private_string"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def expose(template=None, validators=None, allow_json=None, html=None,\n format=None, content_type=None, inputform=None, fragment=False,\n as_format=\"default\", mapping=None, accept_format=None,\n exclude_from_memory_profiling=False):\n \"\"\"Exposes a method to the web.\n\n By putting the expose decorator on a method, you tell TurboGears that\n the method should be accessible via URL traversal. Additionally, expose\n handles the output processing (turning a dictionary into finished\n output) and is also responsible for ensuring that the request is\n wrapped in a database transaction.\n\n You can apply multiple expose decorators to a method, if\n you'd like to support multiple output formats. The decorator that's\n listed first in your code without as_format or accept_format is\n the default that is chosen when no format is specifically asked for.\n Any other expose calls that are missing as_format and accept_format\n will have as_format implicitly set to the whatever comes before\n the \":\" in the template name (or the whole template name if there\n is no \":\". For example, expose(\"json\"), if it's not\n the default expose, will have as_format set to \"json\".\n\n When as_format is set, passing the same value in the tg_format\n parameter in a request will choose the options for that expose\n decorator. Similarly, accept_format will watch for matching\n Accept headers. You can also use both. expose(\"json\", as_format=\"json\",\n accept_format=\"application/json\") will choose JSON output for either\n case: tg_format=json as a parameter or Accept: application/json as a\n request header.\n\n Passing allow_json=True to an expose decorator\n is equivalent to adding the decorator just mentioned.\n\n Each expose decorator has its own set of options, and each one\n can choose a different template or even template engine (you can\n use Kid for HTML output and Cheetah for plain text, for example).\n See the other expose parameters below to learn about the options\n you can pass to the template engine.\n\n Take a look at the\n test_expose.py suite\n for more examples.\n\n @param template \"templateengine:dotted.reference\" reference along the\n Python path for the template and the template engine. For\n example, \"kid:foo.bar\" will have Kid render the bar template in\n the foo package.\n @keyparam format format for the template engine to output (if the\n template engine can render different formats. Kid, for example,\n can render \"html\", \"xml\" or \"xhtml\")\n @keyparam content_type sets the content-type http header\n @keyparam allow_json allow the function to be exposed as json\n @keyparam fragment for template engines (like Kid) that generate\n DOCTYPE declarations and the like, this is a signal to\n just generate the immediate template fragment. Use this\n if you're building up a page from multiple templates or\n going to put something onto a page with .innerHTML.\n @keyparam mapping mapping with options that are sent to the template\n engine\n @keyparam as_format designates which value of tg_format will choose\n this expose.\n @keyparam accept_format which value of an Accept: header will\n choose this expose.\n @keyparam html deprecated in favor of template\n @keyparam validators deprecated. Maps argument names to validator\n applied to that arg\n @keyparam inputform deprecated. A form object that generates the\n input to this method\n @keyparam exclude_from_memory_profiling allows to exclude individual end points from memory profiling. Can be \n used for performance or in case profiling generates errors\n \"\"\"\n if html:\n template = html\n if not template:\n template = format\n if format == \"json\" or (format is None and template is None):\n template = \"json\"\n allow_json = True\n if content_type is None:\n content_type = config.get(\"tg.content_type\", None)\n\n if config.get(\"tg.session.automatic_lock\", None):\n cherrypy.session.acquire_lock()\n\n def entangle(func):\n log.debug(\"Exposing %s\", func)\n log.debug(\"template: %s, format: %s, allow_json: %s, \"\n \"content-type: %s\", template, format, allow_json, content_type)\n if not getattr(func, \"exposed\", False):\n def expose(func, *args, **kw):\n accept = request.headers.get('Accept', \"\").lower()\n accept = tg_util.simplify_http_accept_header(accept)\n if not hasattr(func, \"_expose\"):\n _build_rules(func)\n if hasattr(request, \"in_transaction\"):\n output = func._expose(func, accept, func._allow_json,\n *args, **kw)\n else:\n request.in_transaction = True\n output = profile_expose_method(_run_with_transaction, accept, args, func, kw,\n exclude_from_memory_profiling)\n return output\n func.exposed = True\n func._ruleinfo = []\n allow_json_from_config = config.get(\"tg.allow_json\", False)\n func._allow_json = allow_json_from_config or template == 'json'\n else:\n expose = lambda func, *args, **kw: func(*args, **kw)\n\n func._ruleinfo.insert(0, dict(as_format=as_format,\n accept_format=accept_format, template=template,\n rulefunc = lambda _func, accept, allow_json, *args, **kw:\n _execute_func(_func, template, format, content_type,\n mapping, fragment, args, kw)))\n\n if allow_json:\n func._allow_json = True\n\n if inputform or validators:\n import warnings\n warnings.warn(\n \"Use a separate decorator validate() rather than passing \"\n \"arguments validators and/or inputform to decorator \"\n \"expose().\",\n DeprecationWarning, 2)\n func = validate(form=inputform, validators=validators)(func)\n\n return expose\n return weak_signature_decorator(entangle) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: turbogears/controllers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+OnShift--turbogears+CVE-2019-25101+vul.pkl", "func_name_": "expose"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;sthis.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "518+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "MooTools.More"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *__pyx_pf_17clickhouse_driver_14bufferedreader_14BufferedReader_8read_strings(struct __pyx_obj_17clickhouse_driver_14bufferedreader_BufferedReader *__pyx_v_self, Py_ssize_t __pyx_v_n_items, PyObject *__pyx_v_encoding) {\n PyObject *__pyx_v_items = NULL;\n Py_ssize_t __pyx_v_i;\n char *__pyx_v_buffer_ptr;\n Py_ssize_t __pyx_v_right;\n Py_ssize_t __pyx_v_size;\n Py_ssize_t __pyx_v_shift;\n Py_ssize_t __pyx_v_bytes_read;\n unsigned char __pyx_v_b;\n char *__pyx_v_c_string;\n Py_ssize_t __pyx_v_c_string_size;\n char *__pyx_v_c_encoding;\n PyObject *__pyx_v_rv = 0;\n PyObject *__pyx_r = NULL;\n __Pyx_RefNannyDeclarations\n PyObject *__pyx_t_1 = NULL;\n int __pyx_t_2;\n PyObject *__pyx_t_3 = NULL;\n PyObject *__pyx_t_4 = NULL;\n char *__pyx_t_5;\n Py_ssize_t __pyx_t_6;\n Py_ssize_t __pyx_t_7;\n Py_ssize_t __pyx_t_8;\n Py_ssize_t __pyx_t_9;\n Py_ssize_t __pyx_t_10;\n Py_ssize_t __pyx_t_11;\n PyObject *__pyx_t_12 = NULL;\n PyObject *__pyx_t_13 = NULL;\n PyObject *__pyx_t_14 = NULL;\n int __pyx_t_15;\n PyObject *__pyx_t_16 = NULL;\n __Pyx_RefNannySetupContext(\"read_strings\", 0);\n __Pyx_INCREF(__pyx_v_encoding);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":67\n * We inline strings reading logic here to avoid this overhead.\n * \"\"\"\n * items = PyTuple_New(n_items) # <<<<<<<<<<<<<<\n * \n * cdef Py_ssize_t i\n */\n __pyx_t_1 = PyTuple_New(__pyx_v_n_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __pyx_v_items = ((PyObject*)__pyx_t_1);\n __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":71\n * cdef Py_ssize_t i\n * # Buffer vars\n * cdef char* buffer_ptr = PyByteArray_AsString(self.buffer) # <<<<<<<<<<<<<<\n * cdef Py_ssize_t right\n * # String length vars\n */\n __pyx_t_1 = __pyx_v_self->buffer;\n __Pyx_INCREF(__pyx_t_1);\n __pyx_v_buffer_ptr = PyByteArray_AsString(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":78\n * \n * # String for decode vars.\n * cdef char *c_string = NULL # <<<<<<<<<<<<<<\n * cdef Py_ssize_t c_string_size = 1024\n * cdef char *c_encoding = NULL\n */\n __pyx_v_c_string = NULL;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":79\n * # String for decode vars.\n * cdef char *c_string = NULL\n * cdef Py_ssize_t c_string_size = 1024 # <<<<<<<<<<<<<<\n * cdef char *c_encoding = NULL\n * if encoding:\n */\n __pyx_v_c_string_size = 0x400;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":80\n * cdef char *c_string = NULL\n * cdef Py_ssize_t c_string_size = 1024\n * cdef char *c_encoding = NULL # <<<<<<<<<<<<<<\n * if encoding:\n * encoding = encoding.encode('utf-8')\n */\n __pyx_v_c_encoding = NULL;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":81\n * cdef Py_ssize_t c_string_size = 1024\n * cdef char *c_encoding = NULL\n * if encoding: # <<<<<<<<<<<<<<\n * encoding = encoding.encode('utf-8')\n * c_encoding = encoding\n */\n __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":82\n * cdef char *c_encoding = NULL\n * if encoding:\n * encoding = encoding.encode('utf-8') # <<<<<<<<<<<<<<\n * c_encoding = encoding\n * \n */\n __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_3);\n __pyx_t_4 = NULL;\n if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {\n __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);\n if (likely(__pyx_t_4)) {\n PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);\n __Pyx_INCREF(__pyx_t_4);\n __Pyx_INCREF(function);\n __Pyx_DECREF_SET(__pyx_t_3, function);\n }\n }\n __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8);\n __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;\n if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;\n __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_1);\n __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":83\n * if encoding:\n * encoding = encoding.encode('utf-8')\n * c_encoding = encoding # <<<<<<<<<<<<<<\n * \n * cdef object rv = object()\n */\n __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_encoding); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)\n __pyx_v_c_encoding = __pyx_t_5;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":81\n * cdef Py_ssize_t c_string_size = 1024\n * cdef char *c_encoding = NULL\n * if encoding: # <<<<<<<<<<<<<<\n * encoding = encoding.encode('utf-8')\n * c_encoding = encoding\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":85\n * c_encoding = encoding\n * \n * cdef object rv = object() # <<<<<<<<<<<<<<\n * # String for decode vars.\n * if c_encoding:\n */\n __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __pyx_v_rv = __pyx_t_1;\n __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":87\n * cdef object rv = object()\n * # String for decode vars.\n * if c_encoding: # <<<<<<<<<<<<<<\n * c_string = PyMem_Realloc(NULL, c_string_size)\n * \n */\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":88\n * # String for decode vars.\n * if c_encoding:\n * c_string = PyMem_Realloc(NULL, c_string_size) # <<<<<<<<<<<<<<\n * \n * for i in range(n_items):\n */\n __pyx_v_c_string = ((char *)PyMem_Realloc(NULL, __pyx_v_c_string_size));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":87\n * cdef object rv = object()\n * # String for decode vars.\n * if c_encoding: # <<<<<<<<<<<<<<\n * c_string = PyMem_Realloc(NULL, c_string_size)\n * \n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":90\n * c_string = PyMem_Realloc(NULL, c_string_size)\n * \n * for i in range(n_items): # <<<<<<<<<<<<<<\n * shift = size = 0\n * \n */\n __pyx_t_6 = __pyx_v_n_items;\n __pyx_t_7 = __pyx_t_6;\n for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {\n __pyx_v_i = __pyx_t_8;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":91\n * \n * for i in range(n_items):\n * shift = size = 0 # <<<<<<<<<<<<<<\n * \n * # Read string size\n */\n __pyx_v_shift = 0;\n __pyx_v_size = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":94\n * \n * # Read string size\n * while True: # <<<<<<<<<<<<<<\n * if self.position == self.current_buffer_size:\n * self.read_into_buffer()\n */\n while (1) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":95\n * # Read string size\n * while True:\n * if self.position == self.current_buffer_size: # <<<<<<<<<<<<<<\n * self.read_into_buffer()\n * # `read_into_buffer` can override buffer\n */\n __pyx_t_2 = ((__pyx_v_self->position == __pyx_v_self->current_buffer_size) != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":96\n * while True:\n * if self.position == self.current_buffer_size:\n * self.read_into_buffer() # <<<<<<<<<<<<<<\n * # `read_into_buffer` can override buffer\n * buffer_ptr = PyByteArray_AsString(self.buffer)\n */\n __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_into_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_3);\n __pyx_t_4 = NULL;\n if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {\n __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);\n if (likely(__pyx_t_4)) {\n PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);\n __Pyx_INCREF(__pyx_t_4);\n __Pyx_INCREF(function);\n __Pyx_DECREF_SET(__pyx_t_3, function);\n }\n }\n __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);\n __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;\n if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":98\n * self.read_into_buffer()\n * # `read_into_buffer` can override buffer\n * buffer_ptr = PyByteArray_AsString(self.buffer) # <<<<<<<<<<<<<<\n * self.position = 0\n * \n */\n __pyx_t_1 = __pyx_v_self->buffer;\n __Pyx_INCREF(__pyx_t_1);\n __pyx_v_buffer_ptr = PyByteArray_AsString(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":99\n * # `read_into_buffer` can override buffer\n * buffer_ptr = PyByteArray_AsString(self.buffer)\n * self.position = 0 # <<<<<<<<<<<<<<\n * \n * b = buffer_ptr[self.position]\n */\n __pyx_v_self->position = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":95\n * # Read string size\n * while True:\n * if self.position == self.current_buffer_size: # <<<<<<<<<<<<<<\n * self.read_into_buffer()\n * # `read_into_buffer` can override buffer\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":101\n * self.position = 0\n * \n * b = buffer_ptr[self.position] # <<<<<<<<<<<<<<\n * self.position += 1\n * \n */\n __pyx_v_b = (__pyx_v_buffer_ptr[__pyx_v_self->position]);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":102\n * \n * b = buffer_ptr[self.position]\n * self.position += 1 # <<<<<<<<<<<<<<\n * \n * size |= (b & 0x7f) << shift\n */\n __pyx_v_self->position = (__pyx_v_self->position + 1);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":104\n * self.position += 1\n * \n * size |= (b & 0x7f) << shift # <<<<<<<<<<<<<<\n * if b < 0x80:\n * break\n */\n __pyx_v_size = (__pyx_v_size | ((__pyx_v_b & 0x7f) << __pyx_v_shift));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":105\n * \n * size |= (b & 0x7f) << shift\n * if b < 0x80: # <<<<<<<<<<<<<<\n * break\n * \n */\n __pyx_t_2 = ((__pyx_v_b < 0x80) != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":106\n * size |= (b & 0x7f) << shift\n * if b < 0x80:\n * break # <<<<<<<<<<<<<<\n * \n * shift += 7\n */\n goto __pyx_L8_break;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":105\n * \n * size |= (b & 0x7f) << shift\n * if b < 0x80: # <<<<<<<<<<<<<<\n * break\n * \n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":108\n * break\n * \n * shift += 7 # <<<<<<<<<<<<<<\n * \n * right = self.position + size\n */\n __pyx_v_shift = (__pyx_v_shift + 7);\n }\n __pyx_L8_break:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":110\n * shift += 7\n * \n * right = self.position + size # <<<<<<<<<<<<<<\n * \n * if c_encoding:\n */\n __pyx_v_right = (__pyx_v_self->position + __pyx_v_size);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":112\n * right = self.position + size\n * \n * if c_encoding: # <<<<<<<<<<<<<<\n * if size + 1 > c_string_size:\n * c_string_size = size + 1\n */\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":113\n * \n * if c_encoding:\n * if size + 1 > c_string_size: # <<<<<<<<<<<<<<\n * c_string_size = size + 1\n * c_string = PyMem_Realloc(c_string, c_string_size)\n */\n __pyx_t_2 = (((__pyx_v_size + 1) > __pyx_v_c_string_size) != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":114\n * if c_encoding:\n * if size + 1 > c_string_size:\n * c_string_size = size + 1 # <<<<<<<<<<<<<<\n * c_string = PyMem_Realloc(c_string, c_string_size)\n * if c_string is NULL:\n */\n __pyx_v_c_string_size = (__pyx_v_size + 1);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":115\n * if size + 1 > c_string_size:\n * c_string_size = size + 1\n * c_string = PyMem_Realloc(c_string, c_string_size) # <<<<<<<<<<<<<<\n * if c_string is NULL:\n * raise MemoryError()\n */\n __pyx_v_c_string = ((char *)PyMem_Realloc(__pyx_v_c_string, __pyx_v_c_string_size));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":116\n * c_string_size = size + 1\n * c_string = PyMem_Realloc(c_string, c_string_size)\n * if c_string is NULL: # <<<<<<<<<<<<<<\n * raise MemoryError()\n * c_string[size] = 0\n */\n __pyx_t_2 = ((__pyx_v_c_string == NULL) != 0);\n if (unlikely(__pyx_t_2)) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":117\n * c_string = PyMem_Realloc(c_string, c_string_size)\n * if c_string is NULL:\n * raise MemoryError() # <<<<<<<<<<<<<<\n * c_string[size] = 0\n * bytes_read = 0\n */\n PyErr_NoMemory(); __PYX_ERR(0, 117, __pyx_L1_error)\n\n /* \"clickhouse_driver/bufferedreader.pyx\":116\n * c_string_size = size + 1\n * c_string = PyMem_Realloc(c_string, c_string_size)\n * if c_string is NULL: # <<<<<<<<<<<<<<\n * raise MemoryError()\n * c_string[size] = 0\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":113\n * \n * if c_encoding:\n * if size + 1 > c_string_size: # <<<<<<<<<<<<<<\n * c_string_size = size + 1\n * c_string = PyMem_Realloc(c_string, c_string_size)\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":118\n * if c_string is NULL:\n * raise MemoryError()\n * c_string[size] = 0 # <<<<<<<<<<<<<<\n * bytes_read = 0\n * \n */\n (__pyx_v_c_string[__pyx_v_size]) = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":119\n * raise MemoryError()\n * c_string[size] = 0\n * bytes_read = 0 # <<<<<<<<<<<<<<\n * \n * # Decoding pure c strings in Cython is faster than in pure Python.\n */\n __pyx_v_bytes_read = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":112\n * right = self.position + size\n * \n * if c_encoding: # <<<<<<<<<<<<<<\n * if size + 1 > c_string_size:\n * c_string_size = size + 1\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":124\n * # We need to copy it into buffer for adding null symbol at the end.\n * # In ClickHouse block there is no null\n * if right > self.current_buffer_size: # <<<<<<<<<<<<<<\n * if c_encoding:\n * memcpy(&c_string[bytes_read], &buffer_ptr[self.position],\n */\n __pyx_t_2 = ((__pyx_v_right > __pyx_v_self->current_buffer_size) != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":125\n * # In ClickHouse block there is no null\n * if right > self.current_buffer_size:\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(&c_string[bytes_read], &buffer_ptr[self.position],\n * self.current_buffer_size - self.position)\n */\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":126\n * if right > self.current_buffer_size:\n * if c_encoding:\n * memcpy(&c_string[bytes_read], &buffer_ptr[self.position], # <<<<<<<<<<<<<<\n * self.current_buffer_size - self.position)\n * else:\n */\n (void)(memcpy((&(__pyx_v_c_string[__pyx_v_bytes_read])), (&(__pyx_v_buffer_ptr[__pyx_v_self->position])), (__pyx_v_self->current_buffer_size - __pyx_v_self->position)));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":125\n * # In ClickHouse block there is no null\n * if right > self.current_buffer_size:\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(&c_string[bytes_read], &buffer_ptr[self.position],\n * self.current_buffer_size - self.position)\n */\n goto __pyx_L15;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":129\n * self.current_buffer_size - self.position)\n * else:\n * rv = PyBytes_FromStringAndSize( # <<<<<<<<<<<<<<\n * &buffer_ptr[self.position],\n * self.current_buffer_size - self.position\n */\n /*else*/ {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":131\n * rv = PyBytes_FromStringAndSize(\n * &buffer_ptr[self.position],\n * self.current_buffer_size - self.position # <<<<<<<<<<<<<<\n * )\n * \n */\n __pyx_t_1 = PyBytes_FromStringAndSize((&(__pyx_v_buffer_ptr[__pyx_v_self->position])), (__pyx_v_self->current_buffer_size - __pyx_v_self->position)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);\n __pyx_t_1 = 0;\n }\n __pyx_L15:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":134\n * )\n * \n * bytes_read = self.current_buffer_size - self.position # <<<<<<<<<<<<<<\n * # Read the rest of the string.\n * while bytes_read != size:\n */\n __pyx_v_bytes_read = (__pyx_v_self->current_buffer_size - __pyx_v_self->position);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":136\n * bytes_read = self.current_buffer_size - self.position\n * # Read the rest of the string.\n * while bytes_read != size: # <<<<<<<<<<<<<<\n * self.position = size - bytes_read\n * \n */\n while (1) {\n __pyx_t_2 = ((__pyx_v_bytes_read != __pyx_v_size) != 0);\n if (!__pyx_t_2) break;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":137\n * # Read the rest of the string.\n * while bytes_read != size:\n * self.position = size - bytes_read # <<<<<<<<<<<<<<\n * \n * self.read_into_buffer()\n */\n __pyx_v_self->position = (__pyx_v_size - __pyx_v_bytes_read);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":139\n * self.position = size - bytes_read\n * \n * self.read_into_buffer() # <<<<<<<<<<<<<<\n * # `read_into_buffer` can override buffer\n * buffer_ptr = PyByteArray_AsString(self.buffer)\n */\n __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_into_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_3);\n __pyx_t_4 = NULL;\n if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {\n __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);\n if (likely(__pyx_t_4)) {\n PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);\n __Pyx_INCREF(__pyx_t_4);\n __Pyx_INCREF(function);\n __Pyx_DECREF_SET(__pyx_t_3, function);\n }\n }\n __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);\n __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;\n if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":141\n * self.read_into_buffer()\n * # `read_into_buffer` can override buffer\n * buffer_ptr = PyByteArray_AsString(self.buffer) # <<<<<<<<<<<<<<\n * # There can be not enough data in buffer.\n * self.position = min(\n */\n __pyx_t_1 = __pyx_v_self->buffer;\n __Pyx_INCREF(__pyx_t_1);\n __pyx_v_buffer_ptr = PyByteArray_AsString(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":144\n * # There can be not enough data in buffer.\n * self.position = min(\n * self.position, self.current_buffer_size # <<<<<<<<<<<<<<\n * )\n * if c_encoding:\n */\n __pyx_t_9 = __pyx_v_self->current_buffer_size;\n __pyx_t_10 = __pyx_v_self->position;\n if (((__pyx_t_9 < __pyx_t_10) != 0)) {\n __pyx_t_11 = __pyx_t_9;\n } else {\n __pyx_t_11 = __pyx_t_10;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":143\n * buffer_ptr = PyByteArray_AsString(self.buffer)\n * # There can be not enough data in buffer.\n * self.position = min( # <<<<<<<<<<<<<<\n * self.position, self.current_buffer_size\n * )\n */\n __pyx_v_self->position = __pyx_t_11;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":146\n * self.position, self.current_buffer_size\n * )\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(\n * &c_string[bytes_read], buffer_ptr, self.position\n */\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":147\n * )\n * if c_encoding:\n * memcpy( # <<<<<<<<<<<<<<\n * &c_string[bytes_read], buffer_ptr, self.position\n * )\n */\n (void)(memcpy((&(__pyx_v_c_string[__pyx_v_bytes_read])), __pyx_v_buffer_ptr, __pyx_v_self->position));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":146\n * self.position, self.current_buffer_size\n * )\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(\n * &c_string[bytes_read], buffer_ptr, self.position\n */\n goto __pyx_L18;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":151\n * )\n * else:\n * rv += PyBytes_FromStringAndSize( # <<<<<<<<<<<<<<\n * buffer_ptr, self.position\n * )\n */\n /*else*/ {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":152\n * else:\n * rv += PyBytes_FromStringAndSize(\n * buffer_ptr, self.position # <<<<<<<<<<<<<<\n * )\n * bytes_read += self.position\n */\n __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_buffer_ptr, __pyx_v_self->position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":151\n * )\n * else:\n * rv += PyBytes_FromStringAndSize( # <<<<<<<<<<<<<<\n * buffer_ptr, self.position\n * )\n */\n __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_3);\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);\n __pyx_t_3 = 0;\n }\n __pyx_L18:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":154\n * buffer_ptr, self.position\n * )\n * bytes_read += self.position # <<<<<<<<<<<<<<\n * \n * else:\n */\n __pyx_v_bytes_read = (__pyx_v_bytes_read + __pyx_v_self->position);\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":124\n * # We need to copy it into buffer for adding null symbol at the end.\n * # In ClickHouse block there is no null\n * if right > self.current_buffer_size: # <<<<<<<<<<<<<<\n * if c_encoding:\n * memcpy(&c_string[bytes_read], &buffer_ptr[self.position],\n */\n goto __pyx_L14;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":157\n * \n * else:\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(c_string, &buffer_ptr[self.position], size)\n * else:\n */\n /*else*/ {\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":158\n * else:\n * if c_encoding:\n * memcpy(c_string, &buffer_ptr[self.position], size) # <<<<<<<<<<<<<<\n * else:\n * rv = PyBytes_FromStringAndSize(\n */\n (void)(memcpy(__pyx_v_c_string, (&(__pyx_v_buffer_ptr[__pyx_v_self->position])), __pyx_v_size));\n\n /* \"clickhouse_driver/bufferedreader.pyx\":157\n * \n * else:\n * if c_encoding: # <<<<<<<<<<<<<<\n * memcpy(c_string, &buffer_ptr[self.position], size)\n * else:\n */\n goto __pyx_L19;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":160\n * memcpy(c_string, &buffer_ptr[self.position], size)\n * else:\n * rv = PyBytes_FromStringAndSize( # <<<<<<<<<<<<<<\n * &buffer_ptr[self.position], size\n * )\n */\n /*else*/ {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":161\n * else:\n * rv = PyBytes_FromStringAndSize(\n * &buffer_ptr[self.position], size # <<<<<<<<<<<<<<\n * )\n * self.position = right\n */\n __pyx_t_3 = PyBytes_FromStringAndSize((&(__pyx_v_buffer_ptr[__pyx_v_self->position])), __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_3);\n __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);\n __pyx_t_3 = 0;\n }\n __pyx_L19:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":163\n * &buffer_ptr[self.position], size\n * )\n * self.position = right # <<<<<<<<<<<<<<\n * \n * if c_encoding:\n */\n __pyx_v_self->position = __pyx_v_right;\n }\n __pyx_L14:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":165\n * self.position = right\n * \n * if c_encoding: # <<<<<<<<<<<<<<\n * try:\n * rv = c_string[:size].decode(c_encoding)\n */\n __pyx_t_2 = (__pyx_v_c_encoding != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":166\n * \n * if c_encoding:\n * try: # <<<<<<<<<<<<<<\n * rv = c_string[:size].decode(c_encoding)\n * except UnicodeDecodeError:\n */\n {\n __Pyx_PyThreadState_declare\n __Pyx_PyThreadState_assign\n __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);\n __Pyx_XGOTREF(__pyx_t_12);\n __Pyx_XGOTREF(__pyx_t_13);\n __Pyx_XGOTREF(__pyx_t_14);\n /*try:*/ {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":167\n * if c_encoding:\n * try:\n * rv = c_string[:size].decode(c_encoding) # <<<<<<<<<<<<<<\n * except UnicodeDecodeError:\n * rv = PyBytes_FromStringAndSize(c_string, size)\n */\n __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_c_string, 0, __pyx_v_size, __pyx_v_c_encoding, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L21_error)\n __Pyx_GOTREF(__pyx_t_3);\n __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);\n __pyx_t_3 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":166\n * \n * if c_encoding:\n * try: # <<<<<<<<<<<<<<\n * rv = c_string[:size].decode(c_encoding)\n * except UnicodeDecodeError:\n */\n }\n __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;\n __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;\n __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;\n goto __pyx_L28_try_end;\n __pyx_L21_error:;\n __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;\n __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;\n __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":168\n * try:\n * rv = c_string[:size].decode(c_encoding)\n * except UnicodeDecodeError: # <<<<<<<<<<<<<<\n * rv = PyBytes_FromStringAndSize(c_string, size)\n * \n */\n __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);\n if (__pyx_t_15) {\n __Pyx_AddTraceback(\"clickhouse_driver.bufferedreader.BufferedReader.read_strings\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 168, __pyx_L23_except_error)\n __Pyx_GOTREF(__pyx_t_3);\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_GOTREF(__pyx_t_4);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":169\n * rv = c_string[:size].decode(c_encoding)\n * except UnicodeDecodeError:\n * rv = PyBytes_FromStringAndSize(c_string, size) # <<<<<<<<<<<<<<\n * \n * Py_INCREF(rv)\n */\n __pyx_t_16 = PyBytes_FromStringAndSize(__pyx_v_c_string, __pyx_v_size); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 169, __pyx_L23_except_error)\n __Pyx_GOTREF(__pyx_t_16);\n __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_16);\n __pyx_t_16 = 0;\n __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;\n __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;\n __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;\n goto __pyx_L22_exception_handled;\n }\n goto __pyx_L23_except_error;\n __pyx_L23_except_error:;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":166\n * \n * if c_encoding:\n * try: # <<<<<<<<<<<<<<\n * rv = c_string[:size].decode(c_encoding)\n * except UnicodeDecodeError:\n */\n __Pyx_XGIVEREF(__pyx_t_12);\n __Pyx_XGIVEREF(__pyx_t_13);\n __Pyx_XGIVEREF(__pyx_t_14);\n __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);\n goto __pyx_L1_error;\n __pyx_L22_exception_handled:;\n __Pyx_XGIVEREF(__pyx_t_12);\n __Pyx_XGIVEREF(__pyx_t_13);\n __Pyx_XGIVEREF(__pyx_t_14);\n __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);\n __pyx_L28_try_end:;\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":165\n * self.position = right\n * \n * if c_encoding: # <<<<<<<<<<<<<<\n * try:\n * rv = c_string[:size].decode(c_encoding)\n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":171\n * rv = PyBytes_FromStringAndSize(c_string, size)\n * \n * Py_INCREF(rv) # <<<<<<<<<<<<<<\n * PyTuple_SET_ITEM(items, i, rv)\n * \n */\n Py_INCREF(__pyx_v_rv);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":172\n * \n * Py_INCREF(rv)\n * PyTuple_SET_ITEM(items, i, rv) # <<<<<<<<<<<<<<\n * \n * if c_string:\n */\n PyTuple_SET_ITEM(__pyx_v_items, __pyx_v_i, __pyx_v_rv);\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":174\n * PyTuple_SET_ITEM(items, i, rv)\n * \n * if c_string: # <<<<<<<<<<<<<<\n * PyMem_Free(c_string)\n * \n */\n __pyx_t_2 = (__pyx_v_c_string != 0);\n if (__pyx_t_2) {\n\n /* \"clickhouse_driver/bufferedreader.pyx\":175\n * \n * if c_string:\n * PyMem_Free(c_string) # <<<<<<<<<<<<<<\n * \n * return items\n */\n PyMem_Free(__pyx_v_c_string);\n\n /* \"clickhouse_driver/bufferedreader.pyx\":174\n * PyTuple_SET_ITEM(items, i, rv)\n * \n * if c_string: # <<<<<<<<<<<<<<\n * PyMem_Free(c_string)\n * \n */\n }\n\n /* \"clickhouse_driver/bufferedreader.pyx\":177\n * PyMem_Free(c_string)\n * \n * return items # <<<<<<<<<<<<<<\n * \n * \n */\n __Pyx_XDECREF(__pyx_r);\n __Pyx_INCREF(__pyx_v_items);\n __pyx_r = __pyx_v_items;\n goto __pyx_L0;\n\n /* \"clickhouse_driver/bufferedreader.pyx\":62\n * return rv\n * \n * def read_strings(self, Py_ssize_t n_items, encoding=None): # <<<<<<<<<<<<<<\n * \"\"\"\n * Python has great overhead between function calls.\n */\n\n /* function exit code */\n __pyx_L1_error:;\n __Pyx_XDECREF(__pyx_t_1);\n __Pyx_XDECREF(__pyx_t_3);\n __Pyx_XDECREF(__pyx_t_4);\n __Pyx_XDECREF(__pyx_t_16);\n __Pyx_AddTraceback(\"clickhouse_driver.bufferedreader.BufferedReader.read_strings\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n __pyx_r = NULL;\n __pyx_L0:;\n __Pyx_XDECREF(__pyx_v_items);\n __Pyx_XDECREF(__pyx_v_rv);\n __Pyx_XDECREF(__pyx_v_encoding);\n __Pyx_XGIVEREF(__pyx_r);\n __Pyx_RefNannyFinishContext();\n return __pyx_r;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedreader.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "17+train+mymarilyn--clickhouse-driver+CVE-2020-26759+vul.pkl", "func_name_": "__pyx_pf_17clickhouse_driver_14bufferedreader_14BufferedReader_8read_strings"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def delete_user_session(user_id, session_key):\n try:\n log.info(\"Deleted session_key : \" + session_key)\n session.query(User_Sessions).filter(User_Sessions.user_id==user_id,\n User_Sessions.session_key==session_key).delete()\n session.commit()\n except (exc.OperationalError, exc.InvalidRequestError):\n session.rollback()\n log.exception(e) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cps/ub.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+janeczku--calibre-web+CVE-2021-25964+vul.pkl", "func_name_": "delete_user_session"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def bulk_get_publicised_groups(self, destination, user_ids):\n \"\"\"Get the groups a list of users are publicising\n \"\"\"\n\n path = _create_v1_path(\"/get_groups_publicised\")\n\n content = {\"user_ids\": user_ids}\n\n return self.client.post_json(\n destination=destination, path=path, data=content, ignore_backoff=True\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/transport/client.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/federation/transport/client.py::_create_v1_path \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "545+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "bulk_get_publicised_groups"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_received_txn_response(*args):\n return defer.succeed(None) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/handlers/test_typing.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "405+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_received_txn_response"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def clamp_dyn_array(ir_node):\n t = ir_node.typ\n assert isinstance(t, DArrayType)\n return [\"assert\", [\"le\", get_dyn_array_count(ir_node), t.count]] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/core.py.\n//This function is called by other functions within the repository:\n vyper/codegen/core.py::make_setter \n//This function itself calls other functions within the repository:\n vyper/codegen/core.py::get_dyn_array_count\nvyper/codegen/core.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "86+train+vyperlang--vyper+CVE-2022-24787+clean.pkl", "func_name_": "clamp_dyn_array"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _from_raw_x509_ptr(cls, x509):\n cert = cls.__new__(cls)\n cert._x509 = _ffi.gc(x509, _lib.X509_free)\n cert._issuer_invalidator = _X509NameInvalidator()\n cert._subject_invalidator = _X509NameInvalidator()\n return cert \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/OpenSSL/crypto.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/OpenSSL/crypto.py::_X509NameInvalidator \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "15+train+pyca--pyopenssl+CVE-2018-1000807+clean.pkl", "func_name_": "_from_raw_x509_ptr"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_existing_file_permissions_are_not_modified(self, init, tmpdir):\n \"\"\"If the log file already exists, we should not modify its permissions\n\n See https://bugs.launchpad.net/cloud-init/+bug/1900837.\n \"\"\"\n # Use a mode that will never be made the default so this test will\n # always be valid\n mode = 0o606\n log_file = tmpdir.join(\"cloud-init.log\")\n log_file.ensure()\n log_file.chmod(mode)\n init._cfg = {\"def_log_file\": str(log_file)}\n\n init._initialize_filesystem()\n\n assert mode == stat.S_IMODE(log_file.stat().mode) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/unittests/test_stages.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/unittests/test_stages.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+canonical--cloud-init+CVE-2023-1786+vul.pkl", "func_name_": "test_existing_file_permissions_are_not_modified"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_problem_responses(request, course_id):\n \"\"\"\n Initiate generation of a CSV file containing all student answers\n to a given problem.\n\n Responds with JSON\n {\"status\": \"... status message ...\"}\n\n if initiation is successful (or generation task is already running).\n\n Responds with BadRequest if problem location is faulty.\n \"\"\"\n course_key = CourseKey.from_string(course_id)\n problem_location = request.GET.get('problem_location', '')\n\n try:\n problem_key = UsageKey.from_string(problem_location)\n # Are we dealing with an \"old-style\" problem location?\n run = problem_key.run\n if not run:\n problem_key = course_key.make_usage_key_from_deprecated_string(problem_location)\n if problem_key.course_key != course_key:\n raise InvalidKeyError(type(problem_key), problem_key)\n except InvalidKeyError:\n return JsonResponseBadRequest(_(\"Could not find problem with this location.\"))\n\n try:\n instructor_task.api.submit_calculate_problem_responses_csv(request, course_key, problem_location)\n success_status = _(\n \"The problem responses report is being created.\"\n \" To view the status of the report, see Pending Tasks below.\"\n )\n return JsonResponse({\"status\": success_status})\n except AlreadyRunningError:\n already_running_status = _(\n \"A problem responses report generation task is already in progress. \"\n \"Check the 'Pending Tasks' table for the status of the task. \"\n \"When completed, the report will be available for download in the table below.\"\n )\n return JsonResponse({\"status\": already_running_status}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/views/api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lms/djangoapps/instructor/views/api.py::cache_control\nlms/djangoapps/instructor/views/api.py::JsonResponse\nlms/djangoapps/instructor/views/api.py::JsonResponseBadRequest\nlms/djangoapps/instructor/views/api.py::type\nlms/djangoapps/instructor/views/api.py::InvalidKeyError\nlms/djangoapps/instructor/views/api.py::require_level\nlms/djangoapps/instructor/views/api.py::_ \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "103+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "get_problem_responses"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def generate(self, module):\n\n if self.csr_content is None and not os.path.exists(self.csr_path):\n raise CertificateError(\n 'The certificate signing request file %s does not exist' % self.csr_path\n )\n\n if not os.path.exists(self.accountkey_path):\n raise CertificateError(\n 'The account key %s does not exist' % self.accountkey_path\n )\n\n if not os.path.exists(self.challenge_path):\n raise CertificateError(\n 'The challenge path %s does not exist' % self.challenge_path\n )\n\n if not self.check(module, perms_required=False) or self.force:\n acme_tiny_path = self.module.get_bin_path('acme-tiny', required=True)\n command = [acme_tiny_path]\n if self.use_chain:\n command.append('--chain')\n command.extend(['--account-key', self.accountkey_path])\n if self.csr_content is not None:\n # We need to temporarily write the CSR to disk\n fd, tmpsrc = tempfile.mkstemp()\n module.add_cleanup_file(tmpsrc) # Ansible will delete the file on exit\n f = os.fdopen(fd, 'wb')\n try:\n f.write(self.csr_content)\n except Exception as err:\n try:\n f.close()\n except Exception as dummy:\n pass\n module.fail_json(\n msg=\"failed to create temporary CSR file: %s\" % to_native(err),\n exception=traceback.format_exc()\n )\n f.close()\n command.extend(['--csr', tmpsrc])\n else:\n command.extend(['--csr', self.csr_path])\n command.extend(['--acme-dir', self.challenge_path])\n command.extend(['--directory-url', self.acme_directory])\n\n try:\n crt = module.run_command(command, check_rc=True)[1]\n if self.backup:\n self.backup_file = module.backup_local(self.path)\n write_file(module, to_bytes(crt))\n self.changed = True\n except OSError as exc:\n raise CertificateError(exc)\n\n file_args = module.load_file_common_arguments(module.params)\n if module.set_fs_attributes_if_different(file_args, False):\n self.changed = True \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_certificate.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n plugins/modules/x509_certificate.py::CertificateError\nplugins/modules/x509_certificate.py::to_bytes\nplugins/modules/x509_certificate.py::write_file\nplugins/modules/x509_certificate.py::to_native \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "130+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "generate"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n node.addEventListener(\"mouseenter\", () => {\n const t = tooltip();\n t.innerHTML = getter();\n }); \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: frontend/src/charts/tooltip.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "7+train+beancount--fava+CVE-2022-2589+vul.pkl", "func_name_": "node.addEventListener"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i= PyTuple_GET_SIZE(iter_obj))) return 0;\n *ppos = pos + 1;\n next_item = PyTuple_GET_ITEM(iter_obj, pos);\n Py_INCREF(next_item);\n } else if (PyList_CheckExact(iter_obj)) {\n Py_ssize_t pos = *ppos;\n if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;\n *ppos = pos + 1;\n next_item = PyList_GET_ITEM(iter_obj, pos);\n Py_INCREF(next_item);\n } else\n#endif\n {\n next_item = PyIter_Next(iter_obj);\n if (unlikely(!next_item)) {\n return __Pyx_IterFinish();\n }\n }\n if (pitem) {\n *pitem = next_item;\n } else if (pkey && pvalue) {\n if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))\n return -1;\n } else if (pkey) {\n *pkey = next_item;\n } else {\n *pvalue = next_item;\n }\n return 1;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/columns/stringcolumn.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "388+train+mymarilyn--clickhouse-driver+CVE-2020-26759+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def handle(self, request, data):\n # For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the\n # form post doesn't include a region.\n endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_URL\n region_name = dict(self.fields['region'].choices)[endpoint]\n request.session['region_endpoint'] = endpoint\n request.session['region_name'] = region_name\n\n redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, \"\")\n\n if data.get('tenant', None):\n try:\n token = api.token_create(request,\n data.get('tenant'),\n data['username'],\n data['password'])\n tenants = api.tenant_list_for_token(request, token.id)\n except:\n msg = _('Unable to authenticate for that project.')\n exceptions.handle(request,\n message=msg,\n escalate=True)\n _set_session_data(request, token)\n user = users.get_user_from_request(request)\n redirect = redirect_to or base.Horizon.get_user_home(user)\n return shortcuts.redirect(redirect)\n\n elif data.get('username', None):\n try:\n unscoped_token = api.token_create(request,\n '',\n data['username'],\n data['password'])\n except keystone_exceptions.Unauthorized:\n exceptions.handle(request,\n _('Invalid user name or password.'))\n except:\n # If we get here we don't want to show a stack trace to the\n # user. However, if we fail here, there may be bad session\n # data that's been cached already.\n request.session.clear()\n exceptions.handle(request,\n message=_(\"An error occurred authenticating.\"\n \" Please try again later.\"),\n escalate=True)\n\n # Unscoped token\n request.session['unscoped_token'] = unscoped_token.id\n request.user.username = data['username']\n\n # Get the tenant list, and log in using first tenant\n # FIXME (anthony): add tenant chooser here?\n try:\n tenants = api.tenant_list_for_token(request, unscoped_token.id)\n except:\n exceptions.handle(request)\n tenants = []\n\n # Abort if there are no valid tenants for this user\n if not tenants:\n messages.error(request,\n _('You are not authorized for any projects.') %\n {\"user\": data['username']},\n extra_tags=\"login\")\n return\n\n # Create a token.\n # NOTE(gabriel): Keystone can return tenants that you're\n # authorized to administer but not to log into as a user, so in\n # the case of an Unauthorized error we should iterate through\n # the tenants until one succeeds or we've failed them all.\n while tenants:\n tenant = tenants.pop()\n try:\n token = api.token_create_scoped(request,\n tenant.id,\n unscoped_token.id)\n break\n except:\n # This will continue for recognized Unauthorized\n # exceptions from keystoneclient.\n exceptions.handle(request, ignore=True)\n token = None\n if token is None:\n raise exceptions.NotAuthorized(\n _(\"You are not authorized for any available projects.\"))\n\n _set_session_data(request, token)\n user = users.get_user_from_request(request)\n redirect = redirect_to or base.Horizon.get_user_home(user)\n return shortcuts.redirect(redirect) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: horizon/views/auth_forms.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n horizon/views/auth_forms.py::dict\nhorizon/views/auth_forms.py::_\nhorizon/views/auth_forms.py::_set_session_data \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+openstack--horizon+CVE-2012-2144+vul.pkl", "func_name_": "handle"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def mysql_insensitive_exact(field: Field, value: str) -> Criterion:\n return functions.Upper(functions.Cast(field, SqlTypes.CHAR)).eq(functions.Upper(f\"{value}\")) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tortoise/backends/mysql/executor.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+tortoise--tortoise-orm+CVE-2020-11010+vul.pkl", "func_name_": "mysql_insensitive_exact"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _setup_stdio(self):\n self._preserve_tty_fp()\n # When sys.stdout was opened by the runtime, overwriting it will not\n # close FD 1. However when forking from a child that previously used\n # fdopen(), overwriting it /will/ close FD 1. So we must swallow the\n # close before IoLogger overwrites FD 1, otherwise its new FD 1 will be\n # clobbered. Additionally, stdout must be replaced with /dev/null prior\n # to stdout.close(), since if block buffering was active in the parent,\n # any pre-fork buffered data will be flushed on close(), corrupting the\n # connection to the parent.\n self._nullify_stdio()\n sys.stdout.close()\n self._nullify_stdio()\n\n self.loggers = []\n for name, fd in (('stdout', 1), ('stderr', 2)):\n log = IoLoggerProtocol.build_stream(name, fd)\n self.broker.start_receive(log)\n self.loggers.append(log)\n\n # Reopen with line buffering.\n sys.stdout = os.fdopen(1, 'w', 1) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mitogen/core.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+mitogen-hq--mitogen+CVE-2019-15149+clean.pkl", "func_name_": "_setup_stdio"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__( self, params, sanitize=True ):\n if sanitize:\n for key, value in params.items():\n if key not in self.NEVER_SANITIZE and True not in [ key.endswith( \"|%s\" % nonsanitize_parameter ) for nonsanitize_parameter in self.NEVER_SANITIZE ]: # sanitize check both ungrouped and grouped parameters by name. Anything relying on NEVER_SANITIZE should be changed to not require this and NEVER_SANITIZE should be removed.\n self.__dict__[ key ] = sanitize_param( value )\n else:\n self.__dict__[ key ] = value\n else:\n self.__dict__.update(params) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/util/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "15+train+blankenberg--galaxy-data-resource+CVE-2015-10062+clean.pkl", "func_name_": "__init__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def checkquote(\n aikblob: bytes, nonce: str, sigblob: bytes, quoteblob: bytes, pcrblob: bytes, exp_hash_alg: str\n) -> Dict[int, str]:\n \"\"\"Check the given quote by checking the signature, then the nonce and then the used hash\n\n Parameters\n ----------\n aikblob: PEM-formatted public RSA or EC key\n nonce: The nonce that was used during the quote\n sigblob: Signature blob containing signature algorithm, hash used for signing, and plain signature\n quoteblob: Marshalled TPMS_ATTEST\n pcrblob: The state of the PCRs that were quoted; Intel tpm2-tools specific format\n exp_hash_alg: The hash that was expected to have been used for quoting\n \"\"\"\n sig_alg, hash_alg, sig_size = struct.unpack_from(\">HHH\", sigblob, 0)\n\n (signature,) = struct.unpack_from(f\"{sig_size}s\", sigblob, 6)\n\n pubkey = serialization.load_pem_public_key(aikblob, backend=backends.default_backend())\n if not isinstance(pubkey, (RSAPublicKey, EllipticCurvePublicKey)):\n raise ValueError(f\"Unsupported key type {type(pubkey).__name__}\")\n\n if isinstance(pubkey, RSAPublicKey) and sig_alg not in [tpm2_objects.TPM_ALG_RSASSA]:\n raise ValueError(f\"Unsupported quote signature algorithm '{sig_alg:#x}' for RSA keys\")\n if isinstance(pubkey, EllipticCurvePublicKey) and sig_alg not in [tpm2_objects.TPM_ALG_ECDSA]:\n raise ValueError(f\"Unsupported quote signature algorithm '{sig_alg:#x}' for EC keys\")\n\n hashfunc = tpm2_objects.HASH_FUNCS.get(hash_alg)\n if not hashfunc:\n raise ValueError(f\"Unsupported hash with id {hash_alg:#x} in signature blob\")\n if hashfunc.name != exp_hash_alg:\n raise ValueError(f\"Quote was expected to use {exp_hash_alg} but used {hashfunc.name} instead\")\n\n digest = hashes.Hash(hashfunc, backend=backends.default_backend())\n digest.update(quoteblob)\n quote_digest = digest.finalize()\n\n try:\n verify(pubkey, signature, quote_digest, hashfunc)\n except InvalidSignature:\n logger.error(\"Invalid quote signature!\")\n\n # Check that reported nonce is expected one\n retDict = tpm2_objects.unmarshal_tpms_attest(quoteblob)\n extradata = retDict[\"extraData\"]\n if extradata.decode(\"utf-8\") != nonce:\n raise Exception(\"The nonce from the attestation differs from the expected nonce\")\n\n # Check that correct quote_digest was used which is equivalent to hash(quoteblob)\n compare_digest, pcrs_dict = __get_and_hash_pcrs(pcrblob, hash_alg)\n if retDict[\"attested.quote.pcrDigest\"] != compare_digest:\n raise Exception(\"The digest used for quoting is different than the one that was calculated\")\n\n return pcrs_dict \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: keylime/tpm/tpm_util.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n keylime/tpm/tpm_util.py::ValueError\nkeylime/tpm/tpm_util.py::verify\nkeylime/tpm/tpm_util.py::type\nkeylime/tpm/tpm_util.py::__get_and_hash_pcrs\nkeylime/tpm/tpm_util.py::Exception\nkeylime/tpm/tpm_util.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+keylime--keylime+CVE-2023-3674+vul.pkl", "func_name_": "checkquote"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def unique_id(KEY_SIZE=128):\n \"\"\"\n Generates an unique id\n\n >>> ids = [ unique_id() for i in range(1000) ]\n >>> len(set(ids))\n 1000\n \"\"\"\n return md5(str( random.getrandbits( KEY_SIZE ) )).hexdigest() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/util/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "63+train+blankenberg--galaxy-data-resource+CVE-2015-10062+clean.pkl", "func_name_": "unique_id"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "185+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "reverse"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def testcasename(self):\n return self.__class__.__name__ + '.' + self.testname \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/gevent/testing/testcase.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "134+train+gevent--gevent+CVE-2023-41419+clean.pkl", "func_name_": "testcasename"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def find_double_newline(s):\n \"\"\"Returns the position just after a double newline in the given string.\"\"\"\n pos1 = s.find(b\"\\n\\r\\n\") # One kind of double newline\n if pos1 >= 0:\n pos1 += 3\n pos2 = s.find(b\"\\n\\n\") # Another kind of double newline\n if pos2 >= 0:\n pos2 += 2\n\n if pos1 >= 0:\n if pos2 >= 0:\n return min(pos1, pos2)\n else:\n return pos1\n else:\n return pos2 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/utilities.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/utilities.py::min \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "99+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "find_double_newline"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "319+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "Fx.Sort"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_user_avatar_update_mutation_permission(api_client):\n \"\"\"Should raise error if user is not staff.\"\"\"\n\n query = USER_AVATAR_UPDATE_MUTATION\n\n image_file, image_name = create_image(\"avatar\")\n variables = {\"image\": image_name}\n body = get_multipart_request_body(query, variables, image_file, image_name)\n response = api_client.post_multipart(body)\n\n assert_no_permission(response) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::assert_no_permission\nsaleor/graphql/account/tests/test_account.py::create_image\nsaleor/graphql/account/tests/test_account.py::get_multipart_request_body \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "188+train+saleor--saleor+CVE-2022-0932+clean.pkl", "func_name_": "test_user_avatar_update_mutation_permission"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "274+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "o"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i', response.body) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: coursebuilder/tests/functional/admin_settings.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+overdrive-diy--course-builder+CVE-2015-10049+clean.pkl", "func_name_": "test_page_has_defaulted_hook_content"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def check_if_mac_version_is_supported():\n return any(\n release in platform.release() for release in MAC_OS_SUPPORTED_VERSION_LIST\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/mount_efs/__init__.py.\n//This function is called by other functions within the repository:\n src/mount_efs/__init__.py::main \n//This function itself calls other functions within the repository:\n src/mount_efs/__init__.py::any \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "50+train+aws--efs-utils+CVE-2022-46174+clean.pkl", "func_name_": "check_if_mac_version_is_supported"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_run_update_report_existing_package_from_bug(self):\n \"\"\"run_update_report() on an existing package (from bug)\"\"\"\n self.ui = UserInterfaceMock([\"ui-test\", \"-u\", \"1\"])\n self.ui.present_details_response = apport.ui.Action(report=True)\n\n self.ui.crashdb.download(1)[\"SourcePackage\"] = \"bash\"\n self.ui.crashdb.download(1)[\"Package\"] = \"bash\"\n self.assertEqual(self.ui.run_argv(), True)\n self.assertEqual(self.ui.msg_severity, None, self.ui.msg_text)\n self.assertEqual(self.ui.msg_title, None)\n self.assertEqual(self.ui.opened_url, None)\n self.assertTrue(self.ui.present_details_shown)\n\n self.assertTrue(self.ui.ic_progress_pulses > 0)\n self.assertTrue(self.ui.report[\"Package\"].startswith(\"bash \"))\n self.assertIn(\"Dependencies\", self.ui.report)\n self.assertIn(\"ProcEnviron\", self.ui.report) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/integration/test_ui.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/integration/test_ui.py::UserInterfaceMock \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "9+train+canonical--apport+CVE-2023-1326+clean.pkl", "func_name_": "test_run_update_report_existing_package_from_bug"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_invalid_userdata_schema(client: IntegrationInstance):\n \"\"\"Test invalid schema represented as Warnings, not fatal\n\n PR #1175\n \"\"\"\n result = client.execute(\"cloud-init status --long\")\n assert result.ok\n log = client.read_from_file(\"/var/log/cloud-init.log\")\n warning = (\n \"[WARNING]: Invalid cloud-config provided:\\napt_pipelining: 'bogus'\"\n \" is not valid under any of the given schemas\\nupdates: Additional\"\n \" properties are not allowed ('notnetwork' was unexpected)\"\n )\n assert warning in log\n result = client.execute(\"cloud-init status --long\")\n if not result.ok:\n raise AssertionError(\n f\"Unexpected error from cloud-init status: {result}\"\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/integration_tests/modules/test_cli.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/integration_tests/modules/test_cli.py::AssertionError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+canonical--cloud-init+CVE-2022-2084+vul.pkl", "func_name_": "test_invalid_userdata_schema"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_after_start_response_http11(self):\n to_send = \"GET /after_start_response HTTP/1.1\\n\\n\"\n to_send = tobytes(to_send)\n self.connect()\n self.sock.send(to_send)\n fp = self.sock.makefile(\"rb\", 0)\n line, headers, response_body = read_http(fp)\n self.assertline(line, \"500\", \"Internal Server Error\", \"HTTP/1.1\")\n cl = int(headers[\"content-length\"])\n self.assertEqual(cl, len(response_body))\n self.assertTrue(response_body.startswith(b\"Internal Server Error\"))\n self.assertEqual(\n sorted(headers.keys()), [\"connection\", \"content-length\", \"content-type\", \"date\", \"server\"]\n )\n # connection has been closed\n self.send_check_error(to_send)\n self.assertRaises(ConnectionClosed, read_http, fp) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::len\nwaitress/tests/test_functional.py::read_http\nwaitress/tests/test_functional.py::tobytes\nwaitress/tests/test_functional.py::int\nwaitress/tests/test_functional.py::sorted \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "35+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_after_start_response_http11"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def on_GET(self, origin, content, query):\n if not self.allow_access:\n raise FederationDeniedError(origin)\n\n limit = parse_integer_from_args(query, \"limit\", 0)\n since_token = parse_string_from_args(query, \"since\", None)\n include_all_networks = parse_boolean_from_args(\n query, \"include_all_networks\", False\n )\n third_party_instance_id = parse_string_from_args(\n query, \"third_party_instance_id\", None\n )\n\n if include_all_networks:\n network_tuple = None\n elif third_party_instance_id:\n network_tuple = ThirdPartyInstanceID.from_string(third_party_instance_id)\n else:\n network_tuple = ThirdPartyInstanceID(None, None)\n\n if limit == 0:\n # zero is a special value which corresponds to no limit.\n limit = None\n\n data = await self.handler.get_local_public_room_list(\n limit, since_token, network_tuple=network_tuple, from_federation=True\n )\n return 200, data \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/transport/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "50+train+matrix-org--synapse+CVE-2020-26257+clean.pkl", "func_name_": "on_GET"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def prepare_plugin_docs_command(self, plugin_names, plugin_type=None, response_format=None,\n snippet=False, playbook_dir=None, module_path=None):\n\n if response_format and response_format not in DocConfig._supported_response_formats:\n raise ConfigurationError(\"Invalid response_format {0}, valid value is one of either {1}\".format(response_format,\n \", \".join(DocConfig._supported_response_formats)))\n\n if not isinstance(plugin_names, list):\n raise ConfigurationError(\"plugin_names should be of type list, instead received {0} of type {1}\".format(plugin_names, type(plugin_names)))\n\n self._prepare_env(runner_mode=self.runner_mode)\n self.cmdline_args = []\n\n if response_format == 'json':\n self.cmdline_args.append('-j')\n\n if snippet:\n self.cmdline_args.append('-s')\n\n if plugin_type:\n self.cmdline_args.extend(['-t', plugin_type])\n\n if playbook_dir:\n self.cmdline_args.extend(['--playbook-dir', playbook_dir])\n\n if module_path:\n self.cmdline_args.extend(['-M', module_path])\n\n self.cmdline_args.append(\" \".join(plugin_names))\n\n self.command = [self._ansible_doc_exec_path] + self.cmdline_args\n self._handle_command_wrap(self.execution_mode, self.cmdline_args) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: ansible_runner/config/doc.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n ansible_runner/config/doc.py::isinstance\nansible_runner/config/doc.py::type\nansible_runner/config/doc.py::ConfigurationError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+ansible--ansible-runner+CVE-2021-4041+vul.pkl", "func_name_": "prepare_plugin_docs_command"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_spam_checker(self):\n return SpamChecker(self) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/server.py::SpamChecker \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "95+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_spam_checker"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n void check_sequence(const SequenceProto& sequence, const CheckerContext& ctx) {\n enforce_has_field(sequence, elem_type);\n if (sequence.elem_type() == SequenceProto::TENSOR) {\n for (const TensorProto& tensor : sequence.tensor_values()) {\n check_tensor(tensor, ctx);\n }\n } else if (sequence.elem_type() == SequenceProto::SPARSE_TENSOR) {\n for (const SparseTensorProto& sparse_tensor : sequence.sparse_tensor_values()) {\n check_sparse_tensor(sparse_tensor, ctx);\n }\n } else if (sequence.elem_type() == SequenceProto::SEQUENCE) {\n for (const SequenceProto& seq : sequence.sequence_values()) {\n check_sequence(seq, ctx);\n }\n } else if (sequence.elem_type() == SequenceProto::MAP) {\n for (const MapProto& map : sequence.map_values()) {\n check_map(map, ctx);\n }\n } else {\n fail_check(\n \"Sequence ( Structure name: \",\n sequence.name(),\n \", elem_type: \",\n sequence.elem_type(),\n \") is not have a valid element type.\");\n }\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: onnx/checker.cc.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "37+train+onnx--onnx+CVE-2022-25882+clean.pkl", "func_name_": null} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(self):\n self.image_service = s3.S3ImageService()\n self.network_api = network.API()\n self.volume_api = volume.API()\n self.compute_api = compute.API(network_api=self.network_api,\n volume_api=self.volume_api)\n self.keypair_api = compute.api.KeypairAPI()\n self.sgh = importutils.import_object(FLAGS.security_group_handler) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nova/api/ec2/cloud.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+openstack--nova+CVE-2012-2654+clean.pkl", "func_name_": "__init__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(ithis.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "423+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "forward"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def page_file(filename):\n 'Open file in pager'\n if not os.path.isfile(filename):\n return\n return ext_cmd_nosudo(get_pager_cmd(filename), shell=True) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: crmsh/utils.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n crmsh/utils.py::ext_cmd_nosudo\ncrmsh/utils.py::get_pager_cmd \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "165+train+ClusterLabs--crmsh+CVE-2021-3020+clean.pkl", "func_name_": "page_file"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_rescore_entrance_exam_single_student(self, act):\n \"\"\" Test re-scoring of entrance exam for single student. \"\"\"\n url = reverse('rescore_entrance_exam', kwargs={'course_id': unicode(self.course.id)})\n response = self.client.get(url, {\n 'unique_student_identifier': self.student.email,\n })\n self.assertEqual(response.status_code, 200)\n self.assertTrue(act.called) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "67+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_rescore_entrance_exam_single_student"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __call__(self, base, econtext, call, path_items):\n request = econtext.get('request')\n\n base = self.traverse(base, request, path_items)\n\n if call is False:\n return base\n\n if getattr(base, '__call__', _marker) is not _marker or \n isinstance(base, type):\n return base()\n\n return base \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/Products/PageTemplates/expression.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/Products/PageTemplates/expression.py::isinstance\nsrc/Products/PageTemplates/expression.py::getattr\nsrc/Products/PageTemplates/expression.py::base \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "14+train+zopefoundation--Zope+CVE-2021-32633+clean.pkl", "func_name_": "__call__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __call__(self, environ, start_response):\n path_info = environ.get('PATH_INFO', '')\n if not path_info:\n # See if this is a static file hackishly mapped.\n if os.path.exists(self.directory) and os.path.isfile(self.directory):\n app = FileApp(self.directory)\n if self.cache_seconds:\n app.cache_control(max_age=int(self.cache_seconds))\n return app(environ, start_response)\n return self.add_slash(environ, start_response)\n if path_info == '/':\n # @@: This should obviously be configurable\n filename = 'index.html'\n else:\n filename = request.path_info_pop(environ)\n\n directory = self.directory\n host = environ.get('HTTP_HOST')\n if self.directory_per_host and host:\n for host_key, host_val in self.directory_per_host.items():\n if host_key in host:\n directory = host_val\n break\n\n full = os.path.join(directory, filename)\n if not os.path.exists(full):\n return self.not_found(environ, start_response)\n if os.path.isdir(full):\n # @@: Cache?\n return self.__class__(full)(environ, start_response)\n if environ.get('PATH_INFO') and environ.get('PATH_INFO') != '/':\n return self.error_extra_path(environ, start_response)\n if_none_match = environ.get('HTTP_IF_NONE_MATCH')\n if if_none_match:\n mytime = os.stat(full).st_mtime\n if str(mytime) == if_none_match:\n headers: List[Tuple[str, str]] = []\n ETAG.update(headers, mytime)\n start_response('304 Not Modified', headers)\n return [''] # empty body\n app = FileApp(full)\n if self.cache_seconds:\n app.cache_control(max_age=int(self.cache_seconds))\n return app(environ, start_response) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/web/framework/middleware/static.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lib/galaxy/web/framework/middleware/static.py::int\nlib/galaxy/web/framework/middleware/static.py::FileApp\nlib/galaxy/web/framework/middleware/static.py::app\nlib/galaxy/web/framework/middleware/static.py::start_response\nlib/galaxy/web/framework/middleware/static.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+galaxyproject--galaxy+CVE-2022-23470+vul.pkl", "func_name_": "__call__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _ValidateSettingsElement(data, struct, key):\n \"\"\"Validates if provided element of settings data fits provided structure.\n\n :param data: dictionary containing settings.\n :type data: dict.\n :param struct: dictionary containing structure information of settings.\n :type struct: dict.\n :param key: key of the settings element to validate.\n :type key: str.\n :raises: InvalidConfigError\n \"\"\"\n # Check if data exists. If not, check if default value exists.\n value = data.get(key)\n data_type = struct[key][\"type\"]\n if value is None:\n try:\n default = struct[key][\"default\"]\n except KeyError:\n raise InvalidConfigError(\"Missing required setting %s\" % key)\n else:\n data[key] = default\n # If data exists, Check type of the data\n elif not isinstance(value, data_type):\n raise InvalidConfigError(f\"Setting {key} should be type {data_type}\")\n # If type of this data is dict, check if structure of the data is valid.\n if data_type is dict:\n _ValidateSettingsStruct(data[key], struct[key][\"struct\"])\n # If type of this data is list, check if all values in the list is valid.\n elif data_type is list:\n for element in data[key]:\n if not isinstance(element, struct[key][\"struct\"]):\n raise InvalidConfigError(\n \"Setting %s should be list of %s\"\n % (key, struct[key][\"struct\"])\n )\n # Check dependency of this attribute.\n dependencies = struct[key].get(\"dependency\")\n if dependencies:\n for dependency in dependencies:\n if value == dependency[\"value\"]:\n for reqkey in dependency[\"attribute\"]:\n _ValidateSettingsElement(data, struct, reqkey) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pydrive2/settings.py.\n//This function is called by other functions within the repository:\n pydrive2/settings.py::_ValidateSettingsStruct\npydrive2/settings.py::_ValidateSettingsElement \n//This function itself calls other functions within the repository:\n pydrive2/settings.py::_ValidateSettingsStruct\npydrive2/settings.py::isinstance\npydrive2/settings.py::_ValidateSettingsElement\npydrive2/settings.py::InvalidConfigError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+iterative--PyDrive2+CVE-2023-49297+clean.pkl", "func_name_": "_ValidateSettingsElement"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def cmd_pasv(self, arg):\n with socket.create_server((self.socket.getsockname()[0], 0)) as sock:\n sock.settimeout(TIMEOUT)\n ip, port = sock.getsockname()[:2]\n ip = ip.replace('.', ','); p1 = port / 256; p2 = port % 256\n self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))\n conn, addr = sock.accept()\n self.dtp = self.dtp_handler(conn, baseclass=self) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Lib/test/test_ftplib.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+python--cpython+CVE-2021-4189+vul.pkl", "func_name_": "cmd_pasv"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_update_custom_field_choice_data_task(self):\n obj_type = ContentType.objects.get_for_model(Location)\n cf = CustomField(\n label=\"CF1\",\n type=CustomFieldTypeChoices.TYPE_SELECT,\n )\n cf.save()\n cf.content_types.set([obj_type])\n\n choice = CustomFieldChoice(custom_field=cf, value=\"Foo\")\n choice.save()\n location_type = LocationType.objects.create(name=\"Root Type 3\")\n location_status = Status.objects.get_for_model(Location).first()\n location = Location(\n name=\"Location 1\",\n location_type=location_type,\n status=location_status,\n _custom_field_data={\"cf1\": \"Foo\"},\n )\n location.save()\n\n choice.value = \"Bar\"\n choice.save()\n\n location.refresh_from_db()\n\n self.assertEqual(location.cf[\"cf1\"], \"Bar\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/extras/tests/test_customfields.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n nautobot/extras/tests/test_customfields.py::CustomFieldChoice\nnautobot/extras/tests/test_customfields.py::Location\nnautobot/extras/tests/test_customfields.py::CustomField \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "160+train+nautobot--nautobot+CVE-2023-48705+clean.pkl", "func_name_": "test_update_custom_field_choice_data_task"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;sthis.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "attachWaiAria"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_subarray_comparison(self):\n # Check that comparisons between record arrays with\n # multi-dimensional field types work properly\n a = np.rec.fromrecords(\n [([1, 2, 3], 'a', [[1, 2], [3, 4]]), ([3, 3, 3], 'b', [[0, 0], [0, 0]])],\n dtype=[('a', ('f4', 3)), ('b', np.object), ('c', ('i4', (2, 2)))])\n b = a.copy()\n assert_equal(a==b, [True, True])\n assert_equal(a!=b, [False, False])\n b[1].b = 'c'\n assert_equal(a==b, [True, False])\n assert_equal(a!=b, [False, True])\n for i in range(3):\n b[0].a = a[0].a\n b[0].a[i] = 5\n assert_equal(a==b, [False, False])\n assert_equal(a!=b, [True, True])\n for i in range(2):\n for j in range(2):\n b = a.copy()\n b[0].c[i, j] = 10\n assert_equal(a==b, [False, True])\n assert_equal(a!=b, [True, False])\n\n # Check that broadcasting with a subarray works\n a = np.array([[(0,)], [(1,)]], dtype=[('a', 'f8')])\n b = np.array([(0,), (0,), (1,)], dtype=[('a', 'f8')])\n assert_equal(a==b, [[True, True, False], [False, False, True]])\n assert_equal(b==a, [[True, True, False], [False, False, True]])\n a = np.array([[(0,)], [(1,)]], dtype=[('a', 'f8', (1,))])\n b = np.array([(0,), (0,), (1,)], dtype=[('a', 'f8', (1,))])\n assert_equal(a==b, [[True, True, False], [False, False, True]])\n assert_equal(b==a, [[True, True, False], [False, False, True]])\n a = np.array([[([0, 0],)], [([1, 1],)]], dtype=[('a', 'f8', (2,))])\n b = np.array([([0, 0],), ([0, 1],), ([1, 1],)], dtype=[('a', 'f8', (2,))])\n assert_equal(a==b, [[True, False, False], [False, False, True]])\n assert_equal(b==a, [[True, False, False], [False, False, True]])\n\n # Check that broadcasting Fortran-style arrays with a subarray work\n a = np.array([[([0, 0],)], [([1, 1],)]], dtype=[('a', 'f8', (2,))], order='F')\n b = np.array([([0, 0],), ([0, 1],), ([1, 1],)], dtype=[('a', 'f8', (2,))])\n assert_equal(a==b, [[True, False, False], [False, False, True]])\n assert_equal(b==a, [[True, False, False], [False, False, True]])\n\n # Check that incompatible sub-array shapes don't result to broadcasting\n x = np.zeros((1,), dtype=[('a', ('f4', (1, 2))), ('b', 'i1')])\n y = np.zeros((1,), dtype=[('a', ('f4', (2,))), ('b', 'i1')])\n assert_equal(x == y, False)\n\n x = np.zeros((1,), dtype=[('a', ('f4', (2, 1))), ('b', 'i1')])\n y = np.zeros((1,), dtype=[('a', ('f4', (2,))), ('b', 'i1')])\n assert_equal(x == y, False) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n numpy/core/tests/test_multiarray.py::assert_equal\nnumpy/core/tests/test_multiarray.py::range \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "233+train+numpy--numpy+CVE-2014-1858+clean.pkl", "func_name_": "test_subarray_comparison"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "93+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "setRowStyle"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "13+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "e.stop"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def run_validators(self, request):\n for validator in self.validators:\n validator(self, request) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: anymail/webhooks/base.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n anymail/webhooks/base.py::validator \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+anymail--django-anymail+CVE-2018-1000089+clean.pkl", "func_name_": "run_validators"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n function checkExistingNode() {\n var node = \"\";\n $('input[name=\"node-name\"]').each(function(i,e) {\n node = e.value;\n });\n\n $.ajax({\n type: 'GET',\n url: '/manage/check_pcsd_status',\n data: {\"nodes\": node},\n timeout: pcs_timeout,\n success: function (data) {\n mydata = jQuery.parseJSON(data);\n update_existing_cluster_dialog(mydata);\n\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n alert(\"ERROR: Unable to contact server\");\n }\n });\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pcsd/public/js/pcsd.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "14+train+ClusterLabs--pcs+CVE-2016-0721+vul.pkl", "func_name_": "checkExistingNode"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def is_string(self, col_name: str) -> bool:\n try:\n return (\n _is_sqla_type(self.list_columns[col_name].type, sa_types.String)\n or self.list_columns[col_name].type.__class__ == UUIDType\n )\n except KeyError:\n return False \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: flask_appbuilder/models/sqla/interface.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n flask_appbuilder/models/sqla/interface.py::_is_sqla_type \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "108+train+dpgaspar--Flask-AppBuilder+CVE-2023-34110+clean.pkl", "func_name_": "is_string"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def create(\n self,\n ctx,\n *,\n reason: Optional[str] = \"No reason provided.\",\n ):\n \"\"\"Create a ticket.\"\"\"\n if await self._check_settings(ctx):\n settings = await self.config.guild(ctx.guild).all()\n if settings[\"use_counter\"]:\n name = f\"ticket-{settings['current_ticket']}\"\n await self.config.guild(ctx.guild).current_ticket.set(\n settings[\"current_ticket\"] + 1\n )\n else:\n name = f\"{ctx.author.name}-{ctx.author.id}\"\n found = False\n for channel in ctx.guild.channels:\n if channel.name == name.lower():\n found = True\n if not found:\n if settings[\"modlog\"]:\n await modlog.create_case(\n ctx.bot,\n ctx.guild,\n ctx.message.created_at,\n action_type=\"ticket_created\",\n user=ctx.author,\n moderator=ctx.author,\n reason=reason,\n )\n overwrite = {\n ctx.guild.default_role: discord.PermissionOverwrite(read_messages=False),\n ctx.author: discord.PermissionOverwrite(\n read_messages=True,\n send_messages=True,\n embed_links=True,\n attach_files=True,\n ),\n ctx.guild.get_role(settings[\"role\"]): discord.PermissionOverwrite(\n read_messages=True,\n send_messages=True,\n embed_links=True,\n attach_files=True,\n manage_messages=True,\n ),\n }\n ticketchannel = await ctx.guild.create_text_channel(\n name,\n overwrites=overwrite,\n category=ctx.guild.get_channel(settings[\"open_category\"]),\n topic=reason,\n )\n await ticketchannel.send(settings[\"message\"].format(user=ctx.author))\n embed = discord.Embed(\n title=name,\n description=reason,\n timestamp=datetime.utcnow(),\n ).set_footer(text=\"Last updated at:\")\n message = await ctx.guild.get_channel(settings[\"channel\"]).send(embed=embed)\n async with self.config.guild(ctx.guild).active() as active:\n active.append((ticketchannel.id, message.id))\n else:\n await ctx.send(\"You already have an open ticket.\")\n else:\n await ctx.send(\"Please finish the setup process before creating a ticket.\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: ticketer/ticketer.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+Dav-Git--Dav-Cogs+CVE-2021-29501+vul.pkl", "func_name_": "create"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def setup(self) -> None:\n logger.info(\"Setting up.\")\n self.start_time = int(self.get_clock().time())\n self.datastores = Databases(self.DATASTORE_CLASS, self)\n logger.info(\"Finished setting up.\")\n\n # Register background tasks required by this server. This must be done\n # somewhat manually due to the background tasks not being registered\n # unless handlers are instantiated.\n if self.config.run_background_tasks:\n self.setup_background_tasks() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/server.py::int\nsynapse/server.py::Databases \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "321+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "setup"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def flate_encode(self, level: int = -1) -> \"EncodedStreamObject\":\n from ..filters import FlateDecode\n\n if SA.FILTER in self:\n f = self[SA.FILTER]\n if isinstance(f, ArrayObject):\n f = ArrayObject([NameObject(FT.FLATE_DECODE), *f])\n try:\n parms = ArrayObject(\n [NullObject(), *self.get(SA.DECODE_PARMS, ArrayObject())]\n )\n except TypeError:\n # case of error where the * operator is not working (not an array\n parms = ArrayObject(\n [NullObject(), self.get(SA.DECODE_PARMS, ArrayObject())]\n )\n else:\n f = ArrayObject([NameObject(FT.FLATE_DECODE), f])\n parms = ArrayObject(\n [NullObject(), self.get(SA.DECODE_PARMS, NullObject())]\n )\n else:\n f = NameObject(FT.FLATE_DECODE)\n parms = None\n retval = EncodedStreamObject()\n retval.update(self)\n retval[NameObject(SA.FILTER)] = f\n if parms is not None:\n retval[NameObject(SA.DECODE_PARMS)] = parms\n retval._data = FlateDecode.encode(b_(self._data), level)\n return retval \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pypdf/generic/_data_structures.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n pypdf/generic/_data_structures.py::isinstance\npypdf/generic/_data_structures.py::ArrayObject\npypdf/generic/_data_structures.py::NameObject\npypdf/generic/_data_structures.py::b_\npypdf/generic/_data_structures.py::EncodedStreamObject\npypdf/generic/_data_structures.py::NullObject \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "79+train+py-pdf--pypdf+CVE-2023-46250+clean.pkl", "func_name_": "flate_encode"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_modify_access_revoke_self(self):\n \"\"\"\n Test that an instructor cannot remove instructor privelages from themself.\n \"\"\"\n url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})\n response = self.client.get(url, {\n 'unique_student_identifier': self.instructor.email,\n 'rolename': 'instructor',\n 'action': 'revoke',\n })\n self.assertEqual(response.status_code, 200)\n # check response content\n expected = {\n 'unique_student_identifier': self.instructor.username,\n 'rolename': 'instructor',\n 'action': 'revoke',\n 'removingSelfAsInstructor': True,\n }\n res_json = json.loads(response.content)\n self.assertEqual(res_json, expected) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "40+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_modify_access_revoke_self"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s Callable[[Any], BasicAuthWebSocketServerProtocol]:\n \"\"\"\n Protocol factory that enforces HTTP Basic Auth.\n\n ``basic_auth_protocol_factory`` is designed to integrate with\n :func:`~websockets.legacy.server.serve` like this::\n\n websockets.serve(\n ...,\n create_protocol=websockets.basic_auth_protocol_factory(\n realm=\"my dev server\",\n credentials=(\"hello\", \"iloveyou\"),\n )\n )\n\n ``realm`` indicates the scope of protection. It should contain only ASCII\n characters because the encoding of non-ASCII characters is undefined.\n Refer to section 2.2 of :rfc:`7235` for details.\n\n ``credentials`` defines hard coded authorized credentials. It can be a\n ``(username, password)`` pair or a list of such pairs.\n\n ``check_credentials`` defines a coroutine that checks whether credentials\n are authorized. This coroutine receives ``username`` and ``password``\n arguments and returns a :class:`bool`.\n\n One of ``credentials`` or ``check_credentials`` must be provided but not\n both.\n\n By default, ``basic_auth_protocol_factory`` creates a factory for building\n :class:`BasicAuthWebSocketServerProtocol` instances. You can override this\n with the ``create_protocol`` parameter.\n\n :param realm: scope of protection\n :param credentials: hard coded credentials\n :param check_credentials: coroutine that verifies credentials\n :raises TypeError: if the credentials argument has the wrong type\n\n \"\"\"\n if (credentials is None) == (check_credentials is None):\n raise TypeError(\"provide either credentials or check_credentials\")\n\n if credentials is not None:\n if is_credentials(credentials):\n\n async def check_credentials(username: str, password: str) -> bool:\n return (username, password) == credentials\n\n elif isinstance(credentials, Iterable):\n credentials_list = list(credentials)\n if all(is_credentials(item) for item in credentials_list):\n credentials_dict = dict(credentials_list)\n\n async def check_credentials(username: str, password: str) -> bool:\n return credentials_dict.get(username) == password\n\n else:\n raise TypeError(f\"invalid credentials argument: {credentials}\")\n\n else:\n raise TypeError(f\"invalid credentials argument: {credentials}\")\n\n if create_protocol is None:\n # Not sure why mypy cannot figure this out.\n create_protocol = cast(\n Callable[[Any], BasicAuthWebSocketServerProtocol],\n BasicAuthWebSocketServerProtocol,\n )\n\n return functools.partial(\n create_protocol, realm=realm, check_credentials=check_credentials\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/websockets/legacy/auth.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/websockets/legacy/auth.py::dict\nsrc/websockets/legacy/auth.py::list\nsrc/websockets/legacy/auth.py::isinstance\nsrc/websockets/legacy/auth.py::is_credentials\nsrc/websockets/legacy/auth.py::TypeError\nsrc/websockets/legacy/auth.py::all\nsrc/websockets/legacy/auth.py::cast \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+python-websockets--websockets+CVE-2021-33880+vul.pkl", "func_name_": "basic_auth_protocol_factory"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def has_length_word(typ):\n return isinstance(typ, (DArrayType, ByteArrayLike)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/core.py.\n//This function is called by other functions within the repository:\n vyper/codegen/core.py::_getelemptr_abi_helper\nvyper/codegen/core.py::_get_element_ptr_array \n//This function itself calls other functions within the repository:\n vyper/codegen/core.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "35+train+vyperlang--vyper+CVE-2022-24845+clean.pkl", "func_name_": "has_length_word"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n dateSuchAs:\"Please enter a valid date such as {date}\",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. \"12/31/1999\")',email:'Please enter a valid email address. For example \"fred@domain.com\".',url:\"Please enter a valid URL such as http://www.example.com.\",currencyDollar:\"Please enter a valid $ amount. For example $100.00 .\",oneRequired:\"Please enter something for at least one of these inputs.\",errorPrefix:\"Error: \",warningPrefix:\"Warning: \",noSpace:\"There can be no spaces in this input.\",reqChkByNode:\"No items are selected.\",requiredChk:\"This field is required.\",reqChkByName:\"Please select a {label}.\",match:\"This field needs to match the {matchName} field\",startDate:\"the start date\",endDate:\"the end date\",currentDate:\"the current date\",afterDate:\"The date should be the same or after {label}.\",beforeDate:\"The date should be the same or before {label}.\",startMonth:\"Please select a start month\",sameMonth:\"These two dates must be in the same month - you must change one or the other.\",creditcard:\"The credit card number entered is invalid. Please check the number and try again. {length} digits entered.\"}),window.Form||(window.Form={});var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:\"Validation failed.\",test:Function.convert(!0)},initialize:function(e,t){this.setOptions(t),this.className=e},test:function(e,t){return!!(e=document.id(e))&&this.options.test(e,t||this.getProps(e))},getError:function(e,t){e=document.id(e);var i=this.options.errorMsg;return\"function\"==typeOf(i)&&(i=i(e,t||this.getProps(e))),i},getProps:function(e){return e=document.id(e),e?e.get(\"validatorProps\"):{}}});Element.Properties.validators={get:function(){return(this.get(\"data-validators\")||this.className).clean().replace(/'(\\\\.|[^'])*'|\"(\\\\.|[^\"])*\"/g,function(e){return e.replace(\" \",\"\\\\x20\")}).split(\" \")}},Element.Properties.validatorProps={set:function(e){return this.eliminate(\"$moo:validatorProps\").store(\"$moo:validatorProps\",e)},get:function(e){if(e&&this.set(e),this.retrieve(\"$moo:validatorProps\"))return this.retrieve(\"$moo:validatorProps\");if(this.getProperty(\"data-validator-properties\")||this.getProperty(\"validatorProps\"))try{this.store(\"$moo:validatorProps\",JSON.decode(this.getProperty(\"validatorProps\")||this.getProperty(\"data-validator-properties\"),!1))}catch(e){return{}}else{var t=this.get(\"validators\").filter(function(e){return e.test(\":\")});t.length?(e={},t.each(function(t){var i=t.split(\":\");if(i[1])try{e[i[0]]=JSON.decode(i[1],!1)}catch(e){}}),this.store(\"$moo:validatorProps\",e)):this.store(\"$moo:validatorProps\",{})}return this.retrieve(\"$moo:validatorProps\")}},Form.Validator=new Class({Implements:[Options,Events],options:{fieldSelectors:\"input, select, textarea\",ignoreHidden:!0,ignoreDisabled:!0,useTitles:!1,evaluateOnSubmit:!0,evaluateFieldsOnBlur:!0,evaluateFieldsOnChange:!0,serial:!0,stopOnFailure:!0,warningPrefix:function(){return Form.Validator.getMsg(\"warningPrefix\")||\"Warning: \"},errorPrefix:function(){return Form.Validator.getMsg(\"errorPrefix\")||\"Error: \"}},initialize:function(e,t){this.setOptions(t),this.element=document.id(e),this.warningPrefix=Function.convert(this.options.warningPrefix)(),this.errorPrefix=Function.convert(this.options.errorPrefix)(),this._bound={onSubmit:this.onSubmit.bind(this),blurOrChange:function(e,t){this.validationMonitor(t,!0)}.bind(this)},this.enable()},toElement:function(){return this.element},getFields:function(){return this.fields=this.element.getElements(this.options.fieldSelectors)},enable:function(){this.element.store(\"validator\",this),this.options.evaluateOnSubmit&&this.element.addEvent(\"submit\",this._bound.onSubmit),this.options.evaluateFieldsOnBlur&&this.element.addEvent(\"blur:relay(input,select,textarea)\",this._bound.blurOrChange),this.options.evaluateFieldsOnChange&&this.element.addEvent(\"change:relay(input,select,textarea)\",this._bound.blurOrChange)},disable:function(){this.element.eliminate(\"validator\"),this.element.removeEvents({submit:this._bound.onSubmit,\"blur:relay(input,select,textarea)\":this._bound.blurOrChange,\"change:relay(input,select,textarea)\":this._bound.blurOrChange})},validationMonitor:function(){clearTimeout(this.timer),this.timer=this.validateField.delay(50,this,arguments)},onSubmit:function(e){this.validate(e)&&this.reset()},reset:function(){return this.getFields().each(this.resetField,this),this},validate:function(e){var t=this.getFields().map(function(e){return this.validateField(e,!0)},this).every(function(e){return e});return this.fireEvent(\"formValidate\",[t,this.element,e]),this.options.stopOnFailure&&!t&&e&&e.preventDefault(),t},validateField:function(e,t){if(this.paused)return!0;e=document.id(e);var i,n,s=!e.hasClass(\"validation-failed\");if(this.options.serial&&!t&&(i=this.element.getElement(\".validation-failed\"),n=this.element.getElement(\".warning\")),e&&(!i||t||e.hasClass(\"validation-failed\")||i&&!this.options.serial)){var a=e.get(\"validators\"),r=a.some(function(e){return this.getValidator(e)},this),o=[];if(a.each(function(t){t&&!this.test(t,e)&&o.include(t)},this),s=0===o.length,r&&!this.hasValidator(e,\"warnOnly\")&&(s?(e.addClass(\"validation-passed\").removeClass(\"validation-failed\"),this.fireEvent(\"elementPass\",[e])):(e.addClass(\"validation-failed\").removeClass(\"validation-passed\"),this.fireEvent(\"elementFail\",[e,o]))),!n){a.some(function(e){return e.test(\"^warn\")?this.getValidator(e.replace(/^warn-/,\"\")):null},this);e.removeClass(\"warning\");a.map(function(t){return t.test(\"^warn\")?this.test(t.replace(/^warn-/,\"\"),e,!0):null},this)}}return s},test:function(e,t,i){if(t=document.id(t),this.options.ignoreHidden&&!t.isVisible()||this.options.ignoreDisabled&&t.get(\"disabled\"))return!0;var n=this.getValidator(e);null!=i&&(i=!1),this.hasValidator(t,\"warnOnly\")&&(i=!0);var s=t.hasClass(\"ignoreValidation\")||!n||n.test(t);return n&&this.fireEvent(\"elementValidate\",[s,t,e,i]),!!i||s},hasValidator:function(e,t){return e.get(\"validators\").contains(t)},resetField:function(e){return e=document.id(e),e&&e.get(\"validators\").each(function(t){t.test(\"^warn-\")&&(t=t.replace(/^warn-/,\"\")),e.removeClass(\"validation-failed\"),e.removeClass(\"warning\"),e.removeClass(\"validation-passed\")},this),this},stop:function(){return this.paused=!0,this},start:function(){return this.paused=!1,this},ignoreField:function(e,t){return e=document.id(e),e&&(this.enforceField(e),t?e.addClass(\"warnOnly\"):e.addClass(\"ignoreValidation\")),this},enforceField:function(e){return e=document.id(e),e&&e.removeClass(\"warnOnly\").removeClass(\"ignoreValidation\"),this}}),Form.Validator.getMsg=function(e){return Locale.get(\"FormValidator.\"+e)},Form.Validator.adders={validators:{},add:function(e,t){this.validators[e]=new InputValidator(e,t),this.initialize||this.implement({validators:this.validators})},addAllThese:function(e){Array.convert(e).each(function(e){this.add(e[0],e[1])},this)},getValidator:function(e){return this.validators[e.split(\":\")[0]]}},Object.append(Form.Validator,Form.Validator.adders),Form.Validator.implement(Form.Validator.adders),Form.Validator.add(\"IsEmpty\",{errorMsg:!1,test:function(e){return\"select-one\"==e.type||\"select\"==e.type?!(e.selectedIndex>=0&&\"\"!=e.options[e.selectedIndex].value):null==e.get(\"value\")||0==e.get(\"value\").length}}),Form.Validator.addAllThese([[\"required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e){return!Form.Validator.getValidator(\"IsEmpty\").test(e)}}],[\"length\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.length)?Form.Validator.getMsg(\"length\").substitute({length:t.length,elLength:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.length)||(e.get(\"value\").length==t.length||0==e.get(\"value\").length)}}],[\"minLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.minLength)?Form.Validator.getMsg(\"minLength\").substitute({minLength:t.minLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.minLength)||e.get(\"value\").length>=(t.minLength||0)}}],[\"maxLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.maxLength)?Form.Validator.getMsg(\"maxLength\").substitute({maxLength:t.maxLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return e.get(\"value\").length<=(t.maxLength||1e4)}}],[\"validate-integer\",{errorMsg:Form.Validator.getMsg.pass(\"integer\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(-?[1-9]\\d*|0)$/.test(e.get(\"value\"))}}],[\"validate-numeric\",{errorMsg:Form.Validator.getMsg.pass(\"numeric\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^-?(?:0$0(?=\\d*\\.)|[1-9]|0)\\d*(\\.\\d+)?$/.test(e.get(\"value\"))}}],[\"validate-digits\",{errorMsg:Form.Validator.getMsg.pass(\"digits\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[\\d() .:\\-\\+#]+$/.test(e.get(\"value\"))}}],[\"validate-alpha\",{errorMsg:Form.Validator.getMsg.pass(\"alpha\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[a-zA-Z]+$/.test(e.get(\"value\"))}}],[\"validate-alphanum\",{errorMsg:Form.Validator.getMsg.pass(\"alphanum\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||!/\\W/.test(e.get(\"value\"))}}],[\"validate-date\",{errorMsg:function(e,t){if(Date.parse){var i=t.dateFormat||\"%x\";return Form.Validator.getMsg(\"dateSuchAs\").substitute({date:(new Date).format(i)})}return Form.Validator.getMsg(\"dateInFormatMDY\")},test:function(e,t){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var i=Locale.get(\"Date\"),n=new RegExp([i.days,i.days_abbr,i.months,i.months_abbr,i.AM,i.PM].flatten().join(\"|\"),\"i\"),s=e.get(\"value\"),a=s.match(/[a-z]+/gi);if(a&&!a.every(n.exec,n))return!1;var r=Date.parse(s);if(!r)return!1;var o=t.dateFormat||\"%x\",l=r.format(o);return\"invalid date\"!=l&&e.set(\"value\",l),r.isValid()}}],[\"validate-email\",{errorMsg:Form.Validator.getMsg.pass(\"email\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(?:[a-z0-9!#$%&'*+\\/=?^_`{|}~-]\\.?){0,63}[a-z0-9!#$%&'*+\\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\])$/i.test(e.get(\"value\"))}}],[\"validate-url\",{errorMsg:Form.Validator.getMsg.pass(\"url\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(https?|ftp|rmtp|mms):\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(:(\\d+))?\\/?/i.test(e.get(\"value\"))}}],[\"validate-currency-dollar\",{errorMsg:Form.Validator.getMsg.pass(\"currencyDollar\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^\\$?\\-?([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}\\d*(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$/.test(e.get(\"value\"))}}],[\"validate-one-required\",{errorMsg:Form.Validator.getMsg.pass(\"oneRequired\"),test:function(e,t){return(document.id(t[\"validate-one-required\"])||e.getParent(t[\"validate-one-required\"])).getElements(\"input\").some(function(e){return[\"checkbox\",\"radio\"].contains(e.get(\"type\"))?e.get(\"checked\"):e.get(\"value\")})}}]]),Element.Properties.validator={set:function(e){this.get(\"validator\").setOptions(e)},get:function(){var e=this.retrieve(\"validator\");return e||(e=new Form.Validator(this),this.store(\"validator\",e)),e}},Element.implement({validate:function(e){return e&&this.set(\"validator\",e),this.get(\"validator\").validate()}}),function(){function e(e,t,i,n){if(t&&e[t])return e[t];var s=document.id(e[i]);return s?s.getElements(n):[]}Form.Validator.addAllThese([[\"validate-enforce-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-ignore-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toIgnore\",\"ignoreChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?(n.ignoreField(e),n.resetField(e)):n.enforceField(e)}),!0)}}],[\"validate-enforce-onselect-value\",{test:function(t,i){if(!i.value)return!0;var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){i.value==t.value?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-nospace\",{errorMsg:function(){return Form.Validator.getMsg(\"noSpace\")},test:function(e,t){return!e.get(\"value\").test(/\\s/)}}],[\"validate-toggle-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");if(!n)return!0;var s=e(i,\"toToggle\",\"toToggleChildrenOf\",\"input, select, textarea\");return t.checked?s.each(function(e){n.enforceField(e)}):s.each(function(e){n.ignoreField(e),n.resetField(e)}),!0}}],[\"validate-reqchk-bynode\",{errorMsg:function(){return Form.Validator.getMsg(\"reqChkByNode\")},test:function(t,i){return e(i,!1,\"nodeId\",i.selector||\"input[type=checkbox], input[type=radio]\").some(function(e){return e.checked})}}],[\"validate-required-check\",{errorMsg:function(e,t){return t.useTitle?e.get(\"title\"):Form.Validator.getMsg(\"requiredChk\")},test:function(e,t){return!!e.checked}}],[\"validate-reqchk-byname\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"reqChkByName\").substitute({label:t.label||e.get(\"type\")})},test:function(e,t){var i=t.groupName||e.get(\"name\"),n=$$(\"[name=\"+i+\"]\"),s=n.some(function(e,t){return e.checked}),a=e.getParent(\"form\").retrieve(\"validator\");return s&&a&&n.each(function(e,t){a.resetField(e)}),s}}],[\"validate-match\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"match\").substitute({matchName:decodeURIComponent((t.matchName+\"\").replace(/\\+/g,\"%20\"))||document.id(t.matchInput).get(\"name\")})},test:function(e,t){var i=e.get(\"value\"),n=document.id(t.matchInput)&&document.id(t.matchInput).get(\"value\");return!i||!n||i==n}}],[\"validate-after-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"afterDate\").substitute({label:t.afterLabel||(t.afterElement?Form.Validator.getMsg(\"startDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=document.id(t.afterElement)?Date.parse(document.id(t.afterElement).get(\"value\")):new Date,n=Date.parse(e.get(\"value\"));return!n||!i||n>=i}}],[\"validate-before-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"beforeDate\").substitute({label:t.beforeLabel||(t.beforeElement?Form.Validator.getMsg(\"endDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=document.id(t.beforeElement)?Date.parse(document.id(t.beforeElement).get(\"value\")):new Date;return!n||!i||n>=i}}],[\"validate-custom-required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e,t){return e.get(\"value\")!=t.emptyValue}}],[\"validate-same-month\",{errorMsg:function(e,t){var i=document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\");if(\"\"!=e.get(\"value\"))return Form.Validator.getMsg(i?\"sameMonth\":\"startMonth\")},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=Date.parse(document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\"));return!i||!n||i.format(\"%B\")==n.format(\"%B\")}}],[\"validate-cc-num\",{errorMsg:function(e){var t=e.get(\"value\").replace(/[^0-9]/g,\"\");return Form.Validator.getMsg(\"creditcard\").substitute({length:t.length})},test:function(e){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var t=e.get(\"value\");t=t.replace(/[^0-9]/g,\"\");var i=!1;if(t.test(/^4[0-9]{12}([0-9]{3})?$/)?i=\"Visa\":t.test(/^5[1-5]([0-9]{14})$/)?i=\"Master Card\":t.test(/^3[47][0-9]{13}$/)?i=\"American Express\":t.test(/^6(?:011|5[0-9]{2})[0-9]{12}$/)?i=\"Discover\":t.test(/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/)&&(i=\"Diners Club\"),i){for(var n=0,s=0,a=t.length-1;a>=0;--a)0!=(s=t.charAt(a).toInt())&&((t.length-a)%2==0&&(s+=s),s>9&&(s=s.toString().charAt(0).toInt()+s.toString().charAt(1).toInt()),n+=s);if(n%10==0)return!0}for(var r=\"\";\"\"!=t;)r+=\" \"+t.substr(0,4),t=t.substr(4);return e.getParent(\"form\").retrieve(\"validator\").ignoreField(e),e.set(\"value\",r.clean()),e.getParent(\"form\").retrieve(\"validator\").enforceField(e),!1}}]])}(),Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(e){e.reveal?e.reveal():e.setStyle(\"display\",\"block\")},hideError:function(e){e.dissolve?e.dissolve():e.setStyle(\"display\",\"none\")},scrollToErrorsOnSubmit:!0,scrollToErrorsOnBlur:!1,scrollToErrorsOnChange:!1,scrollFxOptions:{transition:\"quad:out\",offset:{y:-20}}},initialize:function(e,t){this.parent(e,t),this.addEvent(\"onElementValidate\",function(e,t,i,n){var s=this.getValidator(i);if(!e&&s.getError(t)){n&&t.addClass(\"warning\");var a=this.makeAdvice(i,t,s.getError(t),n);this.insertAdvice(a,t),this.showAdvice(i,t)}else this.hideAdvice(i,t)})},makeAdvice:function(e,t,i,n){var s=n?this.warningPrefix:this.errorPrefix;s+=this.options.useTitles?t.title||i:i;var a=n?\"warning-advice\":\"validation-advice\",r=this.getAdvice(e,t);return r=r?r.set(\"html\",s):new Element(\"div\",{html:s,styles:{display:\"none\"},id:\"advice-\"+e.split(\":\")[0]+\"-\"+this.getFieldId(t)}).addClass(a),t.store(\"$moo:advice-\"+e,r),r},getFieldId:function(e){return e.id?e.id:e.id=\"input_\"+e.name},showAdvice:function(e,t){var i=this.getAdvice(e,t);!i||t.retrieve(\"$moo:\"+this.getPropName(e))||\"none\"!=i.getStyle(\"display\")&&\"hidden\"!=i.getStyle(\"visibility\")&&0!=i.getStyle(\"opacity\")||(t.store(\"$moo:\"+this.getPropName(e),!0),this.options.showError(i),this.fireEvent(\"showAdvice\",[t,i,e]))},hideAdvice:function(e,t){var i=this.getAdvice(e,t);i&&t.retrieve(\"$moo:\"+this.getPropName(e))&&(t.store(\"$moo:\"+this.getPropName(e),!1),this.options.hideError(i),this.fireEvent(\"hideAdvice\",[t,i,e]))},getPropName:function(e){return\"advice\"+e},resetField:function(e){return(e=document.id(e))?(this.parent(e),e.get(\"validators\").each(function(t){this.hideAdvice(t,e)},this),this):this},getAllAdviceMessages:function(e,t){var i=[];if(e.hasClass(\"ignoreValidation\")&&!t)return i;e.get(\"validators\").some(function(t){var n=t.test(\"^warn-\")||e.hasClass(\"warnOnly\");n&&(t=t.replace(/^warn-/,\"\"));var s=this.getValidator(t);s&&i.push({message:s.getError(e),warnOnly:n,passed:s.test(),validator:s})},this);return i},getAdvice:function(e,t){return t.retrieve(\"$moo:advice-\"+e)},insertAdvice:function(e,t){var i=t.get(\"validatorProps\");i.msgPos&&document.id(i.msgPos)?document.id(i.msgPos).grab(e):t.type&&\"radio\"==t.type.toLowerCase()?t.getParent().adopt(e):e.inject(document.id(t),\"after\")},validateField:function(e,t,i){var n=this.parent(e,t);if((this.options.scrollToErrorsOnSubmit&&null==i||i)&&!n){for(var s=document.id(this).getElement(\".validation-failed\"),a=document.id(this).getParent();a!=document.body&&a.getScrollSize().y==a.getSize().y;)a=a.getParent();var r=a.retrieve(\"$moo:fvScroller\");!r&&window.Fx&&Fx.Scroll&&(r=new Fx.Scroll(a,this.options.scrollFxOptions),a.store(\"$moo:fvScroller\",r)),s&&(r?r.toElement(s):a.scrollTo(a.getScroll().x,s.getPosition(a).y-20))}return n},watchFields:function(e){e.each(function(e){this.options.evaluateFieldsOnBlur&&e.addEvent(\"blur\",this.validationMonitor.pass([e,!1,this.options.scrollToErrorsOnBlur],this)),this.options.evaluateFieldsOnChange&&e.addEvent(\"change\",this.validationMonitor.pass([e,!0,this.options.scrollToErrorsOnChange],this))},this)}}),function(){var e=this.OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:[\"reposition\",\"assert\",\"focus\",\"hide\"],options:{element:\"label\",labelClass:\"overTxtLabel\",positionOptions:{position:\"upperLeft\",edge:\"upperLeft\",offset:{x:4,y:2}},poll:!1,pollInterval:250,wrap:!1},property:\"OverText\",initialize:function(t,i){if(t=this.element=document.id(t),this.occlude())return this.occluded;this.setOptions(i),this.attach(t),e.instances.push(this),this.options.poll&&this.poll()},toElement:function(){return this.element},attach:function(){var e=this.element,t=this.options,i=t.textOverride||e.get(\"alt\")||e.get(\"title\");if(!i)return this;var n=this.text=new Element(t.element,{class:t.labelClass,styles:{lineHeight:\"normal\",position:\"absolute\",cursor:\"text\"},html:i,events:{click:this.hide.pass(\"label\"==t.element,this)}}).inject(e,\"after\");return\"label\"==t.element&&(e.get(\"id\")||e.set(\"id\",\"input_\"+String.uniqueID()),n.set(\"for\",e.get(\"id\"))),t.wrap&&(this.textHolder=new Element(\"div.overTxtWrapper\",{styles:{lineHeight:\"normal\",position:\"relative\"}}).grab(n).inject(e,\"before\")),this.enable()},destroy:function(){return this.element.eliminate(this.property),this.disable(),this.text&&this.text.destroy(),this.textHolder&&this.textHolder.destroy(),this},disable:function(){return this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.removeEvent(\"resize\",this.reposition),this.hide(!0,!0),this},enable:function(){return this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.addEvent(\"resize\",this.reposition),this.reposition(),this},wrap:function(){\"label\"==this.options.element&&(this.element.get(\"id\")||this.element.set(\"id\",\"input_\"+String.uniqueID()),this.text.set(\"for\",this.element.get(\"id\")))},startPolling:function(){return this.pollingPaused=!1,this.poll()},poll:function(e){return this.poller&&!e?this:(e?clearInterval(this.poller):this.poller=function(){this.pollingPaused||this.assert(!0)}.periodical(this.options.pollInterval,this),this)},stopPolling:function(){return this.pollingPaused=!0,this.poll(!0)},focus:function(){return!this.text||this.text.isDisplayed()&&!this.element.get(\"disabled\")?this.hide():this},hide:function(e,t){if(this.text&&this.text.isDisplayed()&&(!this.element.get(\"disabled\")||t)&&(this.text.hide(),this.fireEvent(\"textHide\",[this.text,this.element]),this.pollingPaused=!0,!e))try{this.element.fireEvent(\"focus\"),this.element.focus()}catch(e){}return this},show:function(){return document.id(this.text)&&!this.text.isDisplayed()&&(this.text.show(),this.reposition(),this.fireEvent(\"textShow\",[this.text,this.element]),this.pollingPaused=!1),this},test:function(){return!this.element.get(\"value\")},assert:function(e){return this[this.test()?\"show\":\"hide\"](e)},reposition:function(){return this.assert(!0),this.element.isVisible()?(this.text&&this.test()&&this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element})),this):this.stopPolling().hide()}})}(),OverText.instances=[],Object.append(OverText,{each:function(e){return OverText.instances.each(function(t,i){t.element&&t.text&&e.call(OverText,t,i)})},update:function(){return OverText.each(function(e){return e.reposition()})},hideAll:function(){return OverText.each(function(e){return e.hide(!0,!0)})},showAll:function(){return OverText.each(function(e){return e.show()})}}),Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(e,t){this.elements=this.subject=$$(e),this.parent(t)},compute:function(e,t,i){var n={};for(var s in e){var a=e[s],r=t[s],o=n[s]={};for(var l in a)o[l]=this.parent(a[l],r[l],i)}return n},set:function(e){for(var t in e)if(this.elements[t]){var i=e[t];for(var n in i)this.render(this.elements[t],n,i[n],this.options.unit)}return this},start:function(e){if(!this.check(e))return this;var t={},i={};for(var n in e)if(this.elements[n]){var s=e[n],a=t[n]={},r=i[n]={};for(var o in s){var l=this.prepare(this.elements[n],o,s[o]);a[o]=l.from,r[o]=l.to}}return this.parent(t,i)}}),Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:!1,fixedWidth:!1,display:0,show:!1,height:!0,width:!1,opacity:!0,alwaysHide:!1,trigger:\"click\",initialDisplayFx:!0,resetHeight:!0,keepOpen:!1},initialize:function(){var e=function(e){return null!=e},t=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:e,elements:e});this.parent(t.elements,t.options);var i=this.options,n=this.togglers=$$(t.togglers);this.previous=-1,this.internalChain=new Chain,i.alwaysHide&&(this.options.link=\"chain\"),(i.show||0===this.options.show)&&(i.display=!1,this.previous=i.show),i.start&&(i.display=!1,i.show=!1);var s=this.effects={};i.opacity&&(s.opacity=\"fullOpacity\"),i.width&&(s.width=i.fixedWidth?\"fullWidth\":\"offsetWidth\"),i.height&&(s.height=i.fixedHeight?\"fullHeight\":\"scrollHeight\");for(var a=0,r=n.length;a=0?n-1:0).chain(a):a(),this},detach:function(e){var t=function(e){e.removeEvent(this.options.trigger,e.retrieve(\"accordion:display\"))}.bind(this);return e?t(e):this.togglers.each(t),this},display:function(e,t){if(!this.check(e,t))return this;var i={},n=this.elements,s=this.options,a=this.effects,r=s.keepOpen,o=s.alwaysHide;if(null==t&&(t=!0),\"element\"==typeOf(e)&&(e=n.indexOf(e)),e==this.current&&!o&&!r)return this;if(s.resetHeight){var l=n[this.current];if(l&&!this.selfHidden)for(var h in a)l.setStyle(h,l[a[h]])}return this.timer&&\"chain\"==s.link?this:(null!=this.current&&(this.previous=this.current),this.current=e,this.selfHidden=!1,n.each(function(n,l){i[l]={};var h,u;if(!r||l==e){l==e&&(u=n.offsetHeight>0&&s.height||n.offsetWidth>0&&s.width),l!=e?h=!0:(o||r)&&u&&(h=!0,this.selfHidden=!0),this.fireEvent(h?\"background\":\"active\",[this.togglers[l],n]);for(var d in a)i[l][d]=h?0:n[a[d]];t||h||!s.resetHeight||(i[l].height=\"auto\")}},this),this.internalChain.clearChain(),this.internalChain.chain(function(){if(s.resetHeight&&!this.selfHidden){var t=n[e];t&&t.setStyle(\"height\",\"auto\")}}.bind(this)),t?this.start(i):this.set(i).internalChain.callChain())}}),Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:\"center\",edge:!1,offset:{x:0,y:0}},start:function(e){var t=this.element,i=t.getStyles(\"top\",\"left\");return\"auto\"!=i.top&&\"auto\"!=i.left||t.setPosition(t.getPosition(t.getOffsetParent())),this.parent(t.position(Object.merge({},this.options,e,{returnPos:!0})))}}),Element.Properties.move={set:function(e){return this.get(\"move\").cancel().setOptions(e),this},get:function(){var e=this.retrieve(\"move\");return e||(e=new Fx.Move(this,{link:\"cancel\"}),this.store(\"move\",e)),e}},Element.implement({move:function(e){return this.get(\"move\").start(e),this}}),function(){function e(e){return/^(?:body|html)$/i.test(e.tagName)}Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:!0},initialize:function(e,t){if(this.element=this.subject=document.id(e),this.parent(t),\"element\"!=typeOf(this.element)&&(this.element=document.id(this.element.getDocument().body)),this.options.wheelStops){var i=this.element,n=this.cancel.pass(!1,this);this.addEvent(\"start\",function(){i.addEvent(\"mousewheel\",n)},!0),this.addEvent(\"complete\",function(){i.removeEvent(\"mousewheel\",n)},!0)}},set:function(){var e=Array.flatten(arguments);return this.element.scrollTo(e[0],e[1]),this},compute:function(e,t,i){return[0,1].map(function(n){return Fx.compute(e[n],t[n],i)})},start:function(e,t){if(!this.check(e,t))return this;var i=this.element.getScroll();return this.parent([i.x,i.y],[e,t])},calculateScroll:function(e,t){var i=this.element,n=i.getScrollSize(),s=i.getScroll(),a=i.getSize(),r=this.options.offset,o={x:e,y:t};for(var l in o)o[l]||0===o[l]||(o[l]=s[l]),\"number\"!=typeOf(o[l])&&(o[l]=n[l]-a[l]),o[l]+=r[l];return[o.x,o.y]},toTop:function(){return this.start.apply(this,this.calculateScroll(!1,0))},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,!1))},toRight:function(){return this.start.apply(this,this.calculateScroll(\"right\",!1))},toBottom:function(){return this.start.apply(this,this.calculateScroll(!1,\"bottom\"))},toElement:function(t,i){i=i?Array.convert(i):[\"x\",\"y\"];var n=e(this.element)?{x:0,y:0}:this.element.getScroll(),s=Object.map(document.id(t).getPosition(this.element),function(e,t){return!!i.contains(t)&&e+n[t]});return this.start.apply(this,this.calculateScroll(s.x,s.y))},toElementEdge:function(e,t,i){t=t?Array.convert(t):[\"x\",\"y\"],e=document.id(e);var n={},s=e.getPosition(this.element),a=e.getSize(),r=this.element.getScroll(),o=this.element.getSize(),l={x:s.x+a.x,y:s.y+a.y};return[\"x\",\"y\"].each(function(e){t.contains(e)&&(l[e]>r[e]+o[e]&&(n[e]=l[e]-o[e]),s[e] None:\n self.login(\"hamlet\")\n fp = StringIO(\"zulip!\")\n fp.name = \"zulip.txt\"\n result = self.client_post(\"/json/user_uploads\", {\"file\": fp})\n\n response_dict = self.assert_json_success(result)\n path_id = re.sub(\"/user_uploads/\", \"\", response_dict[\"uri\"])\n self.assertTrue(delete_message_image(path_id)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: zerver/tests/test_upload.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n zerver/tests/test_upload.py::delete_message_image\nzerver/tests/test_upload.py::StringIO \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "54+train+zulip--zulip+CVE-2023-22735+clean.pkl", "func_name_": "test_delete_message_image_local"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def dump(self, check_mode=False):\n\n result = {\n 'changed': self.changed,\n 'filename': self.path,\n 'privatekey': self.privatekey_path,\n 'csr': self.csr_path,\n }\n\n if self.backup_file:\n result['backup_file'] = self.backup_file\n if self.return_content:\n content = load_file_if_exists(self.path, ignore_errors=True)\n result['certificate'] = content.decode('utf-8') if content else None\n\n result.update(self._get_cert_details())\n\n return result \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_certificate.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n plugins/modules/x509_certificate.py::load_file_if_exists \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "141+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "dump"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_account_reset_password_storefront_hosts_not_allowed(\n mocked_notify, user_api_client, customer_user, channel_USD\n):\n variables = {\n \"email\": customer_user.email,\n \"redirectUrl\": \"https://www.fake.com\",\n \"channel\": channel_USD.slug,\n }\n response = user_api_client.post_graphql(REQUEST_PASSWORD_RESET_MUTATION, variables)\n content = get_graphql_content(response)\n data = content[\"data\"][\"requestPasswordReset\"]\n assert len(data[\"errors\"]) == 1\n assert data[\"errors\"][0][\"field\"] == \"redirectUrl\"\n mocked_notify.assert_not_called() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::get_graphql_content\nsaleor/graphql/account/tests/test_account.py::len\nsaleor/graphql/account/tests/test_account.py::patch \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "262+train+saleor--saleor+CVE-2023-26051+clean.pkl", "func_name_": "test_account_reset_password_storefront_hosts_not_allowed"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_disabling_room_list(self):\n self.room_list_handler.enable_room_list_search = True\n self.directory_handler.enable_room_list_search = True\n\n # Room list is enabled so we should get some results\n request, channel = self.make_request(\"GET\", b\"publicRooms\")\n self.assertEquals(200, channel.code, channel.result)\n self.assertTrue(len(channel.json_body[\"chunk\"]) > 0)\n\n self.room_list_handler.enable_room_list_search = False\n self.directory_handler.enable_room_list_search = False\n\n # Room list disabled so we should get no results\n request, channel = self.make_request(\"GET\", b\"publicRooms\")\n self.assertEquals(200, channel.code, channel.result)\n self.assertTrue(len(channel.json_body[\"chunk\"]) == 0)\n\n # Room list disabled so we shouldn't be allowed to publish rooms\n room_id = self.helper.create_room_as(self.user_id)\n request, channel = self.make_request(\n \"PUT\", b\"directory/list/room/%s\" % (room_id.encode(\"ascii\"),), b\"{}\"\n )\n self.assertEquals(403, channel.code, channel.result) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/handlers/test_directory.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/handlers/test_directory.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "555+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "test_disabling_room_list"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "363+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "deactivate"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_app_no_permission_query_address_federation(app_api_client, address):\n address_id = graphene.Node.to_global_id(\"Address\", address.pk)\n variables = {\n \"representations\": [\n {\n \"__typename\": \"Address\",\n \"id\": address_id,\n },\n ],\n }\n\n response = app_api_client.post_graphql(ADDRESS_FEDERATION_QUERY, variables)\n content = get_graphql_content(response)\n assert content[\"data\"][\"_entities\"] == [None] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::get_graphql_content \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "177+train+saleor--saleor+CVE-2022-0932+clean.pkl", "func_name_": "test_app_no_permission_query_address_federation"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_nonexistent_catalog_is_none(self):\n pardir = self.get_test_dir(erase=1)\n cat = catalog.get_catalog(pardir,'r')\n self.remove_dir(pardir)\n assert_(cat is None) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: scipy/weave/tests/test_catalog.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n scipy/weave/tests/test_catalog.py::assert_ \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+scipy--scipy+CVE-2013-4251+vul.pkl", "func_name_": "test_nonexistent_catalog_is_none"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "314+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "_handle"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_course_has_entrance_exam_in_student_attempts_reset(self):\n \"\"\" Test course has entrance exam id set while resetting attempts\"\"\"\n url = reverse('reset_student_attempts_for_entrance_exam',\n kwargs={'course_id': unicode(self.course.id)})\n response = self.client.get(url, {\n 'all_students': True,\n 'delete_module': False,\n })\n self.assertEqual(response.status_code, 400) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_course_has_entrance_exam_in_student_attempts_reset"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_received_control_line_finished_all_chunks_not_received(self):\n buf = DummyBuffer()\n inst = self._makeOne(buf)\n result = inst.received(b\"a;discard\\n\")\n self.assertEqual(inst.control_line, b\"\")\n self.assertEqual(inst.chunk_remainder, 10)\n self.assertEqual(inst.all_chunks_received, False)\n self.assertEqual(result, 10)\n self.assertEqual(inst.completed, False) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_receiver.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_receiver.py::DummyBuffer \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "96+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_received_control_line_finished_all_chunks_not_received"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(self, hs):\n super().__init__()\n self.auth = hs.get_auth() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/app/generic_worker.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/app/generic_worker.py::Linearizer \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "200+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "__init__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def delete_book_from_table(book_id, book_format, jsonResponse):\n warning = {}\n if current_user.role_delete_books():\n book = calibre_db.get_book(book_id)\n if book:\n try:\n result, error = helper.delete_book(book, config.config_calibre_dir, book_format=book_format.upper())\n if not result:\n if jsonResponse:\n return json.dumps([{\"location\": url_for(\"editbook.edit_book\", book_id=book_id),\n \"type\": \"danger\",\n \"format\": \"\",\n \"message\": error}])\n else:\n flash(error, category=\"error\")\n return redirect(url_for('editbook.edit_book', book_id=book_id))\n if error:\n if jsonResponse:\n warning = {\"location\": url_for(\"editbook.edit_book\", book_id=book_id),\n \"type\": \"warning\",\n \"format\": \"\",\n \"message\": error}\n else:\n flash(error, category=\"warning\")\n if not book_format:\n delete_whole_book(book_id, book)\n else:\n calibre_db.session.query(db.Data).filter(db.Data.book == book.id).\\\n filter(db.Data.format == book_format).delete()\n if book_format.upper() in ['KEPUB', 'EPUB', 'EPUB3']:\n kobo_sync_status.remove_synced_book(book.id, True)\n calibre_db.session.commit()\n except Exception as ex:\n log.error_or_exception(ex)\n calibre_db.session.rollback()\n if jsonResponse:\n return json.dumps([{\"location\": url_for(\"editbook.edit_book\", book_id=book_id),\n \"type\": \"danger\",\n \"format\": \"\",\n \"message\": ex}])\n else:\n flash(str(ex), category=\"error\")\n return redirect(url_for('editbook.edit_book', book_id=book_id))\n\n else:\n # book not found\n log.error('Book with id \"%s\" could not be deleted: not found', book_id)\n return render_delete_book_result(book_format, jsonResponse, warning, book_id)\n message = _(\"You are missing permissions to delete books\")\n if jsonResponse:\n return json.dumps({\"location\": url_for(\"editbook.edit_book\", book_id=book_id),\n \"type\": \"danger\",\n \"format\": \"\",\n \"message\": message})\n else:\n flash(message, category=\"error\")\n return redirect(url_for('editbook.edit_book', book_id=book_id)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cps/editbooks.py.\n//This function is called by other functions within the repository:\n cps/editbooks.py::delete_book_from_details\ncps/editbooks.py::delete_book_ajax\ncps/editbooks.py::merge_list_book \n//This function itself calls other functions within the repository:\n cps/editbooks.py::delete_whole_book\ncps/editbooks.py::str\ncps/editbooks.py::url_for\ncps/editbooks.py::_\ncps/editbooks.py::render_delete_book_result\ncps/editbooks.py::flash\ncps/editbooks.py::redirect \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+janeczku--calibre-web+CVE-2022-0939+vul.pkl", "func_name_": "delete_book_from_table"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def infer_arg_types(self, node):\n self._validate_arg_types(node)\n # return a concrete type for `value`\n value_type = get_possible_types_from_node(node.args[0]).pop()\n return [value_type] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/builtins/functions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n vyper/builtins/functions.py::TYPE_T\nvyper/builtins/functions.py::get_exact_type_from_node\nvyper/builtins/functions.py::type_from_annotation\nvyper/builtins/functions.py::validate_call_args \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "17+train+vyperlang--vyper+CVE-2023-30629+clean.pkl", "func_name_": "infer_arg_types"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_read_empty_name(self):\n data = b\":foo\"\n with pytest.raises(ValueError):\n self._read(data) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/mitmproxy/net/http/http1/test_read.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "18+train+mitmproxy--mitmproxy+CVE-2022-24766+clean.pkl", "func_name_": "test_read_empty_name"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def run_cmd_in_pty(cmd, print_cmd=True, print_output=True, columns=120):\n \"\"\"Similar to run_subprocess(), but the command is executed in a pseudo-terminal.\n\n The pseudo-terminal can be useful when a command prints out a different output with or without an active terminal\n session. E.g. yumdownloader does not print the name of the downloaded rpm if not executed from a terminal.\n Switching off printing the command can be useful in case it contains a password in plain text.\n\n :param cmd: The command to execute, including the options, e.g. \"ls -al\"\n :type cmd: string\n :param print_cmd: Log the command (to both logfile and stdout)\n :type print_cmd: bool\n :param print_output: Log the combined stdout and stderr of the executed command (to both logfile and stdout)\n :type print_output: bool\n :param columns: Number of columns of the pseudo-terminal (characters on a line). This may influence the output.\n :type columns: int\n :return: The output (combined stdout and stderr) and the return code of the executed command\n :rtype: tuple\n \"\"\"\n # This check is here because we passed in strings in the past and changed to a list\n # for security hardening. Remove this once everyone is comfortable with using a list\n # instead.\n if isinstance(cmd, str):\n raise TypeError(\"cmd should be a list, not a str\")\n\n if print_cmd:\n loggerinst.debug(\"Calling command '%s'\" % \" \".join(cmd))\n\n class PexpectSizedWindowSpawn(pexpect.spawn):\n # https://github.com/pexpect/pexpect/issues/134\n def setwinsize(self, rows, cols):\n super(PexpectSizedWindowSpawn, self).setwinsize(0, columns)\n\n process = PexpectSizedWindowSpawn(cmd[0], cmd[1:], env={\"LC_ALL\": \"C\"}, timeout=None)\n\n # The setting of window size is super unreliable\n process.setwinsize(0, columns)\n loggerinst.debug(\"Pseudo-PTY columns set to: %s\" % (process.getwinsize(),))\n\n process.expect(pexpect.EOF)\n output = process.before.decode()\n if print_output:\n loggerinst.info(output.rstrip(\"\\n\"))\n\n process.close() # Per the pexpect API, this is necessary in order to get the return code\n return_code = process.exitstatus\n\n return output, return_code \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: convert2rhel/utils.py.\n//This function is called by other functions within the repository:\n convert2rhel/utils.py::download_pkg \n//This function itself calls other functions within the repository:\n convert2rhel/utils.py::TypeError\nconvert2rhel/utils.py::isinstance\nconvert2rhel/utils.py::PexpectSizedWindowSpawn \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "31+train+oamg--convert2rhel+CVE-2022-0852+vul.pkl", "func_name_": "run_cmd_in_pty"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_parse_header_no_cr_in_headerplus(self):\n data = b\"GET /foobar HTTP/8.4\"\n self.parser.parse_header(data)\n self.assertEqual(self.parser.first_line, data) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_parser.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "86+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_parse_header_no_cr_in_headerplus"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def unicodify( value, encoding=DEFAULT_ENCODING, error='replace', default=None ):\n \"\"\"\n Returns a unicode string or None\n \"\"\"\n\n if isinstance( value, unicode ):\n return value\n try:\n return unicode( str( value ), encoding, error )\n except:\n return default \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/util/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "68+train+blankenberg--galaxy-data-resource+CVE-2015-10062+clean.pkl", "func_name_": "unicodify"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def upload_from_request(request, project):\n if \"file\" not in request.data:\n return Response({\"detail\": \"Missing uploaded file\"}, status=400)\n fileobj = request.data[\"file\"]\n files = create_files_from_dif_zip(fileobj, project=project)\n return Response(serialize(files, request.user), status=201) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/sentry/api/endpoints/debug_files.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/sentry/api/endpoints/debug_files.py::serialize\nsrc/sentry/api/endpoints/debug_files.py::create_files_from_dif_zip\nsrc/sentry/api/endpoints/debug_files.py::Response \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+getsentry--sentry+CVE-2023-36826+clean.pkl", "func_name_": "upload_from_request"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n MooTools.More={version:\"1.6.0\",build:\"45b71db70f879781a7e0b0d3fb3bb1307c2521eb\"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain.implement(e),this.Fx&&Fx.implement(e),this.Element&&Element.implement&&this.Fx&&Element.implement({chains:function(e){return Array.convert(e||[\"tween\",\"morph\",\"reveal\"]).each(function(e){(e=this.get(e))&&e.setOptions({link:\"chain\"})},this),this},pauseFx:function(e,t){return this.chains(t).get(t||\"tween\").wait(e),this}})}(),Class.Mutators.Binds=function(e){return this.prototype.initialize||this.implement(\"initialize\",function(){}),Array.convert(e).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(e){return function(){return Array.convert(this.Binds).each(function(e){var t=this[e];t&&(this[e]=t.bind(this))},this),e.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(e,t){t=document.id(t||this.element);var i=t.retrieve(e||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,t.store(e||this.property,this),this.occluded)}}),Class.refactor=function(e,t){return Object.each(t,function(t,i){var n=e.prototype[i];n=n&&n.$origin||n||function(){},e.implement(i,\"function\"==typeof t?function(){var e=this.previous;this.previous=n;var i=t.apply(this,arguments);return this.previous=e,i}:t)}),e},Class.Singleton=new Class({initialize:function(e){var t,i=new Class(e);return function(){if(t)return t;t=Object.append({},i.prototype),t.constructor=i;var e=i.apply(t,arguments);return t=\"object\"==typeof e?e:t}}}),function(){Events.Pseudos=function(e,t,i){var n=function(e){return{store:e.store?function(t,i){e.store(\"_monitorEvents:\"+t,i)}:function(t,i){(e._monitorEvents||(e._monitorEvents={}))[t]=i},retrieve:e.retrieve?function(t,i){return e.retrieve(\"_monitorEvents:\"+t,i)}:function(t,i){return e._monitorEvents?e._monitorEvents[t]||i:i}}},s=function(t){if(-1==t.indexOf(\":\")||!e)return null;for(var i=Slick.parse(t).expressions[0][0],n=i.pseudos,s=n.length,a=[];s--;){var r=n[s].key,o=e[r];null!=o&&a.push({event:i.tag,value:n[s].value,pseudo:r,original:t,listener:o})}return a.length?a:null};return{addEvent:function(e,i,a){var r=s(e);if(!r)return t.call(this,e,i,a);var o=n(this),l=o.retrieve(e,[]),h=r[0].event,u=Array.slice(arguments,2),d=i,c=this;return r.each(function(e){var t=e.listener,i=d;0==t?h+=\":\"+e.pseudo+\"(\"+e.value+\")\":d=function(){t.call(c,e,i,arguments,d)}}),l.include({type:h,event:i,monitor:d}),o.store(e,l),e!=h&&t.apply(this,[e,i].concat(u)),t.apply(this,[h,d].concat(u))},removeEvent:function(e,t){if(!s(e))return i.call(this,e,t);var a=n(this),r=a.retrieve(e);if(!r)return this;var o=Array.slice(arguments,2);return i.apply(this,[e,t].concat(o)),r.each(function(e,n){t&&e.event!=t||i.apply(this,[e.type,e.monitor].concat(o)),delete r[n]},this),a.store(e,r),this}}};var e={once:function(e,t,i,n){t.apply(this,i),this.removeEvent(e.event,n).removeEvent(e.original,t)},throttle:function(e,t,i){t._throttled||(t.apply(this,i),t._throttled=setTimeout(function(){t._throttled=!1},e.value||250))},pause:function(e,t,i){clearTimeout(t._pause),t._pause=t.delay(e.value||250,this,i)}};Events.definePseudo=function(t,i){return e[t]=i,this},Events.lookupPseudo=function(t){return e[t]};var t=Events.prototype;Events.implement(Events.Pseudos(e,t.addEvent,t.removeEvent)),[\"Request\",\"Fx\"].each(function(e){this[e]&&this[e].implement(Events.prototype)})}(),function(){var e=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:\"px\",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:\"left\",y:\"top\"}},initialize:function(){var t=Array.link(arguments,{options:Type.isObject,element:function(e){return null!=e}});this.element=document.id(t.element),this.document=this.element.getDocument(),this.setOptions(t.options||{});var i=typeOf(this.options.handle);this.handles=(\"array\"==i||\"collection\"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(e){var t=e.getOffsetParent();return!t||/^(?:body|html)$/i.test(t.tagName)?window:document.id(t)}(this.element),this.selection=\"selectstart\"in document?\"selectstart\":\"mousedown\",this.compensateScroll={start:{},diff:{},last:{}},!(\"ondragstart\"in document)||\"FileReader\"in window||e.ondragstartFixed||(document.ondragstart=Function.convert(!1),e.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent(\"mousedown\",this.bound.start),this.handles.addEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent(\"scroll\",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent(\"mousedown\",this.bound.start),this.handles.removeEvent(\"touchstart\",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent(\"scroll\",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var e=this.offsetParent.getScroll();if(\"absolute\"==this.element.getStyle(\"position\")){var t=this.sumValues(e,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,t,1)}else this.compensateScroll.diff=this.sumValues(e,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,e,-1)),this.compensateScroll.last=e,this.render(this.options)}},sumValues:function(e,t,i){var n={},s=this.options;for(var a in s.modifiers)s.modifiers[a]&&(n[a]=e[a]+t[a]*i);return n},start:function(e){if(!this.options.unDraggableTags.contains(e.target.get(\"tag\"))){var t=this.options;if(!e.rightClick){t.preventDefault&&e.preventDefault(),t.stopPropagation&&e.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=e.page,this.fireEvent(\"beforeStart\",this.element);var i=t.limit;this.limit={x:[],y:[]};var n,s,a=this.offsetParent==window?null:this.offsetParent;for(n in t.modifiers)if(t.modifiers[n]){var r=this.element.getStyle(t.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(a)),r=s[t.modifiers[n]]),t.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[t.modifiers[n]],t.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=e.page[n]-this.value.now[n],i&&i[n])for(var o=2;o--;){var l=i[n][o];(l||0===l)&&(this.limit[n][o]=\"function\"==typeof l?l():l)}}\"number\"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var h={mousemove:this.bound.check,mouseup:this.bound.cancel,touchmove:this.bound.check,touchend:this.bound.cancel};h[this.selection]=this.bound.eventStop,this.document.addEvents(h)}}},check:function(e){this.options.preventDefault&&e.preventDefault(),Math.round(Math.sqrt(Math.pow(e.page.x-this.mouse.start.x,2)+Math.pow(e.page.y-this.mouse.start.y,2)))>this.options.snap&&(this.cancel(),this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop,touchmove:this.bound.drag,touchend:this.bound.stop}),this.fireEvent(\"start\",[this.element,e]).fireEvent(\"snap\",this.element))},drag:function(e){var t=this.options;t.preventDefault&&e.preventDefault(),this.mouse.now=this.sumValues(e.page,this.compensateScroll.diff,-1),this.render(t),this.fireEvent(\"drag\",[this.element,e])},render:function(e){for(var t in e.modifiers)e.modifiers[t]&&(this.value.now[t]=this.mouse.now[t]-this.mouse.pos[t],e.invert&&(this.value.now[t]*=-1),e.limit&&this.limit[t]&&((this.limit[t][1]||0===this.limit[t][1])&&this.value.now[t]>this.limit[t][1]?this.value.now[t]=this.limit[t][1]:(this.limit[t][0]||0===this.limit[t][0])&&this.value.now[t]e.left&&i.xe.top},this).getLast();this.overed!=e&&(this.overed&&this.fireEvent(\"leave\",[this.element,this.overed]),e&&this.fireEvent(\"enter\",[this.element,e]),this.overed=e)},drag:function(e){this.parent(e),this.options.checkDroppables&&this.droppables.length&&this.checkDroppables()},stop:function(e){return this.checkDroppables(),this.fireEvent(\"drop\",[this.element,this.overed,e]),this.overed=null,this.parent(e)}}),Element.implement({makeDraggable:function(e){var t=new Drag.Move(this,e);return this.store(\"dragger\",t),t}}),function(){var e=function(e,t){var i=[];return Object.each(t,function(t){Object.each(t,function(t){e.each(function(e){i.push(e+\"-\"+t+(\"border\"==e?\"-width\":\"\"))})})}),i},t=function(e,t){var i=0;return Object.each(t,function(t,n){n.test(e)&&(i+=t.toInt())}),i},i=function(e){return!(e&&!e.offsetHeight&&!e.offsetWidth)};Element.implement({measure:function(e){if(i(this))return e.call(this);for(var t=this.getParent(),n=[];!i(t)&&t!=document.body;)n.push(t.expose()),t=t.getParent();var s=this.expose(),a=e.call(this);return s(),n.each(function(e){e()}),a},expose:function(){if(\"none\"!=this.getStyle(\"display\"))return function(){};var e=this.style.cssText;return this.setStyles({display:\"block\",position:\"absolute\",visibility:\"hidden\"}),function(){this.style.cssText=e}.bind(this)},getDimensions:function(e){e=Object.merge({computeSize:!1},e);var t={x:0,y:0},i=function(e,t){return t.computeSize?e.getComputedSize(t):e.getSize()},n=this.getParent(\"body\");if(n&&\"none\"==this.getStyle(\"display\"))t=this.measure(function(){return i(this,e)});else if(n)try{t=i(this,e)}catch(e){}return Object.append(t,t.x||0===t.x?{width:t.x,height:t.y}:{x:t.width,y:t.height})},getComputedSize:function(i){i=Object.merge({styles:[\"padding\",\"border\"],planes:{height:[\"top\",\"bottom\"],width:[\"left\",\"right\"]},mode:\"both\"},i);var n,s={},a={width:0,height:0};return\"vertical\"==i.mode?(delete a.width,delete i.planes.width):\"horizontal\"==i.mode&&(delete a.height,delete i.planes.height),e(i.styles,i.planes).each(function(e){s[e]=this.getStyle(e).toInt()},this),Object.each(i.planes,function(e,i){var r=i.capitalize(),o=this.getStyle(i);\"auto\"!=o||n||(n=this.getDimensions()),o=s[i]=\"auto\"==o?n[i]:o.toInt(),a[\"total\"+r]=o,e.each(function(e){var i=t(e,s);a[\"computed\"+e.capitalize()]=i,a[\"total\"+r]+=i})},this),Object.append(a,s)}})}(),function(){this.Slider=new Class({Implements:[Events,Options],Binds:[\"clickedElement\",\"draggedKnob\",\"scrolledElement\"],options:{onTick:function(e){this.setKnobPosition(e)},initialStep:0,snap:!1,offset:0,range:!1,wheel:!1,steps:100,mode:\"horizontal\"},initialize:function(e,t,i){this.setOptions(i),i=this.options,this.element=document.id(e),t=this.knob=document.id(t),this.previousChange=this.previousEnd=this.step=i.initialStep?i.initialStep:i.range?i.range[0]:0;var n={},s={x:!1,y:!1};switch(i.mode){case\"vertical\":this.axis=\"y\",this.property=\"top\",this.offset=\"offsetHeight\";break;case\"horizontal\":this.axis=\"x\",this.property=\"left\",this.offset=\"offsetWidth\"}this.setSliderDimensions(),this.setRange(i.range,null,!0),\"static\"==t.getStyle(\"position\")&&t.setStyle(\"position\",\"relative\"),t.setStyle(this.property,-i.offset),s[this.axis]=this.property,n[this.axis]=[-i.offset,this.full-i.offset];var a={snap:0,limit:n,modifiers:s,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:function(){this.isDragging=!0}.bind(this),onCancel:function(){this.isDragging=!1}.bind(this),onComplete:function(){this.isDragging=!1,this.draggedKnob(),this.end()}.bind(this)};i.snap&&this.setSnap(a),this.drag=new Drag(t,a),null!=i.initialStep&&this.set(i.initialStep,!0),this.attach()},attach:function(){return this.element.addEvent(\"mousedown\",this.clickedElement),this.options.wheel&&this.element.addEvent(\"mousewheel\",this.scrolledElement),this.drag.attach(),this},detach:function(){return this.element.removeEvent(\"mousedown\",this.clickedElement).removeEvent(\"mousewheel\",this.scrolledElement),this.drag.detach(),this},autosize:function(){return this.setSliderDimensions().setKnobPosition(this.toPosition(this.step)),this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset],this.options.snap&&this.setSnap(),this},setSnap:function(e){return e||(e=this.drag.options),e.grid=Math.ceil(this.stepWidth),e.limit[this.axis][1]=this.element[this.offset],this},setKnobPosition:function(e){return this.options.snap&&(e=this.toPosition(this.step)),this.knob.setStyle(this.property,e),this},setSliderDimensions:function(){return this.full=this.element.measure(function(){return this.half=this.knob[this.offset]/2,this.element[this.offset]-this.knob[this.offset]+2*this.options.offset}.bind(this)),this},set:function(e,t){return this.range>0^e0^e>this.max||(e=this.max),this.step=e.round(this.modulus.decimalLength),t?this.checkStep().setKnobPosition(this.toPosition(this.step)):this.checkStep().fireEvent(\"tick\",this.toPosition(this.step)).fireEvent(\"move\").end(),this},setRange:function(e,t,i){this.min=Array.pick([e[0],0]),this.max=Array.pick([e[1],this.options.steps]),this.range=this.max-this.min,this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;return this.stepWidth=this.stepSize*this.full/Math.abs(this.range),this.setModulus(),e&&this.set(Array.pick([t,this.step]).limit(this.min,this.max),i),this},setModulus:function(){for(var e=((this.stepSize+\"\").split(\".\")[1]||[]).length,t=\"1\";e--;)t+=\"0\";this.modulus={multiplier:t.toInt(10),decimalLength:t.length-1}},clickedElement:function(e){if(!this.isDragging&&e.target!=this.knob){var t=this.range<0?-1:1,i=e.page[this.axis]-this.element.getPosition()[this.axis]-this.half;i=i.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+t*this.toStep(i)).round(this.modulus.decimalLength),this.checkStep().fireEvent(\"tick\",i).fireEvent(\"move\").end()}},scrolledElement:function(e){var t=\"horizontal\"==this.options.mode?e.wheel<0:e.wheel>0;this.set(this.step+(t?-1:1)*this.stepSize),e.stop()},draggedKnob:function(){var e=this.range<0?-1:1,t=this.drag.value.now[this.axis];t=t.limit(-this.options.offset,this.full-this.options.offset),this.step=(this.min+e*this.toStep(t)).round(this.modulus.decimalLength),this.checkStep(),this.fireEvent(\"move\")},checkStep:function(){var e=this.step;return this.previousChange!=e&&(this.previousChange=e,this.fireEvent(\"change\",e)),this},end:function(){var e=this.step;return this.previousEnd!==e&&(this.previousEnd=e,this.fireEvent(\"complete\",e+\"\")),this},toStep:function(e){var t=(e+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?(t-t*this.modulus.multiplier%(this.stepSize*this.modulus.multiplier)/this.modulus.multiplier).round(this.modulus.decimalLength):t},toPosition:function(e){return this.full*Math.abs(this.min-e)/(this.steps*this.stepSize)-this.options.offset||0}})}(),function(){this.Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:!1,revert:!1,handle:!1,dragOptions:{},unDraggableTags:[\"button\",\"input\",\"a\",\"textarea\",\"select\",\"option\"]},initialize:function(e,t){this.setOptions(t),this.elements=[],this.lists=[],this.idle=!0,this.addLists($$(document.id(e)||e)),this.options.clone||(this.options.revert=!1),this.options.revert&&(this.effect=new Fx.Morph(null,Object.merge({duration:250,link:\"cancel\"},this.options.revert)))},attach:function(){return this.addLists(this.lists),this},detach:function(){return this.lists=this.removeLists(this.lists),this},addItems:function(){return Array.flatten(arguments).each(function(e){this.elements.push(e);var t=e.retrieve(\"sortables:start\",function(t){this.start.call(this,t,e)}.bind(this));(this.options.handle?e.getElement(this.options.handle)||e:e).addEvent(\"mousedown\",t)},this),this},addLists:function(){return Array.flatten(arguments).each(function(e){this.lists.include(e),this.addItems(e.getChildren())},this),this},removeItems:function(){return $$(Array.flatten(arguments).map(function(e){this.elements.erase(e);var t=e.retrieve(\"sortables:start\");return(this.options.handle?e.getElement(this.options.handle)||e:e).removeEvent(\"mousedown\",t),e},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(e){return this.lists.erase(e),this.removeItems(e.getChildren()),e},this))},getDroppableCoordinates:function(e){var t=e.getOffsetParent(),i=e.getPosition(t),n={w:window.getScroll(),offsetParent:t.getScroll()};return i.x+=n.offsetParent.x,i.y+=n.offsetParent.y,\"fixed\"==t.getStyle(\"position\")&&(i.x-=n.w.x,i.y-=n.w.y),i},getClone:function(e,t){if(!this.options.clone)return new Element(t.tagName).inject(document.body);if(\"function\"==typeOf(this.options.clone))return this.options.clone.call(this,e,t,this.list);var i=t.clone(!0).setStyles({margin:0,position:\"absolute\",visibility:\"hidden\",width:t.getStyle(\"width\")}).addEvent(\"mousedown\",function(e){t.fireEvent(\"mousedown\",e)});return i.get(\"html\").test(\"radio\")&&i.getElements(\"input[type=radio]\").each(function(e,i){e.set(\"name\",\"clone_\"+i),e.get(\"checked\")&&t.getElements(\"input[type=radio]\")[i].set(\"checked\",!0)}),i.inject(this.list).setPosition(this.getDroppableCoordinates(this.element))},getDroppables:function(){var e=this.list.getChildren().erase(this.clone).erase(this.element);return this.options.constrain||e.append(this.lists).erase(this.list),e},insert:function(e,t){var i=\"inside\";this.lists.contains(t)?(this.list=t,this.drag.droppables=this.getDroppables()):i=this.element.getAllPrevious().contains(t)?\"before\":\"after\",this.element.inject(t,i),this.fireEvent(\"sort\",[this.element,this.clone])},start:function(e,t){!this.idle||e.rightClick||!this.options.handle&&this.options.unDraggableTags.contains(e.target.get(\"tag\"))||(this.idle=!1,this.element=t,this.opacity=t.getStyle(\"opacity\"),this.list=t.getParent(),this.clone=this.getClone(e,t),this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){e.stop(),this.clone.setStyle(\"visibility\",\"visible\"),this.element.setStyle(\"opacity\",this.options.opacity||0),this.fireEvent(\"start\",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)}),this.clone.inject(this.element,\"before\"),this.drag.start(e))},end:function(){this.drag.detach(),this.element.setStyle(\"opacity\",this.opacity);var e=this;if(this.effect){var t=this.element.getStyles(\"width\",\"height\"),i=this.clone,n=i.computePosition(this.getDroppableCoordinates(i)),s=function(){this.removeEvent(\"cancel\",s),i.destroy(),e.reset()};this.effect.element=i,this.effect.start({top:n.top,left:n.left,width:t.width,height:t.height,opacity:.25}).addEvent(\"cancel\",s).chain(s)}else this.clone.destroy(),e.reset()},reset:function(){this.idle=!0,this.fireEvent(\"complete\",this.element)},serialize:function(){var e=Array.link(arguments,{modifier:Type.isFunction,index:function(e){return null!=e}}),t=this.lists.map(function(t){return t.getChildren().map(e.modifier||function(e){return e.get(\"id\")},this)},this),i=e.index;return 1==this.lists.length&&(i=0),(i||0===i)&&i>=0&&i]*>([\\\\s\\\\S]*?)\":\"|<\"+e+\"[\\\\s|/][^>]*>\";return new RegExp(i,\"gi\")};String.implement({standardize:function(){return s(this,e)},repeat:function(e){return new Array(e+1).join(this)},pad:function(e,t,i){if(this.length>=e)return this;var n=(null==t?\" \":\"\"+t).repeat(e-this.length).substr(0,e-this.length);return i&&\"right\"!=i?\"left\"==i?n+this:n.substr(0,(n.length/2).floor())+this+n.substr(0,(n.length/2).ceil()):this+n},getTags:function(e,t){return this.match(a(e,t))||[]},stripTags:function(e,t){return this.replace(a(e,t),\"\")},tidy:function(){return s(this,t)},truncate:function(e,t,i){var n=this;if(null==t&&1==arguments.length&&(t=\"\u2026\"),n.length>e){if(n=n.substring(0,e),i){var s=n.lastIndexOf(i);-1!=s&&(n=n.substr(0,s))}t&&(n+=t)}return n},ms:function(){var e=n.exec(this);return null==e?Number(this):Number(e[1])*i[e[2]]}})}(),Element.implement({tidy:function(){this.set(\"value\",this.get(\"value\").tidy())},getTextInRange:function(e,t){return this.get(\"value\").substring(e,t)},getSelectedText:function(){return this.setSelectionRange?this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd()):document.selection.createRange().text},getSelectedRange:function(){if(null!=this.selectionStart)return{start:this.selectionStart,end:this.selectionEnd};var e={start:0,end:0},t=this.getDocument().selection.createRange();if(!t||t.parentElement()!=this)return e;var i=t.duplicate();if(\"text\"==this.type)e.start=0-i.moveStart(\"character\",-1e5),e.end=e.start+t.text.length;else{var n=this.get(\"value\"),s=n.length;i.moveToElementText(this),i.setEndPoint(\"StartToEnd\",t),i.text.length&&(s-=n.match(/[\\n\\r]*$/)[0].length),e.end=s-i.text.length,i.setEndPoint(\"StartToStart\",t),e.start=s-i.text.length}return e},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(e){return\"end\"==e&&(e=this.get(\"value\").length),this.selectRange(e,e),this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(e,t){if(this.setSelectionRange)this.focus(),this.setSelectionRange(e,t);else{var i=this.get(\"value\"),n=i.substr(e,t-e).replace(/\\r/g,\"\").length;e=i.substr(0,e).replace(/\\r/g,\"\").length;var s=this.createTextRange();s.collapse(!0),s.moveEnd(\"character\",e+n),s.moveStart(\"character\",e),s.select()}return this},insertAtCursor:function(e,t){var i=this.getSelectedRange(),n=this.get(\"value\");return this.set(\"value\",n.substring(0,i.start)+e+n.substring(i.end,n.length)),!1!==t?this.selectRange(i.start,i.start+e.length):this.setCaretPosition(i.start+e.length),this},insertAroundCursor:function(e,t){e=Object.append({before:\"\",defaultMiddle:\"\",after:\"\"},e);var i=this.getSelectedText()||e.defaultMiddle,n=this.getSelectedRange(),s=this.get(\"value\");if(n.start==n.end)this.set(\"value\",s.substring(0,n.start)+e.before+i+e.after+s.substring(n.end,s.length)),this.selectRange(n.start+e.before.length,n.end+e.before.length+i.length);else{var a=s.substring(n.start,n.end);this.set(\"value\",s.substring(0,n.start)+e.before+a+e.after+s.substring(n.end,s.length));var r=n.start+e.before.length;!1!==t?this.selectRange(r,r+a.length):this.setCaretPosition(r+s.length)}return this}}),function(){var e=!1,t=!1,i=function(){var i=new Element(\"div\").setStyles({position:\"fixed\",top:0,right:0}).inject(document.body);e=0===i.offsetTop,i.dispose(),t=!0};Element.implement({pin:function(n,s){if(t||i(),\"none\"==this.getStyle(\"display\"))return this;var a,r,o,l=window.getScroll();if(!1!==n){if(a=this.getPosition(),!this.retrieve(\"pin:_pinned\")){var h={top:a.y-l.y,left:a.x-l.x,margin:\"0px\",padding:\"0px\"};if(e&&!s)this.setStyle(\"position\",\"fixed\").setStyles(h);else{r=this.getOffsetParent();var u=this.getPosition(r),d=this.getStyles(\"left\",\"top\");(r&&\"auto\"==d.left||\"auto\"==d.top)&&this.setPosition(u),\"static\"==this.getStyle(\"position\")&&this.setStyle(\"position\",\"absolute\"),u={x:d.left.toInt()-l.x,y:d.top.toInt()-l.y},o=function(){if(this.retrieve(\"pin:_pinned\")){var e=window.getScroll();this.setStyles({left:u.x+e.x,top:u.y+e.y})}}.bind(this),this.store(\"pin:_scrollFixer\",o),window.addEvent(\"scroll\",o)}this.store(\"pin:_pinned\",!0)}}else{if(!this.retrieve(\"pin:_pinned\"))return this;r=this.getParent();\"static\"!=r.getComputedStyle(\"position\")||r.getOffsetParent();a=this.getPosition(),this.store(\"pin:_pinned\",!1),o=this.retrieve(\"pin:_scrollFixer\"),o?(this.store(\"pin:_scrollFixer\",null),window.removeEvent(\"scroll\",o)):this.setStyles({position:\"absolute\",top:a.y+l.y,left:a.x+l.x}),this.removeClass(\"isPinned\")}return this},unpin:function(){return this.pin(!1)},togglePin:function(){return this.pin(!this.retrieve(\"pin:_pinned\"))}})}(),function(e){var t=Element.Position={options:{relativeTo:document.body,position:{x:\"center\",y:\"center\"},offset:{x:0,y:0}},getOptions:function(e,i){return i=Object.merge({},t.options,i),t.setPositionOption(i),t.setEdgeOption(i),t.setOffsetOption(e,i),t.setDimensionsOption(e,i),i},setPositionOption:function(e){e.position=t.getCoordinateFromValue(e.position)},setEdgeOption:function(e){var i=t.getCoordinateFromValue(e.edge);e.edge=i||(\"center\"==e.position.x&&\"center\"==e.position.y?{x:\"center\",y:\"center\"}:{x:\"left\",y:\"top\"})},setOffsetOption:function(e,t){var i={x:0,y:0},n={x:0,y:0},s=e.measure(function(){return document.id(this.getOffsetParent())});s&&s!=e.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var e=this.getPosition();if(\"fixed\"==this.getStyle(\"position\")){var t=window.getScroll();e.x+=t.x,e.y+=t.y}return e}),t.offset={parentPositioned:s!=document.id(t.relativeTo),x:t.offset.x-i.x+n.x,y:t.offset.y-i.y+n.y})},setDimensionsOption:function(e,t){t.dimensions=e.getDimensions({computeSize:!0,styles:[\"padding\",\"border\",\"margin\"]})},getPosition:function(e,i){var n={};i=t.getOptions(e,i);var s=document.id(i.relativeTo)||document.body;t.setPositionCoordinates(i,n,s),i.edge&&t.toEdge(n,i);var a=i.offset;return n.left=(n.x>=0||a.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||a.parentPositioned||i.allowNegative?n.y:0).toInt(),t.toMinMax(n,i),(i.relFixedPosition||\"fixed\"==s.getStyle(\"position\"))&&t.toRelFixedPosition(s,n),i.ignoreScroll&&t.toIgnoreScroll(s,n),i.ignoreMargins&&t.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(e,t,i){var n=e.offset.y,s=e.offset.x,a=i==document.body?window.getScroll():i.getPosition(),r=a.y,o=a.x,l=window.getSize();switch(e.position.x){case\"left\":t.x=o+s;break;case\"right\":t.x=o+s+i.offsetWidth;break;default:t.x=o+(i==document.body?l.x:i.offsetWidth)/2+s}switch(e.position.y){case\"top\":t.y=r+n;break;case\"bottom\":t.y=r+n+i.offsetHeight;break;default:t.y=r+(i==document.body?l.y:i.offsetHeight)/2+n}},toMinMax:function(e,t){var i,n={left:\"x\",top:\"y\"};[\"minimum\",\"maximum\"].each(function(s){[\"left\",\"top\"].each(function(a){null!=(i=t[s]?t[s][n[a]]:null)&&(\"minimum\"==s?e[a]i)&&(e[a]=i)})})},toRelFixedPosition:function(e,t){var i=window.getScroll();t.top+=i.y,t.left+=i.x},toIgnoreScroll:function(e,t){var i=e.getScroll();t.top-=i.y,t.left-=i.x},toIgnoreMargins:function(e,t){e.left+=\"right\"==t.edge.x?t.dimensions[\"margin-right\"]:\"center\"!=t.edge.x?-t.dimensions[\"margin-left\"]:-t.dimensions[\"margin-left\"]+(t.dimensions[\"margin-right\"]+t.dimensions[\"margin-left\"])/2,e.top+=\"bottom\"==t.edge.y?t.dimensions[\"margin-bottom\"]:\"center\"!=t.edge.y?-t.dimensions[\"margin-top\"]:-t.dimensions[\"margin-top\"]+(t.dimensions[\"margin-bottom\"]+t.dimensions[\"margin-top\"])/2},toEdge:function(e,t){var i={},n=t.dimensions,s=t.edge;switch(s.x){case\"left\":i.x=0;break;case\"right\": \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "194+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "check"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def verify(cert, signature, data, digest):\n \"\"\"\n Verify a signature.\n\n :param cert: signing certificate (X509 object)\n :param signature: signature returned by sign function\n :param data: data to be verified\n :param digest: message digest to use\n :return: ``None`` if the signature is correct, raise exception otherwise.\n \"\"\"\n data = _text_to_bytes_and_warn(\"data\", data)\n\n digest_obj = _lib.EVP_get_digestbyname(_byte_string(digest))\n if digest_obj == _ffi.NULL:\n raise ValueError(\"No such digest method\")\n\n pkey = _lib.X509_get_pubkey(cert._x509)\n _openssl_assert(pkey != _ffi.NULL)\n pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)\n\n md_ctx = _lib.Cryptography_EVP_MD_CTX_new()\n md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)\n\n _lib.EVP_VerifyInit(md_ctx, digest_obj)\n _lib.EVP_VerifyUpdate(md_ctx, data, len(data))\n verify_result = _lib.EVP_VerifyFinal(\n md_ctx, signature, len(signature), pkey\n )\n\n if verify_result != 1:\n _raise_current_error() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/OpenSSL/crypto.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/OpenSSL/crypto.py::_byte_string\nsrc/OpenSSL/crypto.py::_raise_current_error\nsrc/OpenSSL/crypto.py::_openssl_assert\nsrc/OpenSSL/crypto.py::ValueError\nsrc/OpenSSL/crypto.py::len\nsrc/OpenSSL/crypto.py::_text_to_bytes_and_warn \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "43+train+pyca--pyopenssl+CVE-2018-1000807+clean.pkl", "func_name_": "verify"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_keepalive_http11_connclose(self):\n # specifying Connection: close explicitly\n data = \"Don't keep me alive\"\n s = tobytes(\n \"GET / HTTP/1.1n\"\n \"Connection: closen\"\n \"Content-Length: %dn\"\n \"n\"\n \"%s\" % (len(data), data)\n )\n self.connect()\n self.sock.send(s)\n response = httplib.HTTPResponse(self.sock)\n response.begin()\n self.assertEqual(int(response.status), 200)\n self.assertEqual(response.getheader(\"connection\"), \"close\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::tobytes\nwaitress/tests/test_functional.py::int\nwaitress/tests/test_functional.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+Pylons--waitress+CVE-2019-16785+clean.pkl", "func_name_": "test_keepalive_http11_connclose"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def common_filters(self, allow_show_archived=False, return_all_languages=False):\n if not allow_show_archived:\n archived_books = (\n ub.session.query(ub.ArchivedBook)\n .filter(ub.ArchivedBook.user_id == int(current_user.id))\n .filter(ub.ArchivedBook.is_archived == True)\n .all()\n )\n archived_book_ids = [archived_book.book_id for archived_book in archived_books]\n archived_filter = Books.id.notin_(archived_book_ids)\n else:\n archived_filter = true()\n\n if current_user.filter_language() == \"all\" or return_all_languages:\n lang_filter = true()\n else:\n lang_filter = Books.languages.any(Languages.lang_code == current_user.filter_language())\n negtags_list = current_user.list_denied_tags()\n postags_list = current_user.list_allowed_tags()\n neg_content_tags_filter = false() if negtags_list == [''] else Books.tags.any(Tags.name.in_(negtags_list))\n pos_content_tags_filter = true() if postags_list == [''] else Books.tags.any(Tags.name.in_(postags_list))\n if self.config.config_restricted_column:\n try:\n pos_cc_list = current_user.allowed_column_value.split(',')\n pos_content_cc_filter = true() if pos_cc_list == [''] else \\\n getattr(Books, 'custom_column_' + str(self.config.config_restricted_column)). \\\n any(cc_classes[self.config.config_restricted_column].value.in_(pos_cc_list))\n neg_cc_list = current_user.denied_column_value.split(',')\n neg_content_cc_filter = false() if neg_cc_list == [''] else \\\n getattr(Books, 'custom_column_' + str(self.config.config_restricted_column)). \\\n any(cc_classes[self.config.config_restricted_column].value.in_(neg_cc_list))\n except (KeyError, AttributeError):\n pos_content_cc_filter = false()\n neg_content_cc_filter = true()\n log.error(u\"Custom Column No.%d is not existing in calibre database\",\n self.config.config_restricted_column)\n flash(_(\"Custom Column No.%(column)d is not existing in calibre database\",\n column=self.config.config_restricted_column),\n category=\"error\")\n\n else:\n pos_content_cc_filter = true()\n neg_content_cc_filter = false()\n return and_(lang_filter, pos_content_tags_filter, ~neg_content_tags_filter,\n pos_content_cc_filter, ~neg_content_cc_filter, archived_filter) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cps/db.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n cps/db.py::false\ncps/db.py::str\ncps/db.py::flash\ncps/db.py::getattr\ncps/db.py::and_\ncps/db.py::true\ncps/db.py::_\ncps/db.py::int \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+janeczku--calibre-web+CVE-2022-0939+vul.pkl", "func_name_": "common_filters"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _transition_stage():\n request_message = _get_request_message(\n TransitionModelVersionStage(),\n schema={\n \"name\": [_assert_string, _assert_required],\n \"version\": [_assert_string, _assert_required],\n \"stage\": [_assert_string, _assert_required],\n \"archive_existing_versions\": [_assert_bool],\n },\n )\n model_version = _get_model_registry_store().transition_model_version_stage(\n name=request_message.name,\n version=request_message.version,\n stage=request_message.stage,\n archive_existing_versions=request_message.archive_existing_versions,\n )\n return _wrap_response(\n TransitionModelVersionStage.Response(model_version=model_version.to_proto())\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/server/handlers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+mlflow--mlflow+CVE-2023-6976+clean.pkl", "func_name_": "_transition_stage"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def prepare(self):\n self.finish('done') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tornado/test/web_test.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "49+train+tornadoweb--tornado+CVE-2014-9720+clean.pkl", "func_name_": "prepare"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_missing_template_exception(edit_config_file, remove_template, psiturk_test_client):\n remove_template('closepopup.html')\n with pytest.raises(RuntimeError):\n app = psiturk_test_client() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_psiturk.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_psiturk.py::psiturk_test_client\ntests/test_psiturk.py::remove_template \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+NYUCCL--psiTurk+CVE-2021-4315+clean.pkl", "func_name_": "test_missing_template_exception"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_address_validation_rules(user_api_client):\n query = GET_ADDRESS_VALIDATION_RULES_QUERY\n variables = {\"country_code\": \"PL\", \"country_area\": None, \"city_area\": None}\n response = user_api_client.post_graphql(query, variables)\n content = get_graphql_content(response)\n data = content[\"data\"][\"addressValidationRules\"]\n assert data[\"countryCode\"] == \"PL\"\n assert data[\"countryName\"] == \"POLAND\"\n assert data[\"addressFormat\"] is not None\n assert data[\"addressLatinFormat\"] is not None\n assert data[\"cityType\"] == \"city\"\n assert data[\"cityAreaType\"] == \"suburb\"\n matcher = data[\"postalCodeMatchers\"][0]\n matcher = re.compile(matcher)\n assert matcher.match(\"00-123\")\n assert not data[\"cityAreaChoices\"]\n assert not data[\"cityChoices\"]\n assert not data[\"countryAreaChoices\"]\n assert data[\"postalCodeExamples\"]\n assert data[\"postalCodeType\"] == \"postal\"\n assert set(data[\"allowedFields\"]) == {\n \"companyName\",\n \"city\",\n \"postalCode\",\n \"streetAddress1\",\n \"name\",\n \"streetAddress2\",\n }\n assert set(data[\"requiredFields\"]) == {\"postalCode\", \"streetAddress1\", \"city\"}\n assert set(data[\"upperFields\"]) == {\"city\"} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::set\nsaleor/graphql/account/tests/test_account.py::get_graphql_content \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "54+train+saleor--saleor+CVE-2023-26051+clean.pkl", "func_name_": "test_address_validation_rules"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def fetch_call_return(self, node):\n return None \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/builtins/functions.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "105+train+vyperlang--vyper+CVE-2023-37902+clean.pkl", "func_name_": "fetch_call_return"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def exchange_third_party_invite(\n self, sender_user_id: str, target_user_id: str, room_id: str, signed: Dict\n ):\n ret = await self.handler.exchange_third_party_invite(\n sender_user_id, target_user_id, room_id, signed\n )\n return ret \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/federation_server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "128+train+matrix-org--synapse+CVE-2020-26257+clean.pkl", "func_name_": "exchange_third_party_invite"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_received_control_line_finished_garbage_in_input(self):\n buf = DummyBuffer()\n inst = self._makeOne(buf)\n result = inst.received(b\"garbage\\n\")\n self.assertEqual(result, 8)\n self.assertTrue(inst.error) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_receiver.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_receiver.py::DummyBuffer \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "95+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_received_control_line_finished_garbage_in_input"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def create_session_defaults():\n \"\"\"\n Create user session defaults and assign default values to them.\n \"\"\"\n\n # Set session defaults for templates filter\n if \"templates_per_page\" not in session:\n session[\"templates_per_page\"] = 10\n if \"templates_filter\" not in session:\n session[\"templates_filter\"] = {key: \"any\" for key in [\"application\", \"backend\"]}\n\n # Set session defaults for jobs filter\n if \"jobs_per_page\" not in session:\n session[\"jobs_per_page\"] = 10\n if \"jobs_filter\" not in session:\n session[\"jobs_filter\"] = {key: \"any\" for key in [\"status\", \"application\", \"backend\"]}\n\n # Set session defaults for subjobs filter\n if \"subjobs_per_page\" not in session:\n session[\"subjobs_per_page\"] = 10\n if \"subjobs_filter\" not in session:\n session[\"subjobs_filter\"] = {key: \"any\" for key in [\"status\", \"application\", \"backend\"]} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: ganga/GangaGUI/gui/routes.py.\n//This function is called by other functions within the repository:\n ganga/GangaGUI/gui/routes.py::initial_run \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "28+train+ganga-devs--ganga+CVE-2022-31507+clean.pkl", "func_name_": "create_session_defaults"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _validate_source(source: str, run_id: str) -> None:\n if not is_local_uri(source):\n return\n\n if run_id:\n store = _get_tracking_store()\n run = store.get_run(run_id)\n source = pathlib.Path(local_file_uri_to_path(source)).resolve()\n run_artifact_dir = pathlib.Path(local_file_uri_to_path(run.info.artifact_uri)).resolve()\n if run_artifact_dir in [source, *source.parents]:\n return\n\n raise MlflowException(\n f\"Invalid source: '{source}'. To use a local path as source, the run_id request parameter \"\n \"has to be specified and the local path has to be contained within the artifact directory \"\n \"of the run specified by the run_id.\",\n INVALID_PARAMETER_VALUE,\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/server/handlers.py.\n//This function is called by other functions within the repository:\n mlflow/server/handlers.py::_create_model_version \n//This function itself calls other functions within the repository:\n mlflow/server/handlers.py::is_local_uri\nmlflow/server/handlers.py::MlflowException\nmlflow/server/handlers.py::local_file_uri_to_path\nmlflow/server/handlers.py::_get_tracking_store \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+mlflow--mlflow+CVE-2023-2780+vul.pkl", "func_name_": "_validate_source"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_response(self, url, auth=None, http_method=\"get\", **kwargs):\n if is_private_address(url) and settings.ENFORCE_PRIVATE_ADDRESS_BLOCK:\n raise Exception(\"Can't query private addresses.\")\n\n # Get authentication values if not given\n if auth is None:\n auth = self.get_auth()\n\n # Then call requests to get the response from the given endpoint\n # URL optionally, with the additional requests parameters.\n error = None\n response = None\n try:\n response = requests_session.request(http_method, url, auth=auth, **kwargs)\n # Raise a requests HTTP exception with the appropriate reason\n # for 4xx and 5xx response status codes which is later caught\n # and passed back.\n response.raise_for_status()\n\n # Any other responses (e.g. 2xx and 3xx):\n if response.status_code != 200:\n error = \"{} ({}).\".format(self.response_error, response.status_code)\n\n except requests.HTTPError as exc:\n logger.exception(exc)\n error = \"Failed to execute query. \" \"Return Code: {} Reason: {}\".format(\n response.status_code, response.text\n )\n except requests.RequestException as exc:\n # Catch all other requests exceptions and return the error.\n logger.exception(exc)\n error = str(exc)\n\n # Return response and error.\n return response, error \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: redash/query_runner/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n redash/query_runner/__init__.py::is_private_address\nredash/query_runner/__init__.py::Exception\nredash/query_runner/__init__.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+getredash--redash+CVE-2021-43780+vul.pkl", "func_name_": "get_response"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n const matrix = node.getScreenCTM();\n if (res && matrix) {\n const [x, y, content] = res;\n const t = tooltip();\n t.style.opacity = \"1\";\n t.innerHTML = content;\n t.style.left = `${window.scrollX + x + matrix.e}px`;\n t.style.top = `${window.scrollY + y + matrix.f - 15}px`;\n } else {\n hide();\n }\n }\n node.addEventListener(\"mousemove\", mousemove);\n node.addEventListener(\"mouseleave\", hide);\n\n return {\n destroy: hide,\n };\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: frontend/src/charts/tooltip.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "9+train+beancount--fava+CVE-2022-2589+vul.pkl", "func_name_": "node.getScreenCTM"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __call__(self, decorated_obj: Any) -> Any:\n if isinstance(decorated_obj, type):\n if not issubclass(decorated_obj, Endpoint):\n raise ValueError(\"`@EndpointSiloLimit` can decorate only Endpoint subclasses\")\n return self.modify_endpoint_class(decorated_obj)\n\n if callable(decorated_obj):\n return self.modify_endpoint_method(decorated_obj)\n\n raise TypeError(\"`@EndpointSiloLimit` must decorate a class or method\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/sentry/api/base.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/sentry/api/base.py::callable\nsrc/sentry/api/base.py::TypeError\nsrc/sentry/api/base.py::ValueError\nsrc/sentry/api/base.py::isinstance\nsrc/sentry/api/base.py::issubclass \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+getsentry--sentry+CVE-2023-36829+clean.pkl", "func_name_": "__call__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_patch_bot_events_register_stream_allowed(self) -> None:\n self.login(\"hamlet\")\n user_profile = self.example_user(\"hamlet\")\n stream = self.subscribe(user_profile, \"Denmark\")\n do_change_stream_permission(stream, invite_only=True, acting_user=user_profile)\n\n bot_info = {\n \"full_name\": \"The Bot of Hamlet\",\n \"short_name\": \"hambot\",\n }\n result = self.client_post(\"/json/bots\", bot_info)\n self.assert_json_success(result)\n bot_info = {\n \"default_events_register_stream\": \"Denmark\",\n }\n email = \"hambot-bot@zulip.testserver\"\n result = self.client_patch(f\"/json/bots/{self.get_bot_user(email).id}\", bot_info)\n response_dict = self.assert_json_success(result)\n\n self.assertEqual(\"Denmark\", response_dict[\"default_events_register_stream\"])\n\n bot = self.get_bot()\n self.assertEqual(\"Denmark\", bot[\"default_events_register_stream\"]) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: zerver/tests/test_bots.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n zerver/tests/test_bots.py::do_change_stream_permission \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "23+train+zulip--zulip+CVE-2022-31168+clean.pkl", "func_name_": "test_patch_bot_events_register_stream_allowed"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __str__(self):\n return self.label \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/extras/models/customfields.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+nautobot--nautobot+CVE-2023-48705+clean.pkl", "func_name_": "__str__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def generate():\r\n yield \"\"\r\n yield '
Executing: {}
'.format(\"/\".join(commands))\r\n yield \"\"\r \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: archivy/click_web/resources/cmd_exec.py.\n//This function is called by other functions within the repository:\n archivy/click_web/resources/cmd_exec.py::_create_cmd_header \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "55+train+archivy--archivy+CVE-2021-4162+clean.pkl", "func_name_": "generate"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_deleting_nonexisting_folder_fails(test_app, client: FlaskClient):\n resp = client.post(\"/folders/delete\", data={\"dir_name\": \"testing\"})\n assert resp.status_code == 404 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/functional/test_routes.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "48+train+archivy--archivy+CVE-2021-4162+clean.pkl", "func_name_": "test_deleting_nonexisting_folder_fails"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_create_address_mutation_the_oldest_address_is_deleted(\n staff_api_client,\n customer_user,\n address,\n permission_manage_users,\n graphql_address_data,\n):\n # given\n same_address = Address.objects.create(**address.as_data())\n customer_user.addresses.set([address, same_address])\n\n user_addresses_count = customer_user.addresses.count()\n graphql_address_data[\"city\"] = \"Dummy\"\n query = ADDRESS_CREATE_MUTATION\n user_id = graphene.Node.to_global_id(\"User\", customer_user.id)\n variables = {\"user\": user_id, \"address\": graphql_address_data}\n\n # when\n response = staff_api_client.post_graphql(\n query, variables, permissions=[permission_manage_users]\n )\n content = get_graphql_content(response)\n\n # then\n assert content[\"data\"][\"addressCreate\"][\"errors\"] == []\n data = content[\"data\"][\"addressCreate\"]\n assert data[\"address\"][\"city\"] == \"DUMMY\"\n assert data[\"address\"][\"country\"][\"code\"] == \"PL\"\n address_obj = Address.objects.get(city=\"DUMMY\")\n assert address_obj.user_addresses.first() == customer_user\n assert data[\"user\"][\"id\"] == user_id\n\n customer_user.refresh_from_db()\n assert customer_user.addresses.count() == user_addresses_count\n\n with pytest.raises(address._meta.model.DoesNotExist):\n address.refresh_from_db() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/account/tests/test_account.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/account/tests/test_account.py::override_settings\nsaleor/graphql/account/tests/test_account.py::get_graphql_content \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "95+train+saleor--saleor+CVE-2023-26051+clean.pkl", "func_name_": "test_create_address_mutation_the_oldest_address_is_deleted"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def on_POST(self, origin, content, query, group_id, role_id):\n requester_user_id = parse_string_from_args(query, \"requester_user_id\")\n if get_domain_from_id(requester_user_id) != origin:\n raise SynapseError(403, \"requester_user_id doesn't match origin\")\n\n if role_id == \"\":\n raise SynapseError(400, \"role_id cannot be empty string\")\n\n resp = await self.handler.update_group_role(\n group_id, requester_user_id, role_id, content\n )\n\n return 200, resp \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/federation/transport/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "153+train+matrix-org--synapse+CVE-2020-26257+clean.pkl", "func_name_": "on_POST"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def fullname(self):\n return os.path.splitext(os.path.basename(self.modulename))[0] + '.' + self.testcasename \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/gevent/testing/testcase.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "128+train+gevent--gevent+CVE-2023-41419+clean.pkl", "func_name_": "fullname"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_register_connector_template_wrong_scope(\n self,\n api_client: TestClient,\n register_connector_template_url,\n generate_auth_header,\n complete_connector_template,\n ):\n CONFIG.security.allow_custom_connector_functions = True\n auth_header = generate_auth_header(scopes=[CLIENT_READ])\n response = api_client.post(\n register_connector_template_url,\n headers=auth_header,\n files={\n \"file\": (\n \"template.zip\",\n complete_connector_template,\n \"application/zip\",\n )\n },\n )\n assert response.status_code == 403 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/ops/api/v1/endpoints/test_saas_config_endpoints.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/ops/api/v1/endpoints/test_saas_config_endpoints.py::generate_auth_header \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "16+train+ethyca--fides+CVE-2023-41319+vul.pkl", "func_name_": "test_register_connector_template_wrong_scope"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def is_integer(self, col_name: str) -> bool:\n try:\n return _is_sqla_type(self.list_columns[col_name].type, sa_types.Integer)\n except KeyError:\n return False \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: flask_appbuilder/models/sqla/interface.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n flask_appbuilder/models/sqla/interface.py::_is_sqla_type \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "76+train+dpgaspar--Flask-AppBuilder+CVE-2023-34110+clean.pkl", "func_name_": "is_integer"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def ui_run_terminal(self, command):\n \"\"\"Run command in a terminal window.\n\n Run given command in a terminal window; raise an\n exception if terminal cannot be opened.\n \"\"\"\n raise NotImplementedError(\n \"this function must be overridden by subclasses\"\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: apport/ui.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n apport/ui.py::NotImplementedError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "139+train+canonical--apport+CVE-2023-1326+clean.pkl", "func_name_": "ui_run_terminal"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_process_request(self, rf):\n uploaded_file = SimpleUploadedFile(\"uploaded_file.txt\", b\"uploaded\")\n request = rf.post(\"/\", data={\"file\": uploaded_file})\n S3FileMiddleware(lambda x: None)(request)\n assert request.FILES.getlist(\"file\")\n assert request.FILES.get(\"file\").read() == b\"uploaded\"\n\n storage.save(\"tmp/s3file/s3_file.txt\", ContentFile(b\"s3file\"))\n request = rf.post(\n \"/\",\n data={\n \"file\": \"custom/location/tmp/s3file/s3_file.txt\",\n \"s3file\": \"file\",\n },\n )\n S3FileMiddleware(lambda x: None)(request)\n assert request.FILES.getlist(\"file\")\n assert request.FILES.get(\"file\").read() == b\"s3file\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_middleware.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_middleware.py::SimpleUploadedFile\ntests/test_middleware.py::S3FileMiddleware\ntests/test_middleware.py::ContentFile \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "17+train+codingjoe--django-s3file+CVE-2022-24840+vul.pkl", "func_name_": "test_process_request"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def process_response(self, request, response, spider):\n if (\n request.meta.get('dont_redirect', False)\n or response.status in getattr(spider, 'handle_httpstatus_list', [])\n or response.status in request.meta.get('handle_httpstatus_list', [])\n or request.meta.get('handle_httpstatus_all', False)\n ):\n return response\n\n allowed_status = (301, 302, 303, 307, 308)\n if 'Location' not in response.headers or response.status not in allowed_status:\n return response\n\n location = safe_url_string(response.headers['Location'])\n if response.headers['Location'].startswith(b'//'):\n request_scheme = urlparse(request.url).scheme\n location = request_scheme + '://' + location.lstrip('/')\n\n redirected_url = urljoin(request.url, location)\n\n if response.status in (301, 307, 308) or request.method == 'HEAD':\n redirected = request.replace(url=redirected_url)\n return self._redirect(redirected, request, spider, response.status)\n\n redirected = self._redirect_request_using_get(request, redirected_url)\n return self._redirect(redirected, request, spider, response.status) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: scrapy/downloadermiddlewares/redirect.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n scrapy/downloadermiddlewares/redirect.py::isinstance\nscrapy/downloadermiddlewares/redirect.py::get_meta_refresh \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+scrapy--scrapy+CVE-2022-0577+vul.pkl", "func_name_": "process_response"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_math_in_utility_builtins():\n from RestrictedPython.Utilities import utility_builtins\n assert utility_builtins['math'] is math \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/builtins/test_utilities.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+zopefoundation--RestrictedPython+CVE-2023-41039+clean.pkl", "func_name_": "test_math_in_utility_builtins"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def generate_tmp_dfs_path(dfs_tmp):\n return posixpath.join(dfs_tmp, str(uuid.uuid4())) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/utils/uri.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n mlflow/utils/uri.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+mlflow--mlflow+CVE-2023-2780+clean.pkl", "func_name_": "generate_tmp_dfs_path"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_graphql_execution_exception(monkeypatch, api_client):\n def mocked_execute(*args, **kwargs):\n raise IOError(\"Spanish inquisition\")\n\n monkeypatch.setattr(\"graphql.backend.core.execute_and_validate\", mocked_execute)\n response = api_client.post_graphql(\"{ shop { name }}\")\n assert response.status_code == 400\n content = get_graphql_content_from_response(response)\n assert content[\"errors\"][0][\"message\"] == \"Spanish inquisition\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: saleor/graphql/core/tests/test_view.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n saleor/graphql/core/tests/test_view.py::get_graphql_content_from_response \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+saleor--saleor+CVE-2023-26051+vul.pkl", "func_name_": "test_graphql_execution_exception"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def handleMatch(m):\n s = m.group(1)\n if s.startswith('0x'):\n i = int(s, 16)\n elif s.startswith('0') and '.' not in s:\n try:\n i = int(s, 8)\n except ValueError:\n i = int(s)\n else:\n i = float(s)\n x = complex(i)\n if x.imag == 0:\n x = x.real\n # Need to use string-formatting here instead of str() because\n # use of str() on large numbers loses information:\n # str(float(33333333333333)) => '3.33333333333e+13'\n # float('3.33333333333e+13') => 33333333333300.0\n return '%.16f' % x\n return str(x) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/Math/plugin.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+progval--Limnoria+CVE-2019-19010+vul.pkl", "func_name_": "calc.handleMatch"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def main() -> None:\n try:\n run(sys.argv)\n except KeyboardInterrupt:\n pass\n except (OSError, TypeError, ValueError) as e:\n print(f\"Error: {e}\", file=sys.stderr) # noqa: T201\n sys.exit(1) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: remarshal.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n remarshal.py::run\nremarshal.py::print \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+remarshal-project--remarshal+CVE-2023-47163+vul.pkl", "func_name_": "main"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_invalid_subscript_assignment(self):\n a = self.d\n def assign(x, i, v):\n x[i] = v\n self.assertRaises(TypeError, assign, a, 0, 42) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "63+train+numpy--numpy+CVE-2014-1858+clean.pkl", "func_name_": "test_invalid_subscript_assignment"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i dict:\n \"\"\"Gets the media info associated with the remote file, downloading\n if necessary.\n\n Args:\n server_name: Remote server_name where the media originated.\n media_id: The media ID of the content (as defined by the remote server).\n\n Returns:\n The media info of the file\n \"\"\"\n if (\n self.federation_domain_whitelist is not None\n and server_name not in self.federation_domain_whitelist\n ):\n raise FederationDeniedError(server_name)\n\n # We linearize here to ensure that we don't try and download remote\n # media multiple times concurrently\n key = (server_name, media_id)\n with (await self.remote_media_linearizer.queue(key)):\n responder, media_info = await self._get_remote_media_impl(\n server_name, media_id\n )\n\n # Ensure we actually use the responder so that it releases resources\n if responder:\n with responder:\n pass\n\n return media_info \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/rest/media/v1/media_repository.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "620+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_remote_media_info"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def http_paos(message, extra=None):\n return {\"headers\": [(\"Content-type\", \"application/soap+xml\")],\n \"data\": make_soap_enveloped_saml_thingy(message, extra)} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/saml2/pack.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/saml2/pack.py::make_soap_enveloped_saml_thingy \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "32+train+IdentityPython--pysaml2+CVE-2016-10127+clean.pkl", "func_name_": "http_paos"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_keepalive_http11_connclose(self):\n # specifying Connection: close explicitly\n data = \"Don't keep me alive\"\n s = tobytes(\n \"GET / HTTP/1.1\\n\"\n \"Connection: close\\n\"\n \"Content-Length: %d\\n\"\n \"\\n\"\n \"%s\" % (len(data), data)\n )\n self.connect()\n self.sock.send(s)\n response = httplib.HTTPResponse(self.sock)\n response.begin()\n self.assertEqual(int(response.status), 200)\n self.assertEqual(response.getheader(\"connection\"), \"close\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_functional.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_functional.py::tobytes\nwaitress/tests/test_functional.py::int\nwaitress/tests/test_functional.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "41+train+Pylons--waitress+CVE-2019-16785+vul.pkl", "func_name_": "test_keepalive_http11_connclose"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def verify_device(self, device):\n # type: (OlmDevice) -> bool\n return self.store.verify_device(device) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nio/crypto/olm_machine.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "55+train+poljar--matrix-nio+CVE-2022-39254+clean.pkl", "func_name_": "verify_device"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_empty_subscript(self):\n a, b = self.d\n self.assertEqual(a[()], 0)\n self.assertEqual(b[()], 'x')\n self.assertTrue(type(a[()]) is a.dtype.type)\n self.assertTrue(type(b[()]) is str) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "79+train+numpy--numpy+CVE-2014-1858+clean.pkl", "func_name_": "test_empty_subscript"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _get_http_response_with_retries(\n method,\n url,\n max_retries,\n backoff_factor,\n backoff_jitter,\n retry_codes,\n raise_on_status=True,\n **kwargs,\n):\n \"\"\"\n Performs an HTTP request using Python's `requests` module with an automatic retry policy.\n\n :param method: a string indicating the method to use, e.g. \"GET\", \"POST\", \"PUT\".\n :param url: the target URL address for the HTTP request.\n :param max_retries: Maximum total number of retries.\n :param backoff_factor: a time factor for exponential backoff. e.g. value 5 means the HTTP\n request will be retried with interval 5, 10, 20... seconds. A value of 0 turns off the\n exponential backoff.\n :param backoff_jitter: A random jitter to add to the backoff interval.\n :param retry_codes: a list of HTTP response error codes that qualifies for retry.\n :param raise_on_status: whether to raise an exception, or return a response, if status falls\n in retry_codes range and retries have been exhausted.\n :param kwargs: Additional keyword arguments to pass to `requests.Session.request()`\n\n :return: requests.Response object.\n \"\"\"\n session = _get_request_session(\n max_retries, backoff_factor, backoff_jitter, retry_codes, raise_on_status\n )\n return session.request(method, url, **kwargs) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/utils/request_utils.py.\n//This function is called by other functions within the repository:\n mlflow/utils/request_utils.py::cloud_storage_http_request \n//This function itself calls other functions within the repository:\n mlflow/utils/request_utils.py::_get_request_session \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+mlflow--mlflow+CVE-2023-6974+vul.pkl", "func_name_": "_get_http_response_with_retries"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def on_end(self) -> None:\n message = (FormMessage.END, b\"\")\n self.messages.append(message) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: starlette/formparsers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "34+train+encode--starlette+CVE-2023-30798+clean.pkl", "func_name_": "on_end"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def to_anchor(self, name):\n self._widget.page().mainFrame().scrollToAnchor(name) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: qutebrowser/browser/webkit/webkittab.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "233+train+qutebrowser--qutebrowser+CVE-2020-11054+clean.pkl", "func_name_": "to_anchor"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def get_resolved_ref_url(self):\n if not hasattr(self, 'resolved_ref_url'):\n await self.get_resolved_ref()\n return self.resolved_ref_url \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: binderhub/repoproviders.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "33+train+jupyterhub--binderhub+CVE-2021-39159+clean.pkl", "func_name_": "get_resolved_ref_url"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s3&&e<21?\"\u03bf\u03c2\":[\"\u03bf\u03c2\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"\u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c0\u03cc \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc \u03c0\u03c1\u03b9\u03bd\",minuteAgo:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc \u03c0\u03c1\u03b9\u03bd\",minutesAgo:\"{delta} \u03bb\u03b5\u03c0\u03c4\u03ac \u03c0\u03c1\u03b9\u03bd\",hourAgo:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 \u03bc\u03b9\u03b1 \u03ce\u03c1\u03b1 \u03c0\u03c1\u03b9\u03bd\",hoursAgo:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 {delta} \u03ce\u03c1\u03b5\u03c2 \u03c0\u03c1\u03b9\u03bd\",dayAgo:\"1 \u03b7\u03bc\u03ad\u03c1\u03b1 \u03c0\u03c1\u03b9\u03bd\",daysAgo:\"{delta} \u03b7\u03bc\u03ad\u03c1\u03b5\u03c2 \u03c0\u03c1\u03b9\u03bd\",weekAgo:\"1 \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b1 \u03c0\u03c1\u03b9\u03bd\",weeksAgo:\"{delta} \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b5\u03c2 \u03c0\u03c1\u03b9\u03bd\",monthAgo:\"1 \u03bc\u03ae\u03bd\u03b1 \u03c0\u03c1\u03b9\u03bd\",monthsAgo:\"{delta} \u03bc\u03ae\u03bd\u03b5\u03c2 \u03c0\u03c1\u03b9\u03bd\",yearAgo:\"1 \u03c7\u03c1\u03cc\u03bd\u03bf \u03c0\u03c1\u03b9\u03bd\",yearsAgo:\"{delta} \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1 \u03c0\u03c1\u03b9\u03bd\",lessThanMinuteUntil:\"\u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c0\u03cc \u03bb\u03b5\u03c0\u03c4\u03cc \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",minuteUntil:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",minutesUntil:\"{delta} \u03bb\u03b5\u03c0\u03c4\u03ac \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",hourUntil:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 \u03bc\u03b9\u03b1 \u03ce\u03c1\u03b1 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",hoursUntil:\"\u03c0\u03b5\u03c1\u03af\u03c0\u03bf\u03c5 {delta} \u03ce\u03c1\u03b5\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",dayUntil:\"1 \u03b7\u03bc\u03ad\u03c1\u03b1 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",daysUntil:\"{delta} \u03b7\u03bc\u03ad\u03c1\u03b5\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",weekUntil:\"1 \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b1 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",weeksUntil:\"{delta} \u03b5\u03b2\u03b4\u03bf\u03bc\u03ac\u03b4\u03b5\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",monthUntil:\"1 \u03bc\u03ae\u03bd\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",monthsUntil:\"{delta} \u03bc\u03ae\u03bd\u03b5\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",yearUntil:\"1 \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\",yearsUntil:\"{delta} \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1 \u03b1\u03c0\u03cc \u03c4\u03ce\u03c1\u03b1\"}),Locale.define(\"el-GR\",\"FormValidator\",{required:\"\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf \u03b5\u03af\u03bd\u03b1\u03b9 \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03bf.\",length:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 {length} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2 (\u03ad\u03c7\u03b5\u03c4\u03b5 \u03ae\u03b4\u03b7 \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03b9 {elLength} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2).\",minLength:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03bf\u03c5\u03bb\u03ac\u03c7\u03b9\u03c3\u03c4\u03bf\u03bd {minLength} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2 (\u03ad\u03c7\u03b5\u03c4\u03b5 \u03ae\u03b4\u03b7 \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5 {length} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2).\",maxlength:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03b5\u03ce\u03c2 {maxlength} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2 (\u03ad\u03c7\u03b5\u03c4\u03b5 \u03ae\u03b4\u03b7 \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5 {length} \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2).\",integer:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1\u03bd \u03b1\u03ba\u03ad\u03c1\u03b1\u03b9\u03bf \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf. \u039f\u03b9 \u03b1\u03c1\u03b9\u03b8\u03bc\u03bf\u03af \u03bc\u03b5 \u03b4\u03b5\u03ba\u03b1\u03b4\u03b9\u03ba\u03ac \u03c8\u03b7\u03c6\u03af\u03b1 (\u03c0.\u03c7. 1.25) \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03bf\u03bd\u03c4\u03b1\u03b9.\",numeric:'\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03cc\u03bd\u03bf \u03b1\u03c1\u03b9\u03b8\u03bc\u03b7\u03c4\u03b9\u03ba\u03ad\u03c2 \u03c4\u03b9\u03bc\u03ad\u03c2 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf (\u03c0.\u03c7.\" 1 \" \u03ae \" 1.1 \" \u03ae \" -1 \" \u03ae \" -1.1 \" ).',digits:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 \u03bc\u03cc\u03bd\u03bf \u03b1\u03c1\u03b9\u03b8\u03bc\u03bf\u03cd\u03c2 \u03ba\u03b1\u03b9 \u03c3\u03b7\u03bc\u03b5\u03af\u03b1 \u03c3\u03c4\u03af\u03be\u03b7\u03c2 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc\u03bd \u03c4\u03bf\u03bd \u03c4\u03bf\u03bc\u03ad\u03b1 (\u03c0.\u03c7. \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b7\u03bb\u03b5\u03c6\u03ce\u03bd\u03bf\u03c5 \u03bc\u03b5 \u03c0\u03b1\u03cd\u03bb\u03b5\u03c2 \u03ae \u03c4\u03b5\u03bb\u03b5\u03af\u03b5\u03c2).\",alpha:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 \u03bc\u03cc\u03bd\u03bf \u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03b1 (a-z) \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf. \u0394\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03bf\u03bd\u03c4\u03b1\u03b9 \u03ba\u03b5\u03bd\u03ac \u03ae \u03ac\u03bb\u03bb\u03bf\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2.\",alphanum:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 \u03bc\u03cc\u03bd\u03bf \u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03b1 (a-z) \u03ae \u03b1\u03c1\u03b9\u03b8\u03bc\u03bf\u03cd\u03c2 (0-9) \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc\u03bd \u03c4\u03bf\u03bd \u03c4\u03bf\u03bc\u03ad\u03b1. \u0394\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03bf\u03bd\u03c4\u03b1\u03b9 \u03ba\u03b5\u03bd\u03ac \u03ae \u03ac\u03bb\u03bb\u03bf\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2.\",dateSuchAs:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1, \u03cc\u03c0\u03c9\u03c2 {date}\",dateInFormatMDY:'\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1, \u03cc\u03c0\u03c9\u03c2 \u039c\u039c/\u0397\u0397/\u0395\u0395\u0395\u0395 (\u03c0.\u03c7. \"12/31/1999\").',email:'\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b7\u03bb\u03b5\u03ba\u03c4\u03c1\u03bf\u03bd\u03b9\u03ba\u03bf\u03cd \u03c4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b5\u03af\u03bf\u03c5 (\u03c0.\u03c7. \"fred@domain.com\").',url:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 URL \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7, \u03cc\u03c0\u03c9\u03c2 http://www.example.com\",currencyDollar:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03c0\u03bf\u03c3\u03cc \u03c3\u03b5 \u03b4\u03bf\u03bb\u03bb\u03ac\u03c1\u03b9\u03b1 (\u03c0.\u03c7. $100.00).\",oneRequired:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03ba\u03ac\u03c4\u03b9 \u03b3\u03b9\u03b1 \u03c4\u03bf\u03c5\u03bb\u03ac\u03c7\u03b9\u03c3\u03c4\u03bf\u03bd \u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc \u03b1\u03c5\u03c4\u03ac \u03c4\u03b1 \u03c0\u03b5\u03b4\u03af\u03b1.\",errorPrefix:\"\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1: \",warningPrefix:\"\u03a0\u03c1\u03bf\u03c3\u03bf\u03c7\u03ae: \",noSpace:\"\u0394\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03bf\u03bd\u03c4\u03b1\u03b9 \u03c4\u03b1 \u03ba\u03b5\u03bd\u03ac \u03c3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf.\",reqChkByNode:\"\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03b9 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03b5\u03af \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf\",requiredChk:\"\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf \u03b5\u03af\u03bd\u03b1\u03b9 \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03bf.\",reqChkByName:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5, \u03b5\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03b5\u03c4\u03b9\u03ba\u03ad\u03c4\u03b1 {label}.\",match:\"\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c4\u03b1\u03b9\u03c1\u03b9\u03ac\u03b6\u03b5\u03b9 \u03bc\u03b5 \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf {matchName}.\",startDate:\"\u03b7 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03ad\u03bd\u03b1\u03c1\u03be\u03b7\u03c2\",endDate:\"\u03b7 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03bb\u03ae\u03be\u03b7\u03c2\",currentDate:\"\u03b7 \u03c4\u03c1\u03ad\u03c7\u03bf\u03c5\u03c3\u03b1 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1\",afterDate:\"\u0397 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03af\u03b4\u03b9\u03b1 \u03ae \u03bc\u03b5\u03c4\u03ac \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd {label}.\",beforeDate:\"\u0397 \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03af\u03b4\u03b9\u03b1 \u03ae \u03c0\u03c1\u03b9\u03bd \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd {label}.\",startMonth:\"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03bc\u03ae\u03bd\u03b1 \u03b1\u03c1\u03c7\u03ae\u03c2.\",sameMonth:\"\u0391\u03c5\u03c4\u03ad\u03c2 \u03bf\u03b9 \u03b4\u03cd\u03bf \u03b7\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b5\u03c2 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c4\u03bf\u03bd \u03af\u03b4\u03b9\u03bf \u03bc\u03ae\u03bd\u03b1 - \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b1\u03bb\u03bb\u03ac\u03be\u03b5\u03c4\u03b5 \u03ae \u03c4\u03bf \u03ad\u03bd\u03b1 \u03ae \u03c4\u03bf \u03ac\u03bb\u03bb\u03bf\",creditcard:\"\u039f \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b7\u03c2 \u03c0\u03b9\u03c3\u03c4\u03c9\u03c4\u03b9\u03ba\u03ae\u03c2 \u03ba\u03ac\u03c1\u03c4\u03b1\u03c2 \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03bf\u03bd \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc \u03ba\u03b1\u03b9 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac. {length} \u03bc\u03ae\u03ba\u03bf\u03c2 \u03c8\u03b7\u03c6\u03af\u03c9\u03bd.\"}),Locale.define(\"en-GB\",\"Date\",{dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d/%m/%Y\",shortTime:\"%H:%M\"}).inherit(\"en-US\",\"Date\"),Locale.define(\"en-US\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"$ \"}}),Locale.define(\"es-ES\",\"Date\",{months:[\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\"],months_abbr:[\"ene\",\"feb\",\"mar\",\"abr\",\"may\",\"jun\",\"jul\",\"ago\",\"sep\",\"oct\",\"nov\",\"dic\"],days:[\"Domingo\",\"Lunes\",\"Martes\",\"Mi\u00e9rcoles\",\"Jueves\",\"Viernes\",\"S\u00e1bado\"],days_abbr:[\"dom\",\"lun\",\"mar\",\"mi\u00e9\",\"juv\",\"vie\",\"s\u00e1b\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d/%m/%Y\",shortTime:\"%H:%M\",AM:\"AM\",PM:\"PM\",firstDayOfWeek:1,ordinal:\"\",lessThanMinuteAgo:\"hace menos de un minuto\",minuteAgo:\"hace un minuto\",minutesAgo:\"hace {delta} minutos\",hourAgo:\"hace una hora\",hoursAgo:\"hace unas {delta} horas\",dayAgo:\"hace un d\u00eda\",daysAgo:\"hace {delta} d\u00edas\",weekAgo:\"hace una semana\",weeksAgo:\"hace unas {delta} semanas\",monthAgo:\"hace un mes\",monthsAgo:\"hace {delta} meses\",yearAgo:\"hace un a\u00f1o\",yearsAgo:\"hace {delta} a\u00f1os\",lessThanMinuteUntil:\"menos de un minuto desde ahora\",minuteUntil:\"un minuto desde ahora\",minutesUntil:\"{delta} minutos desde ahora\",hourUntil:\"una hora desde ahora\",hoursUntil:\"unas {delta} horas desde ahora\",dayUntil:\"un d\u00eda desde ahora\",daysUntil:\"{delta} d\u00edas desde ahora\",weekUntil:\"una semana desde ahora\",weeksUntil:\"unas {delta} semanas desde ahora\",monthUntil:\"un mes desde ahora\",monthsUntil:\"{delta} meses desde ahora\",yearUntil:\"un a\u00f1o desde ahora\",yearsUntil:\"{delta} a\u00f1os desde ahora\"}),Locale.define(\"es-AR\").inherit(\"es-ES\",\"Date\"),Locale.define(\"es-AR\",\"FormValidator\",{required:\"Este campo es obligatorio.\",minLength:\"Por favor ingrese al menos {minLength} caracteres (ha ingresado {length} caracteres).\",maxLength:\"Por favor no ingrese m\u00e1s de {maxLength} caracteres (ha ingresado {length} caracteres).\",integer:\"Por favor ingrese un n\u00famero entero en este campo. N\u00fameros con decimales (p.e. 1,25) no se permiten.\",numeric:'Por favor ingrese solo valores num\u00e9ricos en este campo (p.e. \"1\" o \"1,1\" o \"-1\" o \"-1,1\").',digits:\"Por favor use s\u00f3lo n\u00fameros y puntuaci\u00f3n en este campo (por ejemplo, un n\u00famero de tel\u00e9fono con guiones y/o puntos no est\u00e1 permitido).\",alpha:\"Por favor use s\u00f3lo letras (a-z) en este campo. No se permiten espacios ni otros caracteres.\",alphanum:\"Por favor, usa s\u00f3lo letras (a-z) o n\u00fameros (0-9) en este campo. No se permiten espacios u otros caracteres.\",dateSuchAs:\"Por favor ingrese una fecha v\u00e1lida como {date}\",dateInFormatMDY:'Por favor ingrese una fecha v\u00e1lida, utulizando el formato DD/MM/YYYY (p.e. \"31/12/1999\")',email:'Por favor, ingrese una direcci\u00f3n de e-mail v\u00e1lida. Por ejemplo, \"fred@dominio.com\".',url:\"Por favor ingrese una URL v\u00e1lida como http://www.example.com.\",currencyDollar:\"Por favor ingrese una cantidad v\u00e1lida de pesos. Por ejemplo $100,00 .\",oneRequired:\"Por favor ingrese algo para por lo menos una de estas entradas.\",errorPrefix:\"Error: \",warningPrefix:\"Advertencia: \",noSpace:\"No se permiten espacios en este campo.\",reqChkByNode:\"No hay elementos seleccionados.\",requiredChk:\"Este campo es obligatorio.\",reqChkByName:\"Por favor selecciona una {label}.\",match:\"Este campo necesita coincidir con el campo {matchName}\",startDate:\"la fecha de inicio\",endDate:\"la fecha de fin\",currentDate:\"la fecha actual\",afterDate:\"La fecha debe ser igual o posterior a {label}.\",beforeDate:\"La fecha debe ser igual o anterior a {label}.\",startMonth:\"Por favor selecciona un mes de origen\",sameMonth:\"Estas dos fechas deben estar en el mismo mes - debes cambiar una u otra.\"}),Locale.define(\"es-AR\",\"Number\",{decimal:\",\",group:\".\",currency:{decimals:2,prefix:\"$ \"}}),Locale.define(\"es-ES\",\"FormValidator\",{required:\"Este campo es obligatorio.\",minLength:\"Por favor introduce al menos {minLength} caracteres (has introducido {length} caracteres).\",maxLength:\"Por favor introduce no más de {maxLength} caracteres (has introducido {length} caracteres).\",integer:\"Por favor introduce un número entero en este campo. Números con decimales (p.e. 1,25) no se permiten.\",numeric:'Por favor introduce solo valores numéricos en este campo (p.e. \"1\" o \"1,1\" o \"-1\" o \"-1,1\").',digits:\"Por favor usa solo números y puntuación en este campo (por ejemplo, un número de teléfono con guiones y puntos no esta permitido).\",alpha:\"Por favor usa letras solo (a-z) en este campo. No se admiten espacios ni otros caracteres.\",alphanum:\"Por favor, usa solo letras (a-z) o números (0-9) en este campo. No se admiten espacios ni otros caracteres.\",dateSuchAs:\"Por favor introduce una fecha válida como {date}\",dateInFormatMDY:'Por favor introduce una fecha válida como DD/MM/YYYY (p.e. \"31/12/1999\")',email:'Por favor, introduce una dirección de email válida. Por ejemplo, \"fred@domain.com\".',url:\"Por favor introduce una URL válida como http://www.example.com.\",currencyDollar:\"Por favor introduce una cantidad válida de \u20ac. Por ejemplo \u20ac100,00 .\",oneRequired:\"Por favor introduce algo para por lo menos una de estas entradas.\",errorPrefix:\"Error: \",warningPrefix:\"Aviso: \",noSpace:\"No pueden haber espacios en esta entrada.\",reqChkByNode:\"No hay elementos seleccionados.\",requiredChk:\"Este campo es obligatorio.\",reqChkByName:\"Por favor selecciona una {label}.\",match:\"Este campo necesita coincidir con el campo {matchName}\",startDate:\"la fecha de inicio\",endDate:\"la fecha de fin\",currentDate:\"la fecha actual\",afterDate:\"La fecha debe ser igual o posterior a {label}.\",beforeDate:\"La fecha debe ser igual o anterior a {label}.\",startMonth:\"Por favor selecciona un mes de origen\",sameMonth:\"Estas dos fechas deben estar en el mismo mes - debes cambiar una u otra.\"}),Locale.define(\"es-VE\").inherit(\"es-ES\",\"Date\"),Locale.define(\"es-VE\",\"FormValidator\",{digits:\"Por favor usa solo números y puntuación en este campo. Por ejemplo, un número de teléfono con guiones y puntos no esta permitido.\",alpha:\"Por favor usa solo letras (a-z) en este campo. No se admiten espacios ni otros caracteres.\",currencyDollar:\"Por favor introduce una cantidad válida de Bs. Por ejemplo Bs. 100,00 .\",oneRequired:\"Por favor introduce un valor para por lo menos una de estas entradas.\",startDate:\"La fecha de inicio\",endDate:\"La fecha de fin\",currentDate:\"La fecha actual\"}).inherit(\"es-ES\",\"FormValidator\"),Locale.define(\"es-VE\",\"Number\",{decimal:\",\",group:\".\",negative:{prefix:\"-\"},currency:{decimals:2,prefix:\"Bs. \"},percentage:{decimals:2,suffix:\"%\"}}),Locale.define(\"et-EE\",\"Date\",{months:[\"jaanuar\",\"veebruar\",\"m\u00e4rts\",\"aprill\",\"mai\",\"juuni\",\"juuli\",\"august\",\"september\",\"oktoober\",\"november\",\"detsember\"],months_abbr:[\"jaan\",\"veebr\",\"m\u00e4rts\",\"apr\",\"mai\",\"juuni\",\"juuli\",\"aug\",\"sept\",\"okt\",\"nov\",\"dets\"],days:[\"p\u00fchap\u00e4ev\",\"esmasp\u00e4ev\",\"teisip\u00e4ev\",\"kolmap\u00e4ev\",\"neljap\u00e4ev\",\"reede\",\"laup\u00e4ev\"],days_abbr:[\"p\u00fchap\",\"esmasp\",\"teisip\",\"kolmap\",\"neljap\",\"reede\",\"laup\"],dateOrder:[\"month\",\"date\",\"year\"],shortDate:\"%m.%d.%Y\",shortTime:\"%H:%M\",AM:\"AM\",PM:\"PM\",firstDayOfWeek:1,ordinal:\"\",lessThanMinuteAgo:\"v\u00e4hem kui minut aega tagasi\",minuteAgo:\"umbes minut aega tagasi\",minutesAgo:\"{delta} minutit tagasi\",hourAgo:\"umbes tund aega tagasi\",hoursAgo:\"umbes {delta} tundi tagasi\",dayAgo:\"1 p\u00e4ev tagasi\",daysAgo:\"{delta} p\u00e4eva tagasi\",weekAgo:\"1 n\u00e4dal tagasi\",weeksAgo:\"{delta} n\u00e4dalat tagasi\",monthAgo:\"1 kuu tagasi\",monthsAgo:\"{delta} kuud tagasi\",yearAgo:\"1 aasta tagasi\",yearsAgo:\"{delta} aastat tagasi\",lessThanMinuteUntil:\"v\u00e4hem kui minuti aja p\u00e4rast\",minuteUntil:\"umbes minuti aja p\u00e4rast\",minutesUntil:\"{delta} minuti p\u00e4rast\",hourUntil:\"umbes tunni aja p\u00e4rast\",hoursUntil:\"umbes {delta} tunni p\u00e4rast\",dayUntil:\"1 p\u00e4eva p\u00e4rast\",daysUntil:\"{delta} p\u00e4eva p\u00e4rast\",weekUntil:\"1 n\u00e4dala p\u00e4rast\",weeksUntil:\"{delta} n\u00e4dala p\u00e4rast\",monthUntil:\"1 kuu p\u00e4rast\",monthsUntil:\"{delta} kuu p\u00e4rast\",yearUntil:\"1 aasta p\u00e4rast\",yearsUntil:\"{delta} aasta p\u00e4rast\"}),Locale.define(\"et-EE\",\"FormValidator\",{required:\"V\u00e4li peab olema t\u00e4idetud.\",minLength:\"Palun sisestage v\u00e4hemalt {minLength} t\u00e4hte (te sisestasite {length} t\u00e4hte).\",maxLength:\"Palun \u00e4rge sisestage rohkem kui {maxLength} t\u00e4hte (te sisestasite {length} t\u00e4hte).\",integer:\"Palun sisestage v\u00e4ljale t\u00e4isarv. K\u00fcmnendarvud (n\u00e4iteks 1.25) ei ole lubatud.\",numeric:'Palun sisestage ainult numbreid v\u00e4ljale (n\u00e4iteks \"1\", \"1.1\", \"-1\" v\u00f5i \"-1.1\").',digits:\"Palun kasutage ainult numbreid ja kirjavahem\u00e4rke (telefoninumbri sisestamisel on lubatud kasutada kriipse ja punkte).\",alpha:\"Palun kasutage ainult t\u00e4hti (a-z). T\u00fchikud ja teised s\u00fcmbolid on keelatud.\",alphanum:\"Palun kasutage ainult t\u00e4hti (a-z) v\u00f5i numbreid (0-9). T\u00fchikud ja teised s\u00fcmbolid on keelatud.\",dateSuchAs:\"Palun sisestage kehtiv kuup\u00e4ev kujul {date}\",dateInFormatMDY:'Palun sisestage kehtiv kuup\u00e4ev kujul MM.DD.YYYY (n\u00e4iteks: \"12.31.1999\").',email:'Palun sisestage kehtiv e-maili aadress (n\u00e4iteks: \"fred@domain.com\").',url:\"Palun sisestage kehtiv URL (n\u00e4iteks: http://www.example.com).\",currencyDollar:\"Palun sisestage kehtiv $ summa (n\u00e4iteks: $100.00).\",oneRequired:\"Palun sisestage midagi v\u00e4hemalt \u00fchele antud v\u00e4ljadest.\",errorPrefix:\"Viga: \",warningPrefix:\"Hoiatus: \",noSpace:\"V\u00e4li ei tohi sisaldada t\u00fchikuid.\",reqChkByNode:\"\u00dckski v\u00e4ljadest pole valitud.\",requiredChk:\"V\u00e4lja t\u00e4itmine on vajalik.\",reqChkByName:\"Palun valige \u00fcks {label}.\",match:\"V\u00e4li peab sobima {matchName} v\u00e4ljaga\",startDate:\"algkuup\u00e4ev\",endDate:\"l\u00f5ppkuup\u00e4ev\",currentDate:\"praegune kuup\u00e4ev\",afterDate:\"Kuup\u00e4ev peab olema v\u00f5rdne v\u00f5i p\u00e4rast {label}.\",beforeDate:\"Kuup\u00e4ev peab olema v\u00f5rdne v\u00f5i enne {label}.\",startMonth:\"Palun valige algkuup\u00e4ev.\",sameMonth:\"Antud kaks kuup\u00e4eva peavad olema samas kuus - peate muutma \u00fchte kuup\u00e4eva.\"}),Locale.define(\"fa\",\"Date\",{months:[\"\u0698\u0627\u0646\u0648\u06cc\u0647\",\"\u0641\u0648\u0631\u06cc\u0647\",\"\u0645\u0627\u0631\u0633\",\"\u0622\u067e\u0631\u06cc\u0644\",\"\u0645\u0647\",\"\u0698\u0648\u0626\u0646\",\"\u0698\u0648\u0626\u06cc\u0647\",\"\u0622\u06af\u0648\u0633\u062a\",\"\u0633\u067e\u062a\u0627\u0645\u0628\u0631\",\"\u0627\u06a9\u062a\u0628\u0631\",\"\u0646\u0648\u0627\u0645\u0628\u0631\",\"\u062f\u0633\u0627\u0645\u0628\u0631\"],months_abbr:[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\"],days:[\"\u06cc\u06a9\u0634\u0646\u0628\u0647\",\"\u062f\u0648\u0634\u0646\u0628\u0647\",\"\u0633\u0647 \u0634\u0646\u0628\u0647\",\"\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647\",\"\u067e\u0646\u062c\u0634\u0646\u0628\u0647\",\"\u062c\u0645\u0639\u0647\",\"\u0634\u0646\u0628\u0647\"],days_abbr:[\"\u064a\",\"\u062f\",\"\u0633\",\"\u0686\",\"\u067e\",\"\u062c\",\"\u0634\"],dateOrder:[\"month\",\"date\",\"year\"],shortDate:\"%m/%d/%Y\",shortTime:\"%I:%M%p\",AM:\"\u0642.\u0638\",PM:\"\u0628.\u0638\",ordinal:\"\u0627\u0645\",lessThanMinuteAgo:\"\u06a9\u0645\u062a\u0631 \u0627\u0632 \u06cc\u06a9 \u062f\u0642\u06cc\u0642\u0647 \u067e\u06cc\u0634\",minuteAgo:\"\u062d\u062f\u0648\u062f \u06cc\u06a9 \u062f\u0642\u06cc\u0642\u0647 \u067e\u06cc\u0634\",minutesAgo:\"{delta} \u062f\u0642\u06cc\u0642\u0647 \u067e\u06cc\u0634\",hourAgo:\"\u062d\u062f\u0648\u062f \u06cc\u06a9 \u0633\u0627\u0639\u062a \u067e\u06cc\u0634\",hoursAgo:\"\u062d\u062f\u0648\u062f {delta} \u0633\u0627\u0639\u062a \u067e\u06cc\u0634\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "123+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "weeksAgo"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def file(path):\n path = secure_filename(path)\n if app.interface.encrypt and isinstance(app.interface.examples, str) and path.startswith(app.interface.examples):\n with open(os.path.join(app.cwd, path), \"rb\") as encrypted_file:\n encrypted_data = encrypted_file.read()\n file_data = encryptor.decrypt(\n app.interface.encryption_key, encrypted_data)\n return send_file(io.BytesIO(file_data), attachment_filename=os.path.basename(path))\n else:\n return send_file(os.path.join(app.cwd, path)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: gradio/networking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n gradio/networking.py::send_file\ngradio/networking.py::secure_filename\ngradio/networking.py::open\ngradio/networking.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+gradio-app--gradio+CVE-2021-43831+vul.pkl", "func_name_": "file"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def field_names(ctx, rd, field):\n '''\n Get a list of all names for the specified field\n Optional: ?library_id=\n '''\n db, library_id = get_library_data(ctx, rd)[:2]\n return tuple(db.all_field_names(field)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/calibre/srv/code.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "4+train+kovidgoyal--calibre+CVE-2018-7889+vul.pkl", "func_name_": "field_names"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def check_valid_read_column(column):\n if column != \"0\":\n if not calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.id == column) \\\n .filter(and_(db.Custom_Columns.datatype == 'bool', db.Custom_Columns.mark_for_delete == 0)).all():\n return False\n return True \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cps/admin.py.\n//This function is called by other functions within the repository:\n cps/admin.py::update_view_configuration \n//This function itself calls other functions within the repository:\n cps/admin.py::and_ \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+janeczku--calibre-web+CVE-2022-0939+vul.pkl", "func_name_": "check_valid_read_column"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_splitattr_deprecation(self):\n with self.assertWarns(DeprecationWarning) as cm:\n urllib.parse.splitattr('')\n self.assertEqual(str(cm.warning),\n 'urllib.parse.splitattr() is deprecated as of 3.8, '\n 'use urllib.parse.urlparse() instead') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Lib/test/test_urlparse.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "8+train+python--cpython+CVE-2019-10160+clean.pkl", "func_name_": "test_splitattr_deprecation"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyMemoTable *\nPyMemoTable_New(void)\n{\n PyMemoTable *memo = PyMem_MALLOC(sizeof(PyMemoTable));\n if (memo == NULL) {\n PyErr_NoMemory();\n return NULL;\n }\n\n memo->mt_used = 0;\n memo->mt_allocated = MT_MINSIZE;\n memo->mt_mask = MT_MINSIZE - 1;\n memo->mt_table = PyMem_MALLOC(MT_MINSIZE * sizeof(PyMemoEntry));\n if (memo->mt_table == NULL) {\n PyMem_FREE(memo);\n PyErr_NoMemory();\n return NULL;\n }\n memset(memo->mt_table, 0, MT_MINSIZE * sizeof(PyMemoEntry));\n\n return memo;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "98+train+python--cpython+CVE-2018-20406+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get(self, request: Request, project: Project) -> Response:\n \"\"\"\n List a Project's Individual Artifacts or Bundles\n ````````````````````````````````````````\n\n Retrieve a list of individual artifacts or artifact bundles for a given project.\n\n :pparam string organization_slug: the slug of the organization to query.\n :pparam string project_slug: the slug of the project to query.\n :qparam string debug_id: if set, will query and return the artifact\n bundle that matches the given `debug_id`.\n :qparam string url: if set, will query and return all the individual\n artifacts, or artifact bundles that contain files\n that match the `url`. This is using a substring-match.\n :qparam string release: used in conjunction with `url`.\n :qparam string dist: used in conjunction with `url`.\n\n :auth: required\n \"\"\"\n if request.GET.get(\"download\") is not None:\n if has_download_permission(request, project):\n return self.download_file(request.GET.get(\"download\"), project)\n else:\n return Response(status=403)\n\n debug_id = request.GET.get(\"debug_id\")\n try:\n debug_id = normalize_debug_id(debug_id)\n except SymbolicError:\n pass\n url = request.GET.get(\"url\")\n release_name = request.GET.get(\"release\")\n dist_name = request.GET.get(\"dist\")\n\n used_artifact_bundles = dict()\n bundle_file_ids = set()\n\n def update_bundles(inner_bundles: Set[Tuple[int, datetime, int]]):\n for (bundle_id, date_added, file_id) in inner_bundles:\n used_artifact_bundles[bundle_id] = date_added\n bundle_file_ids.add(file_id)\n\n if debug_id:\n bundles = get_artifact_bundles_containing_debug_id(debug_id, project)\n update_bundles(bundles)\n\n individual_files = set()\n if url and release_name and not bundle_file_ids:\n # Get both the newest X release artifact bundles,\n # and also query the legacy artifact bundles. One of those should have the\n # file we are looking for. We want to return more here, even bundles that\n # do *not* contain the file, rather than opening up each bundle. We want to\n # avoid opening up bundles at all cost.\n bundles = get_release_artifacts(project, release_name, dist_name)\n update_bundles(bundles)\n\n release, dist = try_resolve_release_dist(project, release_name, dist_name)\n if release:\n bundle_file_ids |= get_legacy_release_bundles(release, dist)\n individual_files = get_legacy_releasefile_by_file_url(release, dist, url)\n\n if options.get(\"sourcemaps.artifact-bundles.enable-renewal\") == 1.0:\n with metrics.timer(\"artifact_lookup.get.renew_artifact_bundles\"):\n # Before constructing the response, we want to update the artifact bundles renewal date.\n renew_artifact_bundles(used_artifact_bundles)\n\n # Then: Construct our response\n url_constructor = UrlConstructor(request, project)\n\n found_artifacts = []\n for file_id in bundle_file_ids:\n found_artifacts.append(\n {\n \"id\": str(file_id),\n \"type\": \"bundle\",\n \"url\": url_constructor.url_for_file_id(file_id),\n }\n )\n\n for release_file in individual_files:\n found_artifacts.append(\n {\n \"id\": str(release_file.file.id),\n \"type\": \"file\",\n \"url\": url_constructor.url_for_file_id(release_file.file.id),\n # The `name` is the url/abs_path of the file,\n # as in: `\"~/path/to/file.min.js\"`.\n \"abs_path\": release_file.name,\n # These headers should ideally include the `Sourcemap` reference\n \"headers\": release_file.file.headers,\n }\n )\n\n # NOTE: We do not paginate this response, as we have very tight limits on all the individual queries.\n return Response(serialize(found_artifacts, request.user)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/sentry/api/endpoints/artifact_lookup.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/sentry/api/endpoints/artifact_lookup.py::get_release_artifacts\nsrc/sentry/api/endpoints/artifact_lookup.py::update_bundles\nsrc/sentry/api/endpoints/artifact_lookup.py::serialize\nsrc/sentry/api/endpoints/artifact_lookup.py::renew_artifact_bundles\nsrc/sentry/api/endpoints/artifact_lookup.py::get_artifact_bundles_containing_debug_id\nsrc/sentry/api/endpoints/artifact_lookup.py::try_resolve_release_dist\nsrc/sentry/api/endpoints/artifact_lookup.py::str\nsrc/sentry/api/endpoints/artifact_lookup.py::set\nsrc/sentry/api/endpoints/artifact_lookup.py::get_legacy_release_bundles\nsrc/sentry/api/endpoints/artifact_lookup.py::normalize_debug_id\nsrc/sentry/api/endpoints/artifact_lookup.py::get_legacy_releasefile_by_file_url\nsrc/sentry/api/endpoints/artifact_lookup.py::UrlConstructor\nsrc/sentry/api/endpoints/artifact_lookup.py::dict\nsrc/sentry/api/endpoints/artifact_lookup.py::Response\nsrc/sentry/api/endpoints/artifact_lookup.py::has_download_permission \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+getsentry--sentry+CVE-2023-36826+vul.pkl", "func_name_": "get"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_tofile_sep(self):\n x = np.array([1.51, 2, 3.51, 4], dtype=float)\n f = open(self.filename, 'w')\n x.tofile(f, sep=',')\n f.close()\n f = open(self.filename, 'r')\n s = f.read()\n f.close()\n assert_equal(s, '1.51,2.0,3.51,4.0')\n os.unlink(self.filename) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_multiarray.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n numpy/core/tests/test_multiarray.py::assert_equal\nnumpy/core/tests/test_multiarray.py::open \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "7+train+numpy--numpy+CVE-2014-1858+vul.pkl", "func_name_": "test_tofile_sep"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def code_block(\n self,\n tokens: Sequence[Token],\n idx: int,\n options: OptionsDict,\n env: MutableMapping,\n ) -> str:\n token = tokens[idx]\n\n return (\n \"\"\n + escapeHtml(tokens[idx].content)\n + \"n\"\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: markdown_it/renderer.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n markdown_it/renderer.py::escapeHtml \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "7+train+executablebooks--markdown-it-py+CVE-2023-26303+clean.pkl", "func_name_": "code_block"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def patch(self):\n self.write('patch') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tornado/test/web_test.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+tornadoweb--tornado+CVE-2014-9720+clean.pkl", "func_name_": "patch"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _list_artifacts_mlflow_artifacts():\n \"\"\"\n A request handler for `GET /mlflow-artifacts/artifacts?path=` to list artifacts in `path`\n (a relative path from the root artifact directory).\n \"\"\"\n request_message = _get_request_message(ListArtifactsMlflowArtifacts())\n if request_message.HasField(\"path\"):\n validate_path_is_safe(request_message.path)\n path = request_message.path\n else:\n path = None\n artifact_repo = _get_artifact_repo_mlflow_artifacts()\n files = []\n for file_info in artifact_repo.list_artifacts(path):\n basename = posixpath.basename(file_info.path)\n new_file_info = FileInfo(basename, file_info.is_dir, file_info.file_size)\n files.append(new_file_info.to_proto())\n response_message = ListArtifacts.Response()\n response_message.files.extend(files)\n response = Response(mimetype=\"application/json\")\n response.set_data(message_to_json(response_message))\n return response \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/server/handlers.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+mlflow--mlflow+CVE-2023-6976+vul.pkl", "func_name_": "_list_artifacts_mlflow_artifacts"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_file_logger_named_version(tmpdir):\n \"\"\"Verify that manual versioning works for string versions, e.g. '2020-02-05-162402'.\"\"\"\n\n exp_name = \"exp\"\n tmpdir.mkdir(exp_name)\n expected_version = \"2020-02-05-162402\"\n\n logger = CSVLogger(save_dir=tmpdir, name=exp_name, version=expected_version)\n logger.log_hyperparams({\"a\": 1, \"b\": 2})\n logger.save()\n assert logger.version == expected_version\n assert os.listdir(tmpdir / exp_name) == [expected_version]\n assert os.listdir(tmpdir / exp_name / expected_version) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/loggers/test_csv.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/loggers/test_csv.py::CSVLogger \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "15+train+Lightning-AI--pytorch-lightning+CVE-2021-4118+clean.pkl", "func_name_": "test_file_logger_named_version"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(self, base_builder, event_id):\n self._base_builder = base_builder\n self._event_id = event_id \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/storage/test_redaction.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "646+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "__init__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def to_jwk(key):\n if isinstance(key, (Ed25519PublicKey, Ed448PublicKey)):\n x = key.public_bytes(\n encoding=Encoding.Raw,\n format=PublicFormat.Raw,\n )\n crv = \"Ed25519\" if isinstance(key, Ed25519PublicKey) else \"Ed448\"\n return json.dumps(\n {\n \"x\": base64url_encode(force_bytes(x)).decode(),\n \"kty\": \"OKP\",\n \"crv\": crv,\n }\n )\n\n if isinstance(key, (Ed25519PrivateKey, Ed448PrivateKey)):\n d = key.private_bytes(\n encoding=Encoding.Raw,\n format=PrivateFormat.Raw,\n encryption_algorithm=NoEncryption(),\n )\n\n x = key.public_key().public_bytes(\n encoding=Encoding.Raw,\n format=PublicFormat.Raw,\n )\n\n crv = \"Ed25519\" if isinstance(key, Ed25519PrivateKey) else \"Ed448\"\n return json.dumps(\n {\n \"x\": base64url_encode(force_bytes(x)).decode(),\n \"d\": base64url_encode(force_bytes(d)).decode(),\n \"kty\": \"OKP\",\n \"crv\": crv,\n }\n )\n\n raise InvalidKeyError(\"Not a public or private key\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: jwt/algorithms.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n jwt/algorithms.py::isinstance\njwt/algorithms.py::force_bytes\njwt/algorithms.py::NoEncryption\njwt/algorithms.py::base64url_encode\njwt/algorithms.py::InvalidKeyError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "52+train+jpadilla--pyjwt+CVE-2022-29217+clean.pkl", "func_name_": "to_jwk"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static int\nsave_float(PicklerObject *self, PyObject *obj)\n{\n double x = PyFloat_AS_DOUBLE((PyFloatObject *)obj);\n\n if (self->bin) {\n char pdata[9];\n pdata[0] = BINFLOAT;\n if (_PyFloat_Pack8(x, (unsigned char *)&pdata[1], 0) < 0)\n return -1;\n if (_Pickler_Write(self, pdata, 9) < 0)\n return -1;\n }\n else {\n int result = -1;\n char *buf = NULL;\n char op = FLOAT;\n\n if (_Pickler_Write(self, &op, 1) < 0)\n goto done;\n\n buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);\n if (!buf) {\n PyErr_NoMemory();\n goto done;\n }\n\n if (_Pickler_Write(self, buf, strlen(buf)) < 0)\n goto done;\n\n if (_Pickler_Write(self, \"n\", 1) < 0)\n goto done;\n\n result = 0;\ndone:\n PyMem_Free(buf);\n return result;\n }\n\n return 0;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "34+train+python--cpython+CVE-2018-20406+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_login_inactive_user(self):\n self.user.is_active = False\n self.user.save()\n\n login_code = LoginCode.objects.create(user=self.user, code='foobar')\n\n response = self.client.post('/accounts-rest/login/code/', {\n 'code': login_code.code,\n })\n\n self.assertEqual(response.status_code, 400)\n self.assertEqual(response.json(), {\n 'code': ['Unable to log in with provided login code.'],\n }) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_rest_views.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+relekang--django-nopassword+CVE-2019-10682+vul.pkl", "func_name_": "test_login_inactive_user"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def extract(self, fp: BinaryIO, parallel: bool, skip_notarget=True, q=None) -> None:\n \"\"\"Extract worker method to handle 7zip folder and decompress each files.\"\"\"\n if hasattr(self.header, \"main_streams\") and self.header.main_streams is not None:\n src_end = self.src_start + self.header.main_streams.packinfo.packpositions[-1]\n numfolders = self.header.main_streams.unpackinfo.numfolders\n if numfolders == 1:\n self.extract_single(\n fp,\n self.files,\n self.src_start,\n src_end,\n q,\n skip_notarget=skip_notarget,\n )\n else:\n folders = self.header.main_streams.unpackinfo.folders\n positions = self.header.main_streams.packinfo.packpositions\n empty_files = [f for f in self.files if f.emptystream]\n if not parallel:\n self.extract_single(fp, empty_files, 0, 0, q)\n for i in range(numfolders):\n if skip_notarget:\n if not any([self.target_filepath.get(f.id, None) for f in folders[i].files]):\n continue\n self.extract_single(\n fp,\n folders[i].files,\n self.src_start + positions[i],\n self.src_start + positions[i + 1],\n q,\n skip_notarget=skip_notarget,\n )\n else:\n if getattr(fp, \"name\", None) is None:\n raise InternalError(\"Caught unknown variable status error\")\n filename: str = getattr(fp, \"name\", \"\") # do not become \"\" but it is for type check.\n self.extract_single(open(filename, \"rb\"), empty_files, 0, 0, q)\n concurrent_tasks = []\n exc_q: queue.Queue = queue.Queue()\n for i in range(numfolders):\n if skip_notarget:\n if not any([self.target_filepath.get(f.id, None) for f in folders[i].files]):\n continue\n p = self.concurrent(\n target=self.extract_single,\n args=(\n filename,\n folders[i].files,\n self.src_start + positions[i],\n self.src_start + positions[i + 1],\n q,\n exc_q,\n skip_notarget,\n ),\n )\n p.start()\n concurrent_tasks.append(p)\n for p in concurrent_tasks:\n p.join()\n if exc_q.empty():\n pass\n else:\n exc_info = exc_q.get()\n raise exc_info[1].with_traceback(exc_info[2])\n else:\n empty_files = [f for f in self.files if f.emptystream]\n self.extract_single(fp, empty_files, 0, 0, q) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: py7zr/py7zr.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n py7zr/py7zr.py::InternalError\npy7zr/py7zr.py::any\npy7zr/py7zr.py::range\npy7zr/py7zr.py::open\npy7zr/py7zr.py::hasattr\npy7zr/py7zr.py::getattr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+miurahr--py7zr+CVE-2022-44900+vul.pkl", "func_name_": "extract"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_imports(self, mocker):\n from openapi_python_client.parser.properties import DateTimeProperty\n\n name = mocker.MagicMock()\n mocker.patch(\"openapi_python_client.utils.snake_case\")\n p = DateTimeProperty(name=name, required=True, default=None)\n assert p.get_imports(prefix=\"\") == {\n \"from datetime import datetime\",\n \"from typing import cast\",\n }\n\n p.required = False\n assert p.get_imports(prefix=\"\") == {\n \"from typing import Optional\",\n \"from datetime import datetime\",\n \"from typing import cast\",\n } \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_openapi_parser/test_properties.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_openapi_parser/test_properties.py::DictProperty \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+openapi-generators--openapi-python-client+CVE-2020-15142+vul.pkl", "func_name_": "test_get_imports"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def trouble(self, s, tb=None):\n pass \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/test_YoutubeDL.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "50+train+yt-dlp--yt-dlp+CVE-2023-40581+clean.pkl", "func_name_": "trouble"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def put(self, name: str):\n \"\"\"add new file\n params in FormData:\n - file\n - original_file_name [optional]\n \"\"\"\n\n data = {}\n mindsdb_file_name = name\n\n existing_file_names = ca.file_controller.get_files_names()\n\n def on_field(field):\n name = field.field_name.decode()\n value = field.value.decode()\n data[name] = value\n\n file_object = None\n\n def on_file(file):\n nonlocal file_object\n data[\"file\"] = file.file_name.decode()\n file_object = file.file_object\n\n temp_dir_path = tempfile.mkdtemp(prefix=\"mindsdb_file_\")\n\n if request.headers[\"Content-Type\"].startswith(\"multipart/form-data\"):\n parser = multipart.create_form_parser(\n headers=request.headers,\n on_field=on_field,\n on_file=on_file,\n config={\n \"UPLOAD_DIR\": temp_dir_path.encode(), # bytes required\n \"UPLOAD_KEEP_FILENAME\": True,\n \"UPLOAD_KEEP_EXTENSIONS\": True,\n \"MAX_MEMORY_FILE_SIZE\": 0,\n },\n )\n\n while True:\n chunk = request.stream.read(8192)\n if not chunk:\n break\n parser.write(chunk)\n parser.finalize()\n parser.close()\n\n if file_object is not None and not file_object.closed:\n file_object.close()\n else:\n data = request.json\n\n if mindsdb_file_name in existing_file_names:\n return http_error(\n 400,\n \"File already exists\",\n f\"File with name '{data['file']}' already exists\",\n )\n\n if data.get(\"source_type\") == \"url\":\n url = data[\"source\"]\n data[\"file\"] = data[\"name\"]\n\n config = Config()\n is_cloud = config.get(\"cloud\", False)\n if is_cloud is True and ctx.user_class != 1:\n info = requests.head(url)\n file_size = info.headers.get(\"Content-Length\")\n try:\n file_size = int(file_size)\n except Exception:\n pass\n\n if file_size is None:\n return http_error(\n 400,\n \"Error getting file info\",\n \"an't determine remote file size\",\n )\n if file_size > 1024 * 1024 * 100:\n return http_error(\n 400, \"File is too big\", \"Upload limit for file is 100Mb\"\n )\n with requests.get(url, stream=True) as r:\n if r.status_code != 200:\n return http_error(\n 400, \"Error getting file\", f\"Got status code: {r.status_code}\"\n )\n file_path = os.path.join(temp_dir_path, data[\"file\"])\n with open(file_path, \"wb\") as f:\n for chunk in r.iter_content(chunk_size=8192):\n f.write(chunk)\n\n original_file_name = data.get(\"original_file_name\")\n\n file_path = os.path.join(temp_dir_path, data[\"file\"])\n lp = file_path.lower()\n if lp.endswith((\".zip\", \".tar.gz\")):\n if lp.endswith(\".zip\"):\n with zipfile.ZipFile(file_path) as f:\n f.extractall(temp_dir_path)\n elif lp.endswith(\".tar.gz\"):\n with tarfile.open(file_path) as f:\n safe_extract(f, temp_dir_path)\n os.remove(file_path)\n files = os.listdir(temp_dir_path)\n if len(files) != 1:\n os.rmdir(temp_dir_path)\n return http_error(\n 400, \"Wrong content.\", \"Archive must contain only one data file.\"\n )\n file_path = os.path.join(temp_dir_path, files[0])\n mindsdb_file_name = files[0]\n if not os.path.isfile(file_path):\n os.rmdir(temp_dir_path)\n return http_error(\n 400, \"Wrong content.\", \"Archive must contain data file in root.\"\n )\n\n ca.file_controller.save_file(\n mindsdb_file_name, file_path, file_name=original_file_name\n )\n\n os.rmdir(temp_dir_path)\n\n return \"\", 200 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mindsdb/api/http/namespaces/file.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n mindsdb/api/http/namespaces/file.py::Config\nmindsdb/api/http/namespaces/file.py::open\nmindsdb/api/http/namespaces/file.py::safe_extract\nmindsdb/api/http/namespaces/file.py::len\nmindsdb/api/http/namespaces/file.py::int\nmindsdb/api/http/namespaces/file.py::http_error \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "10+train+mindsdb--mindsdb+CVE-2023-49795+clean.pkl", "func_name_": "put"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_response_requests_exception(self, mock_get):\n mock_response = mock.Mock()\n mock_response.status_code = 500\n mock_response.text = \"Server Error\"\n exception_message = \"Some requests exception\"\n requests_exception = requests.RequestException(exception_message)\n mock_response.raise_for_status.side_effect = requests_exception\n mock_get.return_value = mock_response\n\n url = \"https://example.com/\"\n query_runner = BaseHTTPQueryRunner({})\n response, error = query_runner.get_response(url)\n mock_get.assert_called_once_with(\"get\", url, auth=None)\n self.assertIsNotNone(error)\n self.assertEqual(exception_message, error) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/query_runner/test_http.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/query_runner/test_http.py::BaseHTTPQueryRunner \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+getredash--redash+CVE-2021-43780+vul.pkl", "func_name_": "test_get_response_requests_exception"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def readFromStream(\n stream: StreamType, pdf: PdfReaderProtocol\n ) -> \"DictionaryObject\": # deprecated\n deprecation_with_replacement(\"readFromStream\", \"read_from_stream\", \"3.0.0\")\n return DictionaryObject.read_from_stream(stream, pdf) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pypdf/generic/_data_structures.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n pypdf/generic/_data_structures.py::deprecation_with_replacement \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "42+train+py-pdf--pypdf+CVE-2023-46250+clean.pkl", "func_name_": "readFromStream"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n person_created_at: DateTime.fromISO(now).toUTC(),\n } as any)\n expect(fetch).toHaveBeenCalledWith('https://example.com/', {\n body: JSON.stringify(\n {\n hook: {\n id: 'id',\n event: 'foo',\n target: 'https://example.com/',\n },\n data: {\n event: 'foo',\n teamId: hook.team_id,\n person: {\n uuid: uuid,\n properties: { foo: 'bar' },\n created_at: now,\n },\n },\n },\n undefined,\n 4\n ),\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n timeout: 20000,\n })\n })\n\n test('private IP hook allowed on self-hosted', async () => {\n await hookCommander.postRestHook({ ...hook, target: 'http://127.0.0.1' }, { event: 'foo' } as any)\n\n expect(fetch).toHaveBeenCalledWith('http://127.0.0.1', expect.anything())\n })\n\n test('private IP hook forbidden on Cloud', async () => {\n jest.mocked(isCloud).mockReturnValue(true)\n\n await expect(\n hookCommander.postRestHook({ ...hook, target: 'http://127.0.0.1' }, { event: 'foo' } as any)\n ).rejects.toThrow(new FetchError('Internal hostname', 'posthog-host-guard'))\n })\n })\n}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugin-server/tests/worker/ingestion/hooks.test.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+PostHog--posthog+CVE-2023-46746+vul.pkl", "func_name_": "DateTime.fromISO"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def _has_watch_regex_match(self, text: str) -> Tuple[Union[bool, re.Match], Optional[str]]:\n \"\"\"\n Return True if `text` matches any regex from `word_watchlist` or `token_watchlist` configs.\n\n `word_watchlist`'s patterns are placed between word boundaries while `token_watchlist` is\n matched as-is. Spoilers are expanded, if any, and URLs are ignored.\n Second return value is a reason written to database about blacklist entry (can be None).\n \"\"\"\n if SPOILER_RE.search(text):\n text = self._expand_spoilers(text)\n\n text = self.clean_input(text)\n\n # Make sure it's not a URL\n if URL_RE.search(text):\n return False, None\n\n watchlist_patterns = self._get_filterlist_items('filter_token', allowed=False)\n for pattern in watchlist_patterns:\n match = re.search(pattern, text, flags=re.IGNORECASE)\n if match:\n return match, self._get_filterlist_value('filter_token', pattern, allowed=False)['comment']\n\n return False, None \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: bot/exts/filters/filtering.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+python-discord--bot+CVE-2021-41250+vul.pkl", "func_name_": "_has_watch_regex_match"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def purge_tickets(self, context):\n try:\n guild = context.guild\n closed_channels = [channel for channel in guild.channels if channel.category_id == await self.config.guild(guild).closed_category()]\n for channel in closed_channels:\n await channel.delete()\n\n return 'All closed tickets removed!'\n except discord.Forbidden:\n return 'I need permissions to manage channels.' \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tickets/core.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+kennnyshiwa--kennnyshiwa-cogs+CVE-2021-29493+vul.pkl", "func_name_": "purge_tickets"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_next_proto_negotiated(self):\n \"\"\"\n Get the protocol that was negotiated by NPN.\n \"\"\"\n data = _ffi.new(\"unsigned char **\")\n data_len = _ffi.new(\"unsigned int *\")\n\n _lib.SSL_get0_next_proto_negotiated(self._ssl, data, data_len)\n\n return _ffi.buffer(data[0], data_len[0])[:] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/OpenSSL/SSL.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "199+train+pyca--pyopenssl+CVE-2018-1000807+clean.pkl", "func_name_": "get_next_proto_negotiated"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def test_fetch_auth_providers_home_assistant_person_not_loaded(\n hass: HomeAssistant,\n aiohttp_client: ClientSessionGenerator,\n ip: str,\n) -> None:\n \"\"\"Test fetching auth providers for homeassistant auth provider, where person integration is not loaded.\"\"\"\n await _test_fetch_auth_providers_home_assistant(\n hass, aiohttp_client, ip, lambda _: {}\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/components/auth/test_login_flow.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+home-assistant--core+CVE-2023-50715+vul.pkl", "func_name_": "test_fetch_auth_providers_home_assistant_person_not_loaded"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_domains_from_state(state):\n \"\"\"Get joined domains from state\n\n Args:\n state (dict[tuple, FrozenEvent]): State map from type/state\n key to event.\n\n Returns:\n list[tuple[str, int]]: Returns a list of servers with the\n lowest depth of their joins. Sorted by lowest depth first.\n \"\"\"\n joined_users = [\n (state_key, int(event.depth))\n for (e_type, state_key), event in state.items()\n if e_type == EventTypes.Member and event.membership == Membership.JOIN\n ]\n\n joined_domains = {} # type: Dict[str, int]\n for u, d in joined_users:\n try:\n dom = get_domain_from_id(u)\n old_d = joined_domains.get(dom)\n if old_d:\n joined_domains[dom] = min(d, old_d)\n else:\n joined_domains[dom] = d\n except Exception:\n pass\n\n return sorted(joined_domains.items(), key=lambda d: d[1]) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/handlers/federation.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/handlers/federation.py::int\nsynapse/handlers/federation.py::get_domain_from_id\nsynapse/handlers/federation.py::min\nsynapse/handlers/federation.py::sorted \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "28+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_domains_from_state"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s form').serialize();\n var url = get_cluster_remote_url() + \"add_group\";\n $.ajax({\n type: \"POST\",\n url: url,\n data: data,\n success: function() {\n Pcs.update();\n $(\"#add_group\").dialog(\"close\");\n },\n error: function (xhr, status, error) {\n alert(\n \"Error creating group \"\n + ajax_simple_error(xhr, status, error)\n );\n $(\"#add_group\").dialog(\"close\");\n }\n });\n } \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pcsd/public/js/pcsd.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+ClusterLabs--pcs+CVE-2016-0721+vul.pkl", "func_name_": "\"Create Group\""} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_filename(self):\n tmpname = mktemp('', 'mmap')\n fp = memmap(tmpname, dtype=self.dtype, mode='w+',\n shape=self.shape)\n abspath = os.path.abspath(tmpname)\n fp[:] = self.data[:]\n self.assertEqual(abspath, fp.filename)\n b = fp[:1]\n self.assertEqual(abspath, b.filename)\n del b\n del fp\n os.unlink(tmpname) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: numpy/core/tests/test_memmap.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n numpy/core/tests/test_memmap.py::mktemp\nnumpy/core/tests/test_memmap.py::memmap \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+numpy--numpy+CVE-2014-1858+vul.pkl", "func_name_": "test_filename"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_basic():\n # Test Basic Authentication\n http = httplib2.Http()\n password = tests.gen_password()\n handler = tests.http_reflect_with_auth(\n allow_scheme=\"basic\", allow_credentials=((\"joe\", password),)\n )\n with tests.server_request(handler, request_count=3) as uri:\n response, content = http.request(uri, \"GET\")\n assert response.status == 401\n http.add_credentials(\"joe\", password)\n response, content = http.request(uri, \"GET\")\n assert response.status == 200 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_auth.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "62+train+httplib2--httplib2+CVE-2021-21240+vul.pkl", "func_name_": "test_basic"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def secret_path(monkeypatch, tmp_path):\n secret_path = str(tmp_path / '.test')\n monkeypatch.setattr(auth, 'SECRET_FILE_PATH', secret_path)\n yield secret_path \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/unit/test_auth.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/unit/test_auth.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+planetlabs--planet-client-python+CVE-2023-32303+vul.pkl", "func_name_": "secret_path"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def required_relationships_test(self, interact_with=\"ui\"):\n \"\"\"\n\n Args:\n interact_with: str: (\"ui\" or \"api\")\n\n Note:\n Where it is used, this test is parameterized to prevent code duplication.\n\n It should not be possible to create an object that has a required relationship without specifying the\n required amount of related objects. It performs the following checks:\n\n 1. Try creating an object when no required target object exists\n 2. Try creating an object without specifying required target object(s)\n 3. Try creating an object when all required data is present\n 4. API interaction scenarios:\n =================================================================\n - Relationship is marked as being not required\n - Object is created without the required relationship data (succeeds)\n - Relationship is marked as being required\n - Object is updated without the required relationship data (fails)\n - Object is updated with the required relationship data (succeeds)\n =================================================================\n - Object is created with the required relationship data (succeeds)\n - Object is updated without specifying \"relationships\" json key (succeeds, relationship associations\n remain in place)\n - Object is created with the required relationship data (succeeds)\n - Object is updated to remove the relationship data (fails)\n =================================================================\n\n \"\"\"\n\n # Create required relationships:\n device_ct = ContentType.objects.get_for_model(Device)\n platform_ct = ContentType.objects.get_for_model(Platform)\n circuittype_ct = ContentType.objects.get_for_model(CircuitType)\n vlan_ct = ContentType.objects.get_for_model(VLAN)\n relationship_m2m = Relationship(\n label=\"VLANs require at least one Device\",\n key=\"vlans_devices_m2m\",\n type=\"many-to-many\",\n source_type=device_ct,\n destination_type=vlan_ct,\n required_on=\"destination\",\n )\n relationship_m2m.validated_save()\n relationship_o2m = Relationship(\n label=\"Platforms require at least one device\",\n key=\"platform_devices_o2m\",\n type=\"one-to-many\",\n source_type=platform_ct,\n destination_type=device_ct,\n required_on=\"source\",\n )\n relationship_o2m.validated_save()\n relationship_o2o = Relationship(\n label=\"Circuit type requires one platform\",\n key=\"circuittype_platform_o2o\",\n type=\"one-to-one\",\n source_type=circuittype_ct,\n destination_type=platform_ct,\n required_on=\"source\",\n )\n relationship_o2o.validated_save()\n vlan_group = VLANGroup.objects.first()\n\n tests_params = [\n # Required many-to-many:\n {\n \"create_data\": {\n \"vid\": \"1\",\n \"name\": \"New VLAN\",\n \"status\": str(Status.objects.get_for_model(VLAN).first().pk),\n \"vlan_group\": str(vlan_group.pk),\n },\n \"relationship\": relationship_m2m,\n \"required_objects_generator\": [\n lambda: create_test_device(\"Device 1\"),\n lambda: create_test_device(\"Device 2\"),\n ],\n \"expected_errors\": {\n \"api\": {\n \"objects_nonexistent\": \"VLANs require at least one device, but no devices exist yet. \"\n \"Create a device by posting to /api/dcim/devices/\",\n \"objects_not_specified\": 'You need to specify [\"relationships\"][\"vlans_devices_m2m\"]'\n '[\"source\"][\"objects\"].',\n },\n \"ui\": {\n \"objects_nonexistent\": \"VLANs require at least one device, but no devices exist yet.\",\n \"objects_not_specified\": \"You need to select at least one device.\",\n },\n },\n },\n # Required one-to-many:\n {\n \"create_data\": {\n \"name\": \"New Platform 1\",\n \"napalm_args\": \"null\",\n },\n \"relationship\": relationship_o2m,\n \"required_objects_generator\": [lambda: create_test_device(\"Device 3\")],\n \"expected_errors\": {\n \"api\": {\n \"objects_nonexistent\": \"Platforms require at least one device, but no devices exist yet. \"\n \"Create a device by posting to /api/dcim/devices/\",\n \"objects_not_specified\": 'You need to specify [\"relationships\"][\"platform_devices_o2m\"]'\n '[\"destination\"][\"objects\"].',\n },\n \"ui\": {\n \"objects_nonexistent\": \"Platforms require at least one device, but no devices exist yet. \",\n \"objects_not_specified\": \"You need to select at least one device.\",\n },\n },\n },\n # Required one-to-one:\n {\n \"create_data\": {\n \"name\": \"New Circuit Type\",\n },\n \"relationship\": relationship_o2o,\n \"required_objects_generator\": [\n lambda: Platform.objects.create(name=\"New Platform 2\", napalm_args=\"null\")\n ],\n \"expected_errors\": {\n \"api\": {\n \"objects_nonexistent\": \"Circuit types require a platform, but no platforms exist yet. \"\n \"Create a platform by posting to /api/dcim/platforms/\",\n \"objects_not_specified\": 'You need to specify [\"relationships\"][\"circuittype_platform_o2o\"]'\n '[\"destination\"][\"objects\"].',\n },\n \"ui\": {\n \"objects_nonexistent\": \"Circuit types require a platform, but no platforms exist yet.\",\n \"objects_not_specified\": \"You need to select a platform.\",\n },\n },\n },\n ]\n\n self.user.is_superuser = True\n self.user.save()\n if interact_with == \"ui\":\n self.client.force_login(self.user)\n\n for params in tests_params:\n required_on = params[\"relationship\"].required_on\n target_side = RelationshipSideChoices.OPPOSITE[required_on]\n from_model = getattr(params[\"relationship\"], f\"{required_on}_type\").model_class()\n to_model = getattr(params[\"relationship\"], f\"{target_side}_type\").model_class()\n\n test_msg = f\"Testing {from_model._meta.verbose_name} relationship '{params['relationship'].key}'\"\n with self.subTest(msg=test_msg):\n # Clear any existing required target model objects that may have been created in previous subTests\n to_model.objects.all().delete()\n\n # Get count of existing objects:\n existing_count = from_model.objects.count()\n\n related_field_name = params[\"relationship\"].key\n if interact_with == \"ui\":\n related_field_name = f\"cr_{related_field_name}__{target_side}\"\n\n create_data = params[\"create_data\"]\n\n # 1. Try creating an object when no required target object exists\n response = self.send_data(from_model, create_data, interact_with)\n\n if interact_with == \"ui\":\n for message in [\n params[\"expected_errors\"][\"ui\"][\"objects_nonexistent\"],\n params[\"expected_errors\"][\"ui\"][\"objects_not_specified\"],\n ]:\n self.assertContains(response, message)\n\n elif interact_with == \"api\":\n self.assertHttpStatus(response, 400)\n expected_error_json = {\n \"relationships\": {\n related_field_name: [\n params[\"expected_errors\"][\"api\"][\"objects_nonexistent\"],\n params[\"expected_errors\"][\"api\"][\"objects_not_specified\"],\n ]\n }\n }\n self.assertEqual(expected_error_json, response.json())\n\n # Check that no object was created:\n self.assertEqual(from_model.objects.count(), existing_count)\n\n # 2. Try creating an object without specifying required target object(s)\n # Create required target objects\n required_object_pks = [instance().pk for instance in params[\"required_objects_generator\"]]\n\n # one-to-one relationship objects vie the UI form need to specify a pk string\n # instead of a list of pk strings\n if interact_with == \"ui\" and params[\"relationship\"].type == \"one-to-one\":\n required_object_pks = required_object_pks[0]\n\n response = self.send_data(from_model, create_data, interact_with)\n\n if interact_with == \"ui\":\n self.assertContains(response, params[\"expected_errors\"][\"ui\"][\"objects_not_specified\"])\n\n elif interact_with == \"api\":\n self.assertHttpStatus(response, 400)\n expected_error_json = {\n \"relationships\": {\n related_field_name: [params[\"expected_errors\"][\"api\"][\"objects_not_specified\"]]\n }\n }\n self.assertEqual(expected_error_json, response.json())\n\n # Check that no object was created:\n self.assertEqual(from_model.objects.count(), existing_count)\n\n # 3. Try creating an object when all required data is present\n if interact_with == \"ui\":\n related_objects_data = {related_field_name: required_object_pks}\n\n elif interact_with == \"api\":\n related_objects_data = {\n \"relationships\": {related_field_name: {target_side: {\"objects\": required_object_pks}}}\n }\n\n response = self.send_data(from_model, {**create_data, **related_objects_data}, interact_with)\n\n if interact_with == \"ui\":\n self.assertHttpStatus(response, 200)\n self.assertContains(response, params[\"create_data\"][\"name\"])\n self.assertContains(response, \"Relationships\")\n\n elif interact_with == \"api\":\n self.assertHttpStatus(response, 201)\n\n # Check object was created:\n self.assertEqual(from_model.objects.count(), existing_count + 1)\n\n if interact_with == \"api\":\n \"\"\"\n - Relationship is marked as being not required\n - Object is created without the required relationship data (succeeds)\n - Relationship is marked as being required\n - Object is updated without the required relationship data (fails)\n - Object is updated with the required relationship data (succeeds)\n \"\"\"\n\n # Delete the object that was previously created, so we can test with the same data again\n from_model.objects.get(name=params[\"create_data\"][\"name\"]).delete()\n self.assertEqual(from_model.objects.count(), existing_count)\n\n # Relationship is marked as being not required\n params[\"relationship\"].required_on = RelationshipRequiredSideChoices.NEITHER_SIDE_REQUIRED\n params[\"relationship\"].save()\n\n # Object is created without the required relationship data (succeeds)\n response = self.send_data(from_model, create_data, interact_with)\n\n # Check object was created\n self.assertHttpStatus(response, 201)\n self.assertEqual(from_model.objects.count(), existing_count + 1)\n\n # Relationship is marked as being required\n params[\"relationship\"].required_on = required_on\n params[\"relationship\"].save()\n\n # Object is updated without the required relationship data (fails)\n newly_created_object = from_model.objects.get(name=params[\"create_data\"][\"name\"])\n response = self.send_data(\n from_model,\n {\n \"name\": f'{params[\"create_data\"][\"name\"]} edited',\n \"relationships\": {},\n },\n interact_with,\n action=\"edit\",\n url_kwargs={\"pk\": newly_created_object.pk},\n )\n self.assertHttpStatus(response, 400)\n expected_error_json = {\n \"relationships\": {\n related_field_name: [params[\"expected_errors\"][\"api\"][\"objects_not_specified\"]]\n }\n }\n self.assertEqual(expected_error_json, response.json())\n\n # Object is updated with the required relationship data (succeeds)\n response = self.send_data(\n from_model,\n {**{\"name\": f'{params[\"create_data\"][\"name\"]} edited'}, **related_objects_data},\n interact_with,\n action=\"edit\",\n url_kwargs={\"pk\": newly_created_object.pk},\n )\n self.assertHttpStatus(response, 200)\n self.assertEqual(f'{params[\"create_data\"][\"name\"]} edited', response.json()[\"name\"])\n\n \"\"\"\n - Object is created with the required relationship data (succeeds)\n - Object is updated without specifying \"relationships\" json key (succeeds, relationship\n remains in place)\n - Object is updated to remove the relationship data (fails)\n \"\"\"\n\n # Delete the object that was previously created, so we can test with the same data again\n from_model.objects.get(name=f'{params[\"create_data\"][\"name\"]} edited').delete()\n self.assertEqual(from_model.objects.count(), existing_count)\n\n # Object is created with the required relationship data (succeeds)\n response = self.send_data(from_model, {**create_data, **related_objects_data}, interact_with)\n self.assertHttpStatus(response, 201)\n self.assertEqual(params[\"create_data\"][\"name\"], response.json()[\"name\"])\n self.assertEqual(from_model.objects.count(), existing_count + 1)\n\n # Object is updated without specifying \"relationships\" json key\n # (succeeds, relationship associations remain in place)\n newly_created_object = from_model.objects.get(name=params[\"create_data\"][\"name\"])\n response = self.send_data(\n from_model,\n {\"name\": f'{params[\"create_data\"][\"name\"]} changed'},\n interact_with,\n action=\"edit\",\n url_kwargs={\"pk\": newly_created_object.pk},\n )\n self.assertHttpStatus(response, 200)\n self.assertEqual(f'{params[\"create_data\"][\"name\"]} changed', response.json()[\"name\"])\n\n # Object is updated to remove the relationship data (fails)\n response = self.send_data(\n from_model,\n {\n \"name\": f'{params[\"create_data\"][\"name\"]} changed again',\n \"relationships\": {},\n },\n interact_with,\n action=\"edit\",\n url_kwargs={\"pk\": newly_created_object.pk},\n )\n self.assertHttpStatus(response, 400)\n expected_error_json = {\n \"relationships\": {\n related_field_name: [params[\"expected_errors\"][\"api\"][\"objects_not_specified\"]]\n }\n }\n self.assertEqual(expected_error_json, response.json()) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/extras/tests/test_relationships.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n nautobot/extras/tests/test_relationships.py::instance\nnautobot/extras/tests/test_relationships.py::str\nnautobot/extras/tests/test_relationships.py::Relationship\nnautobot/extras/tests/test_relationships.py::getattr\nnautobot/extras/tests/test_relationships.py::create_test_device \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "26+train+nautobot--nautobot+CVE-2023-48705+vul.pkl", "func_name_": "required_relationships_test"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_post_broken_body():\n response = client.post(\"/items/\", data={\"name\": \"Foo\", \"price\": 50.5})\n assert response.status_code == 422, response.text\n assert response.json() == {\n \"detail\": [\n {\n \"ctx\": {\n \"colno\": 1,\n \"doc\": \"name=Foo&price=50.5\",\n \"lineno\": 1,\n \"msg\": \"Expecting value\",\n \"pos\": 0,\n },\n \"loc\": [\"body\", 0],\n \"msg\": \"Expecting value: line 1 column 1 (char 0)\",\n \"type\": \"value_error.jsondecode\",\n }\n ]\n }\n with patch(\"json.loads\", side_effect=Exception):\n response = client.post(\"/items/\", json={\"test\": \"test2\"})\n assert response.status_code == 400, response.text\n assert response.json() == {\"detail\": \"There was an error parsing the body\"} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_tutorial/test_body/test_tutorial001.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_tutorial/test_body/test_tutorial001.py::patch \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+tiangolo--fastapi+CVE-2021-32677+vul.pkl", "func_name_": "test_post_broken_body"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __call__(self, cmd, *args, **kwargs):\n self.cmd = cmd\n self.called += 1\n\n if self.tuples:\n return self.tuples.pop(0)\n return self.default_tuple \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: convert2rhel/unit_tests/subscription_test.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+oamg--convert2rhel+CVE-2022-0852+vul.pkl", "func_name_": "__call__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def train_stats(self, statistic=None):\n \"\"\"\n Return a named statistic collected during training, or a dictionary of all\n available statistics if no name given\n\n :param statistic: name of statistic\n :type statistic: str\n :return: some statistic collected during training of this tagger\n :rtype: any (but usually a number)\n \"\"\"\n if statistic is None:\n return self._training_stats\n else:\n return self._training_stats.get(statistic) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nltk/tag/brill.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "43+train+nltk--nltk+CVE-2021-3842+clean.pkl", "func_name_": "train_stats"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def runserverobj(method, docs=None, dt=None, dn=None, arg=None, args=None):\n\t\"\"\"run controller method - old style\"\"\"\n\tif not args: args = arg or \"\"\n\n\tif dt: # not called from a doctype (from a page)\n\t\tif not dn: dn = dt # single\n\t\tdoc = frappe.get_doc(dt, dn)\n\n\telse:\n\t\tdoc = frappe.get_doc(json.loads(docs))\n\t\tdoc._original_modified = doc.modified\n\t\tdoc.check_if_latest()\n\n\tif not doc.has_permission(\"read\"):\n\t\tfrappe.msgprint(_(\"Not permitted\"), raise_exception = True)\n\n\tif doc:\n\t\ttry:\n\t\t\targs = json.loads(args)\n\t\texcept ValueError:\n\t\t\targs = args\n\n\t\ttry:\n\t\t\tfnargs, varargs, varkw, defaults = inspect.getargspec(getattr(doc, method))\n\t\texcept ValueError:\n\t\t\tfnargs = inspect.getfullargspec(getattr(doc, method)).args\n\t\t\tvarargs = inspect.getfullargspec(getattr(doc, method)).varargs\n\t\t\tvarkw = inspect.getfullargspec(getattr(doc, method)).varkw\n\t\t\tdefaults = inspect.getfullargspec(getattr(doc, method)).defaults\n\n\t\tif not fnargs or (len(fnargs)==1 and fnargs[0]==\"self\"):\n\t\t\tr = doc.run_method(method)\n\n\t\telif \"args\" in fnargs or not isinstance(args, dict):\n\t\t\tr = doc.run_method(method, args)\n\n\t\telse:\n\t\t\tr = doc.run_method(method, **args)\n\n\t\tif r:\n\t\t\t#build output as csv\n\t\t\tif cint(frappe.form_dict.get('as_csv')):\n\t\t\t\tmake_csv_output(r, doc.doctype)\n\t\t\telse:\n\t\t\t\tfrappe.response['message'] = r\n\n\t\tfrappe.response.docs.append(doc) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: None.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+frappe--frappe+CVE-2022-23057+vul.pkl", "func_name_": "runserverobj"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def renderCell(self, item):\n value = get_value(item, self.attribute, default=())\n\n if not isinstance(value, (list, tuple)):\n value = (value,)\n\n gtool = getToolByName(plone.api.portal.get(), 'portal_groups')\n mtool = getToolByName(plone.api.portal.get(), 'portal_membership')\n principals = []\n for principal_id in value:\n user = mtool.getMemberById(principal_id)\n if user is not None:\n principals.append(user.getProperty('fullname', None) or user.getId())\n else:\n group = gtool.getGroupById(principal_id)\n if group is not None:\n principals.append(group.getProperty('title', None) or group.getId())\n\n return ', '.join(principals).decode('utf-8') \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/collective/dms/basecontent/browser/column.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/collective/dms/basecontent/browser/column.py::get_value \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+collective--collective.dms.basecontent+CVE-2022-4495+vul.pkl", "func_name_": "renderCell"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def del_version(request, client_id, project, version):\n if request.method == 'GET':\n client = Client.objects.get(id=client_id)\n try:\n scrapyd = get_scrapyd(client)\n result = scrapyd.delete_version(project=project, version=version)\n return JsonResponse(result)\n except ConnectionError:\n return JsonResponse({'message': 'Connect Error'}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: gerapy/server/core/views.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n gerapy/server/core/views.py::permission_classes\ngerapy/server/core/views.py::JsonResponse\ngerapy/server/core/views.py::api_view\ngerapy/server/core/views.py::get_scrapyd \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+Gerapy--Gerapy+CVE-2020-7698+vul.pkl", "func_name_": "del_version"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def should_show(account: TreeNode) -> bool:\n \"\"\"Determine whether the account should be shown.\"\"\"\n if not account.balance_children.is_empty() or any(\n should_show(a) for a in account.children\n ):\n return True\n ledger = g.ledger\n filtered = g.filtered\n if account.name not in ledger.accounts:\n return False\n fava_options = ledger.fava_options\n if not fava_options.show_closed_accounts and filtered.account_is_closed(\n account.name\n ):\n return False\n if (\n not fava_options.show_accounts_with_zero_balance\n and account.balance.is_empty()\n ):\n return False\n if (\n not fava_options.show_accounts_with_zero_transactions\n and not account.has_txns\n ):\n return False\n return True \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/fava/template_filters.py.\n//This function is called by other functions within the repository:\n src/fava/template_filters.py::should_show \n//This function itself calls other functions within the repository:\n src/fava/template_filters.py::any\nsrc/fava/template_filters.py::should_show \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "14+train+beancount--fava+CVE-2022-2514+clean.pkl", "func_name_": "should_show"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_current_user(self):\n \"\"\"Override to determine the current user from, e.g., a cookie.\"\"\"\n return None \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tornado/web.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "269+train+tornadoweb--tornado+CVE-2014-9720+clean.pkl", "func_name_": "get_current_user"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def add_text(self, text: str) -> BaseCard:\n \"\"\"\n Add text to the textual representation of this card.\n\n :param text: a string text\n :return: the updated card instance\n \"\"\"\n self._string_builder.write(text)\n return self \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/recipes/cards/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "15+train+mlflow--mlflow+CVE-2023-6709+clean.pkl", "func_name_": "add_text"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i GroupAttestationSigning:\n return GroupAttestationSigning(self) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: synapse/server.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n synapse/server.py::GroupAttestationSigning \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "80+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "get_groups_attestation_signing"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __setitem__(self, attr, obj):\n if self._scopes:\n self.validate_assignment(attr)\n self._scopes[-1].add(attr)\n assert isinstance(attr, str), f\"not a string: {attr}\"\n super().__setitem__(attr, obj) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/semantics/namespace.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n vyper/semantics/namespace.py::isinstance\nvyper/semantics/namespace.py::super \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "52+train+vyperlang--vyper+CVE-2023-42441+clean.pkl", "func_name_": "__setitem__"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get(self, request):\n model = self.queryset.model\n content_type = ContentType.objects.get_for_model(model)\n\n display_filter_params = []\n dynamic_filter_form = None\n filter_form = None\n\n if self.filterset:\n filter_params = self.get_filter_params(request)\n filterset = self.filterset(filter_params, self.queryset)\n self.queryset = filterset.qs\n if not filterset.is_valid():\n messages.error(\n request,\n mark_safe(f\"Invalid filters were specified: {filterset.errors}\"),\n )\n self.queryset = self.queryset.none()\n\n display_filter_params = [\n check_filter_for_display(filterset.filters, field_name, values)\n for field_name, values in filter_params.items()\n ]\n\n if request.GET:\n factory_formset_params = convert_querydict_to_factory_formset_acceptable_querydict(\n request.GET, filterset\n )\n dynamic_filter_form = DynamicFilterFormSet(filterset=filterset, data=factory_formset_params)\n else:\n dynamic_filter_form = DynamicFilterFormSet(filterset=filterset)\n\n if self.filterset_form:\n filter_form = self.filterset_form(filter_params, label_suffix=\"\")\n\n # Check for export template rendering\n if request.GET.get(\"export\"):\n et = get_object_or_404(\n ExportTemplate,\n content_type=content_type,\n name=request.GET.get(\"export\"),\n )\n try:\n return et.render_to_response(self.queryset)\n except Exception as e:\n messages.error(\n request,\n f\"There was an error rendering the selected export template ({et.name}): {e}\",\n )\n\n # Check for YAML export support\n elif \"export\" in request.GET and hasattr(model, \"to_yaml\"):\n response = HttpResponse(self.queryset_to_yaml(), content_type=\"text/yaml\")\n filename = f\"{settings.BRANDING_PREPENDED_FILENAME}{self.queryset.model._meta.verbose_name_plural}.yaml\"\n response[\"Content-Disposition\"] = f'attachment; filename=\"{filename}\"'\n return response\n\n # Provide a hook to tweak the queryset based on the request immediately prior to rendering the object list\n self.queryset = self.alter_queryset(request)\n\n # Compile a dictionary indicating which permissions are available to the current user for this model\n permissions = {}\n for action in (\"add\", \"change\", \"delete\", \"view\"):\n perm_name = get_permission_for_model(model, action)\n permissions[action] = request.user.has_perm(perm_name)\n\n table = None\n table_config_form = None\n if self.table:\n # Construct the objects table\n # Order By is needed in the table `__init__` method\n order_by = self.request.GET.getlist(\"sort\")\n table = self.table(self.queryset, user=request.user, order_by=order_by)\n if \"pk\" in table.base_columns and (permissions[\"change\"] or permissions[\"delete\"]):\n table.columns.show(\"pk\")\n\n # Apply the request context\n paginate = {\n \"paginator_class\": EnhancedPaginator,\n \"per_page\": get_paginate_count(request),\n }\n RequestConfig(request, paginate).configure(table)\n table_config_form = TableConfigForm(table=table)\n max_page_size = get_settings_or_config(\"MAX_PAGE_SIZE\")\n if max_page_size and paginate[\"per_page\"] > max_page_size:\n messages.warning(\n request,\n f'Requested \"per_page\" is too large. No more than {max_page_size} items may be displayed at a time.',\n )\n\n # For the search form field, use a custom placeholder.\n q_placeholder = \"Search \" + bettertitle(model._meta.verbose_name_plural)\n search_form = SearchForm(data=request.GET, q_placeholder=q_placeholder)\n\n valid_actions = self.validate_action_buttons(request)\n\n context = {\n \"content_type\": content_type,\n \"table\": table,\n \"permissions\": permissions,\n \"action_buttons\": valid_actions,\n \"table_config_form\": table_config_form,\n \"filter_params\": display_filter_params,\n \"filter_form\": filter_form,\n \"dynamic_filter_form\": dynamic_filter_form,\n \"search_form\": search_form,\n \"list_url\": validated_viewname(model, \"list\"),\n \"title\": bettertitle(model._meta.verbose_name_plural),\n }\n\n # `extra_context()` would require `request` access, however `request` parameter cannot simply be\n # added to `extra_context()` because this method has been used by multiple apps without any parameters.\n # Changing 'def extra context()' to 'def extra context(request)' might break current methods\n # in plugins and core that either override or implement it without request.\n setattr(self, \"request\", request)\n context.update(self.extra_context())\n\n return render(request, self.template_name, context) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/core/views/generic.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n nautobot/core/views/generic.py::render \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+nautobot--nautobot+CVE-2023-48705+vul.pkl", "func_name_": "get"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def __init__(self, producer, consumer, finished):\n self._length = producer.length\n self._producer = producer\n self._consumer = consumer\n self._finished = finished \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/twisted/web/_newclient.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "202+train+twisted--twisted+CVE-2019-12387+clean.pkl", "func_name_": "__init__"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_override_splash_url():\n mw = _get_mw()\n req1 = scrapy.Request(\"http://example.com\", meta={\n 'splash': {\n 'endpoint': 'render.png',\n 'splash_url': 'http://splash.example.com'\n }\n })\n req = mw.process_request(req1, None)\n assert req.url == 'http://splash.example.com/render.png'\n assert json.loads(to_native_str(req.body)) == {'url': req1.url} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_middleware.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_middleware.py::_get_mw\ntests/test_middleware.py::to_native_str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "27+train+scrapy-plugins--scrapy-splash+CVE-2021-41124+clean.pkl", "func_name_": "test_override_splash_url"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_hook_i18n(self):\n actions.update_course_config(\n COURSE_NAME,\n {\n 'html_hooks': {'base': {'after_body_tag_begins': 'foozle'}},\n 'extra_locales': [\n {'locale': 'de', 'availability': 'available'},\n ]\n })\n\n hook_bundle = {\n 'content': {\n 'type': 'html',\n 'source_value': '',\n 'data': [{\n 'source_value': 'foozle',\n 'target_value': 'FUZEL',\n }],\n }\n }\n hook_key = i18n_dashboard.ResourceBundleKey(\n utils.ResourceHtmlHook.TYPE, 'base.after_body_tag_begins', 'de')\n with common_utils.Namespace(NAMESPACE):\n i18n_dashboard.ResourceBundleDAO.save(\n i18n_dashboard.ResourceBundleDTO(str(hook_key), hook_bundle))\n\n # Verify non-translated version.\n response = self.get(BASE_URL)\n dom = self.parse_html_string(response.body)\n html_hook = dom.find('.//div[@id=\"base-after-body-tag-begins\"]')\n self.assertEquals('foozle', html_hook.text)\n\n # Set preference to translated language, and check that that's there.\n with common_utils.Namespace(NAMESPACE):\n prefs = models.StudentPreferencesDAO.load_or_create()\n prefs.locale = 'de'\n models.StudentPreferencesDAO.save(prefs)\n\n response = self.get(BASE_URL)\n dom = self.parse_html_string(response.body)\n html_hook = dom.find('.//div[@id=\"base-after-body-tag-begins\"]')\n self.assertEquals('FUZEL', html_hook.text)\n\n # With no translation present, but preference set to foreign language,\n # verify that we fall back to the original language.\n\n # Remove translation bundle, and clear cache.\n with common_utils.Namespace(NAMESPACE):\n i18n_dashboard.ResourceBundleDAO.delete(\n i18n_dashboard.ResourceBundleDTO(str(hook_key), hook_bundle))\n i18n_dashboard.ProcessScopedResourceBundleCache.instance().clear()\n\n response = self.get(BASE_URL)\n dom = self.parse_html_string(response.body)\n html_hook = dom.find('.//div[@id=\"base-after-body-tag-begins\"]')\n self.assertEquals('foozle', html_hook.text) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: coursebuilder/tests/functional/admin_settings.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n coursebuilder/tests/functional/admin_settings.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "39+train+overdrive-diy--course-builder+CVE-2015-10049+clean.pkl", "func_name_": "test_hook_i18n"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i 1024 * 1024 * 100:\n return http_error(\n 400,\n \"File is too big\",\n \"Upload limit for file is 100Mb\"\n )\n with requests.get(url, stream=True) as r:\n if r.status_code != 200:\n return http_error(\n 400,\n \"Error getting file\",\n f\"Got status code: {r.status_code}\"\n )\n file_path = os.path.join(temp_dir_path, data['file'])\n with open(file_path, 'wb') as f:\n for chunk in r.iter_content(chunk_size=8192):\n f.write(chunk)\n\n original_file_name = data.get('original_file_name')\n\n file_path = os.path.join(temp_dir_path, data['file'])\n lp = file_path.lower()\n if lp.endswith(('.zip', '.tar.gz')):\n if lp.endswith('.zip'):\n with zipfile.ZipFile(file_path) as f:\n f.extractall(temp_dir_path)\n elif lp.endswith('.tar.gz'):\n with tarfile.open(file_path) as f:\n f.extractall(temp_dir_path)\n os.remove(file_path)\n files = os.listdir(temp_dir_path)\n if len(files) != 1:\n os.rmdir(temp_dir_path)\n return http_error(400, 'Wrong content.', 'Archive must contain only one data file.')\n file_path = os.path.join(temp_dir_path, files[0])\n mindsdb_file_name = files[0]\n if not os.path.isfile(file_path):\n os.rmdir(temp_dir_path)\n return http_error(400, 'Wrong content.', 'Archive must contain data file in root.')\n\n ca.file_controller.save_file(mindsdb_file_name, file_path, file_name=original_file_name)\n\n os.rmdir(temp_dir_path)\n\n return '', 200 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mindsdb/api/http/namespaces/file.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n mindsdb/api/http/namespaces/file.py::Config\nmindsdb/api/http/namespaces/file.py::open\nmindsdb/api/http/namespaces/file.py::len\nmindsdb/api/http/namespaces/file.py::int\nmindsdb/api/http/namespaces/file.py::http_error \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+mindsdb--mindsdb+CVE-2023-30620+vul.pkl", "func_name_": "put"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {\n return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedwriter.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "127+train+mymarilyn--clickhouse-driver+CVE-2020-26759+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n ) => [number, number, string] | undefined; \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: frontend/src/charts/tooltip.ts.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+beancount--fava+CVE-2022-2589+vul.pkl", "func_name_": "TooltipFindNode"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i current_age:\n retval = \"FRESH\"\n return retval \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: python3/httplib2/__init__.py.\n//This function is called by other functions within the repository:\n python3/httplib2/__init__.py::request \n//This function itself calls other functions within the repository:\n python3/httplib2/__init__.py::int\npython3/httplib2/__init__.py::max\npython3/httplib2/__init__.py::_parse_cache_control \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "38+train+httplib2--httplib2+CVE-2021-21240+vul.pkl", "func_name_": "_entry_disposition"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def print_train_stats():\n print(\n \"TEMPLATE STATISTICS (TRAIN) {} templates, {} rules)\".format(\n len(template_counts), len(tids)\n )\n )\n print(\n \"TRAIN ({tokencount:7d} tokens) initial {initialerrors:5d} {initialacc:.4f} \"\n \"final: {finalerrors:5d} {finalacc:.4f} \".format(**train_stats)\n )\n head = \"#ID | Score (train) | #Rules | Template\"\n print(head, \"\\n\", \"-\" * len(head), sep=\"\")\n train_tplscores = sorted(\n weighted_traincounts.items(), key=det_tplsort, reverse=True\n )\n for (tid, trainscore) in train_tplscores:\n s = \"{} | {:5d} {:5.3f} |{:4d} {:.3f} | {}\".format(\n tid,\n trainscore,\n trainscore / tottrainscores,\n template_counts[tid],\n template_counts[tid] / len(tids),\n Template.ALLTEMPLATES[int(tid)],\n )\n print(s) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nltk/tag/brill.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "3+train+nltk--nltk+CVE-2021-3842+vul.pkl", "func_name_": "print_template_statistics.print_train_stats"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_log_model(mlflow_client):\n experiment_id = mlflow_client.create_experiment(\"Log models\")\n with TempDir(chdr=True):\n model_paths = [f\"model/path/{i}\" for i in range(3)]\n mlflow.set_tracking_uri(mlflow_client.tracking_uri)\n with mlflow.start_run(experiment_id=experiment_id) as run:\n for i, m in enumerate(model_paths):\n mlflow.pyfunc.log_model(m, loader_module=\"mlflow.pyfunc\")\n mlflow.pyfunc.save_model(\n m,\n mlflow_model=Model(artifact_path=m, run_id=run.info.run_id),\n loader_module=\"mlflow.pyfunc\",\n )\n model = Model.load(os.path.join(m, \"MLmodel\"))\n run = mlflow.get_run(run.info.run_id)\n tag = run.data.tags[\"mlflow.log-model.history\"]\n models = json.loads(tag)\n model.utc_time_created = models[i][\"utc_time_created\"]\n\n history_model_meta = models[i].copy()\n original_model_uuid = history_model_meta.pop(\"model_uuid\")\n model_meta = model.to_dict().copy()\n new_model_uuid = model_meta.pop(\"model_uuid\")\n assert history_model_meta == model_meta\n assert original_model_uuid != new_model_uuid\n assert len(models) == i + 1\n for j in range(0, i + 1):\n assert models[j][\"artifact_path\"] == model_paths[j] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/tracking/test_rest_tracking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/tracking/test_rest_tracking.py::range\ntests/tracking/test_rest_tracking.py::Model\ntests/tracking/test_rest_tracking.py::enumerate\ntests/tracking/test_rest_tracking.py::TempDir\ntests/tracking/test_rest_tracking.py::len \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "98+train+mlflow--mlflow+CVE-2023-2780+clean.pkl", "func_name_": "test_log_model"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _rpsl_db_query_to_graphql_out(query: RPSLDatabaseQuery, info: GraphQLResolveInfo):\n \"\"\"\n Given an RPSL database query, execute it and clean up the output\n to be suitable to return to GraphQL.\n\n Main changes are:\n - Enum handling\n - Adding the asn and prefix fields if applicable\n - Ensuring the right fields are returned as a list of strings or a string\n \"\"\"\n database_handler = info.context['request'].app.state.database_handler\n if info.context.get('sql_trace'):\n if 'sql_queries' not in info.context:\n info.context['sql_queries'] = [repr(query)]\n else:\n info.context['sql_queries'].append(repr(query))\n\n for row in database_handler.execute_query(query, refresh_on_error=True):\n graphql_result = {snake_to_camel_case(k): v for k, v in row.items() if k != 'parsed_data'}\n if 'object_text' in row:\n graphql_result['objectText'] = remove_auth_hashes(row['object_text'])\n if 'rpki_status' in row:\n graphql_result['rpkiStatus'] = row['rpki_status']\n if row.get('ip_first') is not None and row.get('prefix_length'):\n graphql_result['prefix'] = row['ip_first'] + '/' + str(row['prefix_length'])\n if row.get('asn_first') is not None and row.get('asn_first') == row.get('asn_last'):\n graphql_result['asn'] = row['asn_first']\n\n object_type = resolve_rpsl_object_type(row)\n for key, value in row.get('parsed_data', dict()).items():\n if key == 'auth':\n value = remove_auth_hashes(value)\n graphql_type = schema.graphql_types[object_type][key]\n if graphql_type == 'String' and isinstance(value, list):\n value = '\\n'.join(value)\n graphql_result[snake_to_camel_case(key)] = value\n yield graphql_result \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: irrd/server/graphql/resolvers.py.\n//This function is called by other functions within the repository:\n irrd/server/graphql/resolvers.py::resolve_rpsl_objects\nirrd/server/graphql/resolvers.py::_resolve_subquery \n//This function itself calls other functions within the repository:\n irrd/server/graphql/resolvers.py::str\nirrd/server/graphql/resolvers.py::snake_to_camel_case\nirrd/server/graphql/resolvers.py::isinstance\nirrd/server/graphql/resolvers.py::resolve_rpsl_object_type\nirrd/server/graphql/resolvers.py::dict\nirrd/server/graphql/resolvers.py::remove_auth_hashes\nirrd/server/graphql/resolvers.py::repr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+irrdnet--irrd+CVE-2022-24798+vul.pkl", "func_name_": "_rpsl_db_query_to_graphql_out"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_slot_policy_single_slot():\n mw = _get_mw()\n meta = {'splash': {\n 'slot_policy': scrapy_splash.SlotPolicy.SINGLE_SLOT\n }}\n\n req1 = scrapy.Request(\"http://example.com/path?key=value\", meta=meta)\n req1 = mw.process_request(req1, None)\n\n req2 = scrapy.Request(\"http://fooexample.com/path?key=value\", meta=meta)\n req2 = mw.process_request(req2, None)\n\n assert req1.meta.get('download_slot')\n assert req1.meta['download_slot'] == req2.meta['download_slot'] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_middleware.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_middleware.py::_get_mw \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "29+train+scrapy-plugins--scrapy-splash+CVE-2021-41124+clean.pkl", "func_name_": "test_slot_policy_single_slot"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_parse_header_bad_content_length(self):\n data = b\"GET /foobar HTTP/8.4\\r\\ncontent-length: abc\\r\\n\"\n self.parser.parse_header(data)\n self.assertEqual(self.parser.body_rcv, None) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_parser.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+Pylons--waitress+CVE-2019-16792+vul.pkl", "func_name_": "test_parse_header_bad_content_length"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_total_outbufs_len_an_outbuf_size_gt_sys_maxint(self):\n from waitress.compat import MAXINT\n\n inst, _, map = self._makeOneWithMap()\n\n class DummyBuffer(object):\n chunks = []\n\n def append(self, data):\n self.chunks.append(data)\n\n class DummyData(object):\n def __len__(self):\n return MAXINT\n\n inst.total_outbufs_len = 1\n inst.outbufs = [DummyBuffer()]\n inst.write_soon(DummyData())\n # we are testing that this method does not raise an OverflowError\n # (see https://github.com/Pylons/waitress/issues/47)\n self.assertEqual(inst.total_outbufs_len, MAXINT + 1) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: waitress/tests/test_channel.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n waitress/tests/test_channel.py::DummyData\nwaitress/tests/test_channel.py::DummyBuffer \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "168+train+Pylons--waitress+CVE-2019-16785+clean.pkl", "func_name_": "test_total_outbufs_len_an_outbuf_size_gt_sys_maxint"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s None:\n \"\"\"\n Tell the mock http client to expect an outgoing GET request for the given key\n \"\"\"\n\n async def get_json(destination, path, ignore_backoff=False, **kwargs):\n self.assertTrue(ignore_backoff)\n self.assertEqual(destination, server_name)\n key_id = \"%s:%s\" % (signing_key.alg, signing_key.version)\n self.assertEqual(\n path, \"/_matrix/key/v2/server/%s\" % (urllib.parse.quote(key_id),)\n )\n\n response = {\n \"server_name\": server_name,\n \"old_verify_keys\": {},\n \"valid_until_ts\": 200 * 1000,\n \"verify_keys\": {\n key_id: {\n \"key\": signedjson.key.encode_verify_key_base64(\n signing_key.verify_key\n )\n }\n },\n }\n sign_json(response, server_name, signing_key)\n return response\n\n self.http_client.get_json.side_effect = get_json \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/rest/key/v2/test_remote_key_resource.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/rest/key/v2/test_remote_key_resource.py::sign_json \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "221+train+matrix-org--synapse+CVE-2021-21273+clean.pkl", "func_name_": "expect_outgoing_key_request"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def lookup_internal_function(self, method_name, args_ir, ast_source):\n # TODO is this the right module for me?\n \"\"\"\n Using a list of args, find the internal method to use, and\n the kwargs which need to be filled in by the compiler\n \"\"\"\n\n sig = self.sigs[\"self\"].get(method_name, None)\n\n def _check(cond, s=\"Unreachable\"):\n if not cond:\n raise CompilerPanic(s)\n\n # these should have been caught during type checking; sanity check\n _check(sig is not None)\n _check(sig.internal)\n _check(len(sig.base_args) <= len(args_ir) <= len(sig.args))\n # more sanity check, that the types match\n # _check(all(l.typ == r.typ for (l, r) in zip(args_ir, sig.args))\n\n num_provided_kwargs = len(args_ir) - len(sig.base_args)\n num_kwargs = len(sig.default_args)\n kwargs_needed = num_kwargs - num_provided_kwargs\n\n kw_vals = list(sig.default_values.values())[:kwargs_needed]\n\n return sig, kw_vals \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/context.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n vyper/codegen/context.py::len\nvyper/codegen/context.py::list\nvyper/codegen/context.py::_check \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+vyperlang--vyper+CVE-2023-32059+vul.pkl", "func_name_": "lookup_internal_function"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i redirection to login page (with base64\n of the originaly requested page (redirection after login)\n if user authenticated, not admin and must_admin enabled -> 403 error\n @boolean must_admin: flag \"user must be an administrator to access\n this page\"\n @rtype str: login of the user\n \"\"\"\n if self.auth_mode == 'none':\n return 'anonymous'\n username = self._check_session()\n\n if cherrypy.request.query_string == '':\n qs = ''\n else:\n qs = '?' + cherrypy.request.query_string\n # base64 of the requested URL\n b64requrl = base64.b64encode(cherrypy.url() + qs)\n if not username:\n # return to login page (with base64 of the url in query string\n if redir_login:\n raise cherrypy.HTTPRedirect(\n \"/signin?url=%(url)s\" % {'url': b64requrl},\n )\n else:\n raise cherrypy.HTTPError(\n \"403 Forbidden\",\n \"You must be logged in to access this ressource.\",\n )\n\n if 'connected' not in cherrypy.session \\\n or not cherrypy.session['connected']:\n if redir_login:\n raise cherrypy.HTTPRedirect(\n \"/signin?url=%(url)s\" % {'url': b64requrl},\n )\n else:\n raise cherrypy.HTTPError(\n \"403 Forbidden\",\n \"You must be logged in to access this ressource.\",\n )\n\n if cherrypy.session['connected'] and \\\n not cherrypy.session['isadmin']:\n if must_admin:\n # user is not an administrator, so he gets 403 Forbidden\n raise cherrypy.HTTPError(\n \"403 Forbidden\",\n \"You are not allowed to access this resource.\",\n )\n else:\n return username\n\n if cherrypy.session['connected'] and \\\n cherrypy.session['isadmin']:\n return username\n else:\n if redir_login:\n raise cherrypy.HTTPRedirect(\n \"/signin?url=%(url)s\" % {'url': b64requrl},\n )\n else:\n raise cherrypy.HTTPError(\n \"403 Forbidden\",\n \"You must be logged in to access this ressource.\",\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: ldapcherry/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+kakwa--ldapcherry+CVE-2019-25095+vul.pkl", "func_name_": "_check_auth"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _execute(cmd, verbose=False):\n output = None if verbose else subprocess.PIPE\n p = subprocess.Popen(cmd, stdout=output, stderr=output)\n return p.wait() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nltk/parse/malt.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "39+train+nltk--nltk+CVE-2021-3842+clean.pkl", "func_name_": "_execute"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n function verify_remove_resources(resource_id) {\n verify_remove(\n remove_resource, true, \"resource_list\", \"dialog_verify_remove_resources\",\n \"resource\", \"Remove resource(s)\", \"Resurce Removal\", resource_id\n );\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: pcsd/public/js/pcsd.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "63+train+ClusterLabs--pcs+CVE-2016-0721+clean.pkl", "func_name_": null} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def has_length_word(typ):\n # Consider moving this to an attribute on typ\n return isinstance(typ, (DArrayT, _BytestringT)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/core.py.\n//This function is called by other functions within the repository:\n vyper/codegen/core.py::_getelemptr_abi_helper\nvyper/codegen/core.py::_get_element_ptr_array \n//This function itself calls other functions within the repository:\n vyper/codegen/core.py::isinstance \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "52+train+vyperlang--vyper+CVE-2023-31146+clean.pkl", "func_name_": "has_length_word"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def is_local_uri(uri, is_tracking_or_registry_uri=True):\n \"\"\"\n Returns true if the specified URI is a local file path (/foo or file:/foo).\n\n :param uri: The URI.\n :param is_tracking_uri: Whether or not the specified URI is an MLflow Tracking or MLflow\n Model Registry URI. Examples of other URIs are MLflow artifact URIs,\n filesystem paths, etc.\n \"\"\"\n if uri == \"databricks\" and is_tracking_or_registry_uri:\n return False\n\n if is_windows() and uri.startswith(\"\\\\\\\\\"):\n # windows network drive path looks like: \"\\\\\\path\\...\"\n return False\n\n parsed_uri = urllib.parse.urlparse(uri)\n if parsed_uri.hostname and not (\n parsed_uri.hostname == \".\"\n or parsed_uri.hostname.startswith(\"localhost\")\n or parsed_uri.hostname.startswith(\"127.0.0.1\")\n ):\n return False\n\n scheme = parsed_uri.scheme\n if scheme == \"\" or scheme == \"file\":\n return True\n\n if is_windows() and len(scheme) == 1 and scheme.lower() == pathlib.Path(uri).drive.lower()[0]:\n return True\n\n return False \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mlflow/utils/uri.py.\n//This function is called by other functions within the repository:\n mlflow/utils/uri.py::resolve_uri_if_local \n//This function itself calls other functions within the repository:\n mlflow/utils/uri.py::len\nmlflow/utils/uri.py::is_windows \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+mlflow--mlflow+CVE-2023-6977+vul.pkl", "func_name_": "is_local_uri"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_adjust_timeout():\n mw = _get_mw()\n req1 = scrapy.Request(\"http://example.com\", meta = {\n 'splash': {'args': {'timeout': 60, 'html': 1}},\n\n # download_timeout is always present,\n # it is set by DownloadTimeoutMiddleware\n 'download_timeout': 30,\n })\n req1 = mw.process_request(req1, None)\n assert req1.meta['download_timeout'] > 60\n\n req2 = scrapy.Request(\"http://example.com\", meta = {\n 'splash': {'args': {'html': 1}},\n 'download_timeout': 30,\n })\n req2 = mw.process_request(req2, None)\n assert req2.meta['download_timeout'] == 30 \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_middleware.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_middleware.py::_get_mw \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "18+train+scrapy-plugins--scrapy-splash+CVE-2021-41124+vul.pkl", "func_name_": "test_adjust_timeout"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def set_api_version(self, api_version):\n \"\"\"Set or unset a specific API version for requests in this test case.\"\"\"\n if api_version is None:\n self.header[\"HTTP_ACCEPT\"] = \"application/json\"\n else:\n self.header[\"HTTP_ACCEPT\"] = f\"application/json; version={api_version}\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nautobot/core/testing/api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+nautobot--nautobot+CVE-2023-46128+clean.pkl", "func_name_": "set_api_version"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_validate_path_is_safe_good(path):\n validate_path_is_safe(path) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/tracking/test_rest_tracking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/tracking/test_rest_tracking.py::validate_path_is_safe \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "5+train+mlflow--mlflow+CVE-2023-6909+vul.pkl", "func_name_": "test_validate_path_is_safe_good"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_register_connector_template_disallow_custom_connector_functions(\n self,\n api_client: TestClient,\n register_connector_template_url,\n generate_auth_header,\n zip_file,\n status_code,\n details,\n request,\n ):\n CONFIG.security.allow_custom_connector_functions = False\n auth_header = generate_auth_header(scopes=[CONNECTOR_TEMPLATE_REGISTER])\n response = api_client.post(\n register_connector_template_url,\n headers=auth_header,\n files={\n \"file\": (\n \"template.zip\",\n request.getfixturevalue(zip_file).read(),\n \"application/zip\",\n )\n },\n )\n assert response.status_code == status_code\n assert response.json() == details \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/ops/api/v1/endpoints/test_saas_config_endpoints.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/ops/api/v1/endpoints/test_saas_config_endpoints.py::generate_auth_header \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "21+train+ethyca--fides+CVE-2023-41319+vul.pkl", "func_name_": "test_register_connector_template_disallow_custom_connector_functions"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def shrink_stream_by_size( value, size, join_by=\"..\", left_larger=True, beginning_on_size_error=False, end_on_size_error=False ):\n rval = ''\n if get_file_size( value ) > size:\n start = value.tell()\n len_join_by = len( join_by )\n min_size = len_join_by + 2\n if size < min_size:\n if beginning_on_size_error:\n rval = value.read( size )\n value.seek( start )\n return rval\n elif end_on_size_error:\n value.seek( -size, 2 )\n rval = value.read( size )\n value.seek( start )\n return rval\n raise ValueError( 'With the provided join_by value (%s), the minimum size value is %i.' % ( join_by, min_size ) )\n left_index = right_index = int( ( size - len_join_by ) / 2 )\n if left_index + right_index + len_join_by < size:\n if left_larger:\n left_index += 1\n else:\n right_index += 1\n rval = value.read( left_index ) + join_by\n value.seek( -right_index, 2 )\n rval += value.read( right_index )\n else:\n while True:\n data = value.read( CHUNK_SIZE )\n if not data:\n break\n rval += data\n return rval \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/galaxy/util/__init__.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "42+train+blankenberg--galaxy-data-resource+CVE-2015-10062+clean.pkl", "func_name_": "shrink_stream_by_size"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def scholar_search(query):\n if have_scholar:\n scholar_gen = scholarly.search_pubs(' '.join(query.split('+')))\n i=0\n result = []\n for publication in scholar_gen:\n del publication['source']\n result.append(publication)\n i+=1\n if(i>=10):\n break\n return Response(json.dumps(result),mimetype='application/json')\n else:\n return \"[]\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: cps/editbooks.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n cps/editbooks.py::Response \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "11+train+janeczku--calibre-web+CVE-2021-25964+clean.pkl", "func_name_": "scholar_search"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _dynarray_make_setter(dst, src):\n assert isinstance(src.typ, DArrayT)\n assert isinstance(dst.typ, DArrayT)\n\n if src.value == \"~empty\":\n return IRnode.from_list(STORE(dst, 0))\n\n if src.value == \"multi\":\n ret = [\"seq\"]\n # handle literals\n\n # write the length word\n store_length = STORE(dst, len(src.args))\n ann = None\n if src.annotation is not None:\n ann = f\"len({src.annotation})\"\n store_length = IRnode.from_list(store_length, annotation=ann)\n ret.append(store_length)\n\n n_items = len(src.args)\n for i in range(n_items):\n k = IRnode.from_list(i, typ=UINT256_T)\n dst_i = get_element_ptr(dst, k, array_bounds_check=False)\n src_i = get_element_ptr(src, k, array_bounds_check=False)\n ret.append(make_setter(dst_i, src_i))\n\n return ret\n\n with src.cache_when_complex(\"darray_src\") as (b1, src):\n # for ABI-encoded dynamic data, we must loop to unpack, since\n # the layout does not match our memory layout\n should_loop = src.encoding == Encoding.ABI and src.typ.value_type.abi_type.is_dynamic()\n\n # if the data is not validated, we must loop to unpack\n should_loop |= needs_clamp(src.typ.value_type, src.encoding)\n\n # performance: if the subtype is dynamic, there might be a lot\n # of unused space inside of each element. for instance\n # DynArray[DynArray[uint256, 100], 5] where all the child\n # arrays are empty - for this case, we recursively call\n # into make_setter instead of straight bytes copy\n # TODO we can make this heuristic more precise, e.g.\n # loop when subtype.is_dynamic AND location == storage\n # OR array_size <= /bound where loop is cheaper than memcpy/\n should_loop |= src.typ.value_type.abi_type.is_dynamic()\n\n with get_dyn_array_count(src).cache_when_complex(\"darray_count\") as (b2, count):\n ret = [\"seq\"]\n\n ret.append(STORE(dst, count))\n\n if should_loop:\n i = IRnode.from_list(_freshname(\"copy_darray_ix\"), typ=UINT256_T)\n\n loop_body = make_setter(\n get_element_ptr(dst, i, array_bounds_check=False),\n get_element_ptr(src, i, array_bounds_check=False),\n )\n loop_body.annotation = f\"{dst}[i] = {src}[i]\"\n\n ret.append([\"repeat\", i, 0, count, src.typ.count, loop_body])\n\n else:\n element_size = src.typ.value_type.memory_bytes_required\n # number of elements * size of element in bytes\n n_bytes = _mul(count, element_size)\n max_bytes = src.typ.count * element_size\n\n src_ = dynarray_data_ptr(src)\n dst_ = dynarray_data_ptr(dst)\n ret.append(copy_bytes(dst_, src_, n_bytes, max_bytes))\n\n return b1.resolve(b2.resolve(ret)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: vyper/codegen/core.py.\n//This function is called by other functions within the repository:\n vyper/codegen/core.py::make_setter \n//This function itself calls other functions within the repository:\n vyper/codegen/core.py::dynarray_data_ptr\nvyper/codegen/core.py::_mul\nvyper/codegen/core.py::len\nvyper/codegen/core.py::get_dyn_array_count\nvyper/codegen/core.py::needs_clamp\nvyper/codegen/core.py::range\nvyper/codegen/core.py::STORE\nvyper/codegen/core.py::copy_bytes\nvyper/codegen/core.py::make_setter\nvyper/codegen/core.py::isinstance\nvyper/codegen/core.py::_freshname\nvyper/codegen/core.py::get_element_ptr \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "1+train+vyperlang--vyper+CVE-2023-31146+vul.pkl", "func_name_": "_dynarray_make_setter"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i 1:\n ratio = 1\n\n r = ratio * 2.0 - 1\n g = ratio * 2.0\n\n if r < 0.0:\n r = 0.0\n if g > 1.0:\n g = 1.0\n\n rgb = (int((1 - r) * 255), int(g * 255), 0)\n color = \"#%02x%02x%02x\" % rgb\n return color\n\n if not by_router:\n for item in lease_data:\n network = IPNetwork(item[\"network\"])\n child = item\n\n if \"usage\" in item:\n child[\"ratio\"] = get_ratio(\n item[\"usage\"][\"available\"], item[\"usage\"][\"dynamic\"]\n )\n child[\"utilized\"] = (\n int((1 - child[\"ratio\"]) * 100)\n if child[\"ratio\"] is not None\n else 0\n )\n else:\n child[\"ratio\"] = 1\n child[\"utilized\"] = 0\n\n if \"ratio\" in item:\n child[\"style\"] = color(child[\"ratio\"])\n else:\n child[\"style\"] = \"#77f\"\n\n child[\"size\"] = network.size\n if network.prefixlen >= 28:\n child[\"size_width\"] = 50\n else:\n child[\"size_width\"] = (32 - 4 - network.prefixlen) ** 1.5 * 20 + 50\n\n lease_data = sorted(\n lease_data,\n key=lambda x: float(x[\"ratio\"]) if x[\"ratio\"] is not None else 1.1,\n )\n\n if request.accepted_renderer.format == \"html\":\n context = {\"lease_data\": lease_data, \"excluded_keys\": [\"style\"]}\n return Response(context, template_name=\"api/web/lease_usage.html\")\n else:\n return Response(\n lease_data,\n status=status.HTTP_200_OK,\n template_name=\"api/web/lease_usage.html\",\n )\n\n grouped_lease_data = {\"name\": \"routers\", \"children\": [], \"style\": \"#000033\"}\n\n for key, group in itertools.groupby(lease_data, lambda item: item[\"router\"]):\n\n if exclude_free and key is None:\n continue\n\n router = {\n \"name\": key.replace(\".gw.usu.edu\", \"\") if key is not None else \"FREE\",\n \"children\": [],\n }\n\n for item in group:\n network = IPNetwork(item[\"network\"])\n child = item\n\n if \"usage\" in item:\n child[\"ratio\"] = get_ratio(\n item[\"usage\"][\"available\"], item[\"usage\"][\"dynamic\"]\n )\n else:\n child[\"ratio\"] = 1\n\n # if key is not None:\n if \"ratio\" in item:\n child[\"style\"] = color(child[\"ratio\"])\n else:\n child[\"style\"] = \"#77f\"\n\n child[\"name\"] = item[\"network\"]\n child[\"desc\"] = item[\"portdesc\"]\n child[\"size\"] = network.size\n child[\"value\"] = network.size if network.size > 256 else 256\n del child[\"router\"]\n\n router[\"children\"].append(child)\n\n grouped_lease_data[\"children\"].append(router)\n\n return Response(\n grouped_lease_data,\n status=status.HTTP_200_OK,\n template_name=\"api/web/lease_usage.html\",\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: openipam/api/views/report.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n openipam/api/views/report.py::F\nopenipam/api/views/report.py::str\nopenipam/api/views/report.py::Response \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "9+train+openipam--django-openipam+CVE-2022-4595+clean.pkl", "func_name_": "get"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def from_cryptography(cls, crypto_req):\n \"\"\"\n Construct based on a ``cryptography`` *crypto_req*.\n\n :param crypto_req: A ``cryptography`` X.509 certificate signing request\n :type crypto_req: ``cryptography.x509.CertificateSigningRequest``\n\n :rtype: PKey\n\n .. versionadded:: 17.1.0\n \"\"\"\n if not isinstance(crypto_req, x509.CertificateSigningRequest):\n raise TypeError(\"Must be a certificate signing request\")\n\n req = cls()\n req._req = crypto_req._x509_req\n return req \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/OpenSSL/crypto.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/OpenSSL/crypto.py::isinstance\nsrc/OpenSSL/crypto.py::TypeError\nsrc/OpenSSL/crypto.py::cls \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "210+train+pyca--pyopenssl+CVE-2018-1000807+clean.pkl", "func_name_": "from_cryptography"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _validate_signature_algorithms(self):\n if self.cert.signature_algorithm_oid._name not in self.signature_algorithms:\n return self.cert.signature_algorithm_oid._name \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: plugins/modules/x509_certificate.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "20+train+ansible-collections--community.crypto+CVE-2020-25646+clean.pkl", "func_name_": "_validate_signature_algorithms"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.queue.erase(i)}.bind(this);return i.name=e,Object.keys(this.getRunning()).length>=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s{h}\" for h in headers))\n row_start = \"\"\n cell_name = cell_count = \"{0}\\n\"\n row_end = \"\"\n mime = \"text/html\"\n end = \"\"\n else:\n start = \"{0}\\n{1} {2}\\n{0}\".format(\n RST_HEADING,\n \" \".join(f\"{h:40}\" for h in headers[:2]),\n \" \".join(f\"{h:24}\" for h in headers[2:]),\n )\n row_start = \"\"\n cell_name = \"{0:40} \"\n cell_count = \"{0:24} \"\n row_end = \"\"\n mime = \"text/plain\"\n end = RST_HEADING\n\n result = [start]\n\n for item in data:\n if row_start:\n result.append(row_start)\n result.append(\n \"\".join(\n (\n cell_name.format(item[\"name\"] or \"Anonymous\"),\n cell_name.format(item[\"email\"] or \"\"),\n cell_count.format(item[\"count\"]),\n cell_count.format(item[\"edits\"]),\n cell_count.format(item[\"words\"]),\n cell_count.format(item[\"chars\"]),\n cell_count.format(item[\"t_words\"]),\n cell_count.format(item[\"t_chars\"]),\n cell_count.format(item[\"count_new\"]),\n cell_count.format(item[\"edits_new\"]),\n cell_count.format(item[\"words_new\"]),\n cell_count.format(item[\"chars_new\"]),\n cell_count.format(item[\"t_words_new\"]),\n cell_count.format(item[\"t_chars_new\"]),\n cell_count.format(item[\"count_approve\"]),\n cell_count.format(item[\"edits_approve\"]),\n cell_count.format(item[\"words_approve\"]),\n cell_count.format(item[\"chars_approve\"]),\n cell_count.format(item[\"t_words_approve\"]),\n cell_count.format(item[\"t_chars_approve\"]),\n cell_count.format(item[\"count_edit\"]),\n cell_count.format(item[\"edits_edit\"]),\n cell_count.format(item[\"words_edit\"]),\n cell_count.format(item[\"chars_edit\"]),\n cell_count.format(item[\"t_words_edit\"]),\n cell_count.format(item[\"t_chars_edit\"]),\n )\n )\n )\n if row_end:\n result.append(row_end)\n\n result.append(end)\n\n return HttpResponse(\"\\n\".join(result), content_type=f\"{mime}; charset=utf-8\") \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: weblate/trans/views/reports.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n weblate/trans/views/reports.py::HttpResponse\nweblate/trans/views/reports.py::ReportsForm\nweblate/trans/views/reports.py::show_form_errors\nweblate/trans/views/reports.py::redirect_param\nweblate/trans/views/reports.py::get_component\nweblate/trans/views/reports.py::get_project\nweblate/trans/views/reports.py::generate_counts\nweblate/trans/views/reports.py::JsonResponse \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "6+train+WeblateOrg--weblate+CVE-2022-24710+vul.pkl", "func_name_": "get_counts"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_check_needed_repos_availability_no_repo_available(self):\n subscription.check_needed_repos_availability([\"rhel\"])\n self.assertTrue(\"rhel repository is not available\" in logging.Logger.warning.msg) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: convert2rhel/unit_tests/subscription_test.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n convert2rhel/unit_tests/subscription_test.py::LogMocked\nconvert2rhel/unit_tests/subscription_test.py::PromptUserMocked \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+oamg--convert2rhel+CVE-2022-0852+clean.pkl", "func_name_": "test_check_needed_repos_availability_no_repo_available"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *__pyx_pf_17clickhouse_driver_14bufferedreader_14BufferedReader_6buffer___get__(struct __pyx_obj_17clickhouse_driver_14bufferedreader_BufferedReader *__pyx_v_self) {\n PyObject *__pyx_r = NULL;\n __Pyx_RefNannyDeclarations\n __Pyx_RefNannySetupContext(\"__get__\", 0);\n __Pyx_XDECREF(__pyx_r);\n __Pyx_INCREF(__pyx_v_self->buffer);\n __pyx_r = __pyx_v_self->buffer;\n goto __pyx_L0;\n\n /* function exit code */\n __pyx_L0:;\n __Pyx_XGIVEREF(__pyx_r);\n __Pyx_RefNannyFinishContext();\n return __pyx_r;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedreader.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "467+train+mymarilyn--clickhouse-driver+CVE-2020-26759+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def connector_template_duplicate_datasets(\n self,\n planet_express_config,\n planet_express_dataset,\n planet_express_functions,\n planet_express_icon,\n ):\n return create_zip_file(\n {\n \"config.yml\": planet_express_config,\n \"1_dataset.yml\": planet_express_dataset,\n \"2_dataset.yml\": planet_express_dataset,\n \"functions.py\": planet_express_functions,\n \"icon.svg\": planet_express_icon,\n }\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/ops/api/v1/endpoints/test_saas_config_endpoints.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/ops/api/v1/endpoints/test_saas_config_endpoints.py::create_zip_file \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "10+train+ethyca--fides+CVE-2023-41319+vul.pkl", "func_name_": "connector_template_duplicate_datasets"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def getFirstName(self):\n \"\"\"\n Returns the first name of the current user\n\n @return: First Name\n @rtype: String\n \"\"\"\n\n return self._blitzcon.getUser().firstName or self.getName() \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: omeroweb/webgateway/views.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+ome--omero-web+CVE-2021-21376+clean.pkl", "func_name_": "getFirstName"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n this.parent(this.doc,e);var i=t.getWindow(),n=i.location.href.match(/^[^#]*/)[0]+\"#\";$$(this.options.links||this.doc.links).each(function(e){if(0==e.href.indexOf(n)){var t=e.href.substr(n.length);t&&this.useLink(e,t)}},this),this.addEvent(\"complete\",function(){i.location.hash=this.anchor,this.element.scrollTo(this.to[0],this.to[1])},!0)},useLink:function(e,t){return e.addEvent(\"click\",function(i){var n=document.id(t)||this.doc.getElement(\"a[name=\"+t+\"]\");n&&(i.preventDefault(),this.toElement(n,this.options.axes).chain(function(){this.fireEvent(\"scrolledTo\",[e,n])}.bind(this)),this.anchor=t)}.bind(this)),this}}),Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:\"vertical\"},initialize:function(e,t){this.parent(e,t),this.elements.each(function(e){\"static\"==e.getStyle(\"position\")&&e.setStyle(\"position\",\"relative\")}),this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(e,t){return t})},sort:function(){if(!this.check(arguments))return this;var e=Array.flatten(arguments),t=0,i=0,n={},s={},a=\"vertical\"==this.options.mode,r=this.elements.map(function(e,n){var r,o=e.getComputedSize({styles:[\"border\",\"padding\",\"margin\"]});a?(r={top:t,margin:o[\"margin-top\"],height:o.totalHeight},t+=r.height-o[\"margin-top\"]):(r={left:i,margin:o[\"margin-left\"],width:o.totalWidth},i+=r.width);var l=a?\"top\":\"left\";s[n]={};var h=e.getStyle(l).toInt();return s[n][l]=h||0,r},this);this.set(s),e=e.map(function(e){return e.toInt()}),e.length!=this.elements.length&&(this.currentOrder.each(function(t){e.contains(t)||e.push(t)}),e.length>this.elements.length&&e.splice(this.elements.length-1,e.length-this.elements.length));var o=0;t=i=0,e.each(function(e){var s={};a?(s.top=t-r[e].top-o,t+=r[e].height):(s.left=i-r[e].left,i+=r[e].width),o+=r[e].margin,n[e]=s},this);var l={};return Array.clone(e).sort().each(function(e){l[e]=n[e]}),this.start(l),this.currentOrder=e,this},rearrangeDOM:function(e){e=e||this.currentOrder;var t=this.elements[0].getParent(),i=[];return this.elements.setStyle(\"opacity\",0),e.each(function(e){i.push(this.elements[e].inject(t).setStyles({top:0,left:0}))},this),this.elements.setStyle(\"opacity\",1),this.elements=$$(i),this.setDefaultOrder(),this},getDefaultOrder:function(){return this.elements.map(function(e,t){return t})},getCurrentOrder:function(){return this.currentOrder},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(e){return this.sort(e.map(function(e){return this.elements.indexOf(e)},this))},swap:function(e,t){\"element\"==typeOf(e)&&(e=this.elements.indexOf(e)),\"element\"==typeOf(t)&&(t=this.elements.indexOf(t));var i=Array.clone(this.currentOrder);return i[this.currentOrder.indexOf(e)]=t,i[this.currentOrder.indexOf(t)]=e,this.sort(i)}}),function(){var e=this.Keyboard=new Class({Extends:Events,Implements:[Options],options:{defaultEventType:\"keydown\",active:!1,manager:null,events:{},nonParsedEvents:[\"activate\",\"deactivate\",\"onactivate\",\"ondeactivate\",\"changed\",\"onchanged\"]},initialize:function(e){e&&e.manager&&(this._manager=e.manager,delete e.manager),this.setOptions(e),this._setup()},addEvent:function(t,i,n){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i,n)},removeEvent:function(t,i){return this.parent(e.parse(t,this.options.defaultEventType,this.options.nonParsedEvents),i)},toggleActive:function(){return this[this.isActive()?\"deactivate\":\"activate\"]()},activate:function(t){if(t){if(t.isActive())return this;this._activeKB&&t!=this._activeKB&&(this.previous=this._activeKB,this.previous.fireEvent(\"deactivate\")),this._activeKB=t.fireEvent(\"activate\"),e.manager.fireEvent(\"changed\")}else this._manager&&this._manager.activate(this);return this},isActive:function(){return this._manager?this._manager._activeKB==this:e.manager==this},deactivate:function(t){return t?t===this._activeKB&&(this._activeKB=null,t.fireEvent(\"deactivate\"),e.manager.fireEvent(\"changed\")):this._manager&&this._manager.deactivate(this),this},relinquish:function(){return this.isActive()&&this._manager&&this._manager.previous?this._manager.activate(this._manager.previous):this.deactivate(),this},manage:function(e){return e._manager&&e._manager.drop(e),this._instances.push(e),e._manager=this,this._activeKB||this.activate(e),this},drop:function(e){return e.relinquish(),this._instances.erase(e),this._activeKB==e&&(this.previous&&this._instances.contains(this.previous)?this.activate(this.previous):this._activeKB=this._instances[0]),this},trace:function(){e.trace(this)},each:function(t){e.each(this,t)},_instances:[],_disable:function(e){this._activeKB==e&&(this._activeKB=null)},_setup:function(){this.addEvents(this.options.events),e.manager&&!this._manager&&e.manager.manage(this),this.options.active?this.activate():this.relinquish()},_handle:function(e,t){if(!e.preventKeyboardPropagation){var i=!!this._manager;i&&this._activeKB&&(this._activeKB._handle(e,t),e.preventKeyboardPropagation)||(this.fireEvent(t,e),!i&&this._activeKB&&this._activeKB._handle(e,t))}}}),t={},i=[\"shift\",\"control\",\"alt\",\"meta\"],n=/^(?:shift|control|ctrl|alt|meta)$/;e.parse=function(e,s,a){if(a&&a.contains(e.toLowerCase()))return e;if(e=e.toLowerCase().replace(/^(keyup|keydown):/,function(e,t){return s=t,\"\"}),!t[e])if(\"+\"!=e){var r,o={};e.split(\"+\").each(function(e){n.test(e)?o[e]=!0:r=e}),o.control=o.control||o.ctrl;var l=[];i.each(function(e){o[e]&&l.push(e)}),r&&l.push(r),t[e]=l.join(\"+\")}else t[e]=e;return s+\":keys(\"+t[e]+\")\"},e.each=function(t,i){for(var n=t||e.manager;n;)i(n),n=n._activeKB},e.stop=function(e){e.preventKeyboardPropagation=!0},e.manager=new e({active:!0}),e.trace=function(t){t=t||e.manager;var i=window.console&&console.log;i&&console.log(\"the following items have focus: \"),e.each(t,function(e){i&&console.log(document.id(e.widget)||e.wiget||e)})};var s=function(t){var s=[];i.each(function(e){t[e]&&s.push(e)}),n.test(t.key)||s.push(t.key),e.manager._handle(t,t.type+\":keys(\"+s.join(\"+\")+\")\")};document.addEvents({keyup:s,keydown:s})}(),Keyboard.prototype.options.nonParsedEvents.combine([\"rebound\",\"onrebound\"]),Keyboard.implement({addShortcut:function(e,t){return this._shortcuts=this._shortcuts||[],this._shortcutIndex=this._shortcutIndex||{},t.getKeyboard=Function.convert(this),t.name=e,this._shortcutIndex[e]=t,this._shortcuts.push(t),t.keys&&this.addEvent(t.keys,t.handler),this},addShortcuts:function(e){for(var t in e)this.addShortcut(t,e[t]);return this},removeShortcut:function(e){var t=this.getShortcut(e);return t&&t.keys&&(this.removeEvent(t.keys,t.handler),delete this._shortcutIndex[e],this._shortcuts.erase(t)),this},removeShortcuts:function(e){return e.each(this.removeShortcut,this),this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(e){return(this._shortcutIndex||{})[e]}}),Keyboard.rebind=function(e,t){Array.convert(t).each(function(t){t.getKeyboard().removeEvent(t.keys,t.handler),t.getKeyboard().addEvent(e,t.handler),t.keys=e,t.getKeyboard().fireEvent(\"rebound\")})},Keyboard.getActiveShortcuts=function(e){var t=[],i=[];return Keyboard.each(e,[].push.bind(t)),t.each(function(e){i.extend(e.getShortcuts())}),i},Keyboard.getShortcut=function(e,t,i){i=i||{};var n=i.many?[]:null,s=i.many?function(t){var i=t.getShortcut(e);i&&n.push(i)}:function(t){n||(n=t.getShortcut(e))};return Keyboard.each(t,s),n},Keyboard.getShortcuts=function(e,t){return Keyboard.getShortcut(e,t,{many:!0})},function(){this.HtmlTable=new Class({Implements:[Options,Events,Class.Occlude],options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[],headers:[],footers:[]},property:\"HtmlTable\",initialize:function(){var e=Array.link(arguments,{options:Type.isObject,table:Type.isElement,id:Type.isString});if(this.setOptions(e.options),!e.table&&e.id&&(e.table=document.id(e.id)),this.element=e.table||new Element(\"table\",this.options.properties),this.occlude())return this.occluded;this.build()},build:function(){this.element.store(\"HtmlTable\",this),this.body=document.id(this.element.tBodies[0])||new Element(\"tbody\").inject(this.element),$$(this.body.rows),this.options.headers.length?this.setHeaders(this.options.headers):this.thead=document.id(this.element.tHead),this.thead&&(this.head=this.getHead()),this.options.footers.length&&this.setFooters(this.options.footers),this.tfoot=document.id(this.element.tFoot),this.tfoot&&(this.foot=document.id(this.tfoot.rows[0])),this.options.rows.each(function(e){this.push(e)},this)},toElement:function(){return this.element},empty:function(){return this.body.empty(),this},set:function(e,t){var i=\"headers\"==e?\"tHead\":\"tFoot\",n=i.toLowerCase();this[n]=(document.id(this.element[i])||new Element(n).inject(this.element,\"top\")).empty();var s=this.push(t,{},this[n],\"headers\"==e?\"th\":\"td\");return\"headers\"==e?this.head=this.getHead():this.foot=this.getHead(),s},getHead:function(){var e=this.thead.rows;return e.length>1?$$(e):!!e.length&&document.id(e[0])},setHeaders:function(e){return this.set(\"headers\",e),this},setFooters:function(e){return this.set(\"footers\",e),this},update:function(e,t,i){var n=e.getChildren(i||\"td\"),s=n.length-1;return t.each(function(t,a){var r=n[a]||new Element(i||\"td\").inject(e),o=(t&&Object.prototype.hasOwnProperty.call(t,\"content\")?t.content:\"\")||t,l=typeOf(o);t&&Object.prototype.hasOwnProperty.call(t,\"properties\")&&r.set(t.properties),/(element(s?)|array|collection)/.test(l)?r.empty().adopt(o):r.set(\"html\",o),a>s?n.push(r):n[a]=r}),{tr:e,tds:n}},push:function(e,t,i,n,s){return\"element\"==typeOf(e)&&\"tr\"==e.get(\"tag\")?(e.inject(i||this.body,s),{tr:e,tds:e.getChildren(\"td\")}):this.update(new Element(\"tr\",t).inject(i||this.body,s),e,n)},pushMany:function(e,t,i,n,s){return e.map(function(e){return this.push(e,t,i,n,s)},this)}})}(),[\"adopt\",\"inject\",\"wraps\",\"grab\",\"replaces\",\"dispose\"].each(function(e){HtmlTable.implement(e,function(){return this.element[e].apply(this.element,arguments),this})}),HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:!0,classRowSelected:\"table-tr-selected\",classRowHovered:\"table-tr-hovered\",classSelectable:\"table-selectable\",shiftForMultiSelect:!0,allowMultiSelect:!0,selectable:!1,selectHiddenRows:!1},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.selectedRows=new Elements,this.bound||(this.bound={}),this.bound.mouseleave=this.mouseleave.bind(this),this.bound.clickRow=this.clickRow.bind(this),this.bound.activateKeyboard=function(){this.keyboard&&this.selectEnabled&&this.keyboard.activate()}.bind(this),this.options.selectable&&this.enableSelect()},empty:function(){return this.body.rows.length&&this.selectNone(),this.previous()},enableSelect:function(){return this.selectEnabled=!0,this.attachSelects(),this.element.addClass(this.options.classSelectable),this},disableSelect:function(){return this.selectEnabled=!1,this.attachSelects(!1),this.element.removeClass(this.options.classSelectable),this},push:function(){var e=this.previous.apply(this,arguments);return this.updateSelects(),e},toggleRow:function(e){return this[(this.isSelected(e)?\"de\":\"\")+\"selectRow\"](e)},selectRow:function(e,t){if(!this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.options.allowMultiSelect||this.selectNone(),this.isSelected(e)||(this.selectedRows.push(e),e.addClass(this.options.classRowSelected),this.fireEvent(\"rowFocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\")),this.focused=e,document.clearSelection(),this},isSelected:function(e){return this.selectedRows.contains(e)},getSelected:function(){return this.selectedRows},serialize:function(){var e=this.previous.apply(this,arguments)||{};return this.options.selectable&&(e.selectedRows=this.selectedRows.map(function(e){return Array.indexOf(this.body.rows,e)}.bind(this))),e},restore:function(e){this.options.selectable&&e.selectedRows&&e.selectedRows.each(function(e){this.selectRow(this.body.rows[e])}.bind(this)),this.previous.apply(this,arguments)},deselectRow:function(e,t){if(this.isSelected(e)&&(t||this.body.getChildren().contains(e)))return this.selectedRows=new Elements(Array.convert(this.selectedRows).erase(e)),e.removeClass(this.options.classRowSelected),this.fireEvent(\"rowUnfocus\",[e,this.selectedRows]),this.fireEvent(\"stateChanged\"),this},selectAll:function(e){if(e||this.options.allowMultiSelect)return this.selectRange(0,this.body.rows.length,e),this},selectNone:function(){return this.selectAll(!0)},selectRange:function(e,t,i){if(this.options.allowMultiSelect||i){var n=i?\"deselectRow\":\"selectRow\",s=Array.clone(this.body.rows);if(\"element\"==typeOf(e)&&(e=s.indexOf(e)),\"element\"==typeOf(t)&&(t=s.indexOf(t)),(t=t0)return null;if(t)i+=e;else{var n=0;if(e>0)for(;ne&&i>0;)this.body.rows[--i].isDisplayed()&&n--}return i},attachSelects:function(e){e=null==e||e;var t=e?\"addEvents\":\"removeEvents\";if(this.element[t]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}),this.body[t]({\"click:relay(tr)\":this.bound.clickRow,\"contextmenu:relay(tr)\":this.bound.clickRow}),this.options.useKeyboard||this.keyboard){if(this.keyboard||(this.keyboard=new Keyboard),!this.selectKeysDefined){this.selectKeysDefined=!0;var i,n,s=function(e){var t=function(s){clearTimeout(i),s.preventDefault();var a=this.body.rows[this.getRowByOffset(e,this.options.selectHiddenRows)];s.shift&&a&&this.isSelected(a)?(this.deselectRow(this.focused),this.focused=a):(!a||this.options.allowMultiSelect&&s.shift||this.selectNone(),this.shiftFocus(e,s)),i=n?t.delay(100,this,s):function(){n=!0,t(s)}.delay(400)}.bind(this);return t}.bind(this),a=function(){clearTimeout(i),n=!1};this.keyboard.addEvents({\"keydown:shift+up\":s(-1),\"keydown:shift+down\":s(1),\"keyup:shift+up\":a,\"keyup:shift+down\":a,\"keyup:up\":a,\"keyup:down\":a});var r=\"\";this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard&&(r=\" (Shift multi-selects).\"),this.keyboard.addShortcuts({\"Select Previous Row\":{keys:\"up\",shortcut:\"up arrow\",handler:s(-1),description:\"Select the previous row in the table.\"+r},\"Select Next Row\":{keys:\"down\",shortcut:\"down arrow\",handler:s(1),description:\"Select the next row in the table.\"+r}})}this.keyboard[e?\"activate\":\"deactivate\"]()}this.updateSelects()},mouseleave:function(){this.hovered&&this.leaveRow(this.hovered)}}),function(){var e=document.createElement(\"table\");try{e.innerHTML=\"\",e=0===e.childNodes.length}catch(t){e=!0}HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:!1,parsers:[],defaultParser:\"string\",classSortable:\"table-sortable\",classHeadSort:\"table-th-sort\",classHeadSortRev:\"table-th-sort-rev\",classNoSort:\"table-th-nosort\",classGroupHead:\"table-tr-group-head\",classGroup:\"table-tr-group\",classCellSort:\"table-td-sort\",classSortSpan:\"table-th-sort-span\",sortable:!1,thSelector:\"th\"},initialize:function(){if(this.previous.apply(this,arguments),this.occluded)return this.occluded;this.sorted={index:null,dir:1},this.bound||(this.bound={}),this.bound.headClick=this.headClick.bind(this),this.sortSpans=new Elements,this.options.sortable&&(this.enableSort(),null!=this.options.sortIndex&&this.sort(this.options.sortIndex,this.options.sortReverse))},attachSorts:function(e){this.detachSorts(),!1!==e&&this.element.addEvent(\"click:relay(\"+this.options.thSelector+\")\",this.bound.headClick)},detachSorts:function(){this.element.removeEvents(\"click:relay(\"+this.options.thSelector+\")\")},setHeaders:function(){this.previous.apply(this,arguments),this.sortable&&this.setParsers()},setParsers:function(){this.parsers=this.detectParsers()},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this)},detectParser:function(e,t){if(e.hasClass(this.options.classNoSort)||e.retrieve(\"htmltable-parser\"))return e.retrieve(\"htmltable-parser\");var i=new Element(\"div\");i.adopt(e.childNodes).inject(e);var n=new Element(\"span\",{class:this.options.classSortSpan}).inject(i,\"top\");this.sortSpans.push(n);var s,a=this.options.parsers[t],r=this.body.rows;switch(typeOf(a)){case\"function\":a={convert:a},s=!0;break;case\"string\":a=a,s=!0}return s||HtmlTable.ParserPriority.some(function(e){var i=HtmlTable.Parsers[e],n=i.match;if(!n)return!1;for(var s=0,o=r.length;so&&e[n].position--}},setRowStyle:function(e,t){this.previous(e,t),e.cells[this.sorted.index].addClass(this.options.classCellSort)},setGroupSort:function(e,t,i){return e==i.value?t.removeClass(this.options.classGroupHead).addClass(this.options.classGroup):t.removeClass(this.options.classGroup).addClass(this.options.classGroupHead),i.value},getParser:function(){var e=this.parsers[this.sorted.index];return\"string\"==typeOf(e)?HtmlTable.Parsers[e]:e},sort:function(t,i,n,s){if(this.head){n||(this.clearSort(),this.setSortedState(t,i),this.setHeadSort(!0));var a=this.getParser();if(a){var r;e||(r=this.body.getParent(),this.body.dispose());var o=this.parseData(a).sort(s||function(e,t){return e.value===t.value?0:e.value>t.value?1:-1}),l=this.sorted.reverse==(a==HtmlTable.Parsers[\"input-checked\"]);return l&&o.reverse(!0),this.setRowSort(o,n),r&&r.grab(this.body),this.fireEvent(\"stateChanged\"),this.fireEvent(\"sort\",[this.body,this.sorted.index,l?\"asc\":\"desc\"])}}},parseData:function(e){return Array.map(this.body.rows,function(t,i){return{position:i,value:e.convert.call(document.id(t.cells[this.sorted.index]))}},this)},clearSort:function(){this.setHeadSort(!1),this.body.getElements(\"td\").removeClass(this.options.classCellSort)},reSort:function(){return this.sortable&&this.sort.call(this,this.sorted.index,this.sorted.reverse),this},enableSort:function(){return this.element.addClass(this.options.classSortable),this.attachSorts(!0),this.setParsers(),this.sortable=!0,this},disableSort:function(){return this.element.removeClass(this.options.classSortable),this.attachSorts(!1),this.sortSpans.each(function(e){e.destroy()}),this.sortSpans.empty(),this.sortable=!1,this}}),HtmlTable.ParserPriority=[\"date\",\"input-checked\",\"input-value\",\"float\",\"number\"],HtmlTable.Parsers={date:{match:/^\\d{2}[-\\/ ]\\d{2}[-\\/ ]\\d{2,4}$/,convert:function(){var e=Date.parse(this.get(\"text\").stripTags());return\"date\"==typeOf(e)?e.format(\"db\"):\"\"},type:\"date\"},\"input-checked\":{match:/ type=\"(radio|checkbox)\"/,convert:function(){return this.getElement(\"input\").checked}},\"input-value\":{match:/e[o]+i[o]&&t[o]+e[o]!=n[o]&&(s[o]=(this.page[o]-e[o]+r-i[o])*this.options.velocity),s[o]=s[o].round();(s.y||s.x)&&this.fireEvent(\"change\",[t.x+s.x,t.y+s.y])}})}(),function(){var e=function(e,t){return e?\"function\"==typeOf(e)?e(t):t.get(e):\"\"};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle(\"display\",\"block\")},onHide:function(){this.tip.setStyle(\"display\",\"none\")},title:\"title\",text:function(e){return e.get(\"rel\")||e.get(\"href\")},showDelay:100,hideDelay:100,className:\"tip-wrap\",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:!1,waiAria:!0,hideEmpty:!1},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,elements:function(e){return null!=e}});this.setOptions(e.options),e.elements&&this.attach(e.elements),this.container=new Element(\"div\",{class:\"tip\"}),this.options.id&&(this.container.set(\"id\",this.options.id),this.options.waiAria&&this.attachWaiAria())},toElement:function(){return this.tip?this.tip:(this.tip=new Element(\"div\",{class:this.options.className,styles:{position:\"absolute\",top:0,left:0,display:\"none\"}}).adopt(new Element(\"div\",{class:\"tip-top\"}),this.container,new Element(\"div\",{class:\"tip-bottom\"})),this.tip)},attachWaiAria:function(){var e=this.options.id;this.container.set(\"role\",\"tooltip\"),this.waiAria||(this.waiAria={show:function(t){e&&t.set(\"aria-describedby\",e),this.container.set(\"aria-hidden\",\"false\")},hide:function(t){e&&t.erase(\"aria-describedby\"),this.container.set(\"aria-hidden\",\"true\")}}),this.addEvents(this.waiAria)},detachWaiAria:function(){this.waiAria&&(this.container.erase(\"role\"),this.container.erase(\"aria-hidden\"),this.removeEvents(this.waiAria))},attach:function(t){return $$(t).each(function(t){var i=e(this.options.title,t),n=e(this.options.text,t);t.set(\"title\",\"\").store(\"tip:native\",i).retrieve(\"tip:title\",i),t.retrieve(\"tip:text\",n),this.fireEvent(\"attach\",[t]);var s=[\"enter\",\"leave\"];this.options.fixed||s.push(\"move\"),s.each(function(e){var i=t.retrieve(\"tip:\"+e);i||(i=function(i){this[\"element\"+e.capitalize()].apply(this,[i,t])}.bind(this)),t.store(\"tip:\"+e,i).addEvent(\"mouse\"+e,i)},this)},this),this},detach:function(e){return $$(e).each(function(e){if([\"enter\",\"leave\",\"move\"].each(function(t){e.removeEvent(\"mouse\"+t,e.retrieve(\"tip:\"+t)).eliminate(\"tip:\"+t)}),this.fireEvent(\"detach\",[e]),\"title\"==this.options.title){var t=e.retrieve(\"tip:native\");t&&e.set(\"title\",t)}},this),this},elementEnter:function(e,t){clearTimeout(this.timer),this.timer=function(){this.container.empty();var i=!this.options.hideEmpty;[\"title\",\"text\"].each(function(e){var n=t.retrieve(\"tip:\"+e),s=this[\"_\"+e+\"Element\"]=new Element(\"div\",{class:\"tip-\"+e}).inject(this.container);n&&(this.fill(s,n),i=!0)},this),i?this.show(t):this.hide(t),this.position(this.options.fixed?{page:t.getPosition()}:e)}.delay(this.options.showDelay,this)},elementLeave:function(e,t){clearTimeout(this.timer),this.timer=this.hide.delay(this.options.hideDelay,this,t),this.fireForParent(e,t)},setTitle:function(e){return this._titleElement&&(this._titleElement.empty(),this.fill(this._titleElement,e)),this},setText:function(e){return this._textElement&&(this._textElement.empty(),this.fill(this._textElement,e)),this},fireForParent:function(e,t){(t=t.getParent())&&t!=document.body&&(t.retrieve(\"tip:enter\")?t.fireEvent(\"mouseenter\",e):this.fireForParent(e,t))},elementMove:function(e,t){this.position(e)},position:function(e){this.tip||document.id(this);var t=window.getSize(),i=window.getScroll(),n={x:this.tip.offsetWidth,y:this.tip.offsetHeight},s={x:\"left\",y:\"top\"},a={y:!1,x2:!1,y2:!1,x:!1},r={};for(var o in s)r[s[o]]=e.page[o]+this.options.offset[o],r[s[o]]<0&&(a[o]=!0),r[s[o]]+n[o]-i[o]>t[o]-this.options.windowPadding[o]&&(r[s[o]]=e.page[o]-this.options.offset[o]-n[o],a[o+\"2\"]=!0);this.fireEvent(\"bound\",a),this.tip.setStyles(r)},fill:function(e,t){\"string\"==typeof t?e.set(\"html\",t):e.adopt(t)},show:function(e){this.tip||document.id(this),this.tip.getParent()||this.tip.inject(document.body),this.fireEvent(\"show\",[this.tip,e])},hide:function(e){this.tip||document.id(this),this.fireEvent(\"hide\",[this.tip,e])}})}(),Locale.define(\"CH\",\"Number\",{decimal:\",\",group:\"'\",currency:{decimal:\".\",suffix:\" CHF\"}}),Locale.define(\"EU\",\"Number\",{decimal:\",\",group:\".\",currency:{prefix:\"\u20ac \"}}),function(){var e={json:JSON.decode};Locale.Set.defineParser=function(t,i){e[t]=i},Locale.Set.from=function(t,i){if(instanceOf(t,Locale.Set))return t;i||\"string\"!=typeOf(t)||(i=\"json\"),e[i]&&(t=e[i](t));var n=new Locale.Set;return n.sets=t.sets||{},t.inherits&&(n.inherits.locales=Array.convert(t.inherits.locales),n.inherits.sets=t.inherits.sets||{}),n}}(),Locale.define(\"ZA\",\"Number\",{decimal:\".\",group:\",\",currency:{prefix:\"R \"}}),Locale.define(\"af-ZA\",\"Date\",{months:[\"Januarie\",\"Februarie\",\"Maart\",\"April\",\"Mei\",\"Junie\",\"Julie\",\"Augustus\",\"September\",\"Oktober\",\"November\",\"Desember\"],months_abbr:[\"Jan\",\"Feb\",\"Mrt\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Okt\",\"Nov\",\"Des\"],days:[\"Sondag\",\"Maandag\",\"Dinsdag\",\"Woensdag\",\"Donderdag\",\"Vrydag\",\"Saterdag\"],days_abbr:[\"Son\",\"Maa\",\"Din\",\"Woe\",\"Don\",\"Vry\",\"Sat\"],dateOrder:[\"date\",\"month\",\"year\"],shortDate:\"%d-%m-%Y\",shortTime:\"%H:%M\",AM:\"VM\",PM:\"NM\",firstDayOfWeek:1,ordinal:function(e){return e>1&&e<20&&8!=e||e>100&&\"1\"==e.toString().substr(-2,1)?\"de\":\"ste\"},lessThanMinuteAgo:\"minder as 'n minuut gelede\",minuteAgo:\"ongeveer 'n minuut gelede\",minutesAgo:\"{delta} minute gelede\",hourAgo:\"omtret 'n uur gelede\",hoursAgo:\"ongeveer {delta} ure gelede\",dayAgo:\"1 dag gelede\",daysAgo:\"{delta} dae gelede\",weekAgo:\"1 week gelede\",weeksAgo:\"{delta} weke gelede\",monthAgo:\"1 maand gelede\",monthsAgo:\"{delta} maande gelede\",yearAgo:\"1 jaar gelede\",yearsAgo:\"{delta} jare gelede\",lessThanMinuteUntil:\"oor minder as 'n minuut\",minuteUntil:\"oor ongeveer 'n minuut\",minutesUntil:\"oor {delta} minute\",hourUntil:\"oor ongeveer 'n uur\",hoursUntil:\"oor {delta} uur\",dayUntil:\"oor ongeveer 'n dag\",daysUntil:\"oor {delta} dae\",weekUntil:\"oor 'n week\",weeksUntil:\"oor {delta} weke\",monthUntil:\"oor 'n maand\",monthsUntil:\"oor {delta} maande\",yearUntil:\"oor 'n jaar\",yearsUntil:\"oor {delta} jaar\"}),Locale.define(\"af-ZA\",\"FormValidator\",{required:\"Hierdie veld word vereis.\",length:\"Voer asseblief {length} karakters in (u het {elLength} karakters ingevoer)\",minLength:\"Voer asseblief ten minste {minLength} karakters in (u het {length} karakters ingevoer).\",maxLength:\"Moet asseblief nie meer as {maxLength} karakters invoer nie (u het {length} karakters ingevoer).\",integer:\"Voer asseblief 'n heelgetal in hierdie veld in. Getalle met desimale (bv. 1.25) word nie toegelaat nie.\",numeric:'Voer asseblief slegs numeriese waardes in hierdie veld in (bv. \"1\" of \"1.1\" of \"-1\" of \"-1.1\").',digits:\"Gebruik asseblief slegs nommers en punktuasie in hierdie veld. (by voorbeeld, 'n telefoon nommer wat koppeltekens en punte bevat is toelaatbaar).\",alpha:\"Gebruik asseblief slegs letters (a-z) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",alphanum:\"Gebruik asseblief slegs letters (a-z) en nommers (0-9) binne-in hierdie veld. Geen spasies of ander karakters word toegelaat nie.\",dateSuchAs:\"Voer asseblief 'n geldige datum soos {date} in\",dateInFormatMDY:'Voer asseblief \\'n geldige datum soos MM/DD/YYYY in (bv. \"12/31/1999\")',email:'Voer asseblief \\'n geldige e-pos adres in. Byvoorbeeld \"fred@domain.com\".',url:\"Voer asseblief 'n geldige bronadres (URL) soos http://www.example.com in.\",currencyDollar:\"Voer asseblief 'n geldige $ bedrag in. Byvoorbeeld $100.00 .\", \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/pyload/webui/app/static/vendor/MooTools/MooTools-More.min.js.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "128+train+pyload--pyload+CVE-2023-0435+vul.pkl", "func_name_": "selectNone"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static PyObject *__pyx_pw_17clickhouse_driver_14bufferedreader_14BufferedReader_5read(PyObject *__pyx_v_self, PyObject *__pyx_arg_unread) {\n Py_ssize_t __pyx_v_unread;\n PyObject *__pyx_r = 0;\n __Pyx_RefNannyDeclarations\n __Pyx_RefNannySetupContext(\"read (wrapper)\", 0);\n assert(__pyx_arg_unread); {\n __pyx_v_unread = __Pyx_PyIndex_AsSsize_t(__pyx_arg_unread); if (unlikely((__pyx_v_unread == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)\n }\n goto __pyx_L4_argument_unpacking_done;\n __pyx_L3_error:;\n __Pyx_AddTraceback(\"clickhouse_driver.bufferedreader.BufferedReader.read\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n __Pyx_RefNannyFinishContext();\n return NULL;\n __pyx_L4_argument_unpacking_done:;\n __pyx_r = __pyx_pf_17clickhouse_driver_14bufferedreader_14BufferedReader_4read(((struct __pyx_obj_17clickhouse_driver_14bufferedreader_BufferedReader *)__pyx_v_self), ((Py_ssize_t)__pyx_v_unread));\n\n /* function exit code */\n __Pyx_RefNannyFinishContext();\n return __pyx_r;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedreader.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "8+train+mymarilyn--clickhouse-driver+CVE-2020-26759+vul.pkl", "func_name_": "__pyx_pw_17clickhouse_driver_14bufferedreader_14BufferedReader_5read"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_attachment_url_without_upload(self) -> None:\n hamlet = self.example_user(\"hamlet\")\n self.login_user(hamlet)\n with self.assertLogs(level=\"WARNING\") as warn_log:\n body = f\"Test message ...[zulip.txt](http://{hamlet.realm.host}/user_uploads/{hamlet.realm_id}/64/fake_path_id.txt)\"\n message_id = self.send_stream_message(\n self.example_user(\"hamlet\"), \"Denmark\", body, \"test\"\n )\n self.assertFalse(\n Attachment.objects.filter(path_id=f\"{hamlet.realm_id}/64/fake_path_id.txt\").exists()\n )\n\n self.assertEqual(\n warn_log.output,\n [\n f\"WARNING:root:User {hamlet.id} tried to share upload {hamlet.realm_id}/64/fake_path_id.txt in message {message_id}, but lacks permission\"\n ],\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: zerver/tests/test_upload.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "53+train+zulip--zulip+CVE-2023-22735+clean.pkl", "func_name_": "test_attachment_url_without_upload"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i 4 and hasattr(__pyx_result, '__dict__'):\n * __pyx_result.__dict__.update(__pyx_state[4])\n */\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"'NoneType' object is not subscriptable\");\n __PYX_ERR(1, 12, __pyx_L1_error)\n }\n __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)\n __pyx_v___pyx_result->__pyx_base.buffer = __pyx_t_2;\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"'NoneType' object is not subscriptable\");\n __PYX_ERR(1, 12, __pyx_L1_error)\n }\n __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n __pyx_v___pyx_result->__pyx_base.buffer_size = __pyx_t_3;\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"'NoneType' object is not subscriptable\");\n __PYX_ERR(1, 12, __pyx_L1_error)\n }\n __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n __pyx_v___pyx_result->__pyx_base.position = __pyx_t_3;\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"'NoneType' object is not subscriptable\");\n __PYX_ERR(1, 12, __pyx_L1_error)\n }\n __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_GIVEREF(__pyx_t_1);\n __Pyx_GOTREF(__pyx_v___pyx_result->sock);\n __Pyx_DECREF(__pyx_v___pyx_result->sock);\n __pyx_v___pyx_result->sock = __pyx_t_1;\n __pyx_t_1 = 0;\n\n /* \"(tree fragment)\":13\n * cdef __pyx_unpickle_BufferedSocketWriter__set_state(BufferedSocketWriter __pyx_result, tuple __pyx_state):\n * __pyx_result.buffer = __pyx_state[0]; __pyx_result.buffer_size = __pyx_state[1]; __pyx_result.position = __pyx_state[2]; __pyx_result.sock = __pyx_state[3]\n * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<\n * __pyx_result.__dict__.update(__pyx_state[4])\n */\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"object of type 'NoneType' has no len()\");\n __PYX_ERR(1, 13, __pyx_L1_error)\n }\n __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)\n __pyx_t_5 = ((__pyx_t_3 > 4) != 0);\n if (__pyx_t_5) {\n } else {\n __pyx_t_4 = __pyx_t_5;\n goto __pyx_L4_bool_binop_done;\n }\n __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)\n __pyx_t_6 = (__pyx_t_5 != 0);\n __pyx_t_4 = __pyx_t_6;\n __pyx_L4_bool_binop_done:;\n if (__pyx_t_4) {\n\n /* \"(tree fragment)\":14\n * __pyx_result.buffer = __pyx_state[0]; __pyx_result.buffer_size = __pyx_state[1]; __pyx_result.position = __pyx_state[2]; __pyx_result.sock = __pyx_state[3]\n * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):\n * __pyx_result.__dict__.update(__pyx_state[4]) # <<<<<<<<<<<<<<\n */\n __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_7);\n __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_8);\n __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;\n if (unlikely(__pyx_v___pyx_state == Py_None)) {\n PyErr_SetString(PyExc_TypeError, \"'NoneType' object is not subscriptable\");\n __PYX_ERR(1, 14, __pyx_L1_error)\n }\n __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_7);\n __pyx_t_9 = NULL;\n if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {\n __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);\n if (likely(__pyx_t_9)) {\n PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);\n __Pyx_INCREF(__pyx_t_9);\n __Pyx_INCREF(function);\n __Pyx_DECREF_SET(__pyx_t_8, function);\n }\n }\n __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);\n __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;\n __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;\n if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)\n __Pyx_GOTREF(__pyx_t_1);\n __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;\n __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;\n\n /* \"(tree fragment)\":13\n * cdef __pyx_unpickle_BufferedSocketWriter__set_state(BufferedSocketWriter __pyx_result, tuple __pyx_state):\n * __pyx_result.buffer = __pyx_state[0]; __pyx_result.buffer_size = __pyx_state[1]; __pyx_result.position = __pyx_state[2]; __pyx_result.sock = __pyx_state[3]\n * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<\n * __pyx_result.__dict__.update(__pyx_state[4])\n */\n }\n\n /* \"(tree fragment)\":11\n * __pyx_unpickle_BufferedSocketWriter__set_state( __pyx_result, __pyx_state)\n * return __pyx_result\n * cdef __pyx_unpickle_BufferedSocketWriter__set_state(BufferedSocketWriter __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<\n * __pyx_result.buffer = __pyx_state[0]; __pyx_result.buffer_size = __pyx_state[1]; __pyx_result.position = __pyx_state[2]; __pyx_result.sock = __pyx_state[3]\n * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):\n */\n\n /* function exit code */\n __pyx_r = Py_None; __Pyx_INCREF(Py_None);\n goto __pyx_L0;\n __pyx_L1_error:;\n __Pyx_XDECREF(__pyx_t_1);\n __Pyx_XDECREF(__pyx_t_7);\n __Pyx_XDECREF(__pyx_t_8);\n __Pyx_XDECREF(__pyx_t_9);\n __Pyx_AddTraceback(\"clickhouse_driver.bufferedwriter.__pyx_unpickle_BufferedSocketWriter__set_state\", __pyx_clineno, __pyx_lineno, __pyx_filename);\n __pyx_r = 0;\n __pyx_L0:;\n __Pyx_XGIVEREF(__pyx_r);\n __Pyx_RefNannyFinishContext();\n return __pyx_r;\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: clickhouse_driver/bufferedwriter.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "29+train+mymarilyn--clickhouse-driver+CVE-2020-26759+vul.pkl", "func_name_": "__pyx_f_17clickhouse_driver_14bufferedwriter___pyx_unpickle_BufferedSocketWriter__set_state"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case\"top\":i.y=0;break;case\"bottom\":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}e.x+=i.x,e.y+=i.y},getCoordinateFromValue:function(e){return\"string\"!=typeOf(e)?e:(e=e.toLowerCase(),{x:e.test(\"left\")?\"left\":e.test(\"right\")?\"right\":\"center\",y:e.test(/upper|top/)?\"top\":e.test(\"bottom\")?\"bottom\":\"center\"})}};Element.implement({position:function(t){if(t&&(null!=t.x||null!=t.y))return e?e.apply(this,arguments):this;var i=this.setStyle(\"position\",\"absolute\").calculatePosition(t);return t&&t.returnPos?i:this.setStyles(i)},calculatePosition:function(e){return t.getPosition(this,e)}})}(Element.prototype.position),Element.implement({isDisplayed:function(){return\"none\"!=this.getStyle(\"display\")},isVisible:function(){var e=this.offsetWidth,t=this.offsetHeight;return(0!=e||0!=t)&&(e>0&&t>0||\"none\"!=this.style.display)},toggle:function(){return this[this.isDisplayed()?\"hide\":\"show\"]()},hide:function(){var e;try{e=this.getStyle(\"display\")}catch(e){}return\"none\"==e?this:this.store(\"element:_originalDisplay\",e||\"\").setStyle(\"display\",\"none\")},show:function(e){return!e&&this.isDisplayed()?this:(e=e||this.retrieve(\"element:_originalDisplay\")||\"block\",this.setStyle(\"display\",\"none\"==e?\"block\":e))},swapClass:function(e,t){return this.removeClass(e).addClass(t)}}),Document.implement({clearSelection:function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}}),Elements.from=function(e,t){(t||null==t)&&(e=e.stripScripts());var i,n=e.match(/^\\s*(?:\\s*)*<(t[dhr]|tbody|tfoot|thead)/i);if(n){i=new Element(\"table\");var s=n[1].toLowerCase();[\"td\",\"th\",\"tr\"].contains(s)&&(i=new Element(\"tbody\").inject(i),\"tr\"!=s&&(i=new Element(\"tr\").inject(i)))}return(i||new Element(\"div\")).set(\"html\",e).getChildren()},function(){var e=this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:\"iframeShim\",src:'javascript:false;document.write(\"\");',display:!1,zIndex:null,margin:0,offset:{x:0,y:0},browsers:!1},property:\"IframeShim\",initialize:function(e,t){return this.element=document.id(e),this.occlude()?this.occluded:(this.setOptions(t),this.makeShim(),this)},makeShim:function(){if(this.options.browsers){var t=this.element.getStyle(\"zIndex\").toInt();if(!t){t=1;var i=this.element.getStyle(\"position\");\"static\"!=i&&i||this.element.setStyle(\"position\",\"relative\"),this.element.setStyle(\"zIndex\",t)}t=(null!=this.options.zIndex||0===this.options.zIndex)&&t>this.options.zIndex?this.options.zIndex:t-1,t<0&&(t=1),this.shim=new Element(\"iframe\",{src:this.options.src,scrolling:\"no\",frameborder:0,styles:{zIndex:t,position:\"absolute\",border:\"none\",filter:\"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\"},class:this.options.className}).store(\"IframeShim\",this);var n=function(){this.shim.inject(this.element,\"after\"),this[this.options.display?\"show\":\"hide\"](),this.fireEvent(\"inject\")}.bind(this);e.ready?n():window.addEvent(\"load\",n)}else this.position=this.hide=this.show=this.dispose=Function.convert(this)},position:function(){if(!e.ready||!this.shim)return this;var t=this.element.measure(function(){return this.getSize()});return void 0!=this.options.margin&&(t.x=t.x-2*this.options.margin,t.y=t.y-2*this.options.margin,this.options.offset.x+=this.options.margin,this.options.offset.y+=this.options.margin),this.shim.set({width:t.x,height:t.y}).position({relativeTo:this.element,offset:this.options.offset}),this},hide:function(){return this.shim&&this.shim.setStyle(\"display\",\"none\"),this},show:function(){return this.shim&&this.shim.setStyle(\"display\",\"block\"),this.position()},dispose:function(){return this.shim&&this.shim.dispose(),this},destroy:function(){return this.shim&&this.shim.destroy(),this}})}(),window.addEvent(\"load\",function(){IframeShim.ready=!0}),function(){this.Mask=new Class({Implements:[Options,Events],Binds:[\"position\"],options:{style:{},class:\"mask\",maskMargins:!1,useIframeShim:!0,iframeShimOptions:{}},initialize:function(e,t){this.target=document.id(e)||document.id(document.body),this.target.store(\"mask\",this),this.setOptions(t),this.render(),this.inject()},render:function(){this.element=new Element(\"div\",{class:this.options.class,id:this.options.id||\"mask-\"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:\"none\"}),events:{click:function(e){this.fireEvent(\"click\",e),this.options.hideOnClick&&this.hide()}.bind(this)}}),this.hidden=!0},toElement:function(){return this.element},inject:function(e,t){t=t||(this.options.inject?this.options.inject.where:\"\")||(this.target==document.body?\"inside\":\"after\"),e=e||this.options.inject&&this.options.inject.target||this.target,this.element.inject(e,t),this.options.useIframeShim&&(this.shim=new IframeShim(this.element,this.options.iframeShimOptions),this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)}))},position:function(){return this.resize(this.options.width,this.options.height),this.element.position({relativeTo:this.target,position:\"topLeft\",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body}),this},resize:function(e,t){var i={styles:[\"padding\",\"border\"]};this.options.maskMargins&&i.styles.push(\"margin\");var n=this.target.getComputedSize(i);if(this.target==document.body){this.element.setStyles({width:0,height:0});var s=window.getScrollSize();n.totalHeight3&&e<21?\"th\":[\"th\",\"st\",\"nd\",\"rd\",\"th\"][Math.min(e%10,4)]},lessThanMinuteAgo:\"less than a minute ago\",minuteAgo:\"about a minute ago\",minutesAgo:\"{delta} minutes ago\",hourAgo:\"about an hour ago\",hoursAgo:\"about {delta} hours ago\",dayAgo:\"1 day ago\",daysAgo:\"{delta} days ago\",weekAgo:\"1 week ago\",weeksAgo:\"{delta} weeks ago\",monthAgo:\"1 month ago\",monthsAgo:\"{delta} months ago\",yearAgo:\"1 year ago\",yearsAgo:\"{delta} years ago\",lessThanMinuteUntil:\"less than a minute from now\",minuteUntil:\"about a minute from now\",minutesUntil:\"{delta} minutes from now\",hourUntil:\"about an hour from now\",hoursUntil:\"about {delta} hours from now\",dayUntil:\"1 day from now\",daysUntil:\"{delta} days from now\",weekUntil:\"1 week from now\",weeksUntil:\"{delta} weeks from now\",monthUntil:\"1 month from now\",monthsUntil:\"{delta} months from now\",yearUntil:\"1 year from now\",yearsUntil:\"{delta} years from now\"}),function(){var e=this.Date,t=e.Methods={ms:\"Milliseconds\",year:\"FullYear\",min:\"Minutes\",mo:\"Month\",sec:\"Seconds\",hr:\"Hours\"};[\"Date\",\"Day\",\"FullYear\",\"Hours\",\"Milliseconds\",\"Minutes\",\"Month\",\"Seconds\",\"Time\",\"TimezoneOffset\",\"Week\",\"Timezone\",\"GMTOffset\",\"DayOfYear\",\"LastMonth\",\"LastDayOfMonth\",\"UTCDate\",\"UTCDay\",\"UTCFullYear\",\"AMPM\",\"Ordinal\",\"UTCHours\",\"UTCMilliseconds\",\"UTCMinutes\",\"UTCMonth\",\"UTCSeconds\",\"UTCMilliseconds\"].each(function(t){e.Methods[t.toLowerCase()]=t});var i=function(e,t,n){return 1==t?e:e28)return 1;0==r&&o<-2&&(n=new e(n).decrement(\"day\",s),s=0),i=new e(n.get(\"year\"),0,1).get(\"day\")||7,i>4&&(a=-7)}else i=new e(n.get(\"year\"),0,1).get(\"day\");return a+=n.get(\"dayofyear\"),a+=6-s,(a+=(7+i-t)%7)/7},getOrdinal:function(t){return e.getMsg(\"ordinal\",t||this.get(\"date\"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,\"$1\").replace(/^.*?\\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\\)$/,\"$1$2$3\")},getGMTOffset:function(){var e=this.get(\"timezoneOffset\");return(e>0?\"-\":\"+\")+i((e.abs()/60).floor(),2)+i(e%60,2)},setAMPM:function(e){e=e.toUpperCase();var t=this.get(\"hr\");return t>11&&\"AM\"==e?this.decrement(\"hour\",12):t<12&&\"PM\"==e?this.increment(\"hour\",12):this},getAMPM:function(){return this.get(\"hr\")<12?\"AM\":\"PM\"},parse:function(t){return this.set(\"time\",e.parse(t)),this},isValid:function(e){return e||(e=this),\"date\"==typeOf(e)&&!isNaN(e.valueOf())},format:function(t){if(!this.isValid())return\"invalid date\";if(t||(t=\"%x %X\"),\"string\"==typeof t&&(t=a[t.toLowerCase()]||t),\"function\"==typeof t)return t(this);var n=this;return t.replace(/%([a-z%])/gi,function(t,s){switch(s){case\"a\":return e.getMsg(\"days_abbr\")[n.get(\"day\")];case\"A\":return e.getMsg(\"days\")[n.get(\"day\")];case\"b\":return e.getMsg(\"months_abbr\")[n.get(\"month\")];case\"B\":return e.getMsg(\"months\")[n.get(\"month\")];case\"c\":return n.format(\"%a %b %d %H:%M:%S %Y\");case\"d\":return i(n.get(\"date\"),2);case\"e\":return i(n.get(\"date\"),2,\" \");case\"H\":return i(n.get(\"hr\"),2);case\"I\":return i(n.get(\"hr\")%12||12,2);case\"j\":return i(n.get(\"dayofyear\"),3);case\"k\":return i(n.get(\"hr\"),2,\" \");case\"l\":return i(n.get(\"hr\")%12||12,2,\" \");case\"L\":return i(n.get(\"ms\"),3);case\"m\":return i(n.get(\"mo\")+1,2);case\"M\":return i(n.get(\"min\"),2);case\"o\":return n.get(\"ordinal\");case\"p\":return e.getMsg(n.get(\"ampm\"));case\"s\":return Math.round(n/1e3);case\"S\":return i(n.get(\"seconds\"),2);case\"T\":return n.format(\"%H:%M:%S\");case\"U\":return i(n.get(\"week\"),2);case\"w\":return n.get(\"day\");case\"x\":return n.format(e.getMsg(\"shortDate\"));case\"X\":return n.format(e.getMsg(\"shortTime\"));case\"y\":return n.get(\"year\").toString().substr(2);case\"Y\":return n.get(\"year\");case\"z\":return n.get(\"GMTOffset\");case\"Z\":return n.get(\"Timezone\")}return s})},toISOString:function(){return this.format(\"iso8601\")}}).alias({toJSON:\"toISOString\",compare:\"diff\",strftime:\"format\"});var n=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],s=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],a={db:\"%Y-%m-%d %H:%M:%S\",compact:\"%Y%m%dT%H%M%S\",short:\"%d %b %H:%M\",long:\"%B %d, %Y %H:%M\",rfc822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %Z\")},rfc2822:function(e){return n[e.get(\"day\")]+e.format(\", %d \")+s[e.get(\"month\")]+e.format(\" %Y %H:%M:%S %z\")},iso8601:function(e){return e.getUTCFullYear()+\"-\"+i(e.getUTCMonth()+1,2)+\"-\"+i(e.getUTCDate(),2)+\"T\"+i(e.getUTCHours(),2)+\":\"+i(e.getUTCMinutes(),2)+\":\"+i(e.getUTCSeconds(),2)+\".\"+i(e.getUTCMilliseconds(),3)+\"Z\"}},r=[],o=e.parse,l=function(t,i,n){var s=-1,a=e.getMsg(t+\"s\");switch(typeOf(i)){case\"object\":s=a[i.get(t)];break;case\"number\":if(!(s=a[i]))throw new Error(\"Invalid \"+t+\" index: \"+i);break;case\"string\":var r=a.filter(function(e){return this.test(e)},new RegExp(\"^\"+i,\"i\"));if(!r.length)throw new Error(\"Invalid \"+t+\" string\");if(r.length>1)throw new Error(\"Ambiguous \"+t);s=r[0]}return n?a.indexOf(s):s},h=1900,u=70;e.extend({getMsg:function(e,t){return Locale.get(\"Date.\"+e,t)},units:{ms:Function.convert(1),second:Function.convert(1e3),minute:Function.convert(6e4),hour:Function.convert(36e5),day:Function.convert(864e5),week:Function.convert(6084e5),month:function(t,i){var n=new e;return 864e5*e.daysInMonth(null!=t?t:n.get(\"mo\"),null!=i?i:n.get(\"year\"))},year:function(t){return t=t||(new e).get(\"year\"),e.isLeapYear(t)?316224e5:31536e6}},daysInMonth:function(t,i){return[31,e.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][t]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},parse:function(t){var i=typeOf(t);if(\"number\"==i)return new e(t);if(\"string\"!=i)return t;if(t=t.clean(),!t.length)return null;var n;return r.some(function(e){var i=e.re.exec(t);return!!i&&(n=e.handler(i))}),n&&n.isValid()||(n=new e(o(t)))&&n.isValid()||(n=new e(t.toInt())),n},parseDay:function(e,t){return l(\"day\",e,t)},parseMonth:function(e,t){return l(\"month\",e,t)},parseUTC:function(t){var i=new e(t),n=e.UTC(i.get(\"year\"),i.get(\"mo\"),i.get(\"date\"),i.get(\"hr\"),i.get(\"min\"),i.get(\"sec\"),i.get(\"ms\"));return new e(n)},orderIndex:function(t){return e.getMsg(\"dateOrder\").indexOf(t)+1},defineFormat:function(e,t){return a[e]=t,this},defineParser:function(e){return r.push(e.re&&e.handler?e:f(e)),this},defineParsers:function(){return Array.flatten(arguments).each(e.defineParser),this},define2DigitYearStart:function(e){return u=e%100,h=e-u,this}}).extend({defineFormats:e.defineFormat.overloadSetter()});var d=function(t){return new RegExp(\"(?:\"+e.getMsg(t).map(function(e){return e.substr(0,3)}).join(\"|\")+\")[a-z]*\")},c=function(t){switch(t){case\"T\":return\"%H:%M:%S\";case\"x\":return(1==e.orderIndex(\"month\")?\"%m[-./]%d\":\"%d[-./]%m\")+\"([-./]%y)?\";case\"X\":return\"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?\"}return null},m={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\\d/,s:/\\d+/,o:/[a-z]*/,p:/[ap]\\.?m\\.?/,y:/\\d{2}|\\d{4}/,Y:/\\d{4}/,z:/Z|[+-]\\d{2}(?::?\\d{2})?/};m.m=m.I,m.S=m.M;var g,p=function(e){g=e,m.a=m.A=d(\"days\"),m.b=m.B=d(\"months\"),r.each(function(e,t){e.format&&(r[t]=f(e.format))})},f=function(t){if(!g)return{format:t};var i=[],n=(t.source||t).replace(/%([a-z])/gi,function(e,t){return c(t)||e}).replace(/\\((?!\\?)/g,\"(?:\").replace(/ (?!\\?|\\*)/g,\",? \").replace(/%([a-z%])/gi,function(e,t){var n=m[t];return n?(i.push(t),\"(\"+n.source+\")\"):t}).replace(/\\[a-z\\]/gi,\"[a-z\\\\u00c0-\\\\uffff;&]\");return{format:t,re:new RegExp(\"^\"+n+\"$\",\"i\"),handler:function(t){t=t.slice(1).associate(i);var n=(new e).clearTime(),s=t.y||t.Y;null!=s&&v.call(n,\"y\",s),\"d\"in t&&v.call(n,\"d\",1),(\"m\"in t||t.b||t.B)&&v.call(n,\"m\",1);for(var a in t)v.call(n,a,t[a]);return n}}},v=function(t,i){if(!i)return this;switch(t){case\"a\":case\"A\":return this.set(\"day\",e.parseDay(i,!0));case\"b\":case\"B\":return this.set(\"mo\",e.parseMonth(i,!0));case\"d\":return this.set(\"date\",i);case\"H\":case\"I\":return this.set(\"hr\",i);case\"m\":return this.set(\"mo\",i-1);case\"M\":return this.set(\"min\",i);case\"p\":return this.set(\"ampm\",i.replace(/\\./g,\"\"));case\"S\":return this.set(\"sec\",i);case\"s\":return this.set(\"ms\",1e3*(\"0.\"+i));case\"w\":return this.set(\"day\",i);case\"Y\":return this.set(\"year\",i);case\"y\":return i=+i,i<100&&(i+=h+(i=0&&\"\"!=e.options[e.selectedIndex].value):null==e.get(\"value\")||0==e.get(\"value\").length}}),Form.Validator.addAllThese([[\"required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e){return!Form.Validator.getValidator(\"IsEmpty\").test(e)}}],[\"length\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.length)?Form.Validator.getMsg(\"length\").substitute({length:t.length,elLength:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.length)||(e.get(\"value\").length==t.length||0==e.get(\"value\").length)}}],[\"minLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.minLength)?Form.Validator.getMsg(\"minLength\").substitute({minLength:t.minLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return\"null\"==typeOf(t.minLength)||e.get(\"value\").length>=(t.minLength||0)}}],[\"maxLength\",{errorMsg:function(e,t){return\"null\"!=typeOf(t.maxLength)?Form.Validator.getMsg(\"maxLength\").substitute({maxLength:t.maxLength,length:e.get(\"value\").length}):\"\"},test:function(e,t){return e.get(\"value\").length<=(t.maxLength||1e4)}}],[\"validate-integer\",{errorMsg:Form.Validator.getMsg.pass(\"integer\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(-?[1-9]\\d*|0)$/.test(e.get(\"value\"))}}],[\"validate-numeric\",{errorMsg:Form.Validator.getMsg.pass(\"numeric\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^-?(?:0$0(?=\\d*\\.)|[1-9]|0)\\d*(\\.\\d+)?$/.test(e.get(\"value\"))}}],[\"validate-digits\",{errorMsg:Form.Validator.getMsg.pass(\"digits\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[\\d() .:\\-\\+#]+$/.test(e.get(\"value\"))}}],[\"validate-alpha\",{errorMsg:Form.Validator.getMsg.pass(\"alpha\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^[a-zA-Z]+$/.test(e.get(\"value\"))}}],[\"validate-alphanum\",{errorMsg:Form.Validator.getMsg.pass(\"alphanum\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||!/\\W/.test(e.get(\"value\"))}}],[\"validate-date\",{errorMsg:function(e,t){if(Date.parse){var i=t.dateFormat||\"%x\";return Form.Validator.getMsg(\"dateSuchAs\").substitute({date:(new Date).format(i)})}return Form.Validator.getMsg(\"dateInFormatMDY\")},test:function(e,t){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var i=Locale.get(\"Date\"),n=new RegExp([i.days,i.days_abbr,i.months,i.months_abbr,i.AM,i.PM].flatten().join(\"|\"),\"i\"),s=e.get(\"value\"),a=s.match(/[a-z]+/gi);if(a&&!a.every(n.exec,n))return!1;var r=Date.parse(s);if(!r)return!1;var o=t.dateFormat||\"%x\",l=r.format(o);return\"invalid date\"!=l&&e.set(\"value\",l),r.isValid()}}],[\"validate-email\",{errorMsg:Form.Validator.getMsg.pass(\"email\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(?:[a-z0-9!#$%&'*+\\/=?^_`{|}~-]\\.?){0,63}[a-z0-9!#$%&'*+\\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\])$/i.test(e.get(\"value\"))}}],[\"validate-url\",{errorMsg:Form.Validator.getMsg.pass(\"url\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^(https?|ftp|rmtp|mms):\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(:(\\d+))?\\/?/i.test(e.get(\"value\"))}}],[\"validate-currency-dollar\",{errorMsg:Form.Validator.getMsg.pass(\"currencyDollar\"),test:function(e){return Form.Validator.getValidator(\"IsEmpty\").test(e)||/^\\$?\\-?([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}\\d*(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$/.test(e.get(\"value\"))}}],[\"validate-one-required\",{errorMsg:Form.Validator.getMsg.pass(\"oneRequired\"),test:function(e,t){return(document.id(t[\"validate-one-required\"])||e.getParent(t[\"validate-one-required\"])).getElements(\"input\").some(function(e){return[\"checkbox\",\"radio\"].contains(e.get(\"type\"))?e.get(\"checked\"):e.get(\"value\")})}}]]),Element.Properties.validator={set:function(e){this.get(\"validator\").setOptions(e)},get:function(){var e=this.retrieve(\"validator\");return e||(e=new Form.Validator(this),this.store(\"validator\",e)),e}},Element.implement({validate:function(e){return e&&this.set(\"validator\",e),this.get(\"validator\").validate()}}),function(){function e(e,t,i,n){if(t&&e[t])return e[t];var s=document.id(e[i]);return s?s.getElements(n):[]}Form.Validator.addAllThese([[\"validate-enforce-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-ignore-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toIgnore\",\"ignoreChildrenOf\",\"input, select, textarea\").each(function(e){t.checked?(n.ignoreField(e),n.resetField(e)):n.enforceField(e)}),!0)}}],[\"validate-enforce-onselect-value\",{test:function(t,i){if(!i.value)return!0;var n=t.getParent(\"form\").retrieve(\"validator\");return!n||(e(i,\"toEnforce\",\"enforceChildrenOf\",\"input, select, textarea\").each(function(e){i.value==t.value?n.enforceField(e):(n.ignoreField(e),n.resetField(e))}),!0)}}],[\"validate-nospace\",{errorMsg:function(){return Form.Validator.getMsg(\"noSpace\")},test:function(e,t){return!e.get(\"value\").test(/\\s/)}}],[\"validate-toggle-oncheck\",{test:function(t,i){var n=t.getParent(\"form\").retrieve(\"validator\");if(!n)return!0;var s=e(i,\"toToggle\",\"toToggleChildrenOf\",\"input, select, textarea\");return t.checked?s.each(function(e){n.enforceField(e)}):s.each(function(e){n.ignoreField(e),n.resetField(e)}),!0}}],[\"validate-reqchk-bynode\",{errorMsg:function(){return Form.Validator.getMsg(\"reqChkByNode\")},test:function(t,i){return e(i,!1,\"nodeId\",i.selector||\"input[type=checkbox], input[type=radio]\").some(function(e){return e.checked})}}],[\"validate-required-check\",{errorMsg:function(e,t){return t.useTitle?e.get(\"title\"):Form.Validator.getMsg(\"requiredChk\")},test:function(e,t){return!!e.checked}}],[\"validate-reqchk-byname\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"reqChkByName\").substitute({label:t.label||e.get(\"type\")})},test:function(e,t){var i=t.groupName||e.get(\"name\"),n=$$(\"[name=\"+i+\"]\"),s=n.some(function(e,t){return e.checked}),a=e.getParent(\"form\").retrieve(\"validator\");return s&&a&&n.each(function(e,t){a.resetField(e)}),s}}],[\"validate-match\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"match\").substitute({matchName:decodeURIComponent((t.matchName+\"\").replace(/\\+/g,\"%20\"))||document.id(t.matchInput).get(\"name\")})},test:function(e,t){var i=e.get(\"value\"),n=document.id(t.matchInput)&&document.id(t.matchInput).get(\"value\");return!i||!n||i==n}}],[\"validate-after-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"afterDate\").substitute({label:t.afterLabel||(t.afterElement?Form.Validator.getMsg(\"startDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=document.id(t.afterElement)?Date.parse(document.id(t.afterElement).get(\"value\")):new Date,n=Date.parse(e.get(\"value\"));return!n||!i||n>=i}}],[\"validate-before-date\",{errorMsg:function(e,t){return Form.Validator.getMsg(\"beforeDate\").substitute({label:t.beforeLabel||(t.beforeElement?Form.Validator.getMsg(\"endDate\"):Form.Validator.getMsg(\"currentDate\"))})},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=document.id(t.beforeElement)?Date.parse(document.id(t.beforeElement).get(\"value\")):new Date;return!n||!i||n>=i}}],[\"validate-custom-required\",{errorMsg:function(){return Form.Validator.getMsg(\"required\")},test:function(e,t){return e.get(\"value\")!=t.emptyValue}}],[\"validate-same-month\",{errorMsg:function(e,t){var i=document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\");if(\"\"!=e.get(\"value\"))return Form.Validator.getMsg(i?\"sameMonth\":\"startMonth\")},test:function(e,t){var i=Date.parse(e.get(\"value\")),n=Date.parse(document.id(t.sameMonthAs)&&document.id(t.sameMonthAs).get(\"value\"));return!i||!n||i.format(\"%B\")==n.format(\"%B\")}}],[\"validate-cc-num\",{errorMsg:function(e){var t=e.get(\"value\").replace(/[^0-9]/g,\"\");return Form.Validator.getMsg(\"creditcard\").substitute({length:t.length})},test:function(e){if(Form.Validator.getValidator(\"IsEmpty\").test(e))return!0;var t=e.get(\"value\");t=t.replace(/[^0-9]/g,\"\");var i=!1;if(t.test(/^4[0-9]{12}([0-9]{3})?$/)?i=\"Visa\":t.test(/^5[1-5]([0-9]{14})$/)?i=\"Master Card\":t.test(/^3[47][0-9]{13}$/)?i=\"American Express\":t.test(/^6(?:011|5[0-9]{2})[0-9]{12}$/)?i=\"Discover\":t.test(/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/)&&(i=\"Diners Club\"),i){for(var n=0,s=0,a=t.length-1;a>=0;--a)0!=(s=t.charAt(a).toInt())&&((t.length-a)%2==0&&(s+=s),s>9&&(s=s.toString().charAt(0).toInt()+s.toString().charAt(1).toInt()),n+=s);if(n%10==0)return!0}for(var r=\"\";\"\"!=t;)r+=\" \"+t.substr(0,4),t=t.substr(4);return e.getParent(\"form\").retrieve(\"validator\").ignoreField(e),e.set(\"value\",r.clean()),e.getParent(\"form\").retrieve(\"validator\").enforceField(e),!1}}]])}(),Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(e){e.reveal?e.reveal():e.setStyle(\"display\",\"block\")},hideError:function(e){e.dissolve?e.dissolve():e.setStyle(\"display\",\"none\")},scrollToErrorsOnSubmit:!0,scrollToErrorsOnBlur:!1,scrollToErrorsOnChange:!1,scrollFxOptions:{transition:\"quad:out\",offset:{y:-20}}},initialize:function(e,t){this.parent(e,t),this.addEvent(\"onElementValidate\",function(e,t,i,n){var s=this.getValidator(i);if(!e&&s.getError(t)){n&&t.addClass(\"warning\");var a=this.makeAdvice(i,t,s.getError(t),n);this.insertAdvice(a,t),this.showAdvice(i,t)}else this.hideAdvice(i,t)})},makeAdvice:function(e,t,i,n){var s=n?this.warningPrefix:this.errorPrefix;s+=this.options.useTitles?t.title||i:i;var a=n?\"warning-advice\":\"validation-advice\",r=this.getAdvice(e,t);return r=r?r.set(\"html\",s):new Element(\"div\",{html:s,styles:{display:\"none\"},id:\"advice-\"+e.split(\":\")[0]+\"-\"+this.getFieldId(t)}).addClass(a),t.store(\"$moo:advice-\"+e,r),r},getFieldId:function(e){return e.id?e.id:e.id=\"input_\"+e.name},showAdvice:function(e,t){var i=this.getAdvice(e,t);!i||t.retrieve(\"$moo:\"+this.getPropName(e))||\"none\"!=i.getStyle(\"display\")&&\"hidden\"!=i.getStyle(\"visibility\")&&0!=i.getStyle(\"opacity\")||(t.store(\"$moo:\"+this.getPropName(e),!0),this.options.showError(i),this.fireEvent(\"showAdvice\",[t,i,e]))},hideAdvice:function(e,t){var i=this.getAdvice(e,t);i&&t.retrieve(\"$moo:\"+this.getPropName(e))&&(t.store(\"$moo:\"+this.getPropName(e),!1),this.options.hideError(i),this.fireEvent(\"hideAdvice\",[t,i,e]))},getPropName:function(e){return\"advice\"+e},resetField:function(e){return(e=document.id(e))?(this.parent(e),e.get(\"validators\").each(function(t){this.hideAdvice(t,e)},this),this):this},getAllAdviceMessages:function(e,t){var i=[];if(e.hasClass(\"ignoreValidation\")&&!t)return i;e.get(\"validators\").some(function(t){var n=t.test(\"^warn-\")||e.hasClass(\"warnOnly\");n&&(t=t.replace(/^warn-/,\"\"));var s=this.getValidator(t);s&&i.push({message:s.getError(e),warnOnly:n,passed:s.test(),validator:s})},this);return i},getAdvice:function(e,t){return t.retrieve(\"$moo:advice-\"+e)},insertAdvice:function(e,t){var i=t.get(\"validatorProps\");i.msgPos&&document.id(i.msgPos)?document.id(i.msgPos).grab(e):t.type&&\"radio\"==t.type.toLowerCase()?t.getParent().adopt(e):e.inject(document.id(t),\"after\")},validateField:function(e,t,i){var n=this.parent(e,t);if((this.options.scrollToErrorsOnSubmit&&null==i||i)&&!n){for(var s=document.id(this).getElement(\".validation-failed\"),a=document.id(this).getParent();a!=document.body&&a.getScrollSize().y==a.getSize().y;)a=a.getParent();var r=a.retrieve(\"$moo:fvScroller\");!r&&window.Fx&&Fx.Scroll&&(r=new Fx.Scroll(a,this.options.scrollFxOptions),a.store(\"$moo:fvScroller\",r)),s&&(r?r.toElement(s):a.scrollTo(a.getScroll().x,s.getPosition(a).y-20))}return n},watchFields:function(e){e.each(function(e){this.options.evaluateFieldsOnBlur&&e.addEvent(\"blur\",this.validationMonitor.pass([e,!1,this.options.scrollToErrorsOnBlur],this)),this.options.evaluateFieldsOnChange&&e.addEvent(\"change\",this.validationMonitor.pass([e,!0,this.options.scrollToErrorsOnChange],this))},this)}}),function(){var e=this.OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:[\"reposition\",\"assert\",\"focus\",\"hide\"],options:{element:\"label\",labelClass:\"overTxtLabel\",positionOptions:{position:\"upperLeft\",edge:\"upperLeft\",offset:{x:4,y:2}},poll:!1,pollInterval:250,wrap:!1},property:\"OverText\",initialize:function(t,i){if(t=this.element=document.id(t),this.occlude())return this.occluded;this.setOptions(i),this.attach(t),e.instances.push(this),this.options.poll&&this.poll()},toElement:function(){return this.element},attach:function(){var e=this.element,t=this.options,i=t.textOverride||e.get(\"alt\")||e.get(\"title\");if(!i)return this;var n=this.text=new Element(t.element,{class:t.labelClass,styles:{lineHeight:\"normal\",position:\"absolute\",cursor:\"text\"},html:i,events:{click:this.hide.pass(\"label\"==t.element,this)}}).inject(e,\"after\");return\"label\"==t.element&&(e.get(\"id\")||e.set(\"id\",\"input_\"+String.uniqueID()),n.set(\"for\",e.get(\"id\"))),t.wrap&&(this.textHolder=new Element(\"div.overTxtWrapper\",{styles:{lineHeight:\"normal\",position:\"relative\"}}).grab(n).inject(e,\"before\")),this.enable()},destroy:function(){return this.element.eliminate(this.property),this.disable(),this.text&&this.text.destroy(),this.textHolder&&this.textHolder.destroy(),this},disable:function(){return this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.removeEvent(\"resize\",this.reposition),this.hide(!0,!0),this},enable:function(){return this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}),window.addEvent(\"resize\",this.reposition),this.reposition(),this},wrap:function(){\"label\"==this.options.element&&(this.element.get(\"id\")||this.element.set(\"id\",\"input_\"+String.uniqueID()),this.text.set(\"for\",this.element.get(\"id\")))},startPolling:function(){return this.pollingPaused=!1,this.poll()},poll:function(e){return this.poller&&!e?this:(e?clearInterval(this.poller):this.poller=function(){this.pollingPaused||this.assert(!0)}.periodical(this.options.pollInterval,this),this)},stopPolling:function(){return this.pollingPaused=!0,this.poll(!0)},focus:function(){return!this.text||this.text.isDisplayed()&&!this.element.get(\"disabled\")?this.hide():this},hide:function(e,t){if(this.text&&this.text.isDisplayed()&&(!this.element.get(\"disabled\")||t)&&(this.text.hide(),this.fireEvent(\"textHide\",[this.text,this.element]),this.pollingPaused=!0,!e))try{this.element.fireEvent(\"focus\"),this.element.focus()}catch(e){}return this},show:function(){return document.id(this.text)&&!this.text.isDisplayed()&&(this.text.show(),this.reposition(),this.fireEvent(\"textShow\",[this.text,this.element]),this.pollingPaused=!1),this},test:function(){return!this.element.get(\"value\")},assert:function(e){return this[this.test()?\"show\":\"hide\"](e)},reposition:function(){return this.assert(!0),this.element.isVisible()?(this.text&&this.test()&&this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element})),this):this.stopPolling().hide()}})}(),OverText.instances=[],Object.append(OverText,{each:function(e){return OverText.instances.each(function(t,i){t.element&&t.text&&e.call(OverText,t,i)})},update:function(){return OverText.each(function(e){return e.reposition()})},hideAll:function(){return OverText.each(function(e){return e.hide(!0,!0)})},showAll:function(){return OverText.each(function(e){return e.show()})}}),Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(e,t){this.elements=this.subject=$$(e),this.parent(t)},compute:function(e,t,i){var n={};for(var s in e){var a=e[s],r=t[s],o=n[s]={};for(var l in a)o[l]=this.parent(a[l],r[l],i)}return n},set:function(e){for(var t in e)if(this.elements[t]){var i=e[t];for(var n in i)this.render(this.elements[t],n,i[n],this.options.unit)}return this},start:function(e){if(!this.check(e))return this;var t={},i={};for(var n in e)if(this.elements[n]){var s=e[n],a=t[n]={},r=i[n]={};for(var o in s){var l=this.prepare(this.elements[n],o,s[o]);a[o]=l.from,r[o]=l.to}}return this.parent(t,i)}}),Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:!1,fixedWidth:!1,display:0,show:!1,height:!0,width:!1,opacity:!0,alwaysHide:!1,trigger:\"click\",initialDisplayFx:!0,resetHeight:!0,keepOpen:!1},initialize:function(){var e=function(e){return null!=e},t=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:e,elements:e});this.parent(t.elements,t.options);var i=this.options,n=this.togglers=$$(t.togglers);this.previous=-1,this.internalChain=new Chain,i.alwaysHide&&(this.options.link=\"chain\"),(i.show||0===this.options.show)&&(i.display=!1,this.previous=i.show),i.start&&(i.display=!1,i.show=!1);var s=this.effects={};i.opacity&&(s.opacity=\"fullOpacity\"),i.width&&(s.width=i.fixedWidth?\"fullWidth\":\"offsetWidth\"),i.height&&(s.height=i.fixedHeight?\"fullHeight\":\"scrollHeight\");for(var a=0,r=n.length;a=0?n-1:0).chain(a):a(),this},detach:function(e){var t=function(e){e.removeEvent(this.options.trigger,e.retrieve(\"accordion:display\"))}.bind(this);return e?t(e):this.togglers.each(t),this},display:function(e,t){if(!this.check(e,t))return this;var i={},n=this.elements,s=this.options,a=this.effects,r=s.keepOpen,o=s.alwaysHide;if(null==t&&(t=!0),\"element\"==typeOf(e)&&(e=n.indexOf(e)),e==this.current&&!o&&!r)return this;if(s.resetHeight){var l=n[this.current];if(l&&!this.selfHidden)for(var h in a)l.setStyle(h,l[a[h]])}return this.timer&&\"chain\"==s.link?this:(null!=this.current&&(this.previous=this.current),this.current=e,this.selfHidden=!1,n.each(function(n,l){i[l]={};var h,u;if(!r||l==e){l==e&&(u=n.offsetHeight>0&&s.height||n.offsetWidth>0&&s.width),l!=e?h=!0:(o||r)&&u&&(h=!0,this.selfHidden=!0),this.fireEvent(h?\"background\":\"active\",[this.togglers[l],n]);for(var d in a)i[l][d]=h?0:n[a[d]];t||h||!s.resetHeight||(i[l].height=\"auto\")}},this),this.internalChain.clearChain(),this.internalChain.chain(function(){if(s.resetHeight&&!this.selfHidden){var t=n[e];t&&t.setStyle(\"height\",\"auto\")}}.bind(this)),t?this.start(i):this.set(i).internalChain.callChain())}}),Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:\"center\",edge:!1,offset:{x:0,y:0}},start:function(e){var t=this.element,i=t.getStyles(\"top\",\"left\");return\"auto\"!=i.top&&\"auto\"!=i.left||t.setPosition(t.getPosition(t.getOffsetParent())),this.parent(t.position(Object.merge({},this.options,e,{returnPos:!0})))}}),Element.Properties.move={set:function(e){return this.get(\"move\").cancel().setOptions(e),this},get:function(){var e=this.retrieve(\"move\");return e||(e=new Fx.Move(this,{link:\"cancel\"}),this.store(\"move\",e)),e}},Element.implement({move:function(e){return this.get(\"move\").start(e),this}}),function(){function e(e){return/^(?:body|html)$/i.test(e.tagName)}Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:!0},initialize:function(e,t){if(this.element=this.subject=document.id(e),this.parent(t),\"element\"!=typeOf(this.element)&&(this.element=document.id(this.element.getDocument().body)),this.options.wheelStops){var i=this.element,n=this.cancel.pass(!1,this);this.addEvent(\"start\",function(){i.addEvent(\"mousewheel\",n)},!0),this.addEvent(\"complete\",function(){i.removeEvent(\"mousewheel\",n)},!0)}},set:function(){var e=Array.flatten(arguments);return this.element.scrollTo(e[0],e[1]),this},compute:function(e,t,i){return[0,1].map(function(n){return Fx.compute(e[n],t[n],i)})},start:function(e,t){if(!this.check(e,t))return this;var i=this.element.getScroll();return this.parent([i.x,i.y],[e,t])},calculateScroll:function(e,t){var i=this.element,n=i.getScrollSize(),s=i.getScroll(),a=i.getSize(),r=this.options.offset,o={x:e,y:t};for(var l in o)o[l]||0===o[l]||(o[l]=s[l]),\"number\"!=typeOf(o[l])&&(o[l]=n[l]-a[l]),o[l]+=r[l];return[o.x,o.y]},toTop:function(){return this.start.apply(this,this.calculateScroll(!1,0))},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,!1))},toRight:function(){return this.start.apply(this,this.calculateScroll(\"right\",!1))},toBottom:function(){return this.start.apply(this,this.calculateScroll(!1,\"bottom\"))},toElement:function(t,i){i=i?Array.convert(i):[\"x\",\"y\"];var n=e(this.element)?{x:0,y:0}:this.element.getScroll(),s=Object.map(document.id(t).getPosition(this.element),function(e,t){return!!i.contains(t)&&e+n[t]});return this.start.apply(this,this.calculateScroll(s.x,s.y))},toElementEdge:function(e,t,i){t=t?Array.convert(t):[\"x\",\"y\"],e=document.id(e);var n={},s=e.getPosition(this.element),a=e.getSize(),r=this.element.getScroll(),o=this.element.getSize(),l={x:s.x+a.x,y:s.y+a.y};return[\"x\",\"y\"].each(function(e){t.contains(e)&&(l[e]>r[e]+o[e]&&(n[e]=l[e]-o[e]),s[e]=this.options.concurrent||this.error&&this.options.stopOnFailure?this.queue.push(i):i(),this},hasNext:function(e){return e?!!this.queue.filter(function(t){return t.name==e}).length:!!this.queue.length},resume:function(){return this.error=!1,(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this),this},runNext:function(e){if(!this.queue.length)return this;if(e){var t;this.queue.each(function(i){t||i.name!=e||(t=!0,i())})}else this.queue[0]();return this},runAll:function(){return this.queue.each(function(e){e()}),this},clear:function(e){return e?this.queue=this.queue.map(function(t){return t.name!=e&&t}).filter(function(e){return e}):this.queue.empty(),this},cancel:function(e){return this.requests[e].cancel(),this},onRequest:function(){this.fireEvent(\"request\",arguments)},onComplete:function(){this.fireEvent(\"complete\",arguments),this.queue.length||this.fireEvent(\"end\")},onCancel:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"cancel\",arguments)},onSuccess:function(){this.options.autoAdvance&&!this.error&&this.runNext(),this.fireEvent(\"success\",arguments)},onFailure:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"failure\",arguments)},onException:function(){this.error=!0,!this.options.stopOnFailure&&this.options.autoAdvance&&this.runNext(),this.fireEvent(\"exception\",arguments)}}),function(e){Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var e=0,t=this.length;if(t)for(;t--;)null!=this[t]&&(e+=parseFloat(this[t]));return e},unique:function(){return[].combine(this)},shuffle:function(){for(var e=this.length;e&&--e;){var t=this[e],i=Math.floor(Math.random()*(e+1));this[e]=this[i],this[i]=t}return this},reduce:function(e,t){for(var i=0,n=this.length;i.75*a&&(n=s);break}e/=a,n=s+\"s\"}return e=e.round(),Date.getMsg(n+t,e).substitute({delta:e})}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(e){var t=(new Date).clearTime();switch(e[0]){case\"tom\":return t.increment();case\"yes\":return t.decrement();default:return t}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var t=(new Date).clearTime(),i=t.getDay(),n=Date.parseDay(e[2],!0),s=n-i;return n<=i&&(s+=7),\"last\"==e[1]&&(s-=7),t.set(\"date\",t.getDate()+s)}}).alias(\"timeAgoInWords\",\"timeDiffInWords\"),function(){if(!this.Hash){var e=this.Hash=new Type(\"Hash\",function(e){\"hash\"==typeOf(e)&&(e=Object.clone(e.getClean()));for(var t in e)this[t]=e[t];return this});this.$H=function(t){return new e(t)},e.implement({forEach:function(e,t){Object.forEach(this,e,t)},getClean:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},getLength:function(){var e=0;for(var t in this)this.hasOwnProperty(t)&&e++;return e}}),e.alias(\"each\",\"forEach\"),e.implement({has:Object.prototype.hasOwnProperty,keyOf:function(e){return Object.keyOf(this,e)},hasValue:function(e){return Object.contains(this,e)},extend:function(t){return e.each(t||{},function(t,i){e.set(this,i,t)},this),this},combine:function(t){return e.each(t||{},function(t,i){e.include(this,i,t)},this),this},erase:function(e){return this.hasOwnProperty(e)&&delete this[e],this},get:function(e){return this.hasOwnProperty(e)?this[e]:null},set:function(e,t){return this[e]&&!this.hasOwnProperty(e)||(this[e]=t),this},empty:function(){return e.each(this,function(e,t){delete this[t]},this),this},include:function(e,t){return void 0==this[e]&&(this[e]=t),this},map:function(t,i){return new e(Object.map(this,t,i))},filter:function(t,i){return new e(Object.filter(this,t,i))},every:function(e,t){return Object.every(this,e,t)},some:function(e,t){return Object.some(this,e,t)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(e){return Object.toQueryString(this,e)}}),e.alias({indexOf:\"keyOf\",contains:\"hasValue\"})}}(),Hash.implement({getFromPath:function(e){return Object.getFromPath(this,e)},cleanValues:function(e){return new Hash(Object.cleanValues(this,e))},run:function(){Object.run(arguments)}}),Number.implement({format:function(e){var t=this;e=e?Object.clone(e):{};var i=function(t){return null!=e[t]?e[t]:Locale.get(\"Number.\"+t)},n=t<0,s=i(\"decimal\"),a=i(\"precision\"),r=i(\"group\"),o=i(\"decimals\");if(n){var l=i(\"negative\")||{};null==l.prefix&&null==l.suffix&&(l.prefix=\"-\"),[\"prefix\",\"suffix\"].each(function(t){l[t]&&(e[t]=i(t)+l[t])}),t=-t}var h=i(\"prefix\"),u=i(\"suffix\");\"\"!==o&&o>=0&&o<=20&&(t=t.toFixed(o)),a>=1&&a<=21&&(t=(+t).toPrecision(a)),t+=\"\";var d;if(!1===i(\"scientific\")&&t.indexOf(\"e\")>-1){var c=t.split(\"e\"),m=+c[1];if(t=c[0].replace(\".\",\"\"),m<0){for(m=-m-1,d=c[0].indexOf(\".\"),d>-1&&(m-=d-1);m--;)t=\"0\"+t;t=\"0.\"+t}else for(d=c[0].lastIndexOf(\".\"),d>-1&&(m-=c[0].length-d-1);m--;)t+=\"0\"}if(\".\"!=s&&(t=t.replace(\".\",s)),r){d=t.lastIndexOf(s),d=d>-1?d:t.length;for(var g=t.substring(d),p=d;p--;)(d-p-1)%3==0&&p!=d-1&&(g=r+g),g=t.charAt(p)+g;t=g}return h&&(t=h+t),u&&(t+=u),t},formatCurrency:function(e){var t=Locale.get(\"Number.currency\")||{};return null==t.scientific&&(t.scientific=!1),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)},formatPercentage:function(e){var t=Locale.get(\"Number.percentage\")||{};return null==t.suffix&&(t.suffix=\"%\"),t.decimals=null!=e?e:null==t.decimals?2:t.decimals,this.format(t)}}),function(){var e=function(){return this.get(\"value\")},t=this.URI=new Class({Implements:Options,options:{},regex:/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?(\\[[A-Fa-f0-9:]+\\]|[^:\\/?#]*)(?::(\\d*))?)?(\\.\\.?$|(?:[^?#\\/]*\\/)*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/,parts:[\"scheme\",\"user\",\"password\",\"host\",\"port\",\"directory\",\"file\",\"query\",\"fragment\"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(e,i){this.setOptions(i);var n=this.options.base||t.base;e||(e=n),e&&e.parsed?this.parsed=Object.clone(e.parsed):this.set(\"value\",e.href||e.toString(),!!n&&new t(n))},parse:function(e,t){var i=e.match(this.regex);return!!i&&(i.shift(),this.merge(i.associate(this.parts),t))},merge:function(e,t){return!!(e&&e.scheme||t&&t.scheme)&&(t&&this.parts.every(function(i){return!e[i]&&(e[i]=t[i]||\"\",!0)}),e.port=e.port||this.schemes[e.scheme.toLowerCase()],e.directory=e.directory?this.parseDirectory(e.directory,t?t.directory:\"\"):\"/\",e)},parseDirectory:function(e,i){if(e=(\"/\"==e.substr(0,1)?\"\":i||\"/\")+e,!e.test(t.regs.directoryDot))return e;var n=[];return e.replace(t.regs.endSlash,\"\").split(\"/\").each(function(e){\"..\"==e&&n.length>0?n.pop():\".\"!=e&&n.push(e)}),n.join(\"/\")+\"/\"},combine:function(e){return e.value||e.scheme+\"://\"+(e.user?e.user+(e.password?\":\"+e.password:\"\")+\"@\":\"\")+(e.host||\"\")+(e.port&&e.port!=this.schemes[e.scheme]?\":\"+e.port:\"\")+(e.directory||\"/\")+(e.file||\"\")+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\")},set:function(e,i,n){if(\"value\"==e){var s=i.match(t.regs.scheme);s&&(s=s[1]),s&&null==this.schemes[s.toLowerCase()]?this.parsed={scheme:s,value:i}:this.parsed=this.parse(i,(n||this).parsed)||(s?{scheme:s,value:i}:{value:i})}else\"data\"==e?this.setData(i):this.parsed[e]=i;return this},get:function(e,t){switch(e){case\"value\":return this.combine(this.parsed,!!t&&t.parsed);case\"data\":return this.getData()}return this.parsed[e]||\"\"},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(e,t){var i=this.get(t||\"query\");if(!i&&0!==i)return e?null:{};var n=i.parseQueryString();return e?n[e]:n},setData:function(e,t,i){if(\"string\"==typeof e){var n=this.getData();n[arguments[0]]=arguments[1],e=n}else t&&(e=Object.merge(this.getData(null,i),e));return this.set(i||\"query\",Object.toQueryString(e))},clearData:function(e){return this.set(e||\"query\",\"\")},toString:e,valueOf:e});t.regs={endSlash:/\\/$/,scheme:/^(\\w+):/,directoryDot:/\\.\\/|\\.$/},t.base=new t(Array.convert(document.getElements(\"base[href]\",!0)).getLast(),{base:document.location}),String.implement({toURI:function(e){return new t(this,e)}})}(),URI=Class.refactor(URI,{combine:function(e,t){if(!t||e.scheme!=t.scheme||e.host!=t.host||e.port!=t.port)return this.previous.apply(this,arguments);var i=e.file+(e.query?\"?\"+e.query:\"\")+(e.fragment?\"#\"+e.fragment:\"\");if(!t.directory)return(e.directory||(e.file?\"\":\"./\"))+i;var n,s=t.directory.split(\"/\"),a=e.directory.split(\"/\"),r=\"\",o=0;for(n=0;n=3?(t=\"rgb\",e=Array.slice(arguments,0,3)):\"string\"==typeof e&&(e=e.match(/rgb/)?e.rgbToHex().hexToRgb(!0):e.match(/hsb/)?e.hsbToRgb():e.hexToRgb(!0)),t=t||\"rgb\"){case\"hsb\":var i=e;e=e.hsbToRgb(),e.hsb=i;break;case\"hex\":e=e.hexToRgb(!0)}return e.rgb=e.slice(0,3),e.hsb=e.hsb||e.rgbToHsb(),e.hex=e.rgbToHex(),Object.append(e,this)});e.implement({mix:function(){var t=Array.slice(arguments),i=\"number\"==typeOf(t.getLast())?t.pop():50,n=this.slice();return t.each(function(t){t=new e(t);for(var s=0;s<3;s++)n[s]=Math.round(n[s]/100*(100-i)+t[s]/100*i)}),new e(n,\"rgb\")},invert:function(){return new e(this.map(function(e){return 255-e}))},setHue:function(t){return new e([t,this.hsb[1],this.hsb[2]],\"hsb\")},setSaturation:function(t){return new e([this.hsb[0],t,this.hsb[2]],\"hsb\")},setBrightness:function(t){return new e([this.hsb[0],this.hsb[1],t],\"hsb\")}}),this.$RGB=function(t,i,n){return new e([t,i,n],\"rgb\")},this.$HSB=function(t,i,n){return new e([t,i,n],\"hsb\")},this.$HEX=function(t){return new e(t,\"hex\")},Array.implement({rgbToHsb:function(){var e=this[0],t=this[1],i=this[2],n=0,s=Math.max(e,t,i),a=Math.min(e,t,i),r=s-a,o=s/255,l=0!=s?r/s:0;if(0!=l){var h=(s-e)/r,u=(s-t)/r,d=(s-i)/r;n=e==s?d-u:t==s?2+h-d:4+u-h,n/=6,n<0&&n++}return[Math.round(360*n),Math.round(100*l),Math.round(100*o)]},hsbToRgb:function(){var e=Math.round(this[2]/100*255);if(0==this[1])return[e,e,e];var t=this[0]%360,i=t%60,n=Math.round(this[2]*(100-this[1])/1e4*255),s=Math.round(this[2]*(6e3-this[1]*i)/6e5*255),a=Math.round(this[2]*(6e3-this[1]*(60-i))/6e5*255);switch(Math.floor(t/60)){case 0:return[e,a,n];case 1:return[s,e,n];case 2:return[n,e,a];case 3:return[n,s,e];case 4:return[a,n,e];case 5:return[e,n,s]}return!1}}),String.implement({rgbToHsb:function(){var e=this.match(/\\d{1,3}/g);return e?e.rgbToHsb():null},hsbToRgb:function(){var e=this.match(/\\d{1,3}/g);return e?e.hsbToRgb():null}})}(),function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments)},addEvent:function(e,t){var i=this.instances,n=i.length,s=n,a=new Array(n),r=this;i.each(function(o,l){o.addEvent(e,function(){a[l]||s--,a[l]=arguments,s||(t.call(r,i,o,a),s=n,a=new Array(n))})})}})}(),Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:!0},initialize:function(e,t){this.parent(e,t),this.load()},save:function(){var e=JSON.encode(this.hash);return!(!e||e.length>4096)&&(\"{}\"==e?this.dispose():this.write(e),!0)},load:function(){return this.hash=new Hash(JSON.decode(this.read(),!0)),this}}),Hash.each(Hash.prototype,function(e,t){\"function\"==typeof e&&Hash.Cookie.implement(t,function(){var t=e.apply(this.hash,arguments);return this.options.autoSave&&this.save(),t})}),function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:\"high\",allowScriptAccess:\"always\",wMode:\"window\",swLiveConnect:!0},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(e,t){this.instance=\"Swiff_\"+String.uniqueID(),this.setOptions(t),t=this.options;var i=this.id=t.id||this.instance,n=document.id(t.container);Swiff.CallBacks[this.instance]={};var s=t.params,a=t.vars,r=t.callBacks,o=Object.append({height:t.height,width:t.width},t.properties),l=this;for(var h in r)Swiff.CallBacks[this.instance][h]=function(e){return function(){return e.apply(l.object,arguments)}}(r[h]),a[h]=\"Swiff.CallBacks.\"+this.instance+\".\"+h;s.flashVars=Object.toQueryString(a),\"ActiveXObject\"in window?(o.classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",s.movie=e):o.type=\"application/x-shockwave-flash\",o.data=e;var u='\";for(var c in s)s[c]&&(u+='');u+=\"\",this.object=(n?n.empty():new Element(\"div\")).set(\"html\",u).firstChild},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this.toElement(),e),this},inject:function(e){return document.id(e,!0).appendChild(this.toElement()),this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments))}});Swiff.CallBacks={},Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+\"\");return eval(rs)}}(),function(){var e=this.Table=function(){this.length=0;var e=[],t=[];this.set=function(i,n){var s=e.indexOf(i);if(-1==s){var a=e.length;e[a]=i,t[a]=n,this.length++}else t[s]=n;return this},this.get=function(i){var n=e.indexOf(i);return-1==n?null:t[n]},this.erase=function(i){var n=e.indexOf(i);return-1!=n?(this.length--,e.splice(n,1),t.splice(n,1)[0]):null},this.each=this.forEach=function(i,n){for(var s=0,a=this.length;s 0:\n data = reader(maxreadlen)\n if not data:\n self.chunk_length = 0\n self._chunked_input_error = True\n raise IOError(\"unexpected end of file while parsing chunked data\")\n\n datalen = len(data)\n response.append(data)\n\n self.position += datalen\n if self.chunk_length == self.position:\n rfile.readline()\n\n if length is not None:\n length -= datalen\n if length == 0:\n break\n if use_readline and data[-1] == b\"n\"[0]:\n break\n else:\n # We're at the beginning of a chunk, so we need to\n # determine the next size to read\n self.chunk_length = self.__read_chunk_length(rfile)\n self.position = 0\n if self.chunk_length == 0:\n # Last chunk. Terminates with a CRLF.\n rfile.readline()\n return b''.join(response) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: src/gevent/pywsgi.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n src/gevent/pywsgi.py::len\nsrc/gevent/pywsgi.py::reader\nsrc/gevent/pywsgi.py::IOError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "71+train+gevent--gevent+CVE-2023-41419+clean.pkl", "func_name_": "_chunked_read"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_code_timeout(self):\n timeout_code = LoginCode.create_code_for_user(self.user)\n time.sleep(3)\n self.assertIsNone(authenticate(username=self.user.username, code=timeout_code.code)) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/test_models.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/test_models.py::override_settings\ntests/test_models.py::authenticate \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "28+train+relekang--django-nopassword+CVE-2019-10682+clean.pkl", "func_name_": "test_code_timeout"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_metric_history_bulk_calls_optimized_impl_when_expected(monkeypatch, tmp_path):\n from mlflow.server.handlers import get_metric_history_bulk_handler\n\n path = path_to_local_file_uri(str(tmp_path.joinpath(\"sqlalchemy.db\")))\n uri = (\"sqlite://\" if sys.platform == \"win32\" else \"sqlite:////\") + path[len(\"file://\") :]\n mock_store = mock.Mock(wraps=SqlAlchemyStore(uri, str(tmp_path)))\n\n flask_app = flask.Flask(\"test_flask_app\")\n\n class MockRequestArgs:\n def __init__(self, args_dict):\n self.args_dict = args_dict\n\n def to_dict(self, flat):\n return self.args_dict\n\n def get(self, key, default=None):\n return self.args_dict.get(key, default)\n\n with mock.patch(\n \"mlflow.server.handlers._get_tracking_store\", return_value=mock_store\n ), flask_app.test_request_context() as mock_context:\n run_ids = [str(i) for i in range(10)]\n mock_context.request.args = MockRequestArgs(\n {\n \"run_id\": run_ids,\n \"metric_key\": \"mock_key\",\n }\n )\n\n get_metric_history_bulk_handler()\n\n mock_store.get_metric_history_bulk.assert_called_once_with(\n run_ids=run_ids,\n metric_key=\"mock_key\",\n max_results=25000,\n ) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tests/tracking/test_rest_tracking.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n tests/tracking/test_rest_tracking.py::SqlAlchemyStore\ntests/tracking/test_rest_tracking.py::path_to_local_file_uri\ntests/tracking/test_rest_tracking.py::get_metric_history_bulk_handler\ntests/tracking/test_rest_tracking.py::range\ntests/tracking/test_rest_tracking.py::MockRequestArgs\ntests/tracking/test_rest_tracking.py::len\ntests/tracking/test_rest_tracking.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "30+train+mlflow--mlflow+CVE-2023-2356+clean.pkl", "func_name_": "test_get_metric_history_bulk_calls_optimized_impl_when_expected"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_edit_and_list_urls(url_prefix, view_template, name_template, permissions=()):\n \"\"\"\n Get a list of edit/new/list URLs for (presumably) an object type with standardized URLs and names.\n\n :param url_prefix: What to prefix the generated URLs with. E.g. `\"^taxes/tax\"`.\n :type url_prefix: str\n :param view_template: A template string for the dotted name of the view class.\n E.g. \"shuup.admin.modules.taxes.views.Tax%sView\".\n :type view_template: str\n :param name_template: A template string for the URLnames. E.g. \"tax.%s\".\n :type name_template: str\n :return: List of URLs.\n :rtype: list[AdminRegexURLPattern]\n \"\"\"\n if permissions:\n warnings.warn(\n \"Warning! `get_edit_and_list_urls` permissions attribute will be \"\n \"deprecated in Shuup 2.0 as unused for this util.\",\n DeprecationWarning,\n )\n\n return [\n admin_url(\n r\"%s/(?Pd+)/$\" % url_prefix,\n view_template % \"Edit\",\n name=name_template % \"edit\",\n permissions=(name_template % \"edit\",),\n ),\n admin_url(\n \"%s/new/$\" % url_prefix,\n view_template % \"Edit\",\n name=name_template % \"new\",\n kwargs={\"pk\": None},\n permissions=(name_template % \"new\",),\n ),\n admin_url(\n \"%s/$\" % url_prefix,\n view_template % \"List\",\n name=name_template % \"list\",\n permissions=(name_template % \"list\",),\n ),\n admin_url(\n \"%s/list-settings/\" % url_prefix,\n \"shuup.admin.modules.settings.views.ListSettingsView\",\n name=name_template % \"list_settings\",\n permissions=(name_template % \"list_settings\",),\n ),\n ] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: shuup/admin/utils/urls.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "25+train+shuup--shuup+CVE-2021-25963+clean.pkl", "func_name_": "get_edit_and_list_urls(url_prefix, view_template, name_template, permissions="} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_get_student_progress_url(self):\n \"\"\" Test that progress_url is in the successful response. \"\"\"\n url = reverse('get_student_progress_url', kwargs={'course_id': self.course.id.to_deprecated_string()})\n url += \"?unique_student_identifier={}\".format(\n quote(self.students[0].email.encode(\"utf-8\"))\n )\n response = self.client.get(url)\n self.assertEqual(response.status_code, 200)\n res_json = json.loads(response.content)\n self.assertIn('progress_url', res_json) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "83+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_get_student_progress_url"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_uses_default(self):\n account_info = self._make_sqlite_account_info(\n env={\n 'HOME': self.home,\n 'USERPROFILE': self.home,\n }\n )\n actual_path = os.path.abspath(account_info.filename)\n assert os.path.join(self.home, '.b2_account_info') == actual_path \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/unit/account_info/test_account_info.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+Backblaze--b2-sdk-python+CVE-2022-23651+vul.pkl", "func_name_": "test_uses_default"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n async def ticket_close(self, context):\n '''\n Close a ticket, must be run in the ticket channel you want to close\n '''\n await self.core.close_ticket(context) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: tickets/tickets.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "10+train+kennnyshiwa--kennnyshiwa-cogs+CVE-2021-29493+vul.pkl", "func_name_": "ticket_close"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_modify_access_allow_with_uname(self):\n url = reverse('modify_access', kwargs={'course_id': self.course.id.to_deprecated_string()})\n response = self.client.get(url, {\n 'unique_student_identifier': self.other_instructor.username,\n 'rolename': 'staff',\n 'action': 'allow',\n })\n self.assertEqual(response.status_code, 200) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "12+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_modify_access_allow_with_uname"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_redirect_cross_host_set_removed_headers(self) -> None:\n with PoolManager() as http:\n r = http.request(\n \"GET\",\n f\"{self.base_url}/redirect\",\n fields={\"target\": f\"{self.base_url_alt}/headers\"},\n headers={\"X-API-Secret\": \"foo\", \"Authorization\": \"bar\"},\n retries=Retry(remove_headers_on_redirect=[\"X-API-Secret\"]),\n )\n\n assert r.status == 200\n\n data = r.json()\n\n assert \"X-API-Secret\" not in data\n assert data[\"Authorization\"] == \"bar\"\n\n headers = {\"x-api-secret\": \"foo\", \"authorization\": \"bar\"}\n r = http.request(\n \"GET\",\n f\"{self.base_url}/redirect\",\n fields={\"target\": f\"{self.base_url_alt}/headers\"},\n headers=headers,\n retries=Retry(remove_headers_on_redirect=[\"X-API-Secret\"]),\n )\n\n assert r.status == 200\n\n data = r.json()\n\n assert \"x-api-secret\" not in data\n assert \"X-API-Secret\" not in data\n assert data[\"Authorization\"] == \"bar\"\n\n # Ensure the header argument itself is not modified in-place.\n assert headers == {\"x-api-secret\": \"foo\", \"authorization\": \"bar\"} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: test/with_dummyserver/test_poolmanager.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n test/with_dummyserver/test_poolmanager.py::Retry\ntest/with_dummyserver/test_poolmanager.py::PoolManager \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+urllib3--urllib3+CVE-2023-43804+vul.pkl", "func_name_": "test_redirect_cross_host_set_removed_headers"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def history_data(start_time, offset=None):\n \"\"\"Return history data.\n\n Arguments:\n start_time: select history starting from this timestamp.\n offset: number of items to skip\n \"\"\"\n # history atimes are stored as ints, ensure start_time is not a float\n start_time = int(start_time)\n hist = objreg.get('web-history')\n if offset is not None:\n entries = hist.entries_before(start_time, limit=1000, offset=offset)\n else:\n # end is 24hrs earlier than start\n end_time = start_time - 24*60*60\n entries = hist.entries_between(end_time, start_time)\n\n return [{\"url\": e.url,\n \"title\": html.escape(e.title) or html.escape(e.url),\n \"time\": e.atime} for e in entries] \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: qutebrowser/browser/qutescheme.py.\n//This function is called by other functions within the repository:\n qutebrowser/browser/qutescheme.py::qute_history \n//This function itself calls other functions within the repository:\n qutebrowser/browser/qutescheme.py::int \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "29+train+qutebrowser--qutebrowser+CVE-2018-10895+clean.pkl", "func_name_": "history_data"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def get_absolute_url(self):\n from django.urls import reverse\n return reverse('helpdesk:kb_category', kwargs={'slug': self.slug}) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: helpdesk/models.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n helpdesk/models.py::reverse\nhelpdesk/models.py::str \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "16+train+django-helpdesk--django-helpdesk+CVE-2021-3994+clean.pkl", "func_name_": "get_absolute_url"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def fetch_file(self, in_path, out_path):\n ''' fetch a file from chroot to local '''\n\n if not in_path.startswith(os.path.sep):\n in_path = os.path.join(os.path.sep, in_path)\n normpath = os.path.normpath(in_path)\n in_path = os.path.join(self.chroot, normpath[1:])\n\n vvv(\"FETCH %s TO %s\" % (in_path, out_path), host=self.chroot)\n if not os.path.exists(in_path):\n raise errors.AnsibleFileNotFound(\"file or module does not exist: %s\" % in_path)\n try:\n shutil.copyfile(in_path, out_path)\n except shutil.Error:\n traceback.print_exc()\n raise errors.AnsibleError(\"failed to copy: %s and %s are the same\" % (in_path, out_path))\n except IOError:\n traceback.print_exc()\n raise errors.AnsibleError(\"failed to transfer file to %s\" % out_path) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lib/ansible/plugins/connections/chroot.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n lib/ansible/plugins/connections/chroot.py::vvv \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "0+train+ansible--ansible+CVE-2015-6240+vul.pkl", "func_name_": "fetch_file"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _inject_greasemonkey_scripts_for_url(self, url):\n matching_scripts = self._greasemonkey.scripts_for(url)\n self._inject_greasemonkey_scripts(\n matching_scripts.start, QWebEngineScript.DocumentCreation, True)\n self._inject_greasemonkey_scripts(\n matching_scripts.end, QWebEngineScript.DocumentReady, False)\n self._inject_greasemonkey_scripts(\n matching_scripts.idle, QWebEngineScript.Deferred, False) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: qutebrowser/browser/webengine/webenginetab.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n qutebrowser/browser/webengine/webenginetab.py::pyqtSlot \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "91+train+qutebrowser--qutebrowser+CVE-2020-11054+clean.pkl", "func_name_": "_inject_greasemonkey_scripts_for_url"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def instance_filter_exists(self, instance, network_info):\n pass \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: nova/virt/firewall.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "56+train+openstack--nova+CVE-2012-2654+clean.pkl", "func_name_": "instance_filter_exists"} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def format_help_for_context(self, ctx: commands.Context) -> str:\n #Thanks Sinbad! And Trusty in whose cogs I found this.\n pre_processed = super().format_help_for_context(ctx)\n return f\"{pre_processed}\\n\\nVersion: {self.__version__}\" \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: ticketer/ticketer.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n ticketer/ticketer.py::super \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "2+train+Dav-Git--Dav-Cogs+CVE-2021-29501+vul.pkl", "func_name_": "format_help_for_context"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n static int\nload_binint1(UnpicklerObject *self)\n{\n char *s;\n\n if (_Unpickler_Read(self, &s, 1) < 0)\n return -1;\n\n return load_binintx(self, s, 1);\n} \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: Modules/_pickle.c.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "164+train+python--cpython+CVE-2018-20406+clean.pkl", "func_name_": null} {"target": 1, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def test_list_entrance_exam_instructor_with_invalid_exam_key(self):\n \"\"\" Test list task history for entrance exam failure if course has invalid exam. \"\"\"\n url = reverse('list_entrance_exam_instructor_tasks',\n kwargs={'course_id': unicode(self.course_with_invalid_ee.id)})\n response = self.client.get(url, {\n 'unique_student_identifier': self.student.email,\n })\n self.assertEqual(response.status_code, 400) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: lms/djangoapps/instructor/tests/test_api.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "14+train+openedx--edx-platform+CVE-2016-10766+vul.pkl", "func_name_": "test_list_entrance_exam_instructor_with_invalid_exam_key"} {"target": 0, "func": "If the following code snippet has any vulnerabilities, output 'Yes'; otherwise, output 'No'.\n//The function being analyzed is:\n //Code Start\n def _throw_dead(self):\n if len(self.data):\n raise ChannelError(self.data.decode('utf-8', 'replace'))\n elif self.src_id == mitogen.context_id:\n raise ChannelError(ChannelError.local_msg)\n else:\n raise ChannelError(ChannelError.remote_msg) \n// Code End\n\n//To assist with your evaluation, here is some contextual information. Use the contextual information (if any) to support your evaluation of vulnerability detection.\n//The function is located in the file: mitogen/core.py.\n//This function is called by other functions within the repository:\n \n//This function itself calls other functions within the repository:\n mitogen/core.py::len\nmitogen/core.py::ChannelError \n \n//Detection\n Only reply with 'Yes' or 'No', the Answer is:", "idx": "100+train+mitogen-hq--mitogen+CVE-2019-15149+clean.pkl", "func_name_": "_throw_dead"}