<s> import gxf <EOL> @ gxf . register ( ) <EOL> class cyclic ( gxf . DataCommand ) : <EOL> '''<STR_LIT>''' <EOL> def setup ( self , parser ) : <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , default = gxf . cyclic . dfltalphabet . decode ( "<STR_LIT:utf8>" ) ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , type = int , default = gxf . cyclic . dfltlength ) <EOL> parser . add_argument ( "<STR_LIT>" , nargs = "<STR_LIT:?>" , type = int , default = <NUM_LIT> ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , type = str , default = None ) <EOL> def run ( self , args ) : <EOL> args . alphabet = args . alphabet . encode ( "<STR_LIT:utf8>" ) <EOL> db = gxf . cyclic . DeBruijn ( a = args . alphabet , n = args . ordern ) <EOL> if args . search is not None : <EOL> args . search = args . search . encode ( "<STR_LIT:utf8>" ) <EOL> for offset in db . offsets ( args . search ) : <EOL> print ( offset ) <EOL> else : <EOL> print ( "<STR_LIT>" . join ( "<STR_LIT>" % c for c in db [ : args . length ] ) ) </s>
