Return a human-readable string representation of this object.

        Kwargs:
            indent (int): The amount of spaces to use as indentation.
514419
def pretty_str(self, indent=0):
        
        spaces = ' ' * indent
        pretty = spaces + 'try:\n'
        pretty += self.body.pretty_str(indent=indent + 2)
        for block in self.catches:
            pretty += '\n' + block.pretty_str(indent)
        if len(self.finally_body) > 0:
            pretty += '\n{}finally:\n'.format(spaces)
            pretty += self.finally_body.pretty_str(indent=indent + 2)
        return pretty
196404
def dumpindented(self, pn, indent=0):
        
        page = self.readpage(pn)
        print("  " * indent, page)
        if page.isindex():
            print("  " * indent, end="")
            self.dumpindented(page.preceeding, indent + 1)
            for p in range(len(page.index)):
                print("  " * indent, end="")
                self.dumpindented(page.getpage(p), indent + 1)
1171265
def indent(func):
    
    def wrapper(self, *args, **kwds):
        func(self, *args, **kwds)
        return Indent(self)
    return wrapper
983101
def to_json(self, indent=2):
        
        return json.dumps(self, default=json_encode_for_printing, indent=indent)
1127940
def t_INDENTIFIER(t):
    '
    if t.value in reserved:
        t.type = t.value.upper()
        if t.value in reservedMap:
            t.value = reservedMap[t.value]
    elif t.value in strStatment:
        t.type = 'STATEMENT'
    return t
1042820
def indent(indent_str=None):
    

    def indentation_rule():
        inst = Indentator(indent_str)
        return {'layout_handlers': {
            OpenBlock: layout_handler_openbrace,
            CloseBlock: layout_handler_closebrace,
            EndStatement: layout_handler_semicolon,
            Space: layout_handler_space_imply,
            OptionalSpace: layout_handler_space_optional_pretty,
            RequiredSpace: layout_handler_space_imply,
            Indent: inst.layout_handler_indent,
            Dedent: inst.layout_handler_dedent,
            Newline: inst.layout_handler_newline,
            OptionalNewline: inst.layout_handler_newline_optional,
            (Space, OpenBlock): NotImplemented,
            (Space, EndStatement): layout_handler_semicolon,
            (OptionalSpace, EndStatement): layout_handler_semicolon,
            (Indent, Newline, Dedent): rule_handler_noop,
        }}
    return indentation_rule
418952
def indent(text, indent=2, width=128):
    
    return "\n".join(
        textwrap.wrap(text,
                      width=width,
                      initial_indent=" " * indent,
                      subsequent_indent=" " * indent))
307965
def _get_indent(marker, s, tab_width=8):
    """"""
    # Figure out how much the marker is indented.
    INDENT_CHARS = tuple(' \t')
    start = s.index(marker)
    i = start
    while i > 0:
        if s[i - 1] not in INDENT_CHARS:
            break
        i -= 1
    indent = s[i:start]
    indent_width = 0
    for ch in indent:
        if ch == ' ':
            indent_width += 1
        elif ch == '\t':
            indent_width += tab_width - (indent_width % tab_width)
    return indent, indent_width
993178
def indent(value, n=2, character=' '):
    

    prefix = n * character
    return '\n'.join(prefix + line for line in value.splitlines())
50272
def indent_string(string, num_spaces=2):
    '''

    '''
    indent = ' '.ljust(num_spaces)
    return indent + re.sub('\n', '\n' + indent, string)
176550
private String getIndentation() {

		final StringBuilder buf = new StringBuilder();
		
		for (int i=0; i<indentLevel; i++) {

			buf.append("\t");
		}

		return buf.toString();
	}
295937
def get_indent(text):
    
    indent = ''

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

    return indent
615297
def indent(self):
        
        cursor = self.editor.textCursor()
        assert isinstance(cursor, QtGui.QTextCursor)
        if cursor.hasSelection():
            self.indent_selection(cursor)
        else:
            # simply insert indentation at the cursor position
            tab_len = self.editor.tab_length
            cursor.beginEditBlock()
            if self.editor.use_spaces_instead_of_tabs:
                nb_space_to_add = tab_len - cursor.positionInBlock() % tab_len
                cursor.insertText(nb_space_to_add * " ")
            else:
                cursor.insertText('\t')
            cursor.endEditBlock()
560084
def _indent(s, indent='  '):
    """"""
    if isinstance(s, six.string_types):
        return '\n'.join(('%s%s' % (indent, line) for line in s.splitlines()))
    return s
1014139
function getIndentation(str, index) {
  let indentStart = index;
  let indentEnd = index;
  while (indentStart) {
    const c = str.charCodeAt(indentStart - 1);
    // line break
    if (c === 10 || c === 13 || c === 0x2028 || c === 0x2029) {
      break;
    }
    indentStart--;
    // not white space
    if (c !== 9 && c !== 11 && c !== 12 && c !== 32 && c !== 160) {
      indentEnd = indentStart;
    }
  }
  return str.substring(indentStart, indentEnd);
}
295110
def _indent(text, amount):
    
    indentation = amount * ' '
    return indentation + ('\n' + indentation).join(text.split('\n'))
39952
def t_ANY_STRING(self, t):
        '
        escaped = 0
        t.lexer.lineno += t.value.count('\n')
        s = t.value[1:-1]
        new_str = ""
        for i in range(0, len(s)):
            c = s[i]
            if escaped:
                if c == 'n':
                    c = '\n'
                elif c == 't':
                    c = '\t'
                new_str += c
                escaped = 0
            else:
                if c == '\\':
                    escaped = 1
                else:
                    new_str += c
        # remove current indentation
        indentation_str = ' ' * _indent_level_to_spaces_count(self.cur_indent)
        lines_without_indentation = [
            line.replace(indentation_str, '', 1)
            for line in new_str.splitlines()]
        t.value = '\n'.join(lines_without_indentation)
        return t