comefrom: <garvit244>33_1.py
code: def search( nums, target):
      if not nums:
          return -1
      
      left, right = 0, len(nums) - 1
      
      while left <= right:
          mid = (left + right) / 2
          if nums[mid] == target:
              return mid
      
          if nums[left] <= nums[mid]:
              if target >= nums[left] and target <= nums[mid]:
                  right = mid - 1
              else:
                  left = mid + 1
          else:
              if target >= nums[mid] and target <= nums[right]:
                  left = mid + 1
              else:
                  right = mid - 1
      
      return -1
masked: def sample_funcname ( var_0 , var_1 ) :
      if not var_0 :
          return - 1
      var_4 , var_6 = 0 , len ( var_0 ) - 1
      while var_4 <= var_6 :
          var_8 = ( var_4 + var_6 ) / 2
          if var_0 [ var_8 ] == var_1 :
              return var_8
          if var_0 [ var_4 ] <= var_0 [ var_8 ] :
              if var_1 >= var_0 [ var_4 ] and var_1 <= var_0 [ var_8 ] :
                  var_6 = var_8 - 1
              else :
                  var_4 = var_8 + 1
          else :
              if var_1 >= var_0 [ var_8 ] and var_1 <= var_0 [ var_6 ] :
                  var_4 = var_8 + 1
              else :
                  var_6 = var_8 - 1
      return - 1
  