chrome/browser/resources/PRESUBMIT.py
def IsBoolean(new_content_lines, metric_name, input_api):
  """Check whether action defined in the changed code is boolean or not.

  Checks whether the action comes from boolean control based on the HTML
  elements attributes.

  Args:
    new_content_lines: List of changed lines.
    metric_name: The  name for which the check should be done.
  """
  new_content = '\n'.join(new_content_lines)

  html_element_re = r'<(.*?)(^|\s+)metric\s*=\s*"%s"(.*?)>' % (metric_name)
  type_re = (r'datatype\s*=\s*"boolean"|type\s*=\s*"checkbox"|'
      'type\s*=\s*"radio".*?value\s*=\s*("true"|"false")')

  match = input_api.re.search(html_element_re, new_content, input_api.re.DOTALL)
  return (match and
      any(input_api.re.search(type_re, match.group(i)) for i in (1, 3)))
Check whether action defined in the changed code is boolean or not.

  Checks whether the action comes from boolean control based on the HTML
  elements attributes.

  Args:
    new_content_lines: List of changed lines.
    metric_name: The  name for which the check should be done.
  
Check whether action defined in the changed code is boolean or not.
Checks whether the action comes from boolean control based on the HTML
elements attributes.
Check whether action defined in the changed code is boolean or not . Checks whether the action comes from boolean control based on the HTML elements attributes .
def IsBoolean(new_content_lines, metric_name, input_api):
  new_content = '\n'.join(new_content_lines)
  html_element_re = r'<(.*?)(^|\s+)metric\s*=\s*"%s"(.*?)>' % (metric_name)
  type_re = (r'datatype\s*=\s*"boolean"|type\s*=\s*"checkbox"|'
      'type\s*=\s*"radio".*?value\s*=\s*("true"|"false")')
  match = input_api.re.search(html_element_re, new_content, input_api.re.DOTALL)
  return (match and
      any(input_api.re.search(type_re, match.group(i)) for i in (1, 3)))
def IsBoolean ( new_content_lines , metric_name , input_api ) : new_content = '\n' . join ( new_content_lines ) html_element_re = r'<(.*?)(^|\s+)metric\s*=\s*"%s"(.*?)>' % ( metric_name ) type_re = ( r'datatype\s*=\s*"boolean"|type\s*=\s*"checkbox"|' 'type\s*=\s*"radio".*?value\s*=\s*("true"|"false")' ) match = input_api . re . search ( html_element_re , new_content , input_api . re . DOTALL ) return ( match and any ( input_api . re . search ( type_re , match . group ( i ) ) for i in ( 1 , 3 ) ) )
Check whether action defined in the changed code is boolean or not.
Check whether action defined in the changed code is boolean or not .
"""Check whether action defined in the changed code is boolean or not.

  Checks whether the action comes from boolean control based on the HTML
  elements attributes.

  Args:
    new_content_lines: List of changed lines.
    metric_name: The  name for which the check should be done.
  """
new_content_lines
List of changed lines.
List of changed lines .
metric_name
The  name for which the check should be done.
The name for which the check should be done .
input_api