def get_description(self):
def split_header(s, get_header=True):<EOL><INDENT>s = s.lstrip().rstrip()<EOL>parts = s.splitlines()<EOL>if parts[<NUM_LIT:0>].startswith('<STR_LIT:#>'):<EOL><INDENT>if get_header:<EOL><INDENT>header = re.sub('<STR_LIT>', '<STR_LIT>', parts.pop(<NUM_LIT:0>))<EOL>if not parts:<EOL><INDENT>return header, '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>header = '<STR_LIT>'<EOL><DEDENT>rest = '<STR_LIT:\n>'.join(parts).lstrip().split('<STR_LIT>')<EOL>desc = rest[<NUM_LIT:0>].replace('<STR_LIT:\n>', '<STR_LIT:U+0020>')<EOL>return header, desc<EOL><DEDENT>else:<EOL><INDENT>if get_header:<EOL><INDENT>if parts[<NUM_LIT:0>].startswith(('<STR_LIT:=>', '<STR_LIT:->')):<EOL><INDENT>parts = parts[<NUM_LIT:1>:]<EOL><DEDENT>header = parts.pop(<NUM_LIT:0>)<EOL>if parts and parts[<NUM_LIT:0>].startswith(('<STR_LIT:=>', '<STR_LIT:->')):<EOL><INDENT>parts.pop(<NUM_LIT:0>)<EOL><DEDENT>if not parts:<EOL><INDENT>return header, '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>header = '<STR_LIT>'<EOL><DEDENT>rest = '<STR_LIT:\n>'.join(parts).lstrip().split('<STR_LIT>')<EOL>desc = rest[<NUM_LIT:0>].replace('<STR_LIT:\n>', '<STR_LIT:U+0020>')<EOL>return header, desc<EOL><DEDENT><DEDENT>first_cell = self.nb['<STR_LIT>'][<NUM_LIT:0>]<EOL>if not first_cell['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>return '<STR_LIT>', '<STR_LIT>'<EOL><DEDENT>header, desc = split_header(first_cell['<STR_LIT:source>'])<EOL>if not desc and len(self.nb['<STR_LIT>']) > <NUM_LIT:1>:<EOL><INDENT>second_cell = self.nb['<STR_LIT>'][<NUM_LIT:1>]<EOL>if second_cell['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>_, desc = split_header(second_cell['<STR_LIT:source>'], False)<EOL><DEDENT><DEDENT>return header, desc<EOL>
Get summary and description of this notebook