def string_to_macaddr(value, strict=False):
    """
    Return a tuple corresponding to the string representation of a Media
    Access Control address (MAC address) of a device, which is a unique
    identifier assigned to a network interface controller (NIC) for
    communications at the data link layer of a network segment.

    The standard (IEEE 802) format for printing EUI-48 addresses in human-
    friendly form is six groups of two hexadecimal digits, separated by
    hyphens (-) in transmission order (e.g. ``01-23-45-67-89-AB``).  This
    form is also commonly used for EUI-64 (e.g. ``01-23-45-67-89-AB-CD-EF``).
    Other conventions include six groups of two hexadecimal digits
    separated by colons (:) (e.g. 01:23:45:67:89:AB), and three groups of
    four hexadecimal digits separated by dots (.) (e.g. ``0123.4567.89AB``);
    again in transmission order.


    @param value: a string representation of a MAC address.

    @param strict: indicate whether the ``None`` value is accepted.


    @return: a tuple of 6 hexadecimal strings ``(hex1, hex2, hex3, hex4, hex5, hex6)``,
        each ranging from ``0x00`` to ``0xFF``.
    """
    if is_undefined(value):
        if strict:
            raise ValueError('The value cannot be null')
        return None

    match = REGEX_MAC_ADDRESS.match(value.lower())
    if match is None:
        raise ValueError('The specified string "%s" does not represent a MAC address' % value)

    return match.groups()
def string_to_macaddr ( value , strict = False ) : if is_undefined ( value ) : if strict : raise ValueError ( 'The value cannot be null' ) return None match = REGEX_MAC_ADDRESS . match ( value . lower ( ) ) if match is None : raise ValueError ( 'The specified string "%s" does not represent a MAC address' % value ) return match . groups ( )
Return a tuple corresponding to the string representation of a Media
    Access Control address (MAC address) of a device, which is a unique
    identifier assigned to a network interface controller (NIC) for
    communications at the data link layer of a network segment.

    The standard (IEEE 802) format for printing EUI-48 addresses in human-
    friendly form is six groups of two hexadecimal digits, separated by
    hyphens (-) in transmission order (e.g. ``01-23-45-67-89-AB``).  This
    form is also commonly used for EUI-64 (e.g. ``01-23-45-67-89-AB-CD-EF``).
    Other conventions include six groups of two hexadecimal digits
    separated by colons (:) (e.g. 01:23:45:67:89:AB), and three groups of
    four hexadecimal digits separated by dots (.) (e.g. ``0123.4567.89AB``);
    again in transmission order.


    @param value: a string representation of a MAC address.

    @param strict: indicate whether the ``None`` value is accepted.


    @return: a tuple of 6 hexadecimal strings ``(hex1, hex2, hex3, hex4, hex5, hex6)``,
        each ranging from ``0x00`` to ``0xFF``.