input: Write a function to detect if a linked list contains a cycle.
  assert contains_cycle(node1) == True  # Assuming node1 is part of a cycle
  assert contains_cycle(node2) == False  # Assuming node2 is not part of a cycle
  assert contains_cycle(empty_node) == False  # Assuming empty_node is an empty linked list
output: def contains_cycle(head):
      slow, fast = head, head
      while fast and fast.next:
          slow = slow.next
          fast = fast.next.next
          if slow == fast:
              return True
      return False