Pretty prints the given role
182604
def print_role(role, detailed=True):
    """"""
    if detailed:
        print(colors.yellow(role.get('fullname')))
    else:
        print("  Role: {0}".format(role.get('fullname')))
    if detailed:
        print("    description: {0}".format(role.get('description')))
    if 'default_attributes' in role:
        print("    default_attributes:")
        _pprint(role['default_attributes'])
    if 'override_attributes' in role:
        print("    override_attributes:")
        _pprint(role['override_attributes'])
    if detailed:
        print("    run_list: {0}".format(role.get('run_list')))
    print("")
1202244
def pretty_print(source, dest):
    
    parser = etree.XMLParser(remove_blank_text=True)
    if not isinstance(source, str):
        source = str(source)
    tree = etree.parse(source, parser)
    docinfo = tree.docinfo
    with open(dest, 'wb') as fp:
        fp.write(etree.tostring(tree, pretty_print=True,
                                encoding=docinfo.encoding, standalone=docinfo.standalone))
917460
def pretty_print_post(req):
    
    print(('{}\n{}\n{}\n\n{}'.format(
        '-----------START-----------',
        req.method + ' ' + req.url,
        '\n'.join('{}: {}'.format(k, v) for k, v in list(req.headers.items())),
        req.body,
    )))
694865
def role_show(endpoint_id, role_id):
    
    client = get_client()

    role = client.get_endpoint_role(endpoint_id, role_id)
    formatted_print(
        role,
        text_format=FORMAT_TEXT_RECORD,
        fields=(
            ("Principal Type", "principal_type"),
            ("Principal", lookup_principal),
            ("Role", "role"),
        ),
    )
901603
def pretty_print(self):
        
        print colored.blue("-" * 40)
        print colored.red("datacats: problem was encountered:")
        print self.message
        print colored.blue("-" * 40)
60420
def pretty_print(self):
        
        msg = "Source: " + str(self._source) + "\n"
        msg += "Destination: " + str(self._destination) + "\n"
        inv_types = {v: k for k, v in defines.Types.items()}
        msg += "Type: " + str(inv_types[self._type]) + "\n"
        msg += "MID: " + str(self._mid) + "\n"
        if self._code is None:
            self._code = 0

        msg += "Code: " + str(defines.Codes.LIST[self._code].name) + "\n"
        msg += "Token: " + str(self._token) + "\n"
        for opt in self._options:
            msg += str(opt)
        msg += "Payload: " + "\n"
        msg += str(self._payload) + "\n"
        return msg
55945
function Roler() {

        /**
         * ### Roler.roles
         *
         * List of all available roles
         *
         * @see Roler.setRoles
         */
        this.roles = {};

        /**
         * ### Roler.rolesArray
         *
         * The array of currently available roles
         *
         * @see Roler.setRoles
         * @see Roler.clear
         */
        this.rolesArray = [];

        /**
         * ### Roler.rolifiedMatches
         *
         * Array of arrays of roles assigned for all matches in all rounds
         *
         * For example:
         * ```javascript
         * [
         *     // Round 1.
         *     [  [ 'ROLE_A', 'ROLE_B' ], [ 'ROLE_A', 'ROLE_B' ], ... ],
         *     // Round 2.
         *     [  [ 'ROLE_A', 'ROLE_B' ], [ 'ROLE_A', 'ROLE_B' ], ... ],
         *     ...
         * ]
         * ```
         *
         * @see Roler.rolifyAll
         * @see Roler.setRolifiedMatches
         */
        this.rolifiedMatches = null;

        /**
         * ### Roler.role2IdMatches
         *
         * Array of arrays of maps role to id/s for all matches in all rounds
         *
         * For example:
         * ```javascript
         * [
         *     [ { ROLE_A: 'ID1', ROLE_B: 'ID2' }, ... ], // Round 1.
         *     [ { ROLE_A: [ 'ID1', 'ID2' ] }, ... ], // Round 2.
         *     ...
         * ]
         * ```
         *
         * @see Roler.rolifyAll
         * @see Roler.setRolifiedMatches
         */
        this.role2IdMatches = null;

        /**
         * ### Roler.id2RoleMatches
         *
         * Array of arrays of maps id to role for all matches in all rounds
         *
         * For example:
         * ```javascript
         * [
         *     [ { ID1: 'ROLE_A', ID2: 'ROLE_B' }, ... ], // Round 1.
         *     [ { ID1: 'ROLE_A', ID2: 'ROLE_A' }, ... ], // Round 2.
         *     ...
         * ]
         * ```
         *
         * @see Roler.rolifyAll
         * @see Roler.setRolifiedMatches
         */
        this.id2RoleMatches = null;

        /**
         * ### Roler.role2IdRoundMap
         *
         * Array of maps of role to id/s per each round
         *
         * For example:
         * ```javascript
         * [
         *     // Round 1.
         *     [ { ROLE_A: [ 'ID1', 'ID3', ... ], ROLE_B: 'ID2', ... } ],
         *     // Round 2.
         *     [ { ROLE_A: [ 'ID1', 'ID2', ... ], ROLE_B: 'ID3', ... } ],
         *     ...
         * ]
         * ```
         */
        this.role2IdRoundMap = [];

        /**
         * ### Roler.rolify
         *
         * Callback that assigns roles to a single match
         *
         * @see Roler.linearRolifier
         */
        this.rolify = Roler.linearRolifier;

        /**
         * ### Roler.missingId
         *
         * The id indicating a skipped match (i.e. a bye in a match)
         *
         * @see Matcher.missingId
         */
        this.missingId = 'bot';
    }
