code: def build_tab_completion_table(alias_table):
      
      alias_commands = [t[1] for t in filter_aliases(alias_table)]
      tab_completion_table = defaultdict(list)
      for alias_command in alias_commands:
          for reserved_command in azext_alias.cached_reserved_commands:
              # Check if alias_command has no parent command
              if reserved_command == alias_command or reserved_command.startswith(alias_command + ' ') \
                      and '' not in tab_completion_table[alias_command]:
                  tab_completion_table[alias_command].append('')
              elif ' {} '.format(alias_command) in reserved_command or reserved_command.endswith(' ' + alias_command):
                  # Extract parent commands
                  index = reserved_command.index(alias_command)
                  parent_command = reserved_command[:index - 1]
                  if parent_command not in tab_completion_table[alias_command]:
                      tab_completion_table[alias_command].append(parent_command)
  
      with open(GLOBAL_ALIAS_TAB_COMP_TABLE_PATH, 'w') as f:
          f.write(json.dumps(tab_completion_table))
  
      return tab_completion_table
docs: Build a dictionary where the keys are all the alias commands (without positional argument placeholders)
      and the values are all the parent commands of the keys. After that, write the table into a file.
      The purpose of the dictionary is to validate the alias tab completion state.
  
      For example:
      {
          "group": ["", "ad"],
          "dns": ["network"]
      }
  
      Args:
          alias_table: The alias table.
  
      Returns:
          The tab completion table.