<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _publish_grade(self, score, only_if_higher=None):
 """ Publish a grade to the runtime. """

        grade_dict = {
            'value': score.raw_earned,
            'max_value': score.raw_possible,
            'only_if_higher': only_if_higher,
        }
        self.runtime.publish(self, 'grade', grade_dict)