<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def note_in_range(self, note):
 """Test whether note is in the range of this Instrument. Return True if so, False otherwise. """

        if type(note) == str:
            note = Note(note)
        if not hasattr(note, 'name'):
            raise UnexpectedObjectError("Unexpected object '%s'. "
                    "Expecting a mingus.containers.Note object" % note)
        if note >= self.range[0] and note <= self.range[1]:
            return True
        return False