nodes: 0, module; 1, function_definition; 2, function_name:percentile; 3, parameters; 4, block; 5, identifier:sorted_list; 6, identifier:percent; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, if_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, return_statement; 16, identifier:key; 17, lambda; 18, comment:"""Find the percentile of a sorted list of values.
  
      Arguments
      ---------
      sorted_list : list
          A sorted (ascending) list of values.
      percent : float
          A float value from 0.0 to 1.0.
      key : function, optional
          An optional function to compute a value from each element of N.
  
      Returns
      -------
      float
          The desired percentile of the value list.
  
      Examples
      --------
      >>> sorted_list = [4,6,8,9,11]
      >>> percentile(sorted_list, 0.4)
      7.0
      >>> percentile(sorted_list, 0.44)
      8.0
      >>> percentile(sorted_list, 0.6)
      8.5
      >>> percentile(sorted_list, 0.99)
      11.0
      >>> percentile(sorted_list, 1)
      11.0
      >>> percentile(sorted_list, 0)
      4.0
      """; 19, not_operator; 20, block; 21, comparison_operator:percent == 1; 22, block; 23, comparison_operator:percent == 0; 24, block; 25, assignment; 26, assignment; 27, comparison_operator:ceil(i) == i; 28, block; 29, call; 30, lambda_parameters; 31, identifier:x; 32, identifier:sorted_list; 33, return_statement; 34, identifier:percent; 35, integer:1; 36, return_statement; 37, identifier:percent; 38, integer:0; 39, return_statement; 40, identifier:n; 41, call; 42, identifier:i; 43, binary_operator:percent * n; 44, call; 45, identifier:i; 46, expression_statement; 47, return_statement; 48, identifier:float; 49, argument_list; 50, identifier:x; 51, None; 52, call; 53, call; 54, identifier:len; 55, argument_list; 56, identifier:percent; 57, identifier:n; 58, identifier:ceil; 59, argument_list; 60, assignment; 61, binary_operator:(sorted_list[i-1] + sorted_list[i]) / 2; 62, subscript; 63, identifier:float; 64, argument_list; 65, identifier:float; 66, argument_list; 67, identifier:sorted_list; 68, identifier:i; 69, identifier:i; 70, call; 71, parenthesized_expression; 72, integer:2; 73, identifier:sorted_list; 74, binary_operator:ceil(i)-1; 75, subscript; 76, subscript; 77, identifier:int; 78, argument_list; 79, binary_operator:sorted_list[i-1] + sorted_list[i]; 80, call; 81, integer:1; 82, identifier:sorted_list; 83, unary_operator; 84, identifier:sorted_list; 85, integer:0; 86, identifier:i; 87, subscript; 88, subscript; 89, identifier:ceil; 90, argument_list; 91, integer:1; 92, identifier:sorted_list; 93, binary_operator:i-1; 94, identifier:sorted_list; 95, identifier:i; 96, identifier:i; 97, identifier:i; 98, integer:1
code: def percentile(sorted_list, percent, key=lambda x: x):
      """Find the percentile of a sorted list of values.
  
      Arguments
      ---------
      sorted_list : list
          A sorted (ascending) list of values.
      percent : float
          A float value from 0.0 to 1.0.
      key : function, optional
          An optional function to compute a value from each element of N.
  
      Returns
      -------
      float
          The desired percentile of the value list.
  
      Examples
      --------
      >>> sorted_list = [4,6,8,9,11]
      >>> percentile(sorted_list, 0.4)
      7.0
      >>> percentile(sorted_list, 0.44)
      8.0
      >>> percentile(sorted_list, 0.6)
      8.5
      >>> percentile(sorted_list, 0.99)
      11.0
      >>> percentile(sorted_list, 1)
      11.0
      >>> percentile(sorted_list, 0)
      4.0
      """
      if not sorted_list:
          return None
      if percent == 1:
          return float(sorted_list[-1])
      if percent == 0:
          return float(sorted_list[0])
      n = len(sorted_list)
      i = percent * n
      if ceil(i) == i:
          i = int(i)
          return (sorted_list[i-1] + sorted_list[i]) / 2
      return float(sorted_list[ceil(i)-1])