tools/metrics/ukm/gen_builders.py
def ReadFilteredData(path):
  """Reads data from path and filters out any obsolete metrics.

  Parses data from given path and removes all nodes that contain an
  <obsolete> tag. First iterates through <event> nodes, then <metric>
  nodes within them.

  Args:
    path: The path of the XML data source.

  Returns:
    A dict of the data not including any obsolete events or metrics.
  """
  with open(path) as ukm_file:
    data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read())
    event_tag = ukm_model._EVENT_TYPE.tag
    metric_tag = ukm_model._METRIC_TYPE.tag
    data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag]))
    for event in data[event_tag]:
      event[metric_tag] = list(
          filter(ukm_model.IsNotObsolete, event[metric_tag]))
    return data
Reads data from path and filters out any obsolete metrics.

  Parses data from given path and removes all nodes that contain an
  <obsolete> tag. First iterates through <event> nodes, then <metric>
  nodes within them.

  Args:
    path: The path of the XML data source.

  Returns:
    A dict of the data not including any obsolete events or metrics.
  
Reads data from path and filters out any obsolete metrics.
Parses data from given path and removes all nodes that contain an
 tag. First iterates through  nodes, then 
nodes within them.
Reads data from path and filters out any obsolete metrics . Parses data from given path and removes all nodes that contain an tag . First iterates through nodes then nodes within them .
def ReadFilteredData(path):
  with open(path) as ukm_file:
    data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read())
    event_tag = ukm_model._EVENT_TYPE.tag
    metric_tag = ukm_model._METRIC_TYPE.tag
    data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag]))
    for event in data[event_tag]:
      event[metric_tag] = list(
          filter(ukm_model.IsNotObsolete, event[metric_tag]))
    return data
def ReadFilteredData ( path ) : with open ( path ) as ukm_file : data = ukm_model . UKM_XML_TYPE . Parse ( ukm_file . read ( ) ) event_tag = ukm_model . _EVENT_TYPE . tag metric_tag = ukm_model . _METRIC_TYPE . tag data [ event_tag ] = list ( filter ( ukm_model . IsNotObsolete , data [ event_tag ] ) ) for event in data [ event_tag ] : event [ metric_tag ] = list ( filter ( ukm_model . IsNotObsolete , event [ metric_tag ] ) ) return data
Reads data from path and filters out any obsolete metrics.
Reads data from path and filters out any obsolete metrics .
"""Reads data from path and filters out any obsolete metrics.

  Parses data from given path and removes all nodes that contain an
  <obsolete> tag. First iterates through <event> nodes, then <metric>
  nodes within them.

  Args:
    path: The path of the XML data source.

  Returns:
    A dict of the data not including any obsolete events or metrics.
  """
A dict of the data not including any obsolete events or metrics.
A dict of the data not including any obsolete events or metrics .
path
The path of the XML data source.
The path of the XML data source .