<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_parameters(self, func, extra_env=None):
 """ Resolve parameter dictionary for the supplied function """

        parameter_list = [
            (k, v.default == inspect.Parameter.empty) for k, v in inspect.signature(func).parameters.items()
        ]
        extra_env = extra_env if extra_env is not None else {}
        kwargs = {}

        for parameter_name, is_required in parameter_list:
            # extra_env is a 'local' object data defined in-place
            if parameter_name in extra_env:
                kwargs[parameter_name] = self.instantiate_from_data(extra_env[parameter_name])
                continue

            if parameter_name in self.instances:
                kwargs[parameter_name] = self.instances[parameter_name]
                continue

            if parameter_name in self.environment:
                kwargs[parameter_name] = self.instantiate_by_name(parameter_name)
                continue

            if is_required:
                funcname = f"{inspect.getmodule(func).__name__}.{func.__name__}"
                raise RuntimeError("Required argument '{}' cannot be resolved for function '{}'".format(
                    parameter_name, funcname
                ))

        return kwargs