#NEWLINE# def cell_brain( self ) : #NEWLINE# #INDENT# '\n        %%brain - run a cell as brain control code\n        for a calysto.simulation.\n\n        Requires calysto.\n\n        Examples:\n           %%brain\n           robot.forward(1)\n        ' #NEWLINE# text = self . code #NEWLINE# pre_code = '\nfrom calysto.simulation import *\nrobot = get_robot()\ndef brain():\n' #NEWLINE# post_code = 'robot.brain = brain' #NEWLINE# new_code = '    ' . join ( ( ( line + '\n' ) for line in text . split ( '\n' ) ) ) #NEWLINE# self . code = ( ( pre_code + new_code ) + post_code )