def _matches(self, item):
        # support passing arguments by feeding a tuple instead of a callable
        if not callable(item) and getattr(item, '__getitem__', False):
            func = item[0]
            params = item[1:]
        else:
            func = item
            params = []

        try:
            before = self.watcher()
        except TypeError:
            before = self.watcher

        # keep a snapshot of the value in case it's mutable
        from copy import deepcopy
        self.before = deepcopy(before)

        func(*params)

        try:
            self.after = self.watcher()
        except __HOLE__:
            self.after = self.watcher

        try:
            hc.assert_that(self.after, hc.equal_to(self.before))
            self.changed = False
        except AssertionError:
            self.changed = True

        return self.changed
dataset/ETHPy150Open drslump/pyshould/pyshould/matchers.py/Changes._matches