code: def test_animation_opts(self):
      animation_opts = {"frame": {"duration": 5000}}
      expected_opts_str = json.dumps(animation_opts)
  
      # When auto_play is False, animation options are skipped
      html = plotly.offline.plot(
          fig_frames,
          output_type="div",
          auto_play=False,
          animation_opts=animation_opts,
      )
      self.assertIn(add_frames, html)
      self.assertNotIn(do_auto_play, html)
      self.assertNotIn(expected_opts_str, html)
  
      # When auto_play is True, animation options are included
      html = plotly.offline.plot(
          fig_frames,
          output_type="div",
          auto_play=True,
          animation_opts=animation_opts,
      )
      self.assertIn(add_frames, html)
      self.assertIn(do_auto_play, html)
      self.assertIn(expected_opts_str, html)
  
imports: import json
  import os
  from unittest import TestCase
  import pytest
  import plotly
  import plotly.io
  from plotly.io._utils import plotly_cdn_url
label_desc: Use image node_id 27 for calling the PlotlyOfflineTestCase obj's underlying member method code with example usage: obj.test_animation_opts() without return types