Shows and persists fail symbol and text and exits.
        Parameters
        ----------
        text : None, optional
            Text to be shown alongside fail symbol.
        Returns
        -------
        self
13522
def fail(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.ERROR.value, text=text)
476664
def unquote(text, exceptions=[]):
    
    if not text:
        if text is None:
            raise TypeError('None object cannot be unquoted')
        else:
            return text
    if '%' not in text:
        return text
    s = text.split('%')
    res = [s[0]]
    for h in s[1:]:
        c = _hextochr.get(h[:2])
        if c and c not in exceptions:
            if len(h) > 2:
                res.append(c + h[2:])
            else:
                res.append(c)
        else:
            res.append('%' + h)
    return ''.join(res)
928771
def warn(self, text):
		
		self.logger.warn("{}{}".format(self.message_prefix, text))
1049292
def canonical_text(self, text):
        
        out = []
        line_continues_a_comment = False
        for line in text.splitlines():
            line,comment = self.comment_re.findall(line)[0]
            if line_continues_a_comment == True:
                out[-1] = out[-1] + line.lstrip()
            else:
                out.append(line)
            line_continues_a_comment = len(comment) > 0
        return '\n'.join(out).rstrip()+'\n'
255956
def run(self, text):
        
        for regex in self.regexes:
            text = regex.sub(self.repl, text)
        return text
702594
def setText(self, text):
        
        self._text = text

        if text:
            if self._textItem is None:
                self._textItem = QGraphicsTextItem()
                self._textItem.setParentItem(self)

            self._textItem.setPlainText(text)

        elif self._textItem:
            self.scene().removeItem(self._textItem)
            self._textItem = None
1298036
def warn(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.WARNING.value, text=text)
615039
def Message(self, text):
        
        self.Display(text)
        self.sconf.cached = 1
        self.did_show_result = 0
407502
def unescape(cls, text: str) -> str:
        
        chop = text.split("\\", 1)
        try:
            return (chop[0] if len(chop) == 1
                    else chop[0] + cls.unescape_map[chop[1][0]] +
                    cls.unescape(chop[1][1:]))
        except KeyError:
            raise InvalidArgument(text) from None
986922
def failure_message(self, fail):
        
        try:
            return u'{0}: {1}'.format(
                fail._value.__class__.__name__,
                str(fail._value),
            )
        except Exception:
            return u'Failed to produce failure message for "{0}"'.format(fail)
101509
def error(self, text, screenshot=None):
        
        step = {
            'time': '%.1f' % (time.time()-self.start_time,),
            'action': 'error',
            'description': text,
            'success': False,
        }   
        if screenshot:
            step['screenshot'] = self._take_screenshot(screenshot, name_prefix='error')
        self.steps.append(step)
1040202
def write_text(self, text):
        
        text_width = max(self.width - self.current_indent, 11)
        indent = ' ' * self.current_indent
        self.write(wrap_text(text, text_width,
                             initial_indent=indent,
                             subsequent_indent=indent,
                             preserve_paragraphs=True))
        self.write('\n')
754105
def assert_text_present(self, text, msg=None):
        
        e = driver.find_element_by_tag_name('body')
        assert text in e.text
819597
def fail(message, exception_data=None):
  
  print(message, file=sys.stderr)
  if exception_data:
    print(repr(exception_data))
  sys.exit(1)
682495
def try_process_text(self, text):
        
        if not text:
            return text
        try:
            return self.process_text(text)
        except (socket.gaierror, socket.timeout, xml.parsers.expat.ExpatError):
            return text
552366
def popError(text, title="Lackey Error"):
    
    root = tk.Tk()
    root.withdraw()
    tkMessageBox.showerror(title, text)
367151
def setText( self, text ):
        
        super(XMultiTagItem, self).setText(text)
        
        metrics = QFontMetrics(self.font())
        
        hint = QSize(metrics.width(text) + 24, 18)
        self.setSizeHint(hint)