
    m                         S r SSKJr  SSKJr  SSKJr  SSKrSSKr\" 1 Sk5      rSr	SR                  S	 \R                   5       5      rS
 rS rSS jrg)zGenerate random names.    )absolute_import)division)unicode_literalsN>   bahbajbalbambarbehbewbezbicbinbodbokbolbonbowboxbunburbuscaccakcaqcincoccokconcoqcozcukculcumcuncurdandawdaydemdevdicdikdiqdixdomdotdudfagfakfanfapfasfekfelfezfisfobfokfotfucfukfuqfutfuxgadgalgangargatgaygecgeygidgilgizgoggopgotgoygucgudgukguqhaghahhehhenhethonhorhujhulhurhusjapjavjebjewjitjizjobkackakkankaqkarkawkefkelkenkepkikkirkockokkoqkorkoxkukkumkunkuskutkuzlamlanlaslemletliclidliklilliqlolloploxludlullunlusluzmajmalmegmehmesmicmikminmiqmormufmulmunmutnadnasnibnignimnoqnunnutpadpahpapparpatpazpekpelpespikpispixpodpompotpugpukpumpusqabqijquzracrakralranraqrevrisritrotrucsacsaksaqsatseksersetsexseysiksobsodsolsotsoysucsudsuksuqsuttaltaytemtintittoctogtoktoqtostuntupvagvajwacwahwakwaqwarwaswatwenwogwopxuyyalyidyoryukzakzebzigzovzutaeiou c              #   <   #    U  H  o[         ;  d  M  Uv   M     g 7fN)_VOWELS).0ls     4lib/googlecloudsdk/command_lib/run/name_generator.py	<genexpr>r  !  s     L!7AG;Kaa!7s   	c                     U [         ;  $ r  )_INVALID_THREE_LETTER_WORDS)words    r  IsValidWordr
  $  s    	0	00    c                      [         R                  " [        5      [         R                  " [        5      -   [         R                  " [        5      -   nU (       a  [	        U5      (       a  U$ Mk  )a5  Generate random 3-letter words.

Words are generated in a consonant-vowel-consonant order to be pronounceable.
A specific word matching this pattern has a 1/21*1/5*1/21 = 1/2205 chance
of being generated.

Args:
  validate: bool, True to validate words against the invalid set.

Returns:
  str, 3-letter word
)randomchoice_CONSONANTSr  r
  )validater	  s     r  _ThreeLetterGeneratorr  (  sP     	k"V]]7%;;k"	# 	 {4((k 	r  c                     U S:  d   e[        U 5       Vs/ s H  n[        U5      PM     nnUb  UR                  SU5        UR                  U5      $ s  snf )a  Generate a random string of 3-letter sections.

Each word has a 1/2205 chance of being generated (see _GenerateThreeLetter).
Therefore a specific name has a (1/2205)^(sections) chance of being generated.
For 3 sections, the denominator is over 10.7 billion.

Args:
  sections: int, number of 3-letter generated sections to include
  separator: str, separator between sections
  prefix: str, prefix of the generated name. This acts like an additional
    section at the start of the name and will be separated from the
    generated sections by the seperator argument, however it does not count
    towards the number of sections specified by the sections argument.
  validate: bool, True to validate sections against invalid word list

Returns:
  str, generated name
r   )ranger  insertjoin)sections	separatorprefixr  _namess         r  GenerateNamer  =  sW    & 
A49(O
DOq *O%
D	LLF		 Es   A)   -NT)__doc__
__future__r   r   r   r  string	frozensetr  r  r  ascii_lowercaser  r
  r  r   r  r  <module>r$     s^     &  '   ( y) y v ggL!7!7LL1*r  