def get_specidentitem_percolator_data(item, xmlns):
    """Loop through SpecIdentificationItem children. Find
    percolator data by matching to a dict lookup. Return a
    dict containing percolator data"""
    percomap = {'{0}userParam'.format(xmlns): PERCO_HEADERMAP, }
    percodata = {}
    for child in item:
        try:
            percoscore = percomap[child.tag][child.attrib['name']]
        except KeyError:
            continue
        else:
            percodata[percoscore] = child.attrib['value']
    outkeys = [y for x in list(percomap.values()) for y in list(x.values())]
    for key in outkeys:
        try:
            percodata[key]
        except KeyError:
            percodata[key] = 'NA'
    return percodata
def get_specidentitem_percolator_data ( item , xmlns ) : percomap = { '{0}userParam' . format ( xmlns ) : PERCO_HEADERMAP , } percodata = { } for child in item : try : percoscore = percomap [ child . tag ] [ child . attrib [ 'name' ] ] except KeyError : continue else : percodata [ percoscore ] = child . attrib [ 'value' ] outkeys = [ y for x in list ( percomap . values ( ) ) for y in list ( x . values ( ) ) ] for key in outkeys : try : percodata [ key ] except KeyError : percodata [ key ] = 'NA' return percodata
Loop through SpecIdentificationItem children. Find
    percolator data by matching to a dict lookup. Return a
    dict containing percolator data