Decorator used to specify the program name for the console script
    help message.

    :param text: The text to use for the program name.
343999
def prog(text):
    

    def decorator(func):
        adaptor = ScriptAdaptor._get_adaptor(func)
        adaptor.prog = text
        return func
    return decorator
832972
def set_text(self, text="YEAH."):
        
        # Make sure the text is actually different, so as not to 
        # trigger a value changed signal
        s = str(text)
        if not s == self.get_text(): self._widget.setText(str(text))
        return self
496665
def with_text(self, text, markdown=None):
        '''
        '''
        self._text = text
        self._markdown = markdown or False

        return self
1372616
public void setInfo(String text)
  {
    if (text != null && text.length() > 0)
    {
      String prefix = "Result for: <span class=\"" + Helper.CORPUS_FONT_FORCE + "\">";
      lblInfo.setDescription(prefix + text.replaceAll("\n", " ") + "</span>");
      lblInfo.setValue(text.length() < 50 ? prefix + StringEscapeUtils.
        escapeHtml4(text.substring(0, text.length())) : prefix + StringEscapeUtils.
        escapeHtml4(text.substring(0, 50)) + " ... </span>");
    }
  }
921602
public void setText(String text) {
        input.setText("");
        if (text != null) {
            input.append(text);
        }
    }
41896
def tag(self, text):
        
        matches = self._match(text.text)
        matches = self._resolve_conflicts(matches)

        if self.return_layer:
            return matches
        else:
            text[self.layer_name] = matches
59627
def create_text_object_decorator(registry):
    
    assert isinstance(registry, BaseRegistry)

    operator_given = ViWaitingForTextObjectMode()
    navigation_mode = ViNavigationMode()
    selection_mode = ViSelectionMode()

    def text_object_decorator(*keys, **kw):
        """
        Register a text object function.

        Usage::

            @text_object('w', filter=..., no_move_handler=False)
            def handler(event):
                # Return a text object for this key.
                return TextObject(...)

        :param no_move_handler: Disable the move handler in navigation mode.
            (It's still active in selection mode.)
        """
        filter = kw.pop('filter', Always())
        no_move_handler = kw.pop('no_move_handler', False)
        no_selection_handler = kw.pop('no_selection_handler', False)
        eager = kw.pop('eager', False)
        assert not kw

        def decorator(text_object_func):
            assert callable(text_object_func)

            @registry.add_binding(*keys, filter=operator_given & filter, eager=eager)
            def _(event):
                # Arguments are multiplied.
                vi_state = event.cli.vi_state
                event._arg = (vi_state.operator_arg or 1) * (event.arg or 1)

                # Call the text object handler.
                text_obj = text_object_func(event)
                if text_obj is not None:
                    assert isinstance(text_obj, TextObject)

                    # Call the operator function with the text object.
                    vi_state.operator_func(event, text_obj)

                # Clear operator.
                event.cli.vi_state.operator_func = None
                event.cli.vi_state.operator_arg = None

            # Register a move operation. (Doesn't need an operator.)
            if not no_move_handler:
                @registry.add_binding(*keys, filter=~operator_given & filter & navigation_mode, eager=eager)
                def _(event):
                    " Move handler for navigation mode. "
                    text_object = text_object_func(event)
                    event.current_buffer.cursor_position += text_object.start

            # Register a move selection operation.
            if not no_selection_handler:
                @registry.add_binding(*keys, filter=~operator_given & filter & selection_mode, eager=eager)
                def _(event):
                    " Move handler for selection mode. "
                    text_object = text_object_func(event)
                    buff = event.current_buffer

                    # When the text object has both a start and end position, like 'i(' or 'iw',
                    # Turn this into a selection, otherwise the cursor.
                    if text_object.end:
                        # Take selection positions from text object.
                        start, end = text_object.operator_range(buff.document)
                        start += buff.cursor_position
                        end += buff.cursor_position

                        buff.selection_state.original_cursor_position = start
                        buff.cursor_position = end

                        # Take selection type from text object.
                        if text_object.type == TextObjectType.LINEWISE:
                            buff.selection_state.type = SelectionType.LINES
                        else:
                            buff.selection_state.type = SelectionType.CHARACTERS
                    else:
                        event.current_buffer.cursor_position += text_object.start

            # Make it possible to chain @text_object decorators.
            return text_object_func

        return decorator
    return text_object_decorator
