def _process_health_pill_event(self, node_name_set, mapping, target_step,
                                 file_path):
    """Creates health pills out of data in an event.

    Creates health pills out of the event and adds them to the mapping.

    Args:
      node_name_set: A set of node names that are relevant.
      mapping: The mapping from node name to HealthPillEvents.
          This object may be destructively modified.
      target_step: The target step at which to obtain health pills.
      file_path: The path to the file with health pill events.

    Returns:
      Whether we should stop reading events because future events are no longer
      relevant.
    """
    events_loader = event_file_loader.EventFileLoader(file_path)
    for event in events_loader.Load():
      if not event.HasField('summary'):
        logger.warn(
            'An event in a debugger events file lacks a summary.')
        continue

      if event.step < target_step:
        # This event is not of the relevant step. We perform this check
        # first because the majority of events will be eliminated from
        # consideration by this check.
        continue

      if event.step > target_step:
        # We have passed the relevant step. No need to read more events.
        return True

      for value in event.summary.value:
        # Obtain the device name from the metadata.
        summary_metadata = value.metadata
        plugin_data = summary_metadata.plugin_data
        if plugin_data.plugin_name == constants.DEBUGGER_PLUGIN_NAME:
          try:
            content = json.loads(
                tf.compat.as_text(summary_metadata.plugin_data.content))
          except ValueError as err:
            logger.warn(
                'Could not parse the JSON string containing data for '
                'the debugger plugin: %r, %r', content, err)
            continue
          device_name = content['device']
          output_slot = content['outputSlot']
        else:
          logger.error(
              'No debugger plugin data found for event with tag %s and node '
              'name %s.', value.tag, value.node_name)
          continue

        if not value.HasField('tensor'):
          logger.warn(
              'An event in a debugger events file lacks a tensor value.')
          continue

        match = re.match(r'^(.*):(\d+):DebugNumericSummary$', value.node_name)
        if not match:
          logger.warn(
              ('A event with a health pill has an invalid watch, (i.e., an '
               'unexpected debug op): %r'), value.node_name)
          return None

        health_pill = self._process_health_pill_value(
            wall_time=event.wall_time,
            step=event.step,
            device_name=device_name,
            output_slot=output_slot,
            node_name=match.group(1),
            tensor_proto=value.tensor,
            node_name_set=node_name_set)
        if not health_pill:
          continue
        mapping[health_pill.node_name].append(health_pill)

    # Keep reading events.
    return False
Creates health pills out of data in an event.

    Creates health pills out of the event and adds them to the mapping.

    Args:
      node_name_set: A set of node names that are relevant.
      mapping: The mapping from node name to HealthPillEvents.
          This object may be destructively modified.
      target_step: The target step at which to obtain health pills.
      file_path: The path to the file with health pill events.

    Returns:
      Whether we should stop reading events because future events are no longer
      relevant.