Sets indentation for the given set of :lines:.
511883
def set_lines( lines, target_level, indent_string="    ", indent_empty_lines=False ):
    

    first_non_empty_line_index = _get_first_non_empty_line_index( lines )
    first_line_original_level =  get_line_level( lines[first_non_empty_line_index], indent_string )

    for i in range(first_non_empty_line_index, len(lines)):
        if not indent_empty_lines and lines[i] == "":
            continue

        line_i_unindented = get_line_unindented( lines[i], indent_string )
        line_i_level =      get_line_level( lines[i], indent_string )

        on_second_line_or_later = i > first_non_empty_line_index
        if on_second_line_or_later:
            first_line_final_level = get_line_level( lines[first_non_empty_line_index], indent_string )
            relative_indent_move =   first_line_final_level - first_line_original_level
            target_level =           line_i_level + relative_indent_move

        if line_i_level == target_level:
            continue

        lines[i] = indent_string * target_level + line_i_unindented
61880
def SetLines(self, lines):
    

    (self._cli_lines, self._cli_cols) = TerminalSize()

    if lines:
      self._cli_lines = int(lines)
936015
def indent(self, value):
        """"""
        # Explicit indent setting
        if isinstance(value, str):
            if value.isspace() or len(value) == 0:
                self._indent = value
            else:
                raise ValueError('String indentation can only contain '
                                 'whitespace.')

        # Set indent width
        elif isinstance(value, int):
            if value >= 0:
                self._indent = value * ' '
            else:
                raise ValueError('Indentation spacing must be nonnegative.')

        else:
            raise TypeError('Indentation must be specified by string or space '
                            'width.')
929627
def unindent(self, lines):
        """"""
        indent = min(
            len(self.re.match(r'^ *', line).group()) for line in lines)
        return [line[indent:].rstrip() for line in lines]
577554
def _setBlockIndent(self, block, indent):
        
        currentIndent = self._blockIndent(block)
        self._qpart.replaceText((block.blockNumber(), 0), len(currentIndent), indent)
627390
function raiseIndent(lines, offset) {
    offset = offset || '    ';

    return lines.map((line) => offset + line);
}
518615
def underline(self, text, indent=4):
        """"""
        length = len(text)
        indentation = (' ' * indent)
        return indentation + text + '\n' + indentation + ('-' * length)
1272709
protected function prepareToIndent()
    {
        foreach ($this->lines as $lineNumber => $line) {
            $this->lines[$lineNumber] = trim($line);
        }

        $this->outputLines = $this->lines;
    }
163975
function indent(str, prefix) {
  prefix = prefix || '   ';
  var lines = str.split("\n");
  lines.forEach(function(line, i) {
    lines[i] = prefix + line;
  });
  return lines.join("\n");
}
569223
def get_same_indent_prefix(lines):
    
    if not lines:
        return ""
    prefix = get_indent_prefix(lines[0])
    if not prefix:
        return ""
    if all([l.startswith(prefix) for l in lines]):
        return prefix
    return None
1103824
private void resetIndent() {
        setArrayStart("{" + LINE_SEPARATOR + spacer(spaces));
        setArraySeparator("," + LINE_SEPARATOR + spacer(spaces));
        setArrayEnd(LINE_SEPARATOR + spacer(spaces - INDENT) + "}");

        setContentStart("[" + LINE_SEPARATOR + spacer(spaces));
        setFieldSeparator("," + LINE_SEPARATOR + spacer(spaces));
        setContentEnd(LINE_SEPARATOR + spacer(spaces - INDENT) + "]");
    }
151861
def get_indented_lines(indent)
      buffer = ''

      # Gather multiple blank lines between lines of text
      blank_lines = proc do
        while lookahead_next_line :line_whitespace
          @line = @code[(@i += 1)]
          @offset = 0

          buffer += accept :line_whitespace
        end
      end

      # Get blank lines until we match something
      blank_lines[]

      # Get the next indentation after the parent line
      # and set it as primary indent
      first_indent = (lookahead_next_line(:indent).to_s || '').size
      next_indent = first_indent

      # While the indentation is smaller, add the line feed  to our buffer
      while next_indent > indent
        # Advance current line and reset offset
        @line = @code[(@i += 1)]
        @offset = 0

        # Get leading whitespace trimmed with first_indent's size
        next_line_indent = accept(:indent)[first_indent..-1] || ''
        next_line_indent = next_line_indent.size

        # Add next line feed, prepend the indent and append the newline
        buffer += ' ' * next_line_indent if next_line_indent > 0
        buffer += accept_stripped(:line_feed) || ''
        buffer += accept(:newline) || ''

        # Get blank lines until we match something
        blank_lines[]

        # Check the indentation on the following line. When we reach EOF,
        # set the indentation to 0 and cause the loop to stop
        if (next_indent = lookahead_next_line :indent)
          next_indent = next_indent[0].size
        else
          next_indent = 0
        end
      end

      buffer
    end
740204
public void setIndent(final short indent) {

        if(cell.getCellStyle().getIndention() == indent) {
            // 既にインデントが同じ値
            return;
        }

        cloneStyle();
        cell.getCellStyle().setIndention(indent);

    }
1273983
def _add_indent(string, indent):
    
    lines = string.split("\n")
    first, lines = lines[0], lines[1:]
    lines = ["{indent}{s}".format(indent=" " * indent, s=s)
             for s in lines]
    lines = [first] + lines
    return "\n".join(lines)
554193
def indent(text, prefix):
    
    # Based on Python 3's textwrap.indent
    def prefixed_lines():
        for line in text.splitlines(True):
            yield (prefix + line if line.strip() else line)
    return u"".join(prefixed_lines())
1339271
def indent (text, indent_string="  "):
    """"""
    lines = str(text).splitlines()
    return os.linesep.join("%s%s" % (indent_string, x) for x in lines)
1093808
def add_indent_lines(prefix, s):
    
    if not s:
        return prefix
    prefix_len = str_visible_len(prefix)
    lines = s.splitlines(True)
    return "".join([prefix + lines[0]] + [" " * prefix_len + l for l in lines[1:]])