Return a human-readable string representation of this object.

        Kwargs:
            indent (int): The amount of spaces to use as indentation.
438179
def pretty_str(self, indent=0):
        
        if self.parenthesis:
            return (' ' * indent) + '(' + self.name + ')'
        return (' ' * indent) + self.name
861636
def ast_to_code(ast, indent=0):
    # type: (Any, int) -> str
    
    code = []

    def append(line):
        # type: (str) -> None
        code.append(("    " * indent) + line)

    if isinstance(ast, Node):
        append("ast.{}(".format(ast.__class__.__name__))
        indent += 1
        for i, k in enumerate(ast._fields, 1):
            v = getattr(ast, k)
            append("{}={},".format(k, ast_to_code(v, indent)))
        if ast.loc:
            append("loc={}".format(ast_to_code(ast.loc, indent)))

        indent -= 1
        append(")")

    elif isinstance(ast, Loc):
        append("loc({}, {})".format(ast.start, ast.end))

    elif isinstance(ast, list):
        if ast:
            append("[")
            indent += 1

            for i, it in enumerate(ast, 1):
                is_last = i == len(ast)
                append(ast_to_code(it, indent) + ("," if not is_last else ""))

            indent -= 1
            append("]")
        else:
            append("[]")

    else:
        append(repr(ast))

    return "\n".join(code).strip()
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
114171
def indentsize(line):
    """"""
    expline = string.expandtabs(line)
    return len(expline) - len(string.lstrip(expline))
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)
777931
def pretty_str(self, indent=0):
        
        indent = ' ' * indent
        values = '{{{}}}'.format(', '.join(map(pretty_str, self.value)))

        if self.parenthesis:
            return '{}({})'.format(indent, values)
        return '{}{}'.format(indent, values)
681392
def _indent(string, count):
    ''''''
    indent = _INDENT * count
    ret = indent + string.replace('\n', '\n' + indent)
    return ret.rstrip()
609843
def custom_print(data_structure, indent):
    
    for key, value in data_structure.items():
        print("\n%s%s:" % (' ' * attribute_indent * indent, str(key)), end=' ')
        if isinstance(value, OrderedDict):
            custom_print(value, indent + 1)
        elif isinstance(value, dict):
            custom_print(value, indent + 1)
        else:
            print("%s" % (str(value)), end=' ')
96655
def writeline(self, line):
        

        if not self.in_indent_lines:
            self._flush_adjusted_lines()
            self.in_indent_lines = True

        if (line is None or
            re.match(r"^\s*#",line) or
            re.match(r"^\s*$", line)
            ):
            hastext = False
        else:
            hastext = True

        is_comment = line and len(line) and line[0] == '#'

        # see if this line should decrease the indentation level
        if (not is_comment and
            (not hastext or self._is_unindentor(line))
            ):

            if self.indent > 0:
                self.indent -= 1
                # if the indent_detail stack is empty, the user
                # probably put extra closures - the resulting
                # module wont compile.
                if len(self.indent_detail) == 0:
                    raise exceptions.SyntaxException(
                                    "Too many whitespace closures")
                self.indent_detail.pop()

        if line is None:
            return

        # write the line
        self.stream.write(self._indent_line(line) + "\n")
        self._update_lineno(len(line.split("\n")))

        # see if this line should increase the indentation level.
        # note that a line can both decrase (before printing) and
        # then increase (after printing) the indentation level.

        if re.search(r":[ \t]*(?:#.*)?$", line):
            # increment indentation count, and also
            # keep track of what the keyword was that indented us,
            # if it is a python compound statement keyword
            # where we might have to look for an "unindent" keyword
            match = re.match(r"^\s*(if|try|elif|while|for|with)", line)
            if match:
                # its a "compound" keyword, so we will check for "unindentors"
                indentor = match.group(1)
                self.indent += 1
                self.indent_detail.append(indentor)
            else:
                indentor = None
                # its not a "compound" keyword.  but lets also
                # test for valid Python keywords that might be indenting us,
                # else assume its a non-indenting line
                m2 = re.match(r"^\s*(def|class|else|elif|except|finally)",
                              line)
                if m2:
                    self.indent += 1
                    self.indent_detail.append(indentor)
19316
def pretty_str(self, indent=0):
        
        spaces = ' ' * indent
        return spaces + ', '.join(v.pretty_str() for v in self.variables)
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)
932207
def pretty(d, indent=0):
    
    for key, value in d.items():
        print('  ' * indent + str(key))
        if isinstance(value, dict):
            pretty(value, indent+1)
        else:
            sys.stderr.write('  ' * (indent+1) + str(value) + '\n')
838068
def calculate_indent(text):
    
    indent = 0
    for c in text:
        if c is '\t':
            raise ValueError()
        if c is not ' ':
            return indent,text[indent:]
        indent += 1
    return indent,''
245800
function indent(str/*: string*/, level/*: number*/ = 1) /*: string*/ {
    if (typeof str === 'number') [ level, str ] = [ str, level ];
    if (typeof level !== 'number') level = 1;
    return (str || '').replace(/^/gm, '  '.repeat(level));
}
447396
def indent(s, spaces=4):
    
    new = re.sub('(\n+)', '\\1%s' % (' ' * spaces), s)
    return (' ' * spaces) + new.strip()
295937
def get_indent(text):
    
    indent = ''

    ret = re.match(r'(\s*)', text)
    if ret:
        indent = ret.group(1)

    return indent
1171265
def indent(func):
    
    def wrapper(self, *args, **kwds):
        func(self, *args, **kwds)
        return Indent(self)
    return wrapper