<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter(self, datax, datay):
 """Filter a set of datax and datay according to `self.points`"""

        f = np.ones(datax.shape, dtype=bool)
        for i, p in enumerate(zip(datax, datay)):
            f[i] = PolygonFilter.point_in_poly(p, self.points)

        if self.inverted:
            np.invert(f, f)

        return f