822301
async def role(self, *args, **kwargs):
        

        return await self._makeApiCall(self.funcinfo["role"], *args, **kwargs)
516089
def pretty_print(q)
      q.instance_exec(self) do |obj|
        text "\#<#{obj.class.to_s}"
        group_sub {
          nest(2) {
            breakable ' '
            pp obj.instance
          }
        }
        breakable ''
        text '>'
      end
    end
535875
static SafeHtml roleItem(final String css, final Role role) {
        if (role.isStandard()) {
            return ITEMS.item(css, role.getName(), role.getName());
        } else {
            return ITEMS.scopedRole(css, role.getName(), baseAndScope(role), shortBaseAndScope(role));
        }
    }
409416
def pretty_print_str(self):
        '''
        
        '''
        retval = ''
        # dfs
        todo = [self.root]
        while todo:
            current = todo.pop()
            for char in reversed(sorted(current.keys())):
                todo.append(current[char])
            indent = ' ' * (current.depth * 2)
            retval += indent + current.__unicode__() + '\n'
        return retval.rstrip('\n')
417315
def data(self, index, role):
        """"""
        if not index.isValid():
            return

        item = self.item(index)
        column = index.column()
        value = item.getItemData(column)

        if role == Qt.DisplayRole:
            try:
                if column == 1:
                    # Display small values using scientific notation.
                    if abs(float(value)) < 1e-3 and float(value) != 0.0:
                        return '{0:8.1e}'.format(value)
                    else:
                        return '{0:8.3f}'.format(value)
                else:
                    return '{0:8.2f}'.format(value)
            except ValueError:
                return value
        elif role == Qt.EditRole:
            try:
                value = float(value)
                if abs(value) < 1e-3 and value != 0.0:
                    return str('{0:8.1e}'.format(value))
                else:
                    return str('{0:8.3f}'.format(value))
            except ValueError:
                return str(value)
        elif role == Qt.CheckStateRole:
            if item.parent == self.rootItem and column == 0:
                return item.getCheckState()
        elif role == Qt.TextAlignmentRole:
            if column > 0:
                return Qt.AlignRight
420970
def role(name, report, role_name_length):
    
    pad_role_name_by = 11 + role_name_length

    defaults = field_value(report["total_defaults"], "defaults", "blue", 16)
    facts = field_value(report["total_facts"], "facts", "purple", 16)
    files = field_value(report["total_files"], "files", "dark gray", 16)
    lines = field_value(report["total_lines"], "lines", "normal", 16)

    print "{0:<{1}} {2} {3} {4} {5}".format(
        clr.stringc(name, c.LOG_COLOR[report["state"]]),
        pad_role_name_by, defaults, facts, files, lines)
593525
def pretty_print(self, obj):
        
        s = repr(obj)
        limit = output_limit()
        if len(s) > limit:
            if self.dom_term:
                s = self.color.py_syntax_highlight(s)
                s = self.dom_term.fold_text_string("", s)
            else:
                s = s[:limit - 3]  # cut before syntax highlighting, to avoid missing color endings
                s = self.color.py_syntax_highlight(s)
                s += "..."
        else:
            s = self.color.py_syntax_highlight(s)
        extra_info = self._pp_extra_info(obj)
        if extra_info != "":
            s += ", " + self.color.py_syntax_highlight(extra_info)
        return s
917887
def prettyprint(datastr):
    
    maxwidth = WPToolsQuery.MAXWIDTH
    rpad = WPToolsQuery.RPAD

    extent = maxwidth - (rpad + 2)
    for line in datastr:
        if len(line) >= maxwidth:
            line = line[:extent] + '...'
        utils.stderr(line)
746809
def pretty_print(q)
      q.text("AbsoluteSet[#{size}/#{@universe.size}]")
      q.group(2, "(", ")") do
        q.breakable ""

        elements = to_a
        elements.take(5).each do |e|
          unless q.current_group.first?
            q.text ","
            q.breakable
          end
          q.pp e
        end

        if elements.length > 5
          q.text ","
          q.breakable
          q.text "..."
        end
      end
    end
53384
def pretty_print(pp)
      return super if custom_inspect_method_defined?
      pp.object_address_group(self) do
        if defined?(@attributes) && @attributes
          attr_names = self.class.attribute_names.select { |name| has_attribute?(name) }
          pp.seplist(attr_names, proc { pp.text "," }) do |attr_name|
            pp.breakable " "
            pp.group(1) do
              pp.text attr_name
              pp.text ":"
              pp.breakable
              value = _read_attribute(attr_name)
              value = inspection_filter.filter_param(attr_name, value) unless value.nil?
              pp.pp value
            end
          end
        else
          pp.breakable " "
          pp.text "not initialized"
        end
      end
    end