@staticmethod
def get_linesep(lines):
    """Returns string containing autodetected line separator for file.

        Keyword arguments:
        lines -- file contents string
        """
    pos = lines.find('\n')
    if pos > 0 and lines[pos - 1] == '\r':
        return '\r\n'
    else:
        return '\n'
