def _find_resource_id_from_path(path):
session.token = verify_credentials()<EOL>parsed_path = path.split('<STR_LIT:/>')<EOL>if parsed_path[-<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>parsed_path.pop()<EOL><DEDENT>if path.startswith('<STR_LIT>'):<EOL><INDENT>parsed_path.pop(<NUM_LIT:0>)  <EOL>parsed_path.pop(<NUM_LIT:0>)  <EOL>name = parsed_path.pop(<NUM_LIT:0>)  <EOL>firstname, lastname = name.split('<STR_LIT:_>')<EOL>end = parsed_path.pop()<EOL>user = session.communicator.get_user_by_name(firstname, lastname)<EOL>leaf_folder_id = _descend_folder_for_id(parsed_path, user['<STR_LIT>'])<EOL>return _search_folder_for_item_or_folder(end, leaf_folder_id)<EOL><DEDENT>elif path.startswith('<STR_LIT>'):<EOL><INDENT>print(parsed_path)<EOL>parsed_path.pop(<NUM_LIT:0>)  <EOL>parsed_path.pop(<NUM_LIT:0>)  <EOL>community_name = parsed_path.pop(<NUM_LIT:0>)  <EOL>end = parsed_path.pop()<EOL>community = session.communicator.get_community_by_name(community_name)<EOL>leaf_folder_id = _descend_folder_for_id(parsed_path,<EOL>community['<STR_LIT>'])<EOL>return _search_folder_for_item_or_folder(end, leaf_folder_id)<EOL><DEDENT>else:<EOL><INDENT>return False, -<NUM_LIT:1><EOL><DEDENT>
Get a folder id from a path on the server.

Warning: This is NOT efficient at all.

The schema for this path is:
path := "/users/<name>/" | "/communities/<name>" , {<subfolder>/}
name := <firstname> , "_" , <lastname>

:param path: The virtual path on the server.
:type path: string
:returns: a tuple indicating True or False about whether the resource is an
    item and id of the resource i.e. (True, item_id) or (False, folder_id)
:rtype: (bool, int | long)