Write a function to check for the presence of a cycle in a linked list.
Represent the linked list with nodes, where each node is an object containing value and next. The next field is the zero-based index of the next node, or -1 for the end of the list. head is the starting index. Return True if traversal can revisit a node, otherwise return False.
def has_cycle(nodes, head):