<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_trial_complete(self, trial_id, result=None, error=False, early_terminated=False):
 """Passes the result to Nevergrad unless early terminated or errored. The result is internally negated when interacting with Nevergrad so that Nevergrad Optimizers can "maximize" this value, as it minimizes on default. """

        ng_trial_info = self._live_trial_mapping.pop(trial_id)
        if result:
            self._nevergrad_opt.tell(ng_trial_info, -result[self._reward_attr])