nodes: 0, module; 1, function_definition; 2, function_name:list_gewesten; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, function_definition; 9, if_statement; 10, for_statement; 11, return_statement; 12, identifier:sort; 13, integer:1; 14, string; 15, function_name:creator; 16, parameters; 17, block; 18, attribute; 19, block; 20, else_clause; 21, identifier:g; 22, identifier:gewesten; 23, block; 24, identifier:gewesten; 25, string_content:List all `gewesten` in Belgium.
  
          :param integer sort: What field to sort on.
          :rtype: A :class`list` of class: `Gewest`.; 26, expression_statement; 27, expression_statement; 28, for_statement; 29, return_statement; 30, subscript; 31, identifier:is_configured; 32, expression_statement; 33, expression_statement; 34, block; 35, expression_statement; 36, assignment; 37, assignment; 38, identifier:r; 39, attribute; 40, block; 41, list_comprehension; 42, attribute; 43, string; 44, assignment; 45, assignment; 46, expression_statement; 47, call; 48, identifier:res; 49, call; 50, identifier:tmp; 51, dictionary; 52, identifier:res; 53, identifier:GewestItem; 54, if_statement; 55, expression_statement; 56, call; 57, for_in_clause; 58, identifier:self; 59, identifier:caches; 60, string_content:permanent; 61, identifier:key; 62, binary_operator:'ListGewesten#%s' % sort; 63, identifier:gewesten; 64, call; 65, assignment; 66, attribute; 67, argument_list; 68, identifier:crab_gateway_request; 69, argument_list; 70, comparison_operator:r.GewestId not in tmp; 71, block; 72, assignment; 73, identifier:Gewest; 74, argument_list; 75, pattern_list; 76, call; 77, string; 78, identifier:sort; 79, attribute; 80, argument_list; 81, identifier:gewesten; 82, call; 83, identifier:g; 84, identifier:set_gateway; 85, identifier:self; 86, attribute; 87, string; 88, identifier:sort; 89, attribute; 90, identifier:tmp; 91, expression_statement; 92, subscript; 93, attribute; 94, identifier:k; 95, identifier:v; 96, identifier:k; 97, identifier:v; 98, attribute; 99, argument_list; 100, string_content:ListGewesten#%s; 101, subscript; 102, identifier:get_or_create; 103, identifier:key; 104, identifier:creator; 105, identifier:creator; 106, argument_list; 107, identifier:self; 108, identifier:client; 109, string_content:ListGewesten; 110, identifier:r; 111, identifier:GewestId; 112, assignment; 113, subscript; 114, attribute; 115, identifier:r; 116, identifier:GewestNaam; 117, identifier:tmp; 118, identifier:items; 119, attribute; 120, string; 121, subscript; 122, dictionary; 123, identifier:tmp; 124, attribute; 125, identifier:r; 126, identifier:TaalCodeGewestNaam; 127, identifier:self; 128, identifier:caches; 129, string_content:permanent; 130, identifier:tmp; 131, attribute; 132, identifier:r; 133, identifier:GewestId; 134, identifier:r; 135, identifier:GewestId
code: def list_gewesten(self, sort=1):
          '''
          List all `gewesten` in Belgium.
  
          :param integer sort: What field to sort on.
          :rtype: A :class`list` of class: `Gewest`.
          '''
          def creator():
              res = crab_gateway_request(self.client, 'ListGewesten', sort)
              tmp = {}
              for r in res.GewestItem:
                  if r.GewestId not in tmp:
                      tmp[r.GewestId] = {}
                  tmp[r.GewestId][r.TaalCodeGewestNaam] = r.GewestNaam
              return[
                  Gewest(
                      k,
                      v
                  )for k, v in tmp.items()
              ]
          if self.caches['permanent'].is_configured:
              key = 'ListGewesten#%s' % sort
              gewesten = self.caches['permanent'].get_or_create(key, creator)
          else:
              gewesten = creator()
          for g in gewesten:
              g.set_gateway(self)
          return gewesten