code: def assert_selected(
      self,
      prop,
      inds,
      selector=None,
      row=None,
      col=None,
      secondary_y=None,
  ):
      # ## Test select_*
      # Get select_ method
      prefix = "layout_" if prop == "images" else ""
      fn = getattr(self.fig, "select_" + prefix + prop)
  
      # Perform selection
      res = fn(
          selector=selector, row=row, col=col, secondary_y=secondary_y
      )
      self.assertIsInstance(res, types.GeneratorType)
      objs = list(res)
  
      # Check length of selected objects
      self.assertEqual(len(objs), len(inds))
  
      # Check individual annotations
      for i, obj in zip(inds, objs):
          self.assertEqual(self.fig.layout[prop][i], obj)
  
      # ## Test for_each_*
      objs = []
      fn = getattr(self.fig, "for_each_" + prefix + prop[:-1])
      fn(
          lambda v: objs.append(v),
          selector=selector,
          row=row,
          col=col,
          secondary_y=secondary_y,
      )
      self.assertEqual(len(objs), len(inds))
      for i, obj in zip(inds, objs):
          self.assertEqual(self.fig.layout[prop][i], obj)
  
imports: import types
  from unittest import TestCase
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  import pytest
label_desc: Use image node_id 2 for calling the TestSelectForEachUpdateAnnotations obj's underlying member method code with example usage: obj.assert_selected(prop, inds, selector, row, col, secondary_y) without return types