code: def _prepare_pyshell_blocks(self, text):
          
          if ">>>" not in text:
              return text
  
          less_than_tab = self.tab_width - 1
          _pyshell_block_re = re.compile(r"""
              ^([ ]{0,%d})>>>[ ].*\n   # first line
              ^(\1.*\S+.*\n)*         # any number of subsequent lines
              ^\n                     # ends with a blank line
              """ % less_than_tab, re.M | re.X)
  
          return _pyshell_block_re.sub(self._pyshell_block_sub, text)
docs: Ensure that Python interactive shell sessions are put in
          code blocks -- even if not properly indented.