def __call__(self, batch):
        """
        Args:
            batch: current batch

        Returns:
            batch values filtered by `keys`
        """
        if isinstance(batch[0], collections.abc.Mapping):
            result = {}
            for key in batch[0]:
                items = [d[key] for d in batch]
                if key not in self.keys:
                    items = default_collate(items)
                result[key] = items
            return result
        else:
            return default_collate(batch)

        Args:
            batch: current batch

        Returns:
            batch values filtered by `keys`
        
catalyst/contrib/data/collate_fn.py