class_docstr: Writes Core training data into a file in a YAML format.
docstr: Converts a RuleStep into an ordered dict.
  
  Args:
      rule_step: RuleStep object.
  
  Returns:
      Converted rule step.
docstr_tok: ["Converts","a","RuleStep","into","an","ordered","dict",".","Args",":","rule_step",":","RuleStep","object",".","Returns",":","Converted","rule","step","."]
code: def process_rule_step(self, rule_step: RuleStep) -> OrderedDict:
      """Converts a RuleStep into an ordered dict.
  
      Args:
          rule_step: RuleStep object.
  
      Returns:
          Converted rule step.
      """
      result: OrderedDict[Text, Any] = OrderedDict()
      result[KEY_RULE_NAME] = rule_step.block_name
  
      condition_steps = []
      condition_events = rule_step.get_rules_condition()
      for event in condition_events:
          processed = self.process_event(event)
          if processed:
              condition_steps.append(processed)
      if condition_steps:
          result[KEY_RULE_CONDITION] = condition_steps
  
      normal_events = rule_step.get_rules_events()
      if normal_events and not (
          isinstance(normal_events[0], ActionExecuted)
          and normal_events[0].action_name
          == rasa.shared.core.constants.RULE_SNIPPET_ACTION_NAME
      ):
          result[KEY_RULE_FOR_CONVERSATION_START] = True
  
      normal_steps = []
      for event in normal_events:
          processed = self.process_event(event)
          if processed:
              normal_steps.append(processed)
      if normal_steps:
          result[KEY_STEPS] = normal_steps
  
      if len(normal_events) > 1:
          last_event = normal_events[len(normal_events) - 1]
          if (
              isinstance(last_event, ActionExecuted)
              and last_event.action_name
              == rasa.shared.core.constants.RULE_SNIPPET_ACTION_NAME
          ):
              result[KEY_WAIT_FOR_USER_INPUT_AFTER_RULE] = False
  
      return result
  
imports: from collections import OrderedDict
  from pathlib import Path
  from typing import Any, Dict, List, Text, Union, Optional
  from ruamel import yaml
  from ruamel.yaml.comments import CommentedMap
  from ruamel.yaml.scalarstring import DoubleQuotedScalarString, LiteralScalarString
  import rasa.shared.utils.io
  import rasa.shared.core.constants
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  import rasa.shared.core.events
  from rasa.shared.core.events import UserUttered, ActionExecuted, SlotSet, ActiveLoop, Event
  from rasa.shared.core.training_data.story_reader.yaml_story_reader import KEY_STORIES, KEY_STORY_NAME, KEY_USER_INTENT, KEY_ENTITIES, KEY_ACTION, KEY_STEPS, KEY_CHECKPOINT, KEY_SLOT_NAME, KEY_CHECKPOINT_SLOTS, KEY_OR, KEY_USER_MESSAGE, KEY_ACTIVE_LOOP, KEY_BOT_END_TO_END_MESSAGE, KEY_RULES, KEY_RULE_FOR_CONVERSATION_START, KEY_WAIT_FOR_USER_INPUT_AFTER_RULE, KEY_RULE_CONDITION, KEY_RULE_NAME
  from rasa.shared.core.training_data.story_writer.story_writer import StoryWriter
  from rasa.shared.core.training_data.structures import StoryStep, Checkpoint, STORY_START, RuleStep
label_desc: Use image node_id 13 for calling the YAMLStoryWriter obj's underlying member method code with example usage: obj.process_rule_step(rule_step) and returns: result