def parse_unix_mode(s):
        """
        Parsing unix mode strings ("rwxr-x--t") into hexacimal notation.

        :param s: mode string
        :type s: :py:class:`str`

        :return mode:
        :rtype: :py:class:`int`
        """
        parse_rw = {"rw": 6, "r-": 4, "-w": 2, "--": 0}
        mode = 0
        mode |= parse_rw[s[0:2]] << 6
        mode |= parse_rw[s[3:5]] << 3
        mode |= parse_rw[s[6:8]]
        if s[2] == "s":
            mode |= 0o4100
        elif s[2] == "x":
            mode |= 0o0100
        elif s[2] != "-":
            raise ValueError

        if s[5] == "s":
            mode |= 0o2010
        elif s[5] == "x":
            mode |= 0o0010
        elif s[5] != "-":
            raise ValueError

        if s[8] == "t":
            mode |= 0o1000
        elif s[8] == "x":
            mode |= 0o0001
        elif s[8] != "-":
            raise ValueError

        return mode
def parse_unix_mode(s):
        """
        Parsing unix mode strings ("rwxr-x--t") into hexacimal notation.

        :param s: mode string
        :type s: :py:class:`str`

        :return mode:
        :rtype: :py:class:`int`
        """
        parse_rw = {"rw": 6, "r-": 4, "-w": 2, "--": 0}
        mode = 0
        mode |= parse_rw[s[0:2]] << 6
        mode |= parse_rw[s[3:5]] << 3
        mode |= parse_rw[s[6:8]]
        if s[2] == "s":
            mode |= 0o4100
        elif s[2] == "x":
            mode |= 0o0100
        elif s[2] != "-":
            raise ValueError

        if s[5] == "s":
            mode |= 0o2010
        elif s[5] == "x":
            mode |= 0o0010
        elif s[5] != "-":
            raise ValueError

        if s[8] == "t":
            mode |= 0o1000
        elif s[8] == "x":
            mode |= 0o0001
        elif s[8] != "-":
            raise ValueError

        return mode
def parse_unix_mode ( s ) : parse_rw = { "rw" : 6 , "r-" : 4 , "-w" : 2 , "--" : 0 } mode = 0 mode |= parse_rw [ s [ 0 : 2 ] ] << 6 mode |= parse_rw [ s [ 3 : 5 ] ] << 3 mode |= parse_rw [ s [ 6 : 8 ] ] if s [ 2 ] == "s" : mode |= 0o4100 elif s [ 2 ] == "x" : mode |= 0o0100 elif s [ 2 ] != "-" : raise ValueError if s [ 5 ] == "s" : mode |= 0o2010 elif s [ 5 ] == "x" : mode |= 0o0010 elif s [ 5 ] != "-" : raise ValueError if s [ 8 ] == "t" : mode |= 0o1000 elif s [ 8 ] == "x" : mode |= 0o0001 elif s [ 8 ] != "-" : raise ValueError return mode
Parsing unix mode strings ("rwxr-x--t") into hexacimal notation.

        :param s: mode string
        :type s: :py:class:`str`

        :return mode:
        :rtype: :py:class:`int`
Parsing unix mode strings ( rwxr - x -- t ) into hexacimal notation .