code: def search_rotate(array, val):
      """
      Finds the index of the given value in an array that has been sorted in
      ascending order and then rotated at some unknown pivot.
      """
      low, high = 0, len(array) - 1
      while low <= high:
          mid = (low + high) // 2
          if val == array[mid]:
              return mid
  
          if array[low] <= array[mid]:
              if array[low] <= val <= array[mid]:
                  high = mid - 1
              else:
                  low = mid + 1
          else:
              if array[mid] <= val <= array[high]:
                  low = mid + 1
              else:
                  high = mid - 1
  
      return -1
  
label_desc: Use image node_id 1 for calling a global function with example usage: search_rotate(array, val) and returns: unknown, mid