code: def determine_newline(data):
          
          line_end_pos = data.find(b'\n')
  
          if line_end_pos == -1:
              return None
          elif line_end_pos == 0:
              return b'\n'
  
          prev_char = data[line_end_pos - 1]
  
          return b'\r\n' if (prev_char is b'\r'[0]) else b'\n'
docs: Looks for a newline character in bytestring parameter 'data'.
          Currently only looks for strings '\r\n', '\n'. If '\n' is
          found at the first position of the string, this raises an
          exception.
  
          Parameters:
              data (bytes): The data to be searched
  
          Returns:
              None: If no-newline is found
              One of '\n', '\r\n': whichever is found first