<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_data_for_model(self, args, kwargs):
 """ In comes args and kwargs expected for the model. Out comes the data from this invocation that will go to the model. In other words, this function does the "data negotiation" between the controller and the model. """

        kwargs_from_invocation = self.get_raw_data()
        args_from_invocation = deque(self.path_args)

        defaults = kwargs
        values = args + list(kwargs.keys())

        output = {}

        raw = False
        for i, field in enumerate(values):
            ## going through each bit of data that the model needs
            ## `field` here is the name of each needed var.

            # the 'default' value that may be defined in the model.
            # this variable might be a string or int or might even be a primitive object.
            # NotImplemented here is used as to preserve if a default value is None.
            # it is used here as a sort of MetaNone.
            default_defined_in_model = defaults.get(field, NotImplemented)
            
            # the value in kwarg arguments such as --values and GET params
            from_data_kwargs = kwargs_from_invocation.get(field, None)

            # The value that will end up being used.
            value_to_use = None

            if default_defined_in_model == RAW_INVOCATION_ARGS:
                # flag that the RAW_INVOCATION_ARGS primitive has been invoked
                # used later to suppress errors for unused program args
                # when this primitive is invoked, all positional args are invalid. 
                raw = True

            if type(default_defined_in_model) == GiottoPrimitive:
                value_to_use = self.get_primitive(default_defined_in_model.name)
            elif from_data_kwargs:
                value_to_use = from_data_kwargs
            elif not raw and args_from_invocation:
                value_to_use = args_from_invocation.popleft()
            elif default_defined_in_model is not NotImplemented:
                value_to_use = default_defined_in_model
            else:
                raise InvalidInvocation("Data Missing For Program. Missing: %s" % field)
            
            output[field] = value_to_use

        if args_from_invocation and not raw:
            msg = "Too many arguments. Program `%s` takes %s arguments, %s given" % (
                self.program.name, len(args) + len(kwargs), len(args_from_invocation)
            )
            raise InvalidInvocation(msg)

        return output