code: def find_module_id_defining_flag(self, flagname, default=None):
      
      registered_flag = self._flags().get(flagname)
      if registered_flag is None:
        return default
      for module_id, flags in six.iteritems(self.flags_by_module_id_dict()):
        for flag in flags:
          # It must compare the flag with the one in _flags. This is because a
          # flag might be overridden only for its long name (or short name),
          # and only its short name (or long name) is considered registered.
          if (flag.name == registered_flag.name and
              flag.short_name == registered_flag.short_name):
            return module_id
      return default
docs: Return the ID of the module defining this flag, or default.
  
      Args:
        flagname: str, name of the flag to lookup.
        default: Value to return if flagname is not defined. Defaults
            to None.
  
      Returns:
        The ID of the module which registered the flag with this name.
        If no such module exists (i.e. no flag with this name exists),
        we return default.