tools/metrics/actions/action_utils.py
def _CreateActionsFromSuffixes(actions_dict, action_to_suffixes_dict):
  """Creates new actions with action-suffix pairs and adds them to actions_dict.

  For every key (action name) in action_to_suffixes_dict, This function looks
  to see whether it exists in actions_dict. If so it combines the Action object
  from actions_dict with all the Suffix objects from action_to_suffixes_dict to
  create new Action objects. New Action objects are added to actions_dict and
  the action name is removed from action_to_suffixes_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action_to_suffixes_dict: dict of action name to list of Suffix objects it
                             will combine with.

  Returns:
    True if any new action was added, False otherwise.
  """
  expanded_actions = set()
  for action_name, suffixes in action_to_suffixes_dict.items():
    if action_name in actions_dict:
      existing_action = actions_dict[action_name]
      for suffix in suffixes:
        _CreateActionFromSuffix(actions_dict, existing_action, suffix)

      expanded_actions.add(action_name)

  for action_name in expanded_actions:
    del action_to_suffixes_dict[action_name]

  return bool(expanded_actions)
Creates new actions with action-suffix pairs and adds them to actions_dict.

  For every key (action name) in action_to_suffixes_dict, This function looks
  to see whether it exists in actions_dict. If so it combines the Action object
  from actions_dict with all the Suffix objects from action_to_suffixes_dict to
  create new Action objects. New Action objects are added to actions_dict and
  the action name is removed from action_to_suffixes_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action_to_suffixes_dict: dict of action name to list of Suffix objects it
                             will combine with.

  Returns:
    True if any new action was added, False otherwise.
  
Creates new actions with action-suffix pairs and adds them to actions_dict.
For every key (action name) in action_to_suffixes_dict, This function looks
to see whether it exists in actions_dict. If so it combines the Action object
from actions_dict with all the Suffix objects from action_to_suffixes_dict to
create new Action objects. New Action objects are added to actions_dict and
the action name is removed from action_to_suffixes_dict.
Creates new actions with action - suffix pairs and adds them to actions_dict . For every key ( action name ) in action_to_suffixes_dict This function looks to see whether it exists in actions_dict . If so it combines the Action object from actions_dict with all the Suffix objects from action_to_suffixes_dict to create new Action objects . New Action objects are added to actions_dict and the action name is removed from action_to_suffixes_dict .
def _CreateActionsFromSuffixes(actions_dict, action_to_suffixes_dict):
  expanded_actions = set()
  for action_name, suffixes in action_to_suffixes_dict.items():
    if action_name in actions_dict:
      existing_action = actions_dict[action_name]
      for suffix in suffixes:
        _CreateActionFromSuffix(actions_dict, existing_action, suffix)
      expanded_actions.add(action_name)
  for action_name in expanded_actions:
    del action_to_suffixes_dict[action_name]
  return bool(expanded_actions)
def _CreateActionsFromSuffixes ( actions_dict , action_to_suffixes_dict ) : expanded_actions = set ( ) for action_name , suffixes in action_to_suffixes_dict . items ( ) : if action_name in actions_dict : existing_action = actions_dict [ action_name ] for suffix in suffixes : _CreateActionFromSuffix ( actions_dict , existing_action , suffix ) expanded_actions . add ( action_name ) for action_name in expanded_actions : del action_to_suffixes_dict [ action_name ] return bool ( expanded_actions )
Creates new actions with action-suffix pairs and adds them to actions_dict.
Creates new actions with action - suffix pairs and adds them to actions_dict .
"""Creates new actions with action-suffix pairs and adds them to actions_dict.

  For every key (action name) in action_to_suffixes_dict, This function looks
  to see whether it exists in actions_dict. If so it combines the Action object
  from actions_dict with all the Suffix objects from action_to_suffixes_dict to
  create new Action objects. New Action objects are added to actions_dict and
  the action name is removed from action_to_suffixes_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action_to_suffixes_dict: dict of action name to list of Suffix objects it
                             will combine with.

  Returns:
    True if any new action was added, False otherwise.
  """
True if any new action was added, False otherwise.
True if any new action was added False otherwise .
actions_dict
dict of existing action name to Action object.
dict of existing action name to Action object .
action_to_suffixes_dict
dict of action name to list of Suffix objects it
will combine with.
dict of action name to list of Suffix objects it will combine with .