parameters: (self, checkpoint_path, eval_result)
docstring: Records a given checkpoint and exports if this is the best model.
  
      Args:
        checkpoint_path: the checkpoint path to export.
        eval_result: a dictionary which is usually generated in evaluation runs.
          By default, eval_results contains 'loss' field.
  
      Returns:
        A string representing the path to the checkpoint to be exported.
        A dictionary of the same type of eval_result.
  
      Raises:
        ValueError: if checkpoint path is empty.
        ValueError: if eval_results is None object.
docstring_summary: Records a given checkpoint and exports if this is the best model.
docstring_tokens: Records a given checkpoint and exports if this is the best model .
function: def update(self, checkpoint_path, eval_result):
      """Records a given checkpoint and exports if this is the best model.
  
      Args:
        checkpoint_path: the checkpoint path to export.
        eval_result: a dictionary which is usually generated in evaluation runs.
          By default, eval_results contains 'loss' field.
  
      Returns:
        A string representing the path to the checkpoint to be exported.
        A dictionary of the same type of eval_result.
  
      Raises:
        ValueError: if checkpoint path is empty.
        ValueError: if eval_results is None object.
      """
      if not checkpoint_path:
        raise ValueError('Checkpoint path is empty.')
      if eval_result is None:
        raise ValueError('%s has empty evaluation results.', checkpoint_path)
  
      if (self._best_eval_result is None or
          self._compare_fn(self._best_eval_result, eval_result)):
        self._best_eval_result = eval_result
        return checkpoint_path, eval_result
      else:
        return '', None
function_tokens: def update ( self , checkpoint_path , eval_result ) : if not checkpoint_path : raise ValueError ( 'Checkpoint path is empty.' ) if eval_result is None : raise ValueError ( '%s has empty evaluation results.' , checkpoint_path ) if ( self . _best_eval_result is None or self . _compare_fn ( self . _best_eval_result , eval_result ) ) : self . _best_eval_result = eval_result return checkpoint_path , eval_result else : return '' , None