<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_nonspeech_fragments(self, zero_length_only=False):
 """ Remove ``NONSPEECH`` fragments from the list. If ``zero_length_only`` is ``True``, remove only those fragments with zero length, and make all the others ``REGULAR``. :param bool zero_length_only: remove only zero length NONSPEECH fragments """

        self.log(u"Removing nonspeech fragments...")
        nonspeech = list(self.nonspeech_fragments)
        if zero_length_only:
            nonspeech = [(i, f) for i, f in nonspeech if f.has_zero_length]
        nonspeech_indices = [i for i, f in nonspeech]
        self.remove(nonspeech_indices)
        if zero_length_only:
            for i, f in list(self.nonspeech_fragments):
                f.fragment_type = SyncMapFragment.REGULAR
        self.log(u"Removing nonspeech fragments... done")