Did I find the right examples for you? yes no

All Samples(14)  |  Call(11)  |  Derive(0)  |  Import(3)

        def indent(text, indent=1, multiplier=4):
    """ Indent the given block of text by indent*4 spaces
    """
    if text is None:
        return ''
    text = ustr(text)
    if indent >= 0:
        sindent = ' ' * multiplier * indent
        text = '\n'.join((sindent + t).rstrip() for t in text.splitlines())
    return text
        


src/g/r/grako-2.4.1/grako/rendering.py   grako(Download)
import itertools
import string
from .util import trim, ustr, isiter, strtype, indent
 
 
 
        if isiter(value):
            return indent(sep.join(fmt % self.render(v) for v in value), ind, mult)
        else:
            return indent(fmt % self.render(value), ind, mult)

src/g/r/grako-2.4.1/grako/grammars.py   grako(Download)
from copy import copy
import time
from .util import indent, trim
from .rendering import Renderer, render
from .model import Node
    def render_fields(self, fields):
        template = trim(self.option_template)
        options = [template.format(option=indent(render(o))) for o in self.options]
        options = '\n'.join(o for o in options)
        firstset = ' '.join(decode(f[0]) for f in self.firstset if f)
            error = 'no available options'
        fields.update(n=self.counter(),
                      options=indent(options),
                      error=urepr(error)
                      )
    def __str__(self):
        return trim(self.str_template) % (self.name, indent(str(self.exp)))
 
    def render_fields(self, fields):
        self.reset_counter()
    def render_fields(self, fields):
        abstract_template = trim(self.abstract_rule_template)
        abstract_rules = [abstract_template.format(name=safe_name(rule.name)) for rule in self.rules]
        abstract_rules = indent('\n'.join(abstract_rules))
        fields.update(rules=indent(render(self.rules)),

src/p/g/pgi-docgen-HEAD/pgidocgen/funcsig.py   pgi-docgen(Download)
import re
 
from .util import escape_rest, indent
 
 
                param_key, current=current, signal=signal)
            key = escape_rest(key)
            docs.append(":param %s:\n%s\n" % (key, indent(text)))
            docs.append(":type %s: %s" % (key, arg_to_class_ref(value)))
 
                if text:
                    if len(self.res) != 1:
                        text = ":%s:\n%s" % (escape_rest(name), indent(text))
                    return_docs.append(text)
 
        if return_docs:
            docs.append(":returns:\n%s\n" % indent("\n\n".join(return_docs)))

src/e/d/editor-imagery-index-HEAD/scripts/convert_xml.py   editor-imagery-index(Download)
                        point.set('lat', str(round(p[1],6)))
 
util.indent(root)
 
tree = ET.ElementTree(root)