code: def _RemoveAllFlagAppearances(self, name):
      
      flag_dict = self.FlagDict()
      if name not in flag_dict:
        raise exceptions.UnrecognizedFlagError(name)
      flag = flag_dict[name]
      names_to_remove = {name}
      names_to_remove.add(flag.name)
      if flag.short_name:
        names_to_remove.add(flag.short_name)
      for n in names_to_remove:
        self.__delattr__(n)
docs: Removes flag with name for all appearances.
  
      A flag can be registered with its long name and an optional short name.
      This method removes both of them. This is different than __delattr__.
  
      Args:
        name: Either flag's long name or short name.
  
      Raises:
        UnrecognizedFlagError: When flag name is not found.