original_docstring: Return the position of query if in data.
docstring: Return the position of query if in data.
docstring_tokens: Return the position of query if in data .
code: def binary_search(data, item, verbose=False):
      """Return the position of query if in data."""
      low = 0
      high = len(data) - 1
  
      while low <= high:
  
          mid = (low + high) // 2
          guess = data[mid]
  
          if verbose:
              print('index:', mid, 'guess:', guess)
  
          if guess == item:
              return mid
          if guess > item:
              high = mid - 1
          else:
              low = mid + 1
  
      return None
code_tokens: def binary_search ( data , item , verbose = False ) : low = 0 high = len ( data ) - 1 while low <= high : mid = ( low + high ) // 2 guess = data [ mid ] if verbose : print ( 'index:' , mid , 'guess:' , guess ) if guess == item : return mid if guess > item : high = mid - 1 else : low = mid + 1 return None
short_docstring: Return the position of query if in data.
short_docstring_tokens: Return the position of query if in data .
comment: """Return the position of query if in data."""