tools/metrics/histograms/update_net_error_codes.py
def ReadNetErrorCodes(filename, error_regex):
  """Reads in values from net_error_list.h, returning a dictionary mapping
  error code to error name.
  """
  # Read the file as a list of lines
  with open(path_util.GetInputFile(filename)) as f:
    content = f.readlines()

  # Parse out lines that are net errors.
  errors = {}
  for line in content:
    m = error_regex.match(line)
    if m:
      name = m.group(1)
      code = int(m.group(2))

      # CERT_END is not a real NET_ERROR and does not have a stable value.
      # Don't include it.
      if name == 'CERT_END':
        continue

      errors[code] = name

  return errors
Reads in values from net_error_list.h, returning a dictionary mapping
  error code to error name.
  
Reads in values from net_error_list.h, returning a dictionary mapping
error code to error name.
Reads in values from net_error_list . h returning a dictionary mapping error code to error name .
def ReadNetErrorCodes(filename, error_regex):
  with open(path_util.GetInputFile(filename)) as f:
    content = f.readlines()
  errors = {}
  for line in content:
    m = error_regex.match(line)
    if m:
      name = m.group(1)
      code = int(m.group(2))
      if name == 'CERT_END':
        continue
      errors[code] = name
  return errors
def ReadNetErrorCodes ( filename , error_regex ) : with open ( path_util . GetInputFile ( filename ) ) as f : content = f . readlines ( ) errors = { } for line in content : m = error_regex . match ( line ) if m : name = m . group ( 1 ) code = int ( m . group ( 2 ) ) if name == 'CERT_END' : continue errors [ code ] = name return errors
Reads in values from net_error_list.h, returning a dictionary mapping
error code to error name.
Reads in values from net_error_list . h returning a dictionary mapping error code to error name .
"""Reads in values from net_error_list.h, returning a dictionary mapping
  error code to error name.
  """ # Read the file as a list of lines # Parse out lines that are net errors. # CERT_END is not a real NET_ERROR and does not have a stable value. # Don't include it.
filename
error_regex