def magic_matches(self, text):
<EOL>lsm = self.shell.magics_manager.lsmagic()<EOL>line_magics = lsm['<STR_LIT>']<EOL>cell_magics = lsm['<STR_LIT>']<EOL>pre = self.magic_escape<EOL>pre2 = pre+pre<EOL>bare_text = text.lstrip(pre)<EOL>comp = [ pre2+m for m in cell_magics if m.startswith(bare_text)]<EOL>if not text.startswith(pre2):<EOL><INDENT>comp += [ pre+m for m in line_magics if m.startswith(bare_text)]<EOL><DEDENT>return comp<EOL>
Match magics