nodes: 0, module; 1, function_definition; 2, function_name:list_kadastrale_afdelingen; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, function_definition; 8, if_statement; 9, return_statement; 10, string; 11, function_name:creator; 12, parameters; 13, block; 14, attribute; 15, block; 16, else_clause; 17, identifier:afdelingen; 18, string_content:List all `kadastrale afdelingen` in Flanders.
  
          :param integer sort: Field to sort on.
          :rtype: A :class:`list` of :class:`Afdeling`.; 19, expression_statement; 20, expression_statement; 21, for_statement; 22, return_statement; 23, subscript; 24, identifier:is_configured; 25, expression_statement; 26, expression_statement; 27, block; 28, assignment; 29, assignment; 30, identifier:g; 31, identifier:gemeentes; 32, block; 33, identifier:res; 34, attribute; 35, string; 36, assignment; 37, assignment; 38, expression_statement; 39, identifier:gemeentes; 40, call; 41, identifier:res; 42, list; 43, expression_statement; 44, identifier:self; 45, identifier:caches; 46, string_content:permanent; 47, identifier:key; 48, string; 49, identifier:afdelingen; 50, call; 51, assignment; 52, attribute; 53, argument_list; 54, augmented_assignment; 55, string_content:list_afdelingen_rest; 56, attribute; 57, argument_list; 58, identifier:afdelingen; 59, call; 60, identifier:self; 61, identifier:list_gemeenten; 62, identifier:res; 63, call; 64, subscript; 65, identifier:get_or_create; 66, identifier:key; 67, identifier:creator; 68, identifier:creator; 69, argument_list; 70, attribute; 71, argument_list; 72, attribute; 73, string; 74, identifier:self; 75, identifier:list_kadastrale_afdelingen_by_gemeente; 76, identifier:g; 77, identifier:self; 78, identifier:caches; 79, string_content:permanent
code: def list_kadastrale_afdelingen(self):
          '''
          List all `kadastrale afdelingen` in Flanders.
  
          :param integer sort: Field to sort on.
          :rtype: A :class:`list` of :class:`Afdeling`.
          '''
  
          def creator():
              gemeentes = self.list_gemeenten()
              res = []
              for g in gemeentes:
                  res += self.list_kadastrale_afdelingen_by_gemeente(g)
              return res
  
          if self.caches['permanent'].is_configured:
              key = 'list_afdelingen_rest'
              afdelingen = self.caches['permanent'].get_or_create(key, creator)
          else:
              afdelingen = creator()
          return afdelingen