'Get the folder ID for a given folder path specified by path_parts.
If the folder does not exist, it will be created ONCE (during the
instantiation of this Uploader object). After that it is stored and
recycled. If the Uploader object is re-created, it is not aware of
previously existing paths and will not respect those. TODO: handle
existing paths.'

def memoized_path(self, path_parts, base_folder=None):

    if (base_folder is None):
        base_folder = self.folder_id
    dropped_prefix = []
    fk = '/'.join(path_parts)
    if (fk in self.memo_path):
        return self.memo_path[fk]
    else:
        for i in reversed(range(len(path_parts))):
            fk = '/'.join(path_parts[0:(i + 1)])
            if (fk in self.memo_path):
                dropped_prefix = path_parts[0:(i + 1)]
                path_parts = path_parts[(i + 1):]
                base_folder = self.memo_path[fk]
                break
    nfk = []
    for i in range(len(path_parts)):
        nfk.append('/'.join((list(dropped_prefix) + list(path_parts[0:(i + 1)]))))
    ids = self.recursively_build_path(path_parts, base_folder)
    for (key, fid) in zip(nfk, ids):
        self.memo_path[key] = fid
    return ids[(-1)]
