input: Write a python function to determine if a given list of positive integers is sorted in non-decreasing order. The function should return False if there are any repeated elements occurring more than twice. It assumes the list contains only positive integers.
  assert is_list_sorted([5]) == True
  assert is_list_sorted([1, 2, 3, 4, 5]) == True
  assert is_list_sorted([1, 3, 2, 4, 5]) == False
  assert is_list_sorted([1, 2, 3, 4, 5, 6]) == True
  assert is_list_sorted([1, 2, 3, 4, 5, 6, 7]) == True
  assert is_list_sorted([1, 3, 2, 4, 5, 6, 7]) == False
  assert is_list_sorted([]) == True
  assert is_list_sorted([1]) == True
  assert is_list_sorted([3, 2, 1]) == False
  assert is_list_sorted([1, 2, 2, 2, 3, 4]) == False
  assert is_list_sorted([1, 2, 3, 3, 3, 4]) == False
  assert is_list_sorted([1, 2, 2, 3, 3, 4]) == True
  assert is_list_sorted([1, 2, 3, 4]) == True
output: def is_list_sorted(lst):
      if not lst:
          return True
      for i in range(1, len(lst)):
          if lst[i] < lst[i - 1]:
              return False
      for num in lst:
          if lst.count(num) > 2:
              return False
      return True