Get a string representation of this object.
        @param indent: The indent.
        @type indent: int
        @return: A string.
        @rtype: str
5974
def str(self, indent=0, history=None):
        
        if history is None:
            history = []
        if self in history:
            return '%s ...' % Repr(self)
        history.append(self)
        tab = '%*s' % (indent * 3, '')
        result = []
        result.append('%s<%s' % (tab, self.id))
        for n in self.description():
            if not hasattr(self, n):
                continue
            v = getattr(self, n)
            if v is None:
                continue
            result.append(' %s="%s"' % (n, v))
        if len(self):
            result.append('>')
            for c in self.rawchildren:
                result.append('\n')
                result.append(c.str(indent+1, history[:]))
                if c.isattr():
                    result.append('@')
            result.append('\n%s' % tab)
            result.append('</%s>' % self.__class__.__name__)
        else:
            result.append(' />')
        return ''.join(result)
293069
def format(self, indent_level, indent_size=4):
        

        desc = self.format_name('String')
        return self.wrap_lines(desc, indent_level, indent_size=indent_size)
205946
def xml(self, indent = ""):
        """"""
        xml = indent + "<" + self.__class__.__name__
        xml += ' id="'+self.id + '"'
        xml += ' name="'+xmlescape(self.name) + '"'
        xml += ' description="'+xmlescape(self.description) + '"'
        if self.paramflag:
            xml += ' flag="'+self.paramflag + '"'
        for key, v in self.kwargs.items():
            if key not in ('value','error','name','description','flag','paramflag', 'validator'):
                if isinstance(v, bool):
                    xml += ' ' + key + '="' + str(int(v))+ '"'
                elif isinstance(v, list):
                    xml += ' ' + key + '="'+xmlescape(",".join(v))+ '"'
                elif isinstance(v, str)  or ( sys.version < '3' and isinstance(v, unicode)): #pylint: disable=undefined-variable
                    xml += ' ' + key + '="'+xmlescape(v)+ '"'
                else:
                    xml += ' ' + key + '="'+xmlescape(str(v))+ '"'
        if self.hasvalue:
            if sys.version < '3':
                xml += ' value="'+xmlescape(unicode(self.value)) + '"' #pylint: disable=undefined-variable
            else:
                xml += ' value="'+xmlescape(str(self.value)) + '"'
        if self.error:
            xml += ' error="'+xmlescape(self.error) + '"'
        xml += " />"
        return xml
975937
def pretty(self, indent=0, indent_str='  '):
        
        return '{0}{1}({2!r}): {3!r}'.format(
            indent_str * indent,
            self.__class__.__name__,
            self.name,
            self.value
        )
315278
def pretty_str(self, indent=0):
        
        spaces = ' ' * indent
        params = ', '.join(map(lambda p: p.result + ' ' + p.name,
                           self.parameters))
        if self.is_constructor:
            pretty = '{}{}({}):\n'.format(spaces, self.name, params)
        else:
            pretty = '{}{} {}({}):\n'.format(spaces, self.result,
                                             self.name, params)
        if self._definition is not self:
            pretty += spaces + '  [declaration]'
        else:
            pretty += self.body.pretty_str(indent + 2)
        return pretty
418952
def indent(text, indent=2, width=128):
    
    return "\n".join(
        textwrap.wrap(text,
                      width=width,
                      initial_indent=" " * indent,
                      subsequent_indent=" " * indent))
932780
def indent(self, message):
        
        indent = self.indent_char * self.indent_size
        return indent + message
79116
def give_str_indented(self, tags=False):
        
        args = self._args[:]
        kwargs = self._kwargs
        rv = self._give_str_indented(args, kwargs, tags)
        if not tags:
            rv = self.strip_color_tags(rv)
        return rv
