code: def emit_arg(keywordstr, stmt, fd, indent, indentstep, max_line_len, line_len):
      
      arg = escape_str(stmt.arg)
      lines = arg.splitlines(True)
      if len(lines) <= 1:
          if len(arg) > 0 and arg[-1] == '\n':
              arg = arg[:-1] + r'\n'
          if (stmt.keyword in _force_newline_arg or
              need_new_line(max_line_len, line_len, arg)):
              fd.write('\n' + indent + indentstep + '"' + arg + '"')
              return True
          else:
              fd.write(' "' + arg + '"')
              return False
      else:
          need_nl = False
          if stmt.keyword in _force_newline_arg:
              need_nl = True
          elif len(keywordstr) > 8:
              # Heuristics: multi-line after a "long" keyword looks better
              # than after a "short" keyword (compare 'when' and 'error-message')
              need_nl = True
          else:
              for line in lines:
                  if need_new_line(max_line_len, line_len + 1, line):
                      need_nl = True
                      break
          if need_nl:
              fd.write('\n' + indent + indentstep)
              prefix = indent + indentstep
          else:
              fd.write(' ')
              prefix = indent + len(keywordstr) * ' ' + ' '
          fd.write('"' + lines[0])
          for line in lines[1:-1]:
              if line[0] == '\n':
                  fd.write('\n')
              else:
                  fd.write(prefix + ' ' + line)
          # write last line
          fd.write(prefix + ' ' + lines[-1])
          if lines[-1][-1] == '\n':
              # last line ends with a newline, indent the ending quote
              fd.write(prefix + '"')
          else:
              fd.write('"')
          return True
docs: Heuristically pretty print the argument string with double quotes