nodes: 0, module; 1, function_definition; 2, function_name:guess_interval; 3, parameters; 4, block; 5, identifier:nums; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, return_statement; 16, identifier:accuracy; 17, integer:0; 18, comment:"""Given a seq of number, return the median, only calculate interval >= accuracy.
  
      ::
  
          from torequests.utils import guess_interval
          import random
  
          seq = [random.randint(1, 100) for i in range(20)]
          print(guess_interval(seq, 5))
          # sorted_seq: [2, 10, 12, 19, 19, 29, 30, 32, 38, 40, 41, 54, 62, 69, 75, 79, 82, 88, 97, 99]
          # diffs: [8, 7, 10, 6, 13, 8, 7, 6, 6, 9]
          # median: 8
      """; 19, not_operator; 20, block; 21, assignment; 22, comparison_operator:len(nums) == 1; 23, block; 24, assignment; 25, assignment; 26, assignment; 27, assignment; 28, identifier:result; 29, identifier:nums; 30, return_statement; 31, identifier:nums; 32, call; 33, call; 34, integer:1; 35, return_statement; 36, identifier:diffs; 37, list_comprehension; 38, identifier:diffs; 39, list_comprehension; 40, identifier:sorted_diff; 41, call; 42, identifier:result; 43, subscript; 44, integer:0; 45, identifier:sorted; 46, argument_list; 47, identifier:len; 48, argument_list; 49, subscript; 50, binary_operator:nums[i + 1] - nums[i]; 51, for_in_clause; 52, identifier:item; 53, for_in_clause; 54, if_clause; 55, identifier:sorted; 56, argument_list; 57, identifier:sorted_diff; 58, binary_operator:len(diffs) // 2; 59, list_comprehension; 60, identifier:nums; 61, identifier:nums; 62, integer:0; 63, subscript; 64, subscript; 65, identifier:i; 66, call; 67, identifier:item; 68, identifier:diffs; 69, comparison_operator:item >= accuracy; 70, identifier:diffs; 71, call; 72, integer:2; 73, call; 74, for_in_clause; 75, identifier:nums; 76, binary_operator:i + 1; 77, identifier:nums; 78, identifier:i; 79, identifier:range; 80, argument_list; 81, identifier:item; 82, identifier:accuracy; 83, identifier:len; 84, argument_list; 85, identifier:int; 86, argument_list; 87, identifier:i; 88, identifier:nums; 89, identifier:i; 90, integer:1; 91, binary_operator:len(nums) - 1; 92, identifier:diffs; 93, identifier:i; 94, call; 95, integer:1; 96, identifier:len; 97, argument_list; 98, identifier:nums
code: def guess_interval(nums, accuracy=0):
      """Given a seq of number, return the median, only calculate interval >= accuracy.
  
      ::
  
          from torequests.utils import guess_interval
          import random
  
          seq = [random.randint(1, 100) for i in range(20)]
          print(guess_interval(seq, 5))
          # sorted_seq: [2, 10, 12, 19, 19, 29, 30, 32, 38, 40, 41, 54, 62, 69, 75, 79, 82, 88, 97, 99]
          # diffs: [8, 7, 10, 6, 13, 8, 7, 6, 6, 9]
          # median: 8
      """
      if not nums:
          return 0
      nums = sorted([int(i) for i in nums])
      if len(nums) == 1:
          return nums[0]
      diffs = [nums[i + 1] - nums[i] for i in range(len(nums) - 1)]
      diffs = [item for item in diffs if item >= accuracy]
      sorted_diff = sorted(diffs)
      result = sorted_diff[len(diffs) // 2]
      return result