684189
static String _dumpAsString(
                                String indent,
                                DERObject obj)
    {
        if (obj instanceof ASN1Sequence)
        {
            StringBuilder buf = new StringBuilder();
            Enumeration e = ((ASN1Sequence) obj).getObjects();
            String tab = indent + TAB;

            buf.append(indent);
            if (obj instanceof BERConstructedSequence)
            {
                buf.append("BER ConstructedSequence");
            }
            else if (obj instanceof DERConstructedSequence)
            {
                buf.append("DER ConstructedSequence");
            }
            else if (obj instanceof BERSequence)
            {
                buf.append("BER Sequence");
            }
            else if (obj instanceof DERSequence)
            {
                buf.append("DER Sequence");
            }
            else
            {
                buf.append("Sequence");
            }

            buf.append(System.getProperty("line.separator"));

            while (e.hasMoreElements())
            {
                Object o = e.nextElement();

                if (o == null || o.equals(new DERNull()))
                {
                    buf.append(tab);
                    buf.append("NULL");
                    buf.append(System.getProperty("line.separator"));
                }
                else if (o instanceof DERObject)
                {
                    buf.append(_dumpAsString(tab, (DERObject) o));
                }
                else
                {
                    buf.append(_dumpAsString(tab, ((DEREncodable) o).getDERObject()));
                }
            }
            return buf.toString();
        }
        else if (obj instanceof DERTaggedObject)
        {
            StringBuilder buf = new StringBuilder();
            String tab = indent + TAB;

            buf.append(indent);
            if (obj instanceof BERTaggedObject)
            {
                buf.append("BER Tagged [");
            }
            else
            {
                buf.append("Tagged [");
            }

            DERTaggedObject o = (DERTaggedObject) obj;

            buf.append(Integer.toString(o.getTagNo()));
            buf.append("]");

            if (!o.isExplicit())
            {
                buf.append(" IMPLICIT ");
            }

            buf.append(System.getProperty("line.separator"));

            if (o.isEmpty())
            {
                buf.append(tab);
                buf.append("EMPTY");
                buf.append(System.getProperty("line.separator"));
            }
            else
            {
                buf.append(_dumpAsString(tab, o.getObject()));
            }

            return buf.toString();
        }
        else if (obj instanceof DERConstructedSet)
        {
            StringBuilder buf = new StringBuilder();
            Enumeration e = ((ASN1Set) obj).getObjects();
            String tab = indent + TAB;

            buf.append(indent);
            buf.append("ConstructedSet");
            buf.append(System.getProperty("line.separator"));

            while (e.hasMoreElements())
            {
                Object o = e.nextElement();

                if (o == null)
                {
                    buf.append(tab);
                    buf.append("NULL");
                    buf.append(System.getProperty("line.separator"));
                }
                else if (o instanceof DERObject)
                {
                    buf.append(_dumpAsString(tab, (DERObject) o));
                }
                else
                {
                    buf.append(_dumpAsString(tab, ((DEREncodable) o).getDERObject()));
                }
            }
            return buf.toString();
        }
        else if (obj instanceof BERSet)
        {
            StringBuilder buf = new StringBuilder();
            Enumeration e = ((ASN1Set) obj).getObjects();
            String tab = indent + TAB;

            buf.append(indent);
            buf.append("BER Set");
            buf.append(System.getProperty("line.separator"));

            while (e.hasMoreElements())
            {
                Object o = e.nextElement();

                if (o == null)
                {
                    buf.append(tab);
                    buf.append("NULL");
                    buf.append(System.getProperty("line.separator"));
                }
                else if (o instanceof DERObject)
                {
                    buf.append(_dumpAsString(tab, (DERObject) o));
                }
                else
                {
                    buf.append(_dumpAsString(tab, ((DEREncodable) o).getDERObject()));
                }
            }
            return buf.toString();
        }
        else if (obj instanceof DERSet)
        {
            StringBuilder buf = new StringBuilder();
            Enumeration e = ((ASN1Set) obj).getObjects();
            String tab = indent + TAB;

            buf.append(indent);
            buf.append("DER Set");
            buf.append(System.getProperty("line.separator"));

            while (e.hasMoreElements())
            {
                Object o = e.nextElement();

                if (o == null)
                {
                    buf.append(tab);
                    buf.append("NULL");
                    buf.append(System.getProperty("line.separator"));
                }
                else if (o instanceof DERObject)
                {
                    buf.append(_dumpAsString(tab, (DERObject) o));
                }
                else
                {
                    buf.append(_dumpAsString(tab, ((DEREncodable) o).getDERObject()));
                }
            }
            return buf.toString();
        }
        else if (obj instanceof DERObjectIdentifier)
        {
            return indent + "ObjectIdentifier(" + ((DERObjectIdentifier) obj).getId() + ")" + System.getProperty("line.separator");
        }
        else if (obj instanceof DERBoolean)
        {
            return indent + "Boolean(" + ((DERBoolean) obj).isTrue() + ")" + System.getProperty("line.separator");
        }
        else if (obj instanceof DERInteger)
        {
            return indent + "Integer(" + ((DERInteger) obj).getValue() + ")" + System.getProperty("line.separator");
        }
        else if (obj instanceof BERConstructedOctetString)
        {
            return indent + "BER Constructed Octet String" + "[" + ((ASN1OctetString) obj).getOctets().length + "] " + System.getProperty("line.separator");
        }
        else if (obj instanceof DEROctetString)
        {
            return indent + "DER Octet String" + "[" + ((ASN1OctetString) obj).getOctets().length + "] " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERBitString)
        {
            return indent + "DER Bit String" + "[" + ((DERBitString) obj).getBytes().length + ", " + ((DERBitString) obj).getPadBits() + "] "
                   + System.getProperty("line.separator");
        }
        else if (obj instanceof DERIA5String)
        {
            return indent + "IA5String(" + ((DERIA5String) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERUTF8String)
        {
            return indent + "UTF8String(" + ((DERUTF8String) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERPrintableString)
        {
            return indent + "PrintableString(" + ((DERPrintableString) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERVisibleString)
        {
            return indent + "VisibleString(" + ((DERVisibleString) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERBMPString)
        {
            return indent + "BMPString(" + ((DERBMPString) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERT61String)
        {
            return indent + "T61String(" + ((DERT61String) obj).getString() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERUTCTime)
        {
            return indent + "UTCTime(" + ((DERUTCTime) obj).getTime() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERGeneralizedTime)
        {
            return indent + "GeneralizedTime(" + ((DERGeneralizedTime) obj).getTime() + ") " + System.getProperty("line.separator");
        }
        else if (obj instanceof DERUnknownTag)
        {
            //TODO liberty if we keep this find Hex
//            return indent + "Unknown " + Integer.toString(((DERUnknownTag)obj).getTag(), 16) + " " + new String(Hex.encode(((DERUnknownTag)obj).getData())) + System.getProperty("line.separator");
            return indent + "Unknown " + Integer.toString(((DERUnknownTag) obj).getTag(), 16) + " " + new String(((DERUnknownTag) obj).getData())
                   + System.getProperty("line.separator");
        }
        else
        {
            return indent + obj.toString() + System.getProperty("line.separator");
        }
    }
1271079
def pretty_dict_string(d, indent=0):
    
    s = ''
    for key, value in sorted(d.items()):
        s += '    ' * indent + str(key)
        if isinstance(value, dict):
             s += '\n' + pretty_dict_string(value, indent+1)
        else:
             s += '=' + str(value) + '\n'
    return s
623552
def indent(self, space=4):
        '''
        '''
        if not isinstance(space,int):
            raise TypeError("space must be an int")
        if space < 0:
            raise ValueError("space must be a non-negative integer")
        space = ' '*space; o = []; l = 0
        for c in self.newick():
            if c == '(':
                o.append('(\n'); l += 1; o.append(space*l)
            elif c == ')':
                o.append('\n'); l -= 1; o.append(space*l); o.append(')')
            elif c == ',':
                o.append(',\n'); o.append(space*l)
            else:
                o.append(c)
        return ''.join(o)
490587
protected function getIndentString($indent = 0) {
		$indentStr = '';
		if (is_numeric($indent)) {
			$indInt = intval($indent);
			if ($indInt > 0) {
				$i = 0;
				while ($i < $indInt) {
					$indentStr .= "\t";
					$i += 1;
				}
			}
		} else if (is_string($indent)) {
			$indentStr = $indent;
		}
		return $indentStr;
	}
492033
def pretty_str(self, indent=0):
        
        return '\n\n'.join(
                codeobj.pretty_str(indent=indent)
                for codeobj in self.children
        )
558602
String getIndentation()
	{
		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < count; i++)
		{
			sb.append(indent);
		}

		return sb.toString();
	}
105485
void toStringRep(String indent, XAppender out) {
        out.append(indent).append("<");
        out.append(name);
        if (attributes.size() > 0) {
            for (String an : attributes.keySet()) {
                out.append(" ").append(an).append("='").append(sanitize(attributes.get(an))).append("'");
            }
        }

        if (children.size() == 0) {
            if (content == null) {
                out.append("/>");
            } else {
                out.append(">");
                out.append(sanitize(content));
                out.append("</");
                out.append(name);
                out.append(">");
            }
        } else {
            if (content == null) {
                out.append(String.format(">%n"));
            } else {
                out.append(">");
                out.append(sanitize(content));
                out.append(String.format("%n"));
            }
            for (XElement e : children) {
                e.toStringRep(indent + "  ", out);
            }
            out.append(indent).append("</");
            out.append(name);
            out.append(">");
        }
        out.append(String.format("%n"));
    }
1151970
def pretty_str(self, indent=0):
        
        spaces = ' ' * indent
        pretty = '{}namespace {}:\n'.format(spaces, self.name)
        pretty += '\n\n'.join(c.pretty_str(indent + 2) for c in self.children)
        return pretty
886715
def _to_string(self):
        
        parts = []
        if self.library:  # pylint: disable=no-member
            parts.extend([self.org, self.library])  # pylint: disable=no-member
            if self.branch:  # pylint: disable=no-member
                parts.append(u"{prefix}@{branch}".format(prefix=self.BRANCH_PREFIX, branch=self.branch))  # pylint: disable=no-member
        if self.version_guid:  # pylint: disable=no-member
            parts.append(u"{prefix}@{guid}".format(prefix=self.VERSION_PREFIX, guid=self.version_guid))  # pylint: disable=no-member
        return u"+".join(parts)