<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def min_chans(self, min_chans):
 """ Remove detections with fewer channels used than min_chans :type min_chans: int :param min_chans: Minimum number of channels to allow a detection. :return: Party .. Note:: Works in place on Party. .. rubric:: Example 4 1 """

        declustered = Party()
        for family in self.families:
            fam = Family(family.template)
            for d in family.detections:
                if d.no_chans > min_chans:
                    fam.detections.append(d)
            declustered.families.append(fam)
        self.families = declustered.families
        return self