Format the educate-line description including the permitted-value(s)
344628
def description_with_permitted str
			permitted_s = permitted.map do |p|
				case p
				when $stdout   then '<stdout>'
				when $stdin    then '<stdin>'
				when $stderr   then '<stderr>'
				else
					p.to_s
				end
			end.join(', ')

			permword = str.end_with?('.') ? 'Permitted' : 'permitted'
			return "#{str} (#{permword}: #{permitted_s})"
		end
1345943
def _format_value(self, val):
        
        name = self.name + ":"
        if not self.multiline or "\n" not in val:
            val = u"{0} {1}".format(name.ljust(self._text_prefix_len), val)
        else:
            spacer = "\n" + " " * (self._text_prefix_len + 1)
            val = u"{0}{1}{2}".format(name, spacer, spacer.join(val.split("\n")))

        return val
1246875
def do_describe(self, line):
        ""
        args = self.getargs(line)

        if '-c' in args:
            create_info = True
            args.remove('-c')
        else:
            create_info = False

        if not args:
            if self.table:
                args = [ self.table.table_name ]
            else:
                args = self.tables

        for table in args:
            desc = self.conn.describe_table(table)

            if create_info:
                info = desc['Table']
                name = info['TableName']
                attributes = info['AttributeDefinitions']
                schema = info['KeySchema']

                hkey = ''
                rkey = ''

                for k in schema:
                    aname = k['AttributeName']
                    for a in attributes:
                        if a['AttributeName'] == aname:
                            value = "%s:%s" % (a['AttributeName'], a['AttributeType'])
                            break

                    if k['KeyType'] == 'HASH':
                        hkey = value
                    elif k['KeyType'] == 'RANGE':
                        rkey = ' ' + value

                prov = info['ProvisionedThroughput']
                prov = "-c %d,%d" % (prov['ReadCapacityUnits'], prov['WriteCapacityUnits'])
                print "create %s %s %s%s" % (name, prov, hkey, rkey)
            else:
                self.pprint(desc, "%s: " % table)
767987
def _value_format(self, value):
        """"""
        return super(Funnel, self)._value_format(value and abs(value))
709131
def friendly_format(self):
        """"""
        if self.description is not None:
            msg = self.description
        else:
            msg = 'errorCode: {} / detailCode: {}'.format(
                self.errorCode, self.detailCode
            )
        return self._fmt(self.name, msg)
865803
def format_box(title, ch="*"):
    
    lt = len(title)
    return [(ch * (lt + 8)),
            (ch * 3 + " " + title + " " + ch * 3),
            (ch * (lt + 8))
           ]
145536
def _format_info(self):
		
		info = 'GNTP/%s %s' % (
			self.info.get('version'),
			self.info.get('messagetype'),
		)
		if self.info.get('encryptionAlgorithmID', None):
			info += ' %s:%s' % (
				self.info.get('encryptionAlgorithmID'),
				self.info.get('ivValue'),
			)
		else:
			info += ' NONE'

		if self.info.get('keyHashAlgorithmID', None):
			info += ' %s:%s.%s' % (
				self.info.get('keyHashAlgorithmID'),
				self.info.get('keyHash'),
				self.info.get('salt')
			)

		return info
1218698
public String getFormattedOption(int offset, int descriptionStart, int width) {
        StringBuilder sb = new StringBuilder();
        if(required && ansiMode)
            sb.append(ANSI.BOLD);
        if(offset > 0)
            sb.append(String.format("%" + offset+ "s", ""));
        if(shortName != null)
            sb.append("-").append(shortName);
        if(name != null && name.length() > 0) {
            if(shortName != null)
                sb.append(", ");
            sb.append("--").append(name);
        }
        if(argument != null && argument.length() > 0) {
            sb.append("=<").append(argument).append(">");
        }
        if(required && ansiMode)
            sb.append(ANSI.BOLD_OFF);
        if(description != null && description.length() > 0) {
            //int descOffset = descriptionStart - sb.length();
            int descOffset = descriptionStart - getFormattedLength() - offset;
            if(descOffset > 0)
                sb.append(String.format("%"+descOffset+"s", ""));
            else
                sb.append(" ");

            sb.append(description);
        }

        return sb.toString();
    }