1259990
def _show_help(self, txt,
                mode_to_set=MAIN_HELP_MODE,
                caption=' Help ',
                prompt=' Press any key to hide ',
                too_small_msg='Window too small to show message',
                is_message=False):
        
        self.helpWinContainer = None
        self.helpWin = None
        self.operation_mode = mode_to_set
        txt_col = curses.color_pair(5)
        box_col = curses.color_pair(3)
        caption_col = curses.color_pair(4)
        lines = txt.split('\n')
        st_lines = [item.replace('\r','') for item in lines]
        lines = [item.strip() for item in st_lines]
        inner_height = len(lines) + 2
        inner_width = self._get_message_width_from_list(lines) + 4
        outer_height = inner_height + 2
        outer_width = inner_width + 2
        if self.window_mode == CONFIG_MODE and \
                self.operation_mode > CONFIG_HELP_MODE:
            use_empty_win = True
            height_to_use = outer_height
            width_to_use = outer_width
        else:
            use_empty_win = False
            height_to_use = inner_height
            width_to_use = inner_width
        if self.maxY - 2 < outer_height or self.maxX < outer_width:
            txt = too_small_msg
            inner_height = 3
            inner_width = len(txt) + 4
            if use_empty_win:
                height_to_use = inner_height +2
                width_to_use = inner_width + 2
            else:
                height_to_use = inner_height
                width_to_use = inner_width
            if self.maxX < width_to_use:
                if logger.isEnabledFor(logging.DEBUG):
                    logger.debug('  ***  Window too small even to show help warning  ***')
                self.operation_mode = self.window_mode = NORMAL_MODE
                return
            lines = [ txt , ]
        if use_empty_win:
            self.helpWinContainer = curses.newwin(height_to_use,width_to_use,int((self.maxY-height_to_use)/2),int((self.maxX-width_to_use)/2))
            self.helpWinContainer.bkgdset(' ', box_col)
            self.helpWinContainer.erase()
        self.helpWin = curses.newwin(inner_height,inner_width,int((self.maxY-inner_height)/2),int((self.maxX-inner_width)/2))
        self.helpWin.bkgdset(' ', box_col)
        self.helpWin.erase()
        self.helpWin.box()
        if is_message:
            start_with = txt_col
            follow = caption_col
        else:
            start_with = caption_col
            follow = txt_col
        if caption.strip():
            self.helpWin.addstr(0, int((inner_width-len(caption))/2), caption, caption_col)
        splited = []
        for i, n in enumerate(lines):
            a_line = self._replace_starting_undesscore(n)
            if a_line.startswith('%'):
                self.helpWin.move(i + 1, 0)
                try:
                    self.helpWin.addstr('├', curses.color_pair(3))
                    self.helpWin.addstr('─' * (inner_width - 2), curses.color_pair(3))
                    self.helpWin.addstr('┤', curses.color_pair(3))
                except:
                    self.helpWin.addstr('├'.encode('utf-8'), curses.color_pair(3))
                    self.helpWin.addstr('─'.encode('utf-8') * (inner_width - 2), curses.color_pair(3))
                    self.helpWin.addstr('┤'.encode('utf-8'), curses.color_pair(3))
                self.helpWin.addstr(i + 1, inner_width-len(a_line[1:]) - 1, a_line[1:].replace('_', ' '), caption_col)
                #self.helpWin.addstr(i + 1, int((inner_width-len(a_line[1:]))/2), a_line[1:].replace('_', ' '), caption_col)
            else:
                splited = a_line.split('|')
                self.helpWin.move(i + 1, 2)
                for part, part_string in enumerate(splited):
                    if part_string.strip():
                        if part == 0 or part % 2 == 0:
                            self.helpWin.addstr(splited[part], start_with)
                        else:
                            self.helpWin.addstr(splited[part], follow)
        if prompt.strip():
            self.helpWin.addstr(inner_height - 1, int(inner_width-len(prompt)-1), prompt)
        if use_empty_win:
            self.helpWinContainer.refresh()
        self.helpWin.refresh()
1319120
def replace_variables(self, text):
        
        variables = {
            'python-executable': str(self._venv_path / 'bin' / 'python')
        }
        return text.format(**variables)
934835
def debug_text_simple(self, text: str):
        
        self._debug_texts.append(self.to_debug_message(text))
281301
def send_text(self, text, **options):
        
        return self.bot.send_message(self.id, text, **options)
1257570
def help_text(self):
        
        help_text = '\n'.join(sorted(get_commands().keys()))
        help_text = "\nCommands:\n" + help_text
        return help_text
554242
def lemmatize(text_string):
    '''
        
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return LEMMATIZER.lemmatize(text_string)
    else:
        raise InputError("string not passed as primary argument")
1190190
def set_text(self, text):
        
        d = self.declaration
        if d.input_type == 'html':
            text = Spanned(__id__=Html.fromHtml(text))
        self.widget.setTextKeepState(text)
923629
def text(self, text):
        '''
        
        '''

        if text:
            if not isinstance(text, str):
                text = _pformat(text)
            text += '\n\n'
            self.m(
                'add text to mail',
                more=dict(len=len(text))
            )
            self.__message.attach(_MIMEText(text, 'plain', 'UTF-8'))
323479
def p_text(self, text):
        ''''''
        item = text[1]
        text[0] = item if item[0] != "\n" else u""
        if len(text) > 2:
            text[0] += "\n"
131603
def formatText(self, text):
        
        format = self.inputFormat()
        if format == XLineEdit.InputFormat.Normal:
            return text
        
        text = projex.text.nativestring(text)
        if format == XLineEdit.InputFormat.CamelHump:
            return projex.text.camelHump(text)
        
        elif format == XLineEdit.InputFormat.Pretty:
            return projex.text.pretty(text)
        
        elif format == XLineEdit.InputFormat.Underscore:
            return projex.text.underscore(text)
        
        elif format == XLineEdit.InputFormat.Dash:
            return projex.text.dashed(text)
        
        elif format == XLineEdit.InputFormat.ClassName:
            return projex.text.classname(text)
        
        elif format == XLineEdit.InputFormat.NoSpaces:
            return projex.text.joinWords(text, self.spacer())
        
        elif format == XLineEdit.InputFormat.Capitalize:
            return text.capitalize()
        
        elif format == XLineEdit.InputFormat.Uppercase:
            return text.upper()
        
        elif format == XLineEdit.InputFormat.Lowercase:
            return text.lower()
        
        elif format == XLineEdit.InputFormat.Package:
            return '.'.join(map(lambda x: x.lower(),
                            map(projex.text.classname, text.split('.'))))
        
        return text