def detect_fold_level(self, prev_block, block):
<EOL>lvl = super(PythonFoldDetector, self).detect_fold_level(<EOL>prev_block, block)<EOL>prev_lvl = TextBlockHelper.get_fold_lvl(prev_block)<EOL>if prev_block and lvl > prev_lvl and not (<EOL>self._strip_comments(prev_block).endswith('<STR_LIT::>')):<EOL><INDENT>lvl = prev_lvl<EOL><DEDENT>lvl = self._handle_docstrings(block, lvl, prev_block)<EOL>lvl = self._handle_imports(block, lvl, prev_block)<EOL>return lvl<EOL>
Perfoms fold level detection for current block (take previous block
into account).

:param prev_block: previous block, None if `block` is the first block.
:param block: block to analyse.
:return: block fold level