code: 
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			str:
       UpperCamelCase__    :     Optional[Any]        =						word.upper()
       UpperCamelCase__    :     Optional[int]        =						0
       UpperCamelCase__    :     List[str]        =						{}
       UpperCamelCase__    :     int        =						[]
  
       for letter in word:
            if letter not in letter_nums:
                 UpperCamelCase__    :     int        =						str(__lowerCAmelCase    )
                 next_num += 1
            word_pattern.append(letter_nums[letter]    )
       return ".".join(__lowerCAmelCase    )
  
  
  if __name__ == "__main__":
   import pprint
   import time
  
   lowerCamelCase			:							Union[str, Any]       =time.time()
   with open('''dictionary.txt''') as in_file:
    lowerCamelCase			:							int       =in_file.read().splitlines()
  
   lowerCamelCase			:							dict       ={}
   for word in word_list:
    lowerCamelCase			:							List[Any]       =get_word_pattern(word)
    if pattern in all_patterns:
     all_patterns[pattern].append(word)
    else:
     lowerCamelCase			:							int       =[word]
  
   with open('''word_patterns.txt''', '''w''') as out_file:
    out_file.write(pprint.pformat(all_patterns))
  
   lowerCamelCase			:							int       =round(time.time() - start_time, 2)
   print(F"""Done!  {len(all_patterns):,} word patterns found in {total_time} seconds.""")
   # Done!  9,581 word patterns found in 0.58 seconds.
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			list[int]:
       assert (
           isinstance(__lowerCAmelCase      ,					__lowerCAmelCase    ) and mask > 0
       ), f'mask needs to be positive integer, your input {mask}'
       UpperCamelCase__    :     Any        =						[]
       UpperCamelCase__    :     int        =						mask
  
       while submask:
            all_submasks.append(__lowerCAmelCase    )
            UpperCamelCase__    :     List[str]        =						(submask - 1) & mask
  
       return all_submasks
  
  
  if __name__ == "__main__":
   import doctest
  
   doctest.testmod()