def generate_new_element(items, prefix, numeric=False):
 while True:
  if numeric:
   candidate = (prefix + generate_random_numeric(8))
  else:
   candidate = (prefix + generate_random_alphanumeric(8))
  if (candidate not in items):
   return candidate
  LOG.debug(('Random collision on %s' % candidate))

def generate_new_element ( items , prefix , numeric = False ) : while True : if numeric : candidate = ( prefix + generate_random_numeric ( 8 ) ) else : candidate = ( prefix + generate_random_alphanumeric ( 8 ) ) if ( candidate not in items ) : return candidate LOG . debug ( ( 'Random collision on %s' % candidate ) )
creates a random string with prefix .