@memoized
def cyclic_pattern(size=None, start=None, charset_type=None):
 charset = config.Option.get('p_charset')
 if (not charset):
  charset = cyclic_pattern_charset(charset)
 else:
  charset = ''.join(set(charset))
 if (start is None):
  start = 0
 if (size is None):
  size = 65536
 size += start
 pattern = de_bruijn(charset, 3, size)
 return pattern[start:size].encode('utf-8')

@ memoized def cyclic_pattern ( size = None , start = None , charset_type = None ) : charset = config . Option . get ( 'p_charset' ) if ( not charset ) : charset = cyclic_pattern_charset ( charset ) else : charset = '' . join ( set ( charset ) ) if ( start is None ) : start = 0 if ( size is None ) : size = 65536 size += start pattern = de_bruijn ( charset , 3 , size ) return pattern [ start : size ] . encode ( 'utf-8' )
generate a cyclic pattern args: - size: size of generated pattern - start: the start offset of the generated pattern - charset_type: charset type 0: basic 1: extended 2: maximum returns: - pattern text .