<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_note(self, note, octave=-1):
 """Remove note from container. The note can either be a Note object or a string representing the note's name. If no specific octave is given, the note gets removed in every octave. """

        res = []
        for x in self.notes:
            if type(note) == str:
                if x.name != note:
                    res.append(x)
                else:
                    if x.octave != octave and octave != -1:
                        res.append(x)
            else:
                if x != note:
                    res.append(x)
        self.notes = res
        return res