<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resample(self, inds):
 """Returns copy of constraint, with mask rearranged according to indices """

        new = copy.deepcopy(self)
        for arr in self.arrays:
            x = getattr(new, arr)
            setattr(new, arr, x[inds])
        return new