def resolve_parameters(self, func, extra_env=None):
parameter_list = [<EOL>(k, v.default == inspect.Parameter.empty) for k, v in inspect.signature(func).parameters.items()<EOL>]<EOL>extra_env = extra_env if extra_env is not None else {}<EOL>kwargs = {}<EOL>for parameter_name, is_required in parameter_list:<EOL><INDENT>if parameter_name in extra_env:<EOL><INDENT>kwargs[parameter_name] = self.instantiate_from_data(extra_env[parameter_name])<EOL>continue<EOL><DEDENT>if parameter_name in self.instances:<EOL><INDENT>kwargs[parameter_name] = self.instances[parameter_name]<EOL>continue<EOL><DEDENT>if parameter_name in self.environment:<EOL><INDENT>kwargs[parameter_name] = self.instantiate_by_name(parameter_name)<EOL>continue<EOL><DEDENT>if is_required:<EOL><INDENT>funcname = f"<STR_LIT>"<EOL>raise RuntimeError("<STR_LIT>".format(<EOL>parameter_name, funcname<EOL>))<EOL><DEDENT><DEDENT>return kwargs<EOL>
Resolve parameter dictionary for the supplied function