def METHOD_NAME(self, inventory, loader, path, cache=False):
    ''' parses the inventory file '''
    super(InventoryModule, self).METHOD_NAME(inventory, loader, path, cache=cache)
    self._read_config_data(path)
    sources = []
    try:
        sources = inventory.processed_sources
    except AttributeError:
        if self.get_option('use_vars_plugins'):
            raise AnsibleOptionsError("The option use_vars_plugins requires ansible >= 2.11.")
    strict = self.get_option('strict')
    fact_cache = FactCache()
    try:
        # Go over hosts (less var copies)
        for host in inventory.hosts:
            # get available variables to templar
            hostvars = self.get_all_host_vars(inventory.hosts[host], loader, sources)
            if host in fact_cache:  # adds facts if cache is active
                hostvars = combine_vars(hostvars, fact_cache[host])
            # create composite vars
            self._set_composite_vars(self.get_option('compose'), hostvars, host, strict=strict)
            # refetch host vars in case new ones have been created above
            hostvars = self.get_all_host_vars(inventory.hosts[host], loader, sources)
            if host in self._cache:  # adds facts if cache is active
                hostvars = combine_vars(hostvars, self._cache[host])
            # constructed groups based on conditionals
            self._add_host_to_composed_groups(self.get_option('groups'), hostvars, host, strict=strict, fetch_hostvars=False)
            # constructed groups based variable values
            self._add_host_to_keyed_groups(self.get_option('keyed_groups'), hostvars, host, strict=strict, fetch_hostvars=False)
    except Exception as e:
        raise AnsibleParserError("failed to parse %s: %s " % (to_native(path), to_native(e)), orig_exc=e)