def parse_bss(bss):
<EOL>intermediate = dict()<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_data)  <EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u32)  <EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_msecs)  <EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u16)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u16)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_data)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u32)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u8)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u32)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_get_u32)<EOL>_get(intermediate, bss, '<STR_LIT>', libnl.attr.nla_data)<EOL>parsed = dict()<EOL>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = '<STR_LIT::>'.join(format(x, '<STR_LIT>') for x in intermediate['<STR_LIT>'][:<NUM_LIT:6>])<EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = intermediate['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = timedelta(microseconds=intermediate['<STR_LIT>'])<EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = intermediate['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>data_u32 = intermediate['<STR_LIT>']<EOL>data_s32 = -(data_u32 & <NUM_LIT>) + (data_u32 & <NUM_LIT>)<EOL>parsed['<STR_LIT>'] = data_s32 / <NUM_LIT><EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = intermediate['<STR_LIT>'] / <NUM_LIT><EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>parsed['<STR_LIT>'] = timedelta(milliseconds=intermediate['<STR_LIT>'])<EOL><DEDENT>if intermediate.get('<STR_LIT:status>') == nl80211.NL80211_BSS_STATUS_AUTHENTICATED:<EOL><INDENT>parsed['<STR_LIT:status>'] = '<STR_LIT>'<EOL><DEDENT>elif intermediate.get('<STR_LIT:status>') == nl80211.NL80211_BSS_STATUS_ASSOCIATED:<EOL><INDENT>parsed['<STR_LIT:status>'] = '<STR_LIT>'<EOL><DEDENT>elif intermediate.get('<STR_LIT:status>') == nl80211.NL80211_BSS_STATUS_IBSS_JOINED:<EOL><INDENT>parsed['<STR_LIT:status>'] = '<STR_LIT>'<EOL><DEDENT>elif '<STR_LIT:status>' in intermediate:<EOL><INDENT>parsed['<STR_LIT:status>'] = '<STR_LIT>'.format(intermediate['<STR_LIT:status>'])<EOL><DEDENT>if '<STR_LIT>' in intermediate:<EOL><INDENT>data = intermediate['<STR_LIT>']<EOL>list_of_caps = list()<EOL>if parsed['<STR_LIT>'] > <NUM_LIT>:<EOL><INDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_TYPE_MASK == iw_scan.WLAN_CAPABILITY_DMG_TYPE_AP:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>elif data & iw_scan.WLAN_CAPABILITY_DMG_TYPE_MASK == iw_scan.WLAN_CAPABILITY_DMG_TYPE_PBSS:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>elif data & iw_scan.WLAN_CAPABILITY_DMG_TYPE_MASK == iw_scan.WLAN_CAPABILITY_DMG_TYPE_IBSS:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_CBAP_ONLY:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_CBAP_SOURCE:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_PRIVACY:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_ECPAC:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_SPECTRUM_MGMT:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DMG_RADIO_MEASURE:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if data & iw_scan.WLAN_CAPABILITY_ESS:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_IBSS:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_CF_POLLABLE:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_CF_POLL_REQUEST:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_PRIVACY:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_SHORT_PREAMBLE:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_PBCC:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_CHANNEL_AGILITY:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_SPECTRUM_MGMT:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_QOS:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_SHORT_SLOT_TIME:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_APSD:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_RADIO_MEASURE:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DSSS_OFDM:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_DEL_BACK:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT>if data & iw_scan.WLAN_CAPABILITY_IMM_BACK:<EOL><INDENT>list_of_caps.append('<STR_LIT>')<EOL><DEDENT><DEDENT>parsed['<STR_LIT>'] = list_of_caps<EOL><DEDENT>for k in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if k not in intermediate:<EOL><INDENT>continue<EOL><DEDENT>parsed[k] = iw_scan.get_ies(intermediate[k])<EOL><DEDENT>parsed['<STR_LIT>'] = parsed.get('<STR_LIT>', parsed.get('<STR_LIT>'))<EOL>parsed['<STR_LIT>'] = _fetch(parsed, '<STR_LIT>')<EOL>parsed['<STR_LIT>'] = _fetch(parsed, '<STR_LIT>') or _fetch(parsed, '<STR_LIT>') or '<STR_LIT>'<EOL>parsed['<STR_LIT>'] = _fetch(parsed, '<STR_LIT>')<EOL>parsed['<STR_LIT>'] = _fetch(parsed, '<STR_LIT>')<EOL>parsed['<STR_LIT>'] = _fetch(parsed, '<STR_LIT>', '<STR_LIT>')<EOL>return parsed<EOL>
Parse data prepared by nla_parse() and nla_parse_nested() into Python-friendly formats.

    Automatically chooses the right data-type for each attribute and converts it into Python integers, strings, unicode,
    etc objects.

    Positional arguments:
    bss -- dictionary with integer keys and nlattr values.

    Returns:
    New dictionary with the same integer keys and converted values. Excludes null/empty data from `bss`.