nodes: 0, module; 1, function_definition; 2, function_name:occupied_by_sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:address; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, if_statement; 11, if_statement; 12, return_statement; 13, comment:"""
          Check if an address belongs to any segment, and if yes, returns the sort of the segment
  
          :param int address: The address to check
          :return: Sort of the segment that occupies this address
          :rtype: str
          """; 14, assignment; 15, comparison_operator:len(self._list) <= idx; 16, block; 17, comparison_operator:self._list[idx].start <= address < self._list[idx].end; 18, block; 19, boolean_operator; 20, comment:# TODO: It seems that this branch is never reached. Should it be removed?; 21, block; 22, None; 23, identifier:idx; 24, call; 25, call; 26, identifier:idx; 27, return_statement; 28, attribute; 29, identifier:address; 30, attribute; 31, return_statement; 32, comparison_operator:idx > 0; 33, comparison_operator:address < self._list[idx - 1].end; 34, return_statement; 35, attribute; 36, argument_list; 37, identifier:len; 38, argument_list; 39, None; 40, subscript; 41, identifier:start; 42, subscript; 43, identifier:end; 44, attribute; 45, identifier:idx; 46, integer:0; 47, identifier:address; 48, attribute; 49, attribute; 50, identifier:self; 51, identifier:_search; 52, identifier:address; 53, attribute; 54, attribute; 55, identifier:idx; 56, attribute; 57, identifier:idx; 58, subscript; 59, identifier:sort; 60, subscript; 61, identifier:end; 62, subscript; 63, identifier:sort; 64, identifier:self; 65, identifier:_list; 66, identifier:self; 67, identifier:_list; 68, identifier:self; 69, identifier:_list; 70, attribute; 71, identifier:idx; 72, attribute; 73, binary_operator:idx - 1; 74, attribute; 75, binary_operator:idx - 1; 76, identifier:self; 77, identifier:_list; 78, identifier:self; 79, identifier:_list; 80, identifier:idx; 81, integer:1; 82, identifier:self; 83, identifier:_list; 84, identifier:idx; 85, integer:1
code: def occupied_by_sort(self, address):
          """
          Check if an address belongs to any segment, and if yes, returns the sort of the segment
  
          :param int address: The address to check
          :return: Sort of the segment that occupies this address
          :rtype: str
          """
  
          idx = self._search(address)
          if len(self._list) <= idx:
              return None
          if self._list[idx].start <= address < self._list[idx].end:
              return self._list[idx].sort
          if idx > 0 and address < self._list[idx - 1].end:
              # TODO: It seems that this branch is never reached. Should it be removed?
              return self._list[idx - 1].sort
          return None