original_docstring: 
      Given a list of numbers, and a single query number, find the number in the sorted list that is numerically
      closest to the query number. Uses list bisection to do so, and so should be O(log n)
      
docstring: Given a list of numbers, and a single query number, find the number in the sorted list that is numerically
  closest to the query number. Uses list bisection to do so, and so should be O(log n)
docstring_tokens: Given a list of numbers and a single query number find the number in the sorted list that is numerically closest to the query number . Uses list bisection to do so and so should be O ( log n )
code: def find_closest(numeric_list, query_number):
      """
      Given a list of numbers, and a single query number, find the number in the sorted list that is numerically
      closest to the query number. Uses list bisection to do so, and so should be O(log n)
      """
      sorted_numeric_list = sorted(numeric_list)
      pos = bisect.bisect_left(sorted_numeric_list, query_number)
      if pos == 0:
          return sorted_numeric_list[0]
      if pos == len(sorted_numeric_list):
          return sorted_numeric_list[-1]
      before = sorted_numeric_list[pos - 1]
      after = sorted_numeric_list[pos]
      if after - query_number < query_number - before:
          return after
      else:
          return before
code_tokens: def find_closest ( numeric_list , query_number ) : sorted_numeric_list = sorted ( numeric_list ) pos = bisect . bisect_left ( sorted_numeric_list , query_number ) if pos == 0 : return sorted_numeric_list [ 0 ] if pos == len ( sorted_numeric_list ) : return sorted_numeric_list [ - 1 ] before = sorted_numeric_list [ pos - 1 ] after = sorted_numeric_list [ pos ] if after - query_number < query_number - before : return after else : return before
short_docstring: Given a list of numbers, and a single query number, find the number in the sorted list that is numerically
  closest to the query number.
short_docstring_tokens: Given a list of numbers and a single query number find the number in the sorted list that is numerically closest to the query number .
comment: """
      Given a list of numbers, and a single query number, find the number in the sorted list that is numerically
      closest to the query number. Uses list bisection to do so, and so should be O(log n)
      """