(command, args, heading)
return first_local_mac
Looks for a MAC address under a heading in a command's output.

    The first line of words in the output is searched for the given
    heading. Words at the same word index as the heading in subsequent
    lines are then examined to see if they look like MAC addresses.
Looks for a MAC address under a heading in a command's output.
Looks for a MAC address under a heading in a command s output .
def _find_mac_under_heading(command, args, heading):
    """Looks for a MAC address under a heading in a command's output.

    The first line of words in the output is searched for the given
    heading. Words at the same word index as the heading in subsequent
    lines are then examined to see if they look like MAC addresses.
    """
    stdout = _get_command_stdout(command, args)
    if stdout is None:
        return None

    keywords = stdout.readline().rstrip().split()
    try:
        column_index = keywords.index(heading)
    except ValueError:
        return None

    first_local_mac = None
    for line in stdout:
        words = line.rstrip().split()
        try:
            word = words[column_index]
        except IndexError:
            continue

        mac = _parse_mac(word)
        if mac is None:
            continue
        if _is_universal(mac):
            return mac
        if first_local_mac is None:
            first_local_mac = mac

    return first_local_mac
def _find_mac_under_heading ( command , args , heading ) : stdout = _get_command_stdout ( command , args ) if stdout is None : return None keywords = stdout . readline ( ) . rstrip ( ) . split ( ) try : column_index = keywords . index ( heading ) except ValueError : return None first_local_mac = None for line in stdout : words = line . rstrip ( ) . split ( ) try : word = words [ column_index ] except IndexError : continue mac = _parse_mac ( word ) if mac is None : continue if _is_universal ( mac ) : return mac if first_local_mac is None : first_local_mac = mac return first_local_mac