code: def _validate_states(states, topology):
      '''Validate states to avoid ignoring states during initialization'''
      states = states or []
      if isinstance(states, dict):
          for x in states:
              assert x in topology.node
      else:
          assert len(states) <= len(topology)
      return statef _validate_states(states, topology):
      '''Validate states to avoid ignoring states during initialization'''
      states = states or []
      if isinstance(states, dict):
          for x in states:
              assert x in topology.node
      else:
          assert len(states) <= len(topology)
      return states
docs: Validate states to avoid ignoring states during initialization