def METHOD_NAME(self, filename, *l):
    if not self.selected_count:
        self.recognizer.export_gesture(filename=filename)
    else:
        tmpgdb = Recognizer()
        for i in self.ids.gesture_list.children:
            if i.ids.select.state == 'down':
                for g in i.gesture_list:
                    tmpgdb.db.append(g)
        tmpgdb.export_gesture(filename=filename)