Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. def email_templates():
  2.  
  3. f_options = ["first", "f_ini"]
  4. m_options = ["middle", "m_ini"]
  5. l_options = ["last", "l_ini"]
  6. sep_options = ['', '.', '_', '-']
  7. sep_options2 = sep_options
  8.  
  9. all_possible_emails = dict()
  10.  
  11. for f_op in f_options:
  12. for m_op in m_options:
  13. for l_op in l_options:
  14.  
  15. stuff = [f_op, m_op, l_op]
  16.  
  17.  
  18. for L in range(1, len(stuff)+1):
  19. for subset in itertools.permutations(stuff, L):
  20. #print subset
  21.  
  22.  
  23. if len(subset) == 1:
  24. tmp = email_formater(subset)
  25. all_possible_emails[tmp] = tmp
  26. elif len(subset) == 2:
  27. for sep_op in sep_options:
  28. tmp = email_formater([subset[0], sep_op, subset[1]])
  29. all_possible_emails[tmp] = tmp
  30. elif len(subset) == 3:
  31. for sep_op in sep_options:
  32. for sep_op2 in sep_options2:
  33. tmp = email_formater([subset[0], sep_op, subset[1], sep_op2, subset[2]])
  34. all_possible_emails[tmp] = tmp
  35.  
  36.  
  37.  
  38.  
  39. return all_possible_emails
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement