sia_tp_sample / AonCyberLabs__EvilAbigail.jsonl
shahp7575's picture
commit files to HF hub
3a7f06a
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.__init__","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Setup the main screen, progress bars and logging box","docstring_summary":"Setup the main screen, progress bars and logging box","docstring_tokens":["Setup","the","main","screen","progress","bars","and","logging","box"],"function":"def __init__(self):\n \"\"\"\n Setup the main screen, progress bars and logging box\n \"\"\"\n self.screen = curses.initscr()\n curses.curs_set(0)\n\n curses.start_color()\n curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)\n curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK)\n curses.init_pair(3, curses.COLOR_MAGENTA, curses.COLOR_BLACK)\n curses.init_pair(4, curses.COLOR_CYAN, curses.COLOR_BLACK)\n curses.init_pair(5, curses.COLOR_BLUE, curses.COLOR_BLACK)\n curses.init_pair(6, curses.COLOR_YELLOW, curses.COLOR_BLACK)\n\n self.height, self.width = self.screen.getmaxyx()\n self.screen.border()\n\n self.preptotal()\n self.prepcurrent()\n self.preplog()\n self.banner()\n self.sig()\n\n self.drives = len(glob.glob(\"\/dev\/sd?1\"))\n self.donedrives = 0\n self.prevprogress = 0\n self.loglines = []\n self.idx = 1","function_tokens":["def","__init__","(","self",")",":","self",".","screen","=","curses",".","initscr","(",")","curses",".","curs_set","(","0",")","curses",".","start_color","(",")","curses",".","init_pair","(","1",",","curses",".","COLOR_RED",",","curses",".","COLOR_BLACK",")","curses",".","init_pair","(","2",",","curses",".","COLOR_GREEN",",","curses",".","COLOR_BLACK",")","curses",".","init_pair","(","3",",","curses",".","COLOR_MAGENTA",",","curses",".","COLOR_BLACK",")","curses",".","init_pair","(","4",",","curses",".","COLOR_CYAN",",","curses",".","COLOR_BLACK",")","curses",".","init_pair","(","5",",","curses",".","COLOR_BLUE",",","curses",".","COLOR_BLACK",")","curses",".","init_pair","(","6",",","curses",".","COLOR_YELLOW",",","curses",".","COLOR_BLACK",")","self",".","height",",","self",".","width","=","self",".","screen",".","getmaxyx","(",")","self",".","screen",".","border","(",")","self",".","preptotal","(",")","self",".","prepcurrent","(",")","self",".","preplog","(",")","self",".","banner","(",")","self",".","sig","(",")","self",".","drives","=","len","(","glob",".","glob","(","\"\/dev\/sd?1\"",")",")","self",".","donedrives","=","0","self",".","prevprogress","=","0","self",".","loglines","=","[","]","self",".","idx","=","1"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L129-L157"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.banner","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Print the above banner and copyight notice","docstring_summary":"Print the above banner and copyight notice","docstring_tokens":["Print","the","above","banner","and","copyight","notice"],"function":"def banner(self):\n \"\"\"\n Print the above banner and copyight notice\n \"\"\"\n bannerlines = banner.split('\\n')\n for idx, line in enumerate(bannerlines):\n self.screen.addstr(2+idx, 1, line.center(self.width-2), curses.color_pair(3))\n start = bannerlines[2].center(self.width-2).index('|')+1\n self.screen.addstr(1+idx, start, copyrightlhs, curses.color_pair(1))\n self.screen.addstr(1+idx, start+len(copyrightlhs)+7, copyrightrhs, curses.color_pair(1))\n self.screen.addstr(2+idx, start, url.rjust(len(bannerlines[2])), curses.color_pair(4))","function_tokens":["def","banner","(","self",")",":","bannerlines","=","banner",".","split","(","'\\n'",")","for","idx",",","line","in","enumerate","(","bannerlines",")",":","self",".","screen",".","addstr","(","2","+","idx",",","1",",","line",".","center","(","self",".","width","-","2",")",",","curses",".","color_pair","(","3",")",")","start","=","bannerlines","[","2","]",".","center","(","self",".","width","-","2",")",".","index","(","'|'",")","+","1","self",".","screen",".","addstr","(","1","+","idx",",","start",",","copyrightlhs",",","curses",".","color_pair","(","1",")",")","self",".","screen",".","addstr","(","1","+","idx",",","start","+","len","(","copyrightlhs",")","+","7",",","copyrightrhs",",","curses",".","color_pair","(","1",")",")","self",".","screen",".","addstr","(","2","+","idx",",","start",",","url",".","rjust","(","len","(","bannerlines","[","2","]",")",")",",","curses",".","color_pair","(","4",")",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L159-L169"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.sig","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Print author signature","docstring_summary":"Print author signature","docstring_tokens":["Print","author","signature"],"function":"def sig(self):\n \"\"\"\n Print author signature\n \"\"\"\n self.sig = self.screen.subwin((self.height\/2)-6, (self.width-2)\/2, (self.height\/2)+6, ((self.width-2)\/2)+1)\n self.sig.border()\n self.sig.addstr(1, 1, \"Evil Abigail\".center(((self.width-2)\/2)-2), curses.color_pair(6))\n self.sig.addstr(2, 1, \"Rory McNamara\".center(((self.width-2)\/2)-2), curses.color_pair(6))\n self.sig.addstr(3, 1, \"[email protected]\".center(((self.width-2)\/2)-2), curses.color_pair(6))","function_tokens":["def","sig","(","self",")",":","self",".","sig","=","self",".","screen",".","subwin","(","(","self",".","height","\/","2",")","-","6",",","(","self",".","width","-","2",")","\/","2",",","(","self",".","height","\/","2",")","+","6",",","(","(","self",".","width","-","2",")","\/","2",")","+","1",")","self",".","sig",".","border","(",")","self",".","sig",".","addstr","(","1",",","1",",","\"Evil Abigail\"",".","center","(","(","(","self",".","width","-","2",")","\/","2",")","-","2",")",",","curses",".","color_pair","(","6",")",")","self",".","sig",".","addstr","(","2",",","1",",","\"Rory McNamara\"",".","center","(","(","(","self",".","width","-","2",")","\/","2",")","-","2",")",",","curses",".","color_pair","(","6",")",")","self",".","sig",".","addstr","(","3",",","1",",","\"[email protected]\"",".","center","(","(","(","self",".","width","-","2",")","\/","2",")","-","2",")",",","curses",".","color_pair","(","6",")",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L171-L179"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.preptotal","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Draw the total progress bar","docstring_summary":"Draw the total progress bar","docstring_tokens":["Draw","the","total","progress","bar"],"function":"def preptotal(self):\n \"\"\"\n Draw the total progress bar\n \"\"\"\n self.totalbar = self.screen.subwin(3, (self.width-2)\/2, (self.height\/2), ((self.width-2)\/2)+1)\n self.totalbar.erase()\n self.totalbar.border()\n self.screen.addstr((self.height\/2), ((self.width-2)\/2)+4, \"Total Progress\")","function_tokens":["def","preptotal","(","self",")",":","self",".","totalbar","=","self",".","screen",".","subwin","(","3",",","(","self",".","width","-","2",")","\/","2",",","(","self",".","height","\/","2",")",",","(","(","self",".","width","-","2",")","\/","2",")","+","1",")","self",".","totalbar",".","erase","(",")","self",".","totalbar",".","border","(",")","self",".","screen",".","addstr","(","(","self",".","height","\/","2",")",",","(","(","self",".","width","-","2",")","\/","2",")","+","4",",","\"Total Progress\"",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L181-L188"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.prepcurrent","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Draw the current progress bar","docstring_summary":"Draw the current progress bar","docstring_tokens":["Draw","the","current","progress","bar"],"function":"def prepcurrent(self):\n \"\"\"\n Draw the current progress bar\n \"\"\"\n self.currentbar = self.screen.subwin(3, (self.width-2)\/2, (self.height\/2)+3, ((self.width-2)\/2)+1)\n self.currentbar.erase()\n self.currentbar.border()\n self.screen.addstr((self.height\/2)+3, ((self.width-2)\/2)+4, \"Current Drive Progress\")","function_tokens":["def","prepcurrent","(","self",")",":","self",".","currentbar","=","self",".","screen",".","subwin","(","3",",","(","self",".","width","-","2",")","\/","2",",","(","self",".","height","\/","2",")","+","3",",","(","(","self",".","width","-","2",")","\/","2",")","+","1",")","self",".","currentbar",".","erase","(",")","self",".","currentbar",".","border","(",")","self",".","screen",".","addstr","(","(","self",".","height","\/","2",")","+","3",",","(","(","self",".","width","-","2",")","\/","2",")","+","4",",","\"Current Drive Progress\"",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L190-L197"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.preplog","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Draw the logging window","docstring_summary":"Draw the logging window","docstring_tokens":["Draw","the","logging","window"],"function":"def preplog(self):\n \"\"\"\n Draw the logging window\n \"\"\"\n self.log = self.screen.subwin((self.height\/2), (self.width-2)\/2, self.height\/2, 1)\n self.log.erase()\n self.log.border()\n self.screen.addstr((self.height\/2), 4, \"Log\")","function_tokens":["def","preplog","(","self",")",":","self",".","log","=","self",".","screen",".","subwin","(","(","self",".","height","\/","2",")",",","(","self",".","width","-","2",")","\/","2",",","self",".","height","\/","2",",","1",")","self",".","log",".","erase","(",")","self",".","log",".","border","(",")","self",".","screen",".","addstr","(","(","self",".","height","\/","2",")",",","4",",","\"Log\"",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L199-L206"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.logger","parameters":"(self, line, status, continuing = False)","argument_list":"","return_statement":"","docstring":"Log a line to the logging window. Autoscrolls\n A progress of 1.0 will fill the current bar accordingly (useful for 'continue')\n Auto splits and indents long lines","docstring_summary":"Log a line to the logging window. Autoscrolls\n A progress of 1.0 will fill the current bar accordingly (useful for 'continue')\n Auto splits and indents long lines","docstring_tokens":["Log","a","line","to","the","logging","window",".","Autoscrolls","A","progress","of","1",".","0","will","fill","the","current","bar","accordingly","(","useful","for","continue",")","Auto","splits","and","indents","long","lines"],"function":"def logger(self, line, status, continuing = False):\n \"\"\"\n Log a line to the logging window. Autoscrolls\n A progress of 1.0 will fill the current bar accordingly (useful for 'continue')\n Auto splits and indents long lines\n \"\"\"\n statuses = {\n \"ERROR\": curses.color_pair(1),\n \"INFO\": curses.color_pair(2)\n }\n if status == \"ERROR\" and not continuing:\n progress = 1.0\n else:\n progress = self.idx\/self.items\n self.idx += 1\n first = True\n while line:\n if first:\n first = False\n self.loglines.append((line[:37], status))\n line = line[37:]\n else:\n self.loglines.append((' '+line[:35], status))\n line = line[35:]\n self.preplog()\n for idx, line in enumerate(self.loglines[-((self.height\/2)-3):]):\n self.log.addstr(idx+1, 1, line[0], statuses[line[1]])\n if progress:\n self.plot(progress)\n self.refresh()","function_tokens":["def","logger","(","self",",","line",",","status",",","continuing","=","False",")",":","statuses","=","{","\"ERROR\"",":","curses",".","color_pair","(","1",")",",","\"INFO\"",":","curses",".","color_pair","(","2",")","}","if","status","==","\"ERROR\"","and","not","continuing",":","progress","=","1.0","else",":","progress","=","self",".","idx","\/","self",".","items","self",".","idx","+=","1","first","=","True","while","line",":","if","first",":","first","=","False","self",".","loglines",".","append","(","(","line","[",":","37","]",",","status",")",")","line","=","line","[","37",":","]","else",":","self",".","loglines",".","append","(","(","' '","+","line","[",":","35","]",",","status",")",")","line","=","line","[","35",":","]","self",".","preplog","(",")","for","idx",",","line","in","enumerate","(","self",".","loglines","[","-","(","(","self",".","height","\/","2",")","-","3",")",":","]",")",":","self",".","log",".","addstr","(","idx","+","1",",","1",",","line","[","0","]",",","statuses","[","line","[","1","]","]",")","if","progress",":","self",".","plot","(","progress",")","self",".","refresh","(",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L208-L237"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.nextdrive","parameters":"(self, items)","argument_list":"","return_statement":"","docstring":"Signifies the start of the next drive for the current progress bar\n Items is how many logging evens we expect to see on the main path","docstring_summary":"Signifies the start of the next drive for the current progress bar\n Items is how many logging evens we expect to see on the main path","docstring_tokens":["Signifies","the","start","of","the","next","drive","for","the","current","progress","bar","Items","is","how","many","logging","evens","we","expect","to","see","on","the","main","path"],"function":"def nextdrive(self, items):\n \"\"\"\n Signifies the start of the next drive for the current progress bar\n Items is how many logging evens we expect to see on the main path\n \"\"\"\n self.idx = 1\n self.items = float(items)","function_tokens":["def","nextdrive","(","self",",","items",")",":","self",".","idx","=","1","self",".","items","=","float","(","items",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L239-L245"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.incritems","parameters":"(self, items)","argument_list":"","return_statement":"","docstring":"Allows adding to how many steps we expect to see\n For branch based differences","docstring_summary":"Allows adding to how many steps we expect to see\n For branch based differences","docstring_tokens":["Allows","adding","to","how","many","steps","we","expect","to","see","For","branch","based","differences"],"function":"def incritems(self, items):\n \"\"\"\n Allows adding to how many steps we expect to see\n For branch based differences\n \"\"\"\n self.items += items","function_tokens":["def","incritems","(","self",",","items",")",":","self",".","items","+=","items"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L247-L252"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.plot","parameters":"(self, progress)","argument_list":"","return_statement":"","docstring":"Actually fill the progress bars accordingly","docstring_summary":"Actually fill the progress bars accordingly","docstring_tokens":["Actually","fill","the","progress","bars","accordingly"],"function":"def plot(self, progress):\n \"\"\"\n Actually fill the progress bars accordingly\n \"\"\"\n if progress < self.prevprogress:\n self.donedrives += 1\n self.prevprogress = progress\n\n progress = progress + self.donedrives\n totalbar = int((progress\/self.drives)*((self.width-2)\/2))\n currentbar = int(progress*((self.width-2)\/2)) % (self.width\/2)\n\n self.preptotal()\n self.prepcurrent()\n\n self.totalbar.addstr(1, 1, \"-\"*(totalbar-2), curses.color_pair(2))\n self.currentbar.addstr(1, 1, \"-\"*(currentbar-2), curses.color_pair(2))\n\n self.refresh()","function_tokens":["def","plot","(","self",",","progress",")",":","if","progress","<","self",".","prevprogress",":","self",".","donedrives","+=","1","self",".","prevprogress","=","progress","progress","=","progress","+","self",".","donedrives","totalbar","=","int","(","(","progress","\/","self",".","drives",")","*","(","(","self",".","width","-","2",")","\/","2",")",")","currentbar","=","int","(","progress","*","(","(","self",".","width","-","2",")","\/","2",")",")","%","(","self",".","width","\/","2",")","self",".","preptotal","(",")","self",".","prepcurrent","(",")","self",".","totalbar",".","addstr","(","1",",","1",",","\"-\"","*","(","totalbar","-","2",")",",","curses",".","color_pair","(","2",")",")","self",".","currentbar",".","addstr","(","1",",","1",",","\"-\"","*","(","currentbar","-","2",")",",","curses",".","color_pair","(","2",")",")","self",".","refresh","(",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L254-L272"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.refresh","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Refresh the screen in order","docstring_summary":"Refresh the screen in order","docstring_tokens":["Refresh","the","screen","in","order"],"function":"def refresh(self):\n \"\"\"\n Refresh the screen in order\n \"\"\"\n self.totalbar.refresh()\n self.currentbar.refresh()\n self.log.refresh()\n self.screen.refresh()","function_tokens":["def","refresh","(","self",")",":","self",".","totalbar",".","refresh","(",")","self",".","currentbar",".","refresh","(",")","self",".","log",".","refresh","(",")","self",".","screen",".","refresh","(",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L274-L281"}
{"nwo":"AonCyberLabs\/EvilAbigail","sha":"5bde1d49a76ef2e5a6e6bcda5b094441b41144ad","path":"evilmaid.py","language":"python","identifier":"UI.destroy","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Clear screen and exit","docstring_summary":"Clear screen and exit","docstring_tokens":["Clear","screen","and","exit"],"function":"def destroy(self):\n \"\"\"\n Clear screen and exit\n \"\"\"\n self.screen.erase()\n self.refresh()\n curses.endwin()","function_tokens":["def","destroy","(","self",")",":","self",".","screen",".","erase","(",")","self",".","refresh","(",")","curses",".","endwin","(",")"],"url":"https:\/\/github.com\/AonCyberLabs\/EvilAbigail\/blob\/5bde1d49a76ef2e5a6e6bcda5b094441b41144ad\/evilmaid.py#L283-L289"}