def _check_nm(nm, notation):
<EOL>_NM_CHECK_FUNCT = {<EOL>NM_DOT: _dot_to_dec,<EOL>NM_HEX: _hex_to_dec,<EOL>NM_BIN: _bin_to_dec,<EOL>NM_OCT: _oct_to_dec,<EOL>NM_DEC: _dec_to_dec_long}<EOL>try:<EOL><INDENT>dec = _NM_CHECK_FUNCT[notation](nm, check=True)<EOL><DEDENT>except ValueError:<EOL><INDENT>return False<EOL><DEDENT>if dec in _NETMASKS_VALUES:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Function internally used to check if the given netmask
    is of the specified notation.