nodes: 0, module; 1, function_definition; 2, function_name:__exportUsers; 3, parameters; 4, block; 5, identifier:self; 6, identifier:sort; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, for_statement; 14, return_statement; 15, identifier:limit; 16, integer:0; 17, comment:"""Export the users to a dictionary.
  
          :param sort: field to sort the users
          :type sort: str.
          :return: exported users.
          :rtype: dict.
          """; 18, assignment; 19, assignment; 20, identifier:limit; 21, block; 22, assignment; 23, identifier:u; 24, identifier:dataUsers; 25, block; 26, identifier:exportedUsers; 27, identifier:position; 28, integer:1; 29, identifier:dataUsers; 30, call; 31, expression_statement; 32, identifier:exportedUsers; 33, list; 34, expression_statement; 35, expression_statement; 36, expression_statement; 37, if_statement; 38, expression_statement; 39, attribute; 40, argument_list; 41, assignment; 42, assignment; 43, assignment; 44, call; 45, comparison_operator:position < len(dataUsers); 46, block; 47, augmented_assignment; 48, identifier:self; 49, identifier:getSortedUsers; 50, identifier:sort; 51, identifier:dataUsers; 52, subscript; 53, identifier:userExported; 54, call; 55, subscript; 56, identifier:position; 57, attribute; 58, argument_list; 59, identifier:position; 60, call; 61, expression_statement; 62, identifier:position; 63, integer:1; 64, identifier:dataUsers; 65, slice; 66, attribute; 67, argument_list; 68, identifier:userExported; 69, string:"position"; 70, identifier:exportedUsers; 71, identifier:append; 72, identifier:userExported; 73, identifier:len; 74, argument_list; 75, assignment; 76, identifier:limit; 77, identifier:u; 78, identifier:export; 79, identifier:dataUsers; 80, subscript; 81, True; 82, identifier:userExported; 83, string:"comma"
code: def __exportUsers(self, sort, limit=0):
          """Export the users to a dictionary.
  
          :param sort: field to sort the users
          :type sort: str.
          :return: exported users.
          :rtype: dict.
          """
          position = 1
          dataUsers = self.getSortedUsers(sort)
  
          if limit:
              dataUsers = dataUsers[:limit]
  
          exportedUsers = []
  
          for u in dataUsers:
              userExported = u.export()
              userExported["position"] = position
              exportedUsers.append(userExported)
  
              if position < len(dataUsers):
                  userExported["comma"] = True
  
              position += 1
          return exportedUsers