tools/metrics/histograms/validate_obsolete_histograms.py
def ValidateObsoleteXml():
  """Checks that all the histograms in the obsolete file are obsolete.

  Returns:
    True if at least a histogram is not obsolete, False otherwise.
  """
  has_obsolete_error = False
  tree = xml.dom.minidom.parse(histogram_paths.OBSOLETE_XML)

  for node in extract_histograms.IterElementsWithTag(tree, 'histogram', 3):
    obsolete_tag_nodelist = node.getElementsByTagName('obsolete')
    if len(obsolete_tag_nodelist) > 0:
      continue

    has_obsolete_error = True
    # If histogram is not obsolete, find out the directory that it should be
    # placed in.
    correct_dir = split_xml.GetDirForNode(node)
    histogram_name = node.getAttribute('name')

    logging.error(
        'Histogram of name %s is not obsolete, please move it to the '
        'metadata/%s directory.', histogram_name, correct_dir)

  return has_obsolete_error
Checks that all the histograms in the obsolete file are obsolete.

  Returns:
    True if at least a histogram is not obsolete, False otherwise.
  
Checks that all the histograms in the obsolete file are obsolete.
Checks that all the histograms in the obsolete file are obsolete .
def ValidateObsoleteXml():
  has_obsolete_error = False
  tree = xml.dom.minidom.parse(histogram_paths.OBSOLETE_XML)
  for node in extract_histograms.IterElementsWithTag(tree, 'histogram', 3):
    obsolete_tag_nodelist = node.getElementsByTagName('obsolete')
    if len(obsolete_tag_nodelist) > 0:
      continue
    has_obsolete_error = True
    correct_dir = split_xml.GetDirForNode(node)
    histogram_name = node.getAttribute('name')
    logging.error(
        'Histogram of name %s is not obsolete, please move it to the '
        'metadata/%s directory.', histogram_name, correct_dir)
  return has_obsolete_error
def ValidateObsoleteXml ( ) : has_obsolete_error = False tree = xml . dom . minidom . parse ( histogram_paths . OBSOLETE_XML ) for node in extract_histograms . IterElementsWithTag ( tree , 'histogram' , 3 ) : obsolete_tag_nodelist = node . getElementsByTagName ( 'obsolete' ) if len ( obsolete_tag_nodelist ) > 0 : continue has_obsolete_error = True correct_dir = split_xml . GetDirForNode ( node ) histogram_name = node . getAttribute ( 'name' ) logging . error ( 'Histogram of name %s is not obsolete, please move it to the ' 'metadata/%s directory.' , histogram_name , correct_dir ) return has_obsolete_error
Checks that all the histograms in the obsolete file are obsolete.
Checks that all the histograms in the obsolete file are obsolete .
"""Checks that all the histograms in the obsolete file are obsolete.

  Returns:
    True if at least a histogram is not obsolete, False otherwise.
  """ # If histogram is not obsolete, find out the directory that it should be # placed in.
True if at least a histogram is not obsolete, False otherwise.
True if at least a histogram is not obsolete False otherwise .