Implement a search function for an element in a sorted list.
Asked in the CoderPad stage. Given a sorted list of integers and a target integer, return the index of any occurrence of the target, or -1 if it is absent. The list is sorted in nondecreasing order.
Implement search_sorted(nums, target). It accepts a list of integers and an integer, and returns an integer index.
def search_sorted(nums, target):