code: def bestmatch(self):
          
          if self.obj is not None:
              for mstate in self.statemanager.all_states_by_value[self.value]:
                  msw = mstate(self.obj, self.cls)  # This returns a wrapper
                  if msw:  # If the wrapper evaluates to True, it's our best match
                      return msw
docs: Best matching current scalar state (direct or conditional), only
          applicable when accessed via an instance.