nodes: 0, module; 1, function_definition; 2, function_name:find_point_in_section_list; 3, parameters; 4, block; 5, identifier:point; 6, identifier:section_list; 7, expression_statement; 8, if_statement; 9, if_statement; 10, try_statement; 11, comment:"""Returns the start of the section the given point belongs to.
  
      The given list is assumed to contain start points of consecutive
      sections, except for the final point, assumed to be the end point of the
      last section. For example, the list [5, 8, 30, 31] is interpreted as the
      following list of sections: [5-8), [8-30), [30-31], so the points -32, 4.5,
      32 and 100 all match no section, while 5 and 7.5 match [5-8) and so for
      them the function returns 5, and 30, 30.7 and 31 all match [30-31].
  
      Parameters
      ---------
      point : float
          The point for which to match a section.
      section_list : sortedcontainers.SortedList
          A list of start points of consecutive sections.
  
      Returns
      -------
      float
          The start of the section the given point belongs to. None if no match
          was found.
  
      Example
      -------
      >>> from sortedcontainers import SortedList
      >>> seclist = SortedList([5, 8, 30, 31])
      >>> find_point_in_section_list(4, seclist)
  
      >>> find_point_in_section_list(5, seclist)
      5
      >>> find_point_in_section_list(27, seclist)
      8
      >>> find_point_in_section_list(31, seclist)
      30
      """; 12, boolean_operator; 13, block; 14, comparison_operator:point in section_list; 15, block; 16, block; 17, except_clause; 18, comparison_operator:point < section_list[0]; 19, comparison_operator:point > section_list[-1]; 20, return_statement; 21, identifier:point; 22, identifier:section_list; 23, if_statement; 24, expression_statement; 25, if_statement; 26, return_statement; 27, expression_statement; 28, return_statement; 29, identifier:IndexError; 30, block; 31, identifier:point; 32, subscript; 33, identifier:point; 34, subscript; 35, None; 36, comparison_operator:point == section_list[-1]; 37, block; 38, assignment; 39, comparison_operator:ind == 0; 40, block; 41, subscript; 42, assignment; 43, subscript; 44, return_statement; 45, identifier:section_list; 46, integer:0; 47, identifier:section_list; 48, unary_operator; 49, identifier:point; 50, subscript; 51, return_statement; 52, identifier:ind; 53, binary_operator:section_list.bisect(point)-1; 54, identifier:ind; 55, integer:0; 56, return_statement; 57, identifier:section_list; 58, identifier:ind; 59, identifier:ind; 60, call; 61, identifier:section_list; 62, binary_operator:ind-1; 63, None; 64, integer:1; 65, identifier:section_list; 66, unary_operator; 67, subscript; 68, call; 69, integer:1; 70, subscript; 71, attribute; 72, argument_list; 73, identifier:ind; 74, integer:1; 75, integer:1; 76, identifier:section_list; 77, unary_operator; 78, attribute; 79, argument_list; 80, identifier:section_list; 81, integer:0; 82, identifier:section_list; 83, identifier:bisect; 84, identifier:point; 85, integer:2; 86, identifier:section_list; 87, identifier:bisect; 88, identifier:point
code: def find_point_in_section_list(point, section_list):
      """Returns the start of the section the given point belongs to.
  
      The given list is assumed to contain start points of consecutive
      sections, except for the final point, assumed to be the end point of the
      last section. For example, the list [5, 8, 30, 31] is interpreted as the
      following list of sections: [5-8), [8-30), [30-31], so the points -32, 4.5,
      32 and 100 all match no section, while 5 and 7.5 match [5-8) and so for
      them the function returns 5, and 30, 30.7 and 31 all match [30-31].
  
      Parameters
      ---------
      point : float
          The point for which to match a section.
      section_list : sortedcontainers.SortedList
          A list of start points of consecutive sections.
  
      Returns
      -------
      float
          The start of the section the given point belongs to. None if no match
          was found.
  
      Example
      -------
      >>> from sortedcontainers import SortedList
      >>> seclist = SortedList([5, 8, 30, 31])
      >>> find_point_in_section_list(4, seclist)
  
      >>> find_point_in_section_list(5, seclist)
      5
      >>> find_point_in_section_list(27, seclist)
      8
      >>> find_point_in_section_list(31, seclist)
      30
      """
      if point < section_list[0] or point > section_list[-1]:
          return None
      if point in section_list:
          if point == section_list[-1]:
              return section_list[-2]
          ind = section_list.bisect(point)-1
          if ind == 0:
              return section_list[0]
          return section_list[ind]
      try:
          ind = section_list.bisect(point)
          return section_list[ind-1]
      except IndexError:
          return None