<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getWidget(self,**kwargs):
 """ Wrapper function that returns a new widget attached to this simulation. Widgets provide real-time 3D visualizations from within an Jupyter notebook. See the Widget class for more details on the possible arguments. Arguments --------- All arguments passed to this wrapper function will be passed to /Widget class. Returns ------- A rebound.Widget object. Examples -------- """

        from .widget import Widget # ondemand
        from ipywidgets import DOMWidget
        from IPython.display import display, HTML
        if not hasattr(self, '_widgets'):
            self._widgets = []
            def display_heartbeat(simp):
                for w in self._widgets:
                    w.refresh(simp,isauto=1)
            self.visualization = VISUALIZATIONS["webgl"] 
            clibrebound.reb_display_init_data(byref(self));
            self._dhbf = AFF(display_heartbeat)
            self._display_heartbeat = self._dhbf
            display(HTML(Widget.getClientCode())) # HACK! Javascript should go into custom.js
        newWidget = Widget(self,**kwargs)
        self._widgets.append(newWidget)
        newWidget.refresh(isauto=0)
        return newWidget