tensorflow/python/framework/python_op_gen_internal.cc
// Indent the first line by "initial" spaces and all following lines
// by "rest" spaces.
Indent the first line by "initial" spaces and all following lines
by "rest" spaces.
Indent the first line by " initial " spaces and all following lines by " rest " spaces .
string Indent(int initial, int rest, StringPiece in) {
  string copy(in.data(), in.size());
  absl::StripTrailingAsciiWhitespace(&copy);
  std::vector<string> v = str_util::Split(copy, '\n');
  string result;
  bool first = true;
  for (const string& line : v) {
    if (first) {
      result = strings::StrCat(Spaces(initial), line, "\n");
      first = false;
    } else {
      if (line.empty()) {
        strings::StrAppend(&result, "\n");
      } else {
        strings::StrAppend(&result, Spaces(rest), line, "\n");
      }
    }
  }
  return result;
}
string Indent ( int initial , int rest , StringPiece in ) { string copy ( in . data ( ) , in . size ( ) ) ; absl :: StripTrailingAsciiWhitespace ( & copy ) ; std :: vector < string > v = str_util :: Split ( copy , ' \n ' ) ; string result ; bool first = true ; for ( const string & line : v ) { if ( first ) { result = strings :: StrCat ( Spaces ( initial ) , line , " \n " ) ; first = false ; } else { if ( line . empty ( ) ) { strings :: StrAppend ( & result , " \n " ) ; } else { strings :: StrAppend ( & result , Spaces ( rest ) , line , " \n " ) ; } } } return result ; }
Indent the first line by "initial" spaces and all following lines
by "rest" spaces.
Indent the first line by " initial " spaces and all following lines by " rest " spaces .
// TODO(josh11b): Also word-wrapping?