<s> import os <EOL> import sys <EOL> runPath = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> sys . path . append ( os . path . join ( runPath , "<STR_LIT:..>" ) ) <EOL> import json <EOL> import re <EOL> from optparse import OptionParser <EOL> from lib . Query import lastentries , apigetcve , apibrowse , apisearch <EOL> optp = OptionParser ( ) <EOL> optp . add_option ( '<STR_LIT:-c>' , '<STR_LIT>' , dest = '<STR_LIT>' , default = '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> optp . add_option ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , default = '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> optp . add_option ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , default = '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> ( opts , args ) = optp . parse_args ( ) <EOL> cve = json . loads ( apigetcve ( opts . api , cveid = opts . cve ) ) <EOL> if not cve : <EOL> sys . exit ( <NUM_LIT:10> ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT:id>' ] ) ) <EOL> print ( "<STR_LIT>" . format ( opts . api , cve [ '<STR_LIT:id>' ] ) ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT:id>' ] , cve [ '<STR_LIT>' ] ) ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT:id>' ] ) ) <EOL> print ( "<STR_LIT:\n>" + cve [ '<STR_LIT>' ] ) <EOL> print ( "<STR_LIT>" ) <EOL> for vul in cve [ '<STR_LIT>' ] : <EOL> print ( "<STR_LIT>" . format ( re . sub ( r'<STR_LIT:\n>' , '<STR_LIT:->' , vul [ '<STR_LIT:title>' ] ) ) ) <EOL> if cve . get ( '<STR_LIT>' ) : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT>' ] ) ) <EOL> if cve . get ( '<STR_LIT>' ) : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> types = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for t in types : <EOL> print ( "<STR_LIT>" . format ( t . title ( ) ) ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT>' ] [ t ] ) ) <EOL> print ( "<STR_LIT>" ) <EOL> if cve . get ( '<STR_LIT>' ) : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> types = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for t in types : <EOL> print ( "<STR_LIT>" . format ( t . title ( ) ) ) <EOL> print ( "<STR_LIT>" . format ( cve [ '<STR_LIT>' ] [ t ] ) ) <EOL> print ( "<STR_LIT>" ) <EOL> if cve . get ( '<STR_LIT>' ) : <EOL> print ( "<STR_LIT>" ) <EOL> if len ( cve [ '<STR_LIT>' ] ) > <NUM_LIT:1> : <EOL> for ref in cve [ '<STR_LIT>' ] : <EOL> print ( "<STR_LIT>" . format ( ref ) ) <EOL> elif len ( cve [ '<STR_LIT>' ] ) == <NUM_LIT:1> : <EOL> ref = cve [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> print ( "<STR_LIT>" . format ( ref ) ) </s>
