chrome/browser/resources/PRESUBMIT.py
def IsActionPresent(current_actions, metric_name, is_boolean):
  """Checks if metric_name is defined in the actions file.

  Checks whether there's matching entries in an actions.xml file for the given
  |metric_name|, depending on whether it is a boolean action.

  Args:
    current_actions: The content of the actions.xml file.
    metric_name: The name for which the check should be done.
    is_boolean: Whether the action comes from a boolean control.
  """
  if not is_boolean:
    action = 'name="{0}"'.format(metric_name)
    return action in current_actions

  action_disabled = 'name="{0}_Disable"'.format(metric_name)
  action_enabled = 'name="{0}_Enable"'.format(metric_name)

  return (action_disabled in current_actions and
      action_enabled in current_actions)
Checks if metric_name is defined in the actions file.

  Checks whether there's matching entries in an actions.xml file for the given
  |metric_name|, depending on whether it is a boolean action.

  Args:
    current_actions: The content of the actions.xml file.
    metric_name: The name for which the check should be done.
    is_boolean: Whether the action comes from a boolean control.
  
Checks if metric_name is defined in the actions file.
Checks whether there's matching entries in an actions.xml file for the given
|metric_name|, depending on whether it is a boolean action.
Checks if metric_name is defined in the actions file . Checks whether there ' s matching entries in an actions . xml file for the given |metric_name| depending on whether it is a boolean action .
def IsActionPresent(current_actions, metric_name, is_boolean):
  if not is_boolean:
    action = 'name="{0}"'.format(metric_name)
    return action in current_actions
  action_disabled = 'name="{0}_Disable"'.format(metric_name)
  action_enabled = 'name="{0}_Enable"'.format(metric_name)
  return (action_disabled in current_actions and
      action_enabled in current_actions)
def IsActionPresent ( current_actions , metric_name , is_boolean ) : if not is_boolean : action = 'name="{0}"' . format ( metric_name ) return action in current_actions action_disabled = 'name="{0}_Disable"' . format ( metric_name ) action_enabled = 'name="{0}_Enable"' . format ( metric_name ) return ( action_disabled in current_actions and action_enabled in current_actions )
Checks if metric_name is defined in the actions file.
Checks if metric_name is defined in the actions file .
"""Checks if metric_name is defined in the actions file.

  Checks whether there's matching entries in an actions.xml file for the given
  |metric_name|, depending on whether it is a boolean action.

  Args:
    current_actions: The content of the actions.xml file.
    metric_name: The name for which the check should be done.
    is_boolean: Whether the action comes from a boolean control.
  """
current_actions
The content of the actions.xml file.
The content of the actions . xml file .
metric_name
The name for which the check should be done.
The name for which the check should be done .
is_boolean
Whether the action comes from a boolean control.
Whether the action comes from a boolean control .