def __pathToTuple(self, path):
if not path or path.count('<STR_LIT:/>') > <NUM_LIT:2>:<EOL><INDENT>raise YTFS.PathConvertError("<STR_LIT>") <EOL><DEDENT>try:<EOL><INDENT>split = path.split('<STR_LIT:/>')<EOL><DEDENT>except (AttributeError, TypeError):<EOL><INDENT>raise TypeError("<STR_LIT>") <EOL><DEDENT>if split[<NUM_LIT:0>]:<EOL><INDENT>raise YTFS.PathConvertError("<STR_LIT>") <EOL><DEDENT>del split[<NUM_LIT:0>]<EOL>try:<EOL><INDENT>if not split[-<NUM_LIT:1>]: split.pop() <EOL><DEDENT>except IndexError:<EOL><INDENT>raise YTFS.PathConvertError("<STR_LIT>") <EOL><DEDENT>if len(split) > <NUM_LIT:2>:<EOL><INDENT>raise YTFS.PathConvertError("<STR_LIT>") <EOL><DEDENT>try:<EOL><INDENT>d = split[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>d = None<EOL><DEDENT>try:<EOL><INDENT>f = split[<NUM_LIT:1>]<EOL><DEDENT>except IndexError:<EOL><INDENT>f = None<EOL><DEDENT>if not d and f:<EOL><INDENT>raise YTFS.PathConvertError("<STR_LIT>") <EOL><DEDENT>return (d, f)<EOL>
Convert directory or file path to its tuple identifier.

Parameters
----------
path : str
    Path to convert. It can look like /, /directory, /directory/ or /directory/filename.

Returns
-------
tup_id : tuple
    Two element tuple identifier of directory/file of (`directory`, `filename`) format. If path leads to main
    directory, then both fields of tuple will be ``None``. If path leads to a directory, then field `filename`
    will be ``None``.

Raises
------
YTFS.PathConvertError
    When invalid path is given.