nodes: 0, module; 1, function_definition; 2, function_name:binary_search; 3, parameters; 4, block; 5, identifier:data; 6, identifier:target; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 14, identifier:lo; 15, integer:0; 16, identifier:hi; 17, None; 18, comment:"""
      Perform binary search on sorted list data for target. Returns int
      representing position of target in data.
      """; 19, assignment; 20, assignment; 21, boolean_operator; 22, block; 23, comparison_operator:data[mid] > target; 24, block; 25, elif_clause; 26, elif_clause; 27, identifier:hi; 28, conditional_expression:hi if hi is not None else len(data); 29, identifier:mid; 30, binary_operator:(lo + hi) // 2; 31, boolean_operator; 32, comparison_operator:target < data[0]; 33, return_statement; 34, subscript; 35, identifier:target; 36, return_statement; 37, comparison_operator:data[mid] < target; 38, block; 39, comparison_operator:data[mid] == target; 40, block; 41, identifier:hi; 42, comparison_operator:hi is not None; 43, call; 44, parenthesized_expression; 45, integer:2; 46, boolean_operator; 47, comparison_operator:target > data[-1]; 48, identifier:target; 49, subscript; 50, unary_operator; 51, identifier:data; 52, identifier:mid; 53, call; 54, subscript; 55, identifier:target; 56, return_statement; 57, subscript; 58, identifier:target; 59, return_statement; 60, identifier:hi; 61, None; 62, identifier:len; 63, argument_list; 64, binary_operator:lo + hi; 65, comparison_operator:hi < 2; 66, comparison_operator:hi > len(data); 67, identifier:target; 68, subscript; 69, identifier:data; 70, integer:0; 71, integer:1; 72, identifier:binary_search; 73, argument_list; 74, identifier:data; 75, identifier:mid; 76, call; 77, identifier:data; 78, identifier:mid; 79, identifier:mid; 80, identifier:data; 81, identifier:lo; 82, identifier:hi; 83, identifier:hi; 84, integer:2; 85, identifier:hi; 86, call; 87, identifier:data; 88, unary_operator; 89, identifier:data; 90, identifier:target; 91, keyword_argument; 92, keyword_argument; 93, identifier:binary_search; 94, argument_list; 95, identifier:len; 96, argument_list; 97, integer:1; 98, identifier:lo; 99, identifier:lo; 100, identifier:hi; 101, identifier:mid; 102, identifier:data; 103, identifier:target; 104, keyword_argument; 105, keyword_argument; 106, identifier:data; 107, identifier:lo; 108, parenthesized_expression; 109, identifier:hi; 110, identifier:hi; 111, binary_operator:mid + 1; 112, identifier:mid; 113, integer:1
code: def binary_search(data, target, lo=0, hi=None):
      """
      Perform binary search on sorted list data for target. Returns int
      representing position of target in data.
      """
      hi = hi if hi is not None else len(data)
      mid = (lo + hi) // 2
      if hi < 2 or hi > len(data) or target > data[-1] or target < data[0]:
          return -1
      if data[mid] > target:
          return binary_search(data, target, lo=lo, hi=mid)
      elif data[mid] < target:
          return binary_search(data, target, lo=(mid + 1), hi=hi)
      elif data[mid] == target:
          return mid