Did I find the right examples for you? yes no

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)
Return a string with consistent line endings.

        def normalize_line_endings(string, eol):
    """Return a string with consistent line endings."""
    string = string.replace("\r\n", "\n").replace("\r", "\n")
    if eol != "\n":
        string = string.replace("\n", eol)
    return string
        


src/r/e/rester-sublime-http-client-HEAD/rester/http.py   rester-sublime-http-client(Download)
 
from .message import Response
from .util import normalize_line_endings
from .util import scan_bytes_for_encoding
from .util import scan_string_for_encoding
        body_bytes = self._unzip_body(body_bytes)
        body = self._decode_body(body_bytes)
        body = normalize_line_endings(body, self._eol)
        return body
 

src/r/e/rester-sublime-http-client-HEAD/rester/commands/http_request_command.py   rester-sublime-http-client(Download)
from ..parse import RequestParser
from ..util import get_end_of_line_character
from ..util import normalize_line_endings
import sublime
import sublime_plugin
        # Scan the request for overrides.
        text = self._get_selection().lstrip()
        text = normalize_line_endings(text, self.eol)
 
        headers = text.split(self.eol * 2, 1)[0]

src/r/e/rester-sublime-http-client-HEAD/rester/parse.py   rester-sublime-http-client(Download)
import re
 
from .message import Request
from .util import normalize_line_endings
 
 
        # Pre-parse clean-up.
        text = normalize_line_endings(text, self.eol)
 
        # Split the string into lines.