docs: def session_dump(self, cell, hash, fname_session):
          """
          Dump ipython session to file
          :param hash: cell hash
          :param fname_session: output filename
          :return:
          """
  
          logging.debug('Cell {}: Dumping session to {}'.format(hash, fname_session))
  
          inject_code = ['import dill',
                         'dill.dump_session(filename="{}")'.format(fname_session),
                         ]
  
          inject_cell = nbf.v4.new_code_cell('\n'.join(inject_code))
          reply, outputs = super().run_cell(inject_cell)
  
          errors = list(filter(lambda out: out.output_type == 'error', outputs))
          if len(errors):
              logging.info('Cell {}: Warning: serialization failed, cache disabled'.format(hash))
              logging.debug(
                  'Cell {}: Serialization error: {}'.format(hash, CellExecutionError.from_cell_and_msg(cell, errors[0])))
  
              # disable attempts to retrieve cache for subsequent cells
              self.disable_cache = True
  
              # remove partial cache for current cell
              os.remove(fname_session)
  
              return False
  
          return True