code: def update_function(self, func, frames=None):
          '''Set the function to be called when it's time to display a frame.
  
          *func* should be a function that takes one integer argument that
          represents the frame that has to be played::
  
              def func(index):
                  # Update the renderers to match the
                  # current animation index
  
          '''
          # Back-compatibility
          if frames is not None:
              self.traj_controls.set_ticks(frames)
          
          self._update_function = funf update_function(self, func, frames=None):
          '''Set the function to be called when it's time to display a frame.
  
          *func* should be a function that takes one integer argument that
          represents the frame that has to be played::
  
              def func(index):
                  # Update the renderers to match the
                  # current animation index
  
          '''
          # Back-compatibility
          if frames is not None:
              self.traj_controls.set_ticks(frames)
          
          self._update_function = func
docs: Set the function to be called when it's time to display a frame.
  
          *func* should be a function that takes one integer argument that
          represents the frame that has to be played::
  
              def func(index):
                  # Update the renderers to match the
                  # current animation index