def cyclic_pattern_charset(charset_type=None):
 charset = []
 charset += ['ABCDEFGHIJKLMNOPQRSTUVWXYZ']
 charset += ['abcdefghijklmnopqrstuvwxyz']
 charset += ['0123456789']
 if (not charset_type):
  charset_type = config.Option.get('pattern')
 if (charset_type == 1):
  charset[1] = ('%$-;' + re.sub('[sn]', '', charset[1]))
  charset[2] = ('sn()' + charset[2])
 if (charset_type == 2):
  charset += ['!"#$%&\\()*+,-./:;<=>?@[]^_{|}~']
 mixed_charset = mixed = ''
 k = 0
 while True:
  for i in range(0, len(charset)):
   mixed += charset[i][k:(k + 1)]
  if (not mixed):
   break
  mixed_charset += mixed
  mixed = ''
  k += 1
 return mixed_charset

def cyclic_pattern_charset ( charset_type = None ) : charset = [ ] charset += [ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ] charset += [ 'abcdefghijklmnopqrstuvwxyz' ] charset += [ '0123456789' ] if ( not charset_type ) : charset_type = config . Option . get ( 'pattern' ) if ( charset_type == 1 ) : charset [ 1 ] = ( '%$-;' + re . sub ( '[sn]' , '' , charset [ 1 ] ) ) charset [ 2 ] = ( 'sn()' + charset [ 2 ] ) if ( charset_type == 2 ) : charset += [ '!"#$%&\\()*+,-./:;<=>?@[]^_{|}~' ] mixed_charset = mixed = '' k = 0 while True : for i in range ( 0 , len ( charset ) ) : mixed += charset [ i ] [ k : ( k + 1 ) ] if ( not mixed ) : break mixed_charset += mixed mixed = '' k += 1 return mixed_charset
generate charset for cyclic pattern args: - charset_type: charset type 0: basic 1: extended 2: maximum returns: - list of charset .