Print all elements' information.
 Args:
   recursively => Whether print recursively or not. Default is false.
   out         => Print target. Default is STDOUT.
963176
def show(recursively=false, out=STDOUT, depth=0)
      @list.each_with_index do |element, i|
        out.puts sprintf(" " * (depth * 2) + "%-5s::%20s  Len: %s Cont: %s",
                         "[#{i}]",
                         element.class.name ? element.class.name.split("::").last : "AnonymouseTemplate",
                         element.structure_bit_length,
                         element.content_description)
        element.show(true, out, depth + 1) if recursively
      end
    end
743173
def do_info(self, subcmd, opts, *args):
        
        print "'svn %s' opts: %s" % (subcmd, opts)
        print "'svn %s' args: %s" % (subcmd, args)
930593
def _printout(self, data, output):
        '''
        
        '''
        opts = {'extension_modules': '', 'color': False}
        try:
            printout = salt.output.get_printout(output, opts)(data)
            if printout is not None:
                return printout.rstrip()
        except (KeyError, AttributeError, TypeError) as err:
            log.debug(err, exc_info=True)
            try:
                printout = salt.output.get_printout('nested', opts)(data)
                if printout is not None:
                    return printout.rstrip()
            except (KeyError, AttributeError, TypeError) as err:
                log.debug(err, exc_info=True)
                printout = salt.output.get_printout('raw', opts)(data)
                if printout is not None:
                    return printout.rstrip()

        return salt.output.try_printout(data, output, opts)
50108
def printClassTree(self, element=None, showids=False, labels=False, showtype=False):
        
        TYPE_MARGIN = 11  # length for owl:class etc..

        if not element:  # first time
            for x in self.toplayer_classes:
                printGenericTree(x, 0, showids, labels, showtype, TYPE_MARGIN)

        else:
            printGenericTree(element, 0, showids, labels, showtype, TYPE_MARGIN)
21593
def do_info(self, line):
        """"""
        # opts = [ 'namespaces', 'description', 'overview', 'toplayer', 'parents', 'children', 'stats', 'triples' ]
        opts = self.INFO_OPTS

        if not self.current:
            self._help_noontology()
            return

        line = line.split()
        g = self.current['graph']

        # get arg, or default to 'overview'
        if not line:
            self._printDescription()
            self._printTaxonomy(False)
            self._printClassDomain(False)
            self._printClassRange(False)
            self._printPropertyDomainRange(False)
            # self._printSourceCode(False)
            if self.currentEntity and self.currentEntity['type'] == 'class':
                self._print("Tip: type 'info inferred_usage' to show inherited properties\n----------------")

        elif line[0] == "inferred_usage":
            if self.currentEntity:  # @todo only for classes?
                self._printDescription()
                self._printTaxonomy(False)
                self._printClassDomain(False, True)
                self._printClassRange(False, True)
                self._printPropertyDomainRange(False)
            # self._printSourceCode(False)
            return

        elif line[0] == "toplayer":
            if g.toplayer_classes:
                self._print("Top Classes\n----------------", "IMPORTANT")
            for x in g.toplayer_classes:
                self._print(x.qname)
            if g.toplayer_properties:
                self._print("\nTop Properties\n----------------", "IMPORTANT")
                for x in g.toplayer_properties:
                    self._print(x.qname)
            if g.toplayer_skos:
                self._print("\nTop Concepts (SKOS)\n----------------", "IMPORTANT")
                for x in g.toplayer_skos:
                    self._print(x.qname)

        elif line[0] == "namespaces":
            for x in self.current['graph'].namespaces:
                self._print("@prefix %s: <%s> ." % (x[0], x[1]))

        elif line[0] == "parents":
            if self.currentEntity and self.currentEntity['object'].parents():
                for x in self.currentEntity['object'].parents():
                    self._print(x.qname)
            else:
                self._print("No parents. This is a top level entity.")

        elif line[0] == "children":
            if self.currentEntity and self.currentEntity['object'].children():
                for x in self.currentEntity['object'].children():
                    self._print(x.qname)
            else:
                self._print("No children. This is a leaf node.")

        elif line[0] == "ancestors":
            if self.currentEntity and self.currentEntity['object'].ancestors():
                for x in self.currentEntity['object'].ancestors():
                    self._print(x.qname)
            else:
                self._print("No ancestors. This is a top level entity.")

        elif line[0] == "descendants":
            if self.currentEntity and self.currentEntity['object'].descendants():
                for x in self.currentEntity['object'].descendants():
                    self._print(x.qname)
            else:
                self._print("No descendants. This is a leaf node.")

            return
949321
def output(ret, **kwargs):
    '''
    
    '''
    # Prefer kwargs before opts
    retcode = kwargs.get('_retcode', 0)
    base_indent = kwargs.get('nested_indent', 0) \
        or __opts__.get('nested_indent', 0)
    nest = NestDisplay(retcode=retcode)
    lines = nest.display(ret, base_indent, '', [])
    try:
        return '\n'.join(lines)
    except UnicodeDecodeError:
        # output contains binary data that can't be decoded
        return str('\n').join(  # future lint: disable=blacklisted-function
            [salt.utils.stringutils.to_str(x) for x in lines]
        )
184339
def print_to_stdout(level, str_out):
    
    if level == NOTICE:
        col = Fore.GREEN
    elif level == WARNING:
        col = Fore.RED
    else:
        col = Fore.YELLOW
    if not is_py3:
        str_out = str_out.encode(encoding, 'replace')
    print((col + str_out + Fore.RESET))
1044987
def print_levels(self, session):
        
        lines = []
        for level in sorted(self.get_levels()):
            methods = sorted(
                method.__name__ for method in self.get_level_methods(level)
            )
            lines.append("- {0}:".format(level))
            lines.append("\t{0}".format(", ".join(methods)))
        session.write_line("\n".join(lines))
