def matches(self, stream):
        """Check if this selector matches the given stream

        Args:
            stream (DataStream): The stream to check

        Returns:
            bool: True if this selector matches the stream
        """

        if self.match_type != stream.stream_type:
            return False

        if self.match_id is not None:
            return self.match_id == stream.stream_id

        if self.match_spec == DataStreamSelector.MatchUserOnly:
            return not stream.system
        elif self.match_spec == DataStreamSelector.MatchSystemOnly:
            return stream.system
        elif self.match_spec == DataStreamSelector.MatchUserAndBreaks:
            return (not stream.system) or (stream.system and (stream.stream_id in DataStream.KnownBreakStreams))

        # The other case is that match_spec is MatchCombined, which matches everything
        # regardless of system of user flag
        return True
Check if this selector matches the given stream

        Args:
            stream (DataStream): The stream to check

        Returns:
            bool: True if this selector matches the stream