1079961
def format_option(self, option):
        
        # The help for each option consists of two parts:
        #   * the opt strings and metavars
        #   eg. ("-x", or "-fFILENAME, --file=FILENAME")
        #   * the user-supplied help string
        #   eg. ("turn on expert mode", "read data from FILENAME")
        #
        # If possible, we write both of these on the same line:
        #   -x    turn on expert mode
        #
        # But if the opt string list is too long, we put the help
        # string on a second line, indented to the same column it would
        # start in if it fit on the first line.
        #   -fFILENAME, --file=FILENAME
        #       read data from FILENAME
        result = []
        opts = self.option_strings[option]
        opt_width = self.help_position - self.current_indent - 2
        if len(opts) > opt_width:
            opts = "%*s%s\n" % (self.current_indent, "", opts)
            indent_first = self.help_position
        else: # start help on same line as opts
            opts = "%*s%-*s  " % (self.current_indent, "", opt_width, opts)
            indent_first = 0
        result.append(opts)
        if option.help:
            help_text = self.expand_default(option)
            # Everything is the same up through here
            help_lines = []
            for para in help_text.split("\n"):
                help_lines.extend(textwrap.wrap(para, self.help_width))
            # Everything is the same after here
            result.append("%*s%s\n" % (
                indent_first, "", help_lines[0]))
            result.extend(["%*s%s\n" % (self.help_position, "", line)
                for line in help_lines[1:]])
        elif opts[-1] != "\n":
            result.append("\n")
        return "".join(result)
498695
def _format_info(data):
    '''
    
    '''
    return {'name': data.gr_name,
            'gid': data.gr_gid,
            'passwd': data.gr_passwd,
            'members': data.gr_mem}
74546
def remove_rules(self, description):
        '''
        
        '''
        rm = []
        description = description.lower()

        for i in range(0, len(self.extract_rules)):
            if self.extract_rules[i]['regex'].search(description):
                rm.append(i)

        for i in rm:
            self.extract_rules.pop(i)

        return len(rm)
796225
def pprint_lines(value):
    
    pformatted = pformat(value, width=1, indent=4)
    formatted = "{0}\n {1}\n{2}".format(
        pformatted[0],
        pformatted[1:-1],
        pformatted[-1]
    )
    return Markup(formatted)
1048672
def _format_info(data):
    '''
    
    '''
    # Put GECOS info into a list
    gecos_field = salt.utils.stringutils.to_unicode(data.pw_gecos).split(',', 4)
    # Make sure our list has at least five elements
    while len(gecos_field) < 5:
        gecos_field.append('')

    return {'gid': data.pw_gid,
            'groups': list_groups(data.pw_name),
            'home': data.pw_dir,
            'name': data.pw_name,
            'passwd': data.pw_passwd,
            'shell': data.pw_shell,
            'uid': data.pw_uid,
            'fullname': gecos_field[0],
            'roomnumber': gecos_field[1],
            'workphone': gecos_field[2],
            'homephone': gecos_field[3],
            'other': gecos_field[4]}
697942
def _format_description(ctx):
    
    help_string = ctx.command.help or ctx.command.short_help
    if not help_string:
        return

    bar_enabled = False
    for line in statemachine.string2lines(
            help_string, tab_width=4, convert_whitespace=True):
        if line == '\b':
            bar_enabled = True
            continue
        if line == '':
            bar_enabled = False
        line = '| ' + line if bar_enabled else line
        yield line
    yield ''
217502
def description(filename):
    """"""
    # This ends up in the Summary header for PKG-INFO and it should be a
    # one-liner.  It will get rendered on the package page just below the
    # package version header but above the long_description, which ironically
    # gets stuff into the Description header.  It should not include reST, so
    # pick out the first single line after the double header.
    with open(filename) as fp:
        for lineno, line in enumerate(fp):
            if lineno < 3:
                continue
            line = line.strip()
            if len(line) > 0:
                return line
885221
def _format_attrs(self):
        
        attrs = [
            ('levels', ibase.default_pprint(self._levels,
                                            max_seq_items=False)),
            ('codes', ibase.default_pprint(self._codes,
                                           max_seq_items=False))]
        if com._any_not_none(*self.names):
            attrs.append(('names', ibase.default_pprint(self.names)))
        if self.sortorder is not None:
            attrs.append(('sortorder', ibase.default_pprint(self.sortorder)))
        return attrs
730557
def full_description
			desc_str = desc
			desc_str = description_with_default desc_str if default
			desc_str = description_with_permitted desc_str if permitted
			desc_str
		end