1256121
def print_callback(val):
    
    success = False
    try:
        # for reasons I cannot fathom, regular printing, even directly
        # to io.stdout does not work.
        # I have to intrude rather deep into IPython to make it behave
        if have_ipython:
            if InteractiveShell.initialized():
                IPython.display.publish_display_data({'text/plain':val,'text/html':'<pre>' + val + '</pre>'})
                success = True
    except:
        pass

    if not success:
        print(val)
        sys.stdout.flush()
53873
def _print(self, *args):
        '''
        '''
        string = ' '.join([str(arg) for arg in args])
        print(string, end='', file=self._stream)
81696
def printChildElements( element, indent = 0 )

      indentation = ""
      indent.times{ indentation << " " } if indent > 0

      if element and element.is_a?( REXML::Element ) and element.has_elements?

         attributes = getAttributeString( element )
         name = lookupFieldName( element )
         puts "#{indentation}#{name} #{attributes}:"

         element.each { |element|
            if element.is_a?( REXML::Element ) and element.has_elements?
               printChildElements( element, (indent+1) )
            elsif element.is_a?( REXML::Element ) and element.has_text?
               attributes = getAttributeString( element )
               name = lookupFieldName( element )
               text = formatFieldValue( element.text, lookupFieldType( element ) )
               puts " #{indentation}#{name} #{attributes} = #{text}"
            end
         }
      elsif element and element.is_a?( Array )
         element.each{ |e| printChildElements( e ) }
      end
      self
   end
360552
def print_help(self):
        

        print('\n  %s %s' % (self._title or self._name, self._version or ''))

        if self._usage:
            print('\n  %s' % self._usage)
        else:
            cmd = self._name
            if hasattr(self, '_parent') and isinstance(self._parent, Command):
                cmd = '%s %s' % (self._parent._name, cmd)

            if self._command_list:
                usage = 'Usage: %s <command> [option]' % cmd
            else:
                usage = 'Usage: %s [option]' % cmd

            pos = ' '.join(['<%s>' % name for name in self._positional_list])
            print('\n  %s %s' % (usage, pos))

        arglen = max(len(o.name) for o in self._option_list)
        arglen += 2

        self.print_title('\n  Options:\n')
        for o in self._option_list:
            print('    %s %s' % (_pad(o.name, arglen), o.description or ''))
        print('')

        if self._command_list:
            self.print_title('  Commands:\n')
            for cmd in self._command_list:
                if isinstance(cmd, Command):
                    name = _pad(cmd._name, arglen)
                    desc = cmd._description or ''
                    print('    %s %s' % (_pad(name, arglen), desc))

            print('')

        if self._help_footer:
            print(self._help_footer)
            print('')

        return self
846342
def do_show(self, args):
		""""""
		self.print_line('')
		if args.thing == 'modules':
			self.print_line('Modules' + os.linesep + '=======')
			headers = ('Name', 'Description')
			rows = [(module.path, module.description) for module in self.frmwk.modules.values()]
		else:
			if self.frmwk.current_module and args.thing == 'options':
				options = self.frmwk.current_module.options
				self.print_line('Module Options' + os.linesep + '==============')
			if self.frmwk.current_module and args.thing == 'advanced':
				options = self.frmwk.current_module.advanced_options
				self.print_line('Advanced Module Options' + os.linesep + '=======================')
			elif self.frmwk.current_module is None and args.thing == 'options':
				options = self.frmwk.options
				self.print_line('Framework Options' + os.linesep + '=================')
			elif self.frmwk.current_module is None and args.thing == 'advanced':
				options = self.frmwk.advanced_options
				self.print_line('Advanced Framework Options' + os.linesep + '==========================')
			headers = ('Name', 'Value', 'Description')
			raw_options = [options.get_option(name) for name in options]
			rows = [(option.name, str(option.value), option.help) for option in raw_options]
		rows = sorted(rows, key=lambda row: row[0])
		self.print_line('')
		self.frmwk.print_table(rows, headers=headers, line_prefix='  ')
		self.print_line('')
		return
1191661
def print_tree(root, space=' '):
    

    if isinstance(root, Leaf):
        print(space + "Prediction: " + str(root.most_frequent))
        return

    print(space + str(root.question))

    print(space + "--> True:")
    print_tree(root.true_branch, space+'  ')

    print(space + "--> False:")
    print_tree(root.false_branch, space+'  ')
826022
def print_declarations(
        decls,
        detailed=True,
        recursive=True,
        writer=lambda x: sys.stdout.write(x + os.linesep),
        verbose=True):
    
    prn = decl_printer_t(0, detailed, recursive, writer, verbose=verbose)
    if not isinstance(decls, list):
        decls = [decls]
    for d in decls:
        prn.level = 0
        prn.instance = d
        algorithm.apply_visitor(prn, d)
302424
def print_parent_and_children_info(self, node):
        """"""
        G = self.G
        parents = G.predecessors(node)
        children = G.successors(node)

        print(general_node_label(G, node))
        tabs = '\t'
        for parent in parents:
            relation = G.edges[parent, node]['relation']
            print(tabs + 'Parent (%s): %s' % (relation,
                  general_node_label(G, parent)))
            for cop in G.successors(parent):
                if cop != node:
                    relation = G.edges[parent, cop]['relation']
                    print(tabs + 'Child of parent (%s): %s' % (relation,
                          general_node_label(G, cop)))
        for child in children:
            relation = G.edges[node, child]['relation']
            print(tabs + 'Child (%s): (%s)' % (relation,
                                               general_node_label(G, child)))
896145
def is_default(self):
        
        for _, item in self.iter_items(recursive=True):
            if not item.is_default:
                return False
        return True