def _descend_folder_for_id(parsed_path, folder_id):
if len(parsed_path) == <NUM_LIT:0>:<EOL><INDENT>return folder_id<EOL><DEDENT>session.token = verify_credentials()<EOL>base_folder = session.communicator.folder_get(session.token,<EOL>folder_id)<EOL>cur_folder_id = -<NUM_LIT:1><EOL>for path_part in parsed_path:<EOL><INDENT>cur_folder_id = base_folder['<STR_LIT>']<EOL>cur_children = session.communicator.folder_children(<EOL>session.token, cur_folder_id)<EOL>for inner_folder in cur_children['<STR_LIT>']:<EOL><INDENT>if inner_folder['<STR_LIT:name>'] == path_part:<EOL><INDENT>base_folder = session.communicator.folder_get(<EOL>session.token, inner_folder['<STR_LIT>'])<EOL>cur_folder_id = base_folder['<STR_LIT>']<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT><DEDENT>return cur_folder_id<EOL>
Descend a path to return a folder id starting from the given folder id.

:param parsed_path: a list of folders from top to bottom of a hierarchy
:type parsed_path: list[string]
:param folder_id: The id of the folder from which to start the descent
:type folder_id: int | long
:returns: The id of the found folder or -1
:rtype: int | long