def __getItemFolder__(self, itemId):
        # This method is probably not needed anymore as the item folder
        # is returned in the description response ('ownerFolder').
        # Recommend deprecating this function or rewriting it to use the simple
        # description request and return 'ownerFolder'.
        parameters = urllib.urlencode({'token' : self.user.token,
                                       'f' : 'json'})
        response = json.loads(urllib.urlopen(self.user.portalUrl + '/sharing/rest/content/users/' + self.user.username + '?' + parameters).read())
        for item in response['items']:
            if item['id'] == itemId:
                return ''
        for folder in response['folders']:
            folderContent = self.__getFolderContent__(folder['id'])
            for item in folderContent['items']:
                if item['id'] == itemId:
                    return folder['id']
Finds the foldername for a particular item.
dataset/ETHPy150Open Esri/ago-tools/agoTools/utilities.py/Utilities.__getItemFolder__