'Read until either self.base_prompt or pattern is detected. Return ALL data available.'

def read_until_prompt_or_pattern(self, pattern=u'', re_flags=0):

    combined_pattern = re.escape(self.base_prompt)
    if pattern:
        combined_pattern += u'|{}'.format(pattern)
    return self._read_channel_expect(combined_pattern, re_flags=re_flags)
