code: def _anim_data(self, anim, fmt):
          
          (writer, _, anim_kwargs, extra_args) = ANIMATION_OPTS[fmt]
          if extra_args != []:
              anim_kwargs = dict(anim_kwargs, extra_args=extra_args)
  
          if self.fps is not None: anim_kwargs['fps'] = max([int(self.fps), 1])
          if self.dpi is not None: anim_kwargs['dpi'] = self.dpi
          if not hasattr(anim, '_encoded_video'):
              # Windows will throw PermissionError with auto-delete
              with NamedTemporaryFile(suffix='.%s' % fmt, delete=False) as f:
                  anim.save(f.name, writer=writer, **anim_kwargs)
                  video = f.read()
              f.close()
              os.remove(f.name)
          return video
docs: Render a matplotlib animation object and return the corresponding data.