def calculate_item_depth(self, tree_alias, item_id, depth=<NUM_LIT:0>):
item = self.get_item_by_id(tree_alias, item_id)<EOL>if hasattr(item, '<STR_LIT>'):<EOL><INDENT>depth = item.depth + depth<EOL><DEDENT>else:<EOL><INDENT>if item.parent is not None:<EOL><INDENT>depth = self.calculate_item_depth(tree_alias, item.parent.id, depth + <NUM_LIT:1>)<EOL><DEDENT><DEDENT>return depth<EOL>
Calculates depth of the item in the tree.

        :param str|unicode tree_alias:
        :param int item_id:
        :param int depth:
        :rtype: int