code: def runcell(cellname, filename):
      
      try:
          filename = filename.decode('utf-8')
      except (UnicodeError, TypeError, AttributeError):
          # UnicodeError, TypeError --> eventually raised in Python 2
          # AttributeError --> systematically raised in Python 3
          pass
      ipython_shell = get_ipython()
      namespace = _get_globals()
      namespace['__file__'] = filename
      try:
          cell_code = ipython_shell.cell_code
      except AttributeError:
          _print("--Run Cell Error--\n"
                 "Please use only through Spyder's Editor; "
                 "shouldn't be called manually from the console")
          return
  
      # Trigger `post_execute` to exit the additional pre-execution.
      # See Spyder PR #7310.
      ipython_shell.events.trigger('post_execute')
  
      ipython_shell.run_cell(cell_code)
      namespace.pop('__file__')
      del ipython_shell.cell_code
docs: Run a code cell from an editor as a file.
  
      Currently looks for code in an `ipython` property called `cell_code`.
      This property must be set by the editor prior to calling this function.
      This function deletes the contents of `cell_code` upon completion.
  
      Parameters
      ----------
      cellname : str
          Used as a reference in the history log of which
          cell was run with the fuction. This variable is not used.
      filename : str
          Needed to allow for proper traceback links.