nodes: 0, module; 1, function_definition; 2, function_name:list_users; 3, parameters; 4, block; 5, default_parameter; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, identifier:order_by; 14, string; 15, string; 16, assignment; 17, assignment; 18, assignment; 19, assignment; 20, identifier:user; 21, identifier:users; 22, block; 23, identifier:ret; 24, string_content:id; 25, string_content:Show all users for this company.
  
      CLI Example:
  
          salt myminion bamboohr.list_users
  
      By default, the return data will be keyed by ID. However, it can be ordered
      by any other field. Keep in mind that if the field that is chosen contains
      duplicate values (i.e., location is used, for a company which only has one
      location), then each duplicate value will be overwritten by the previous.
      Therefore, it is advisable to only sort by fields that are guaranteed to be
      unique.
  
      CLI Examples:
  
          salt myminion bamboohr.list_users order_by=id
          salt myminion bamboohr.list_users order_by=email; 26, identifier:ret; 27, dictionary; 28, pattern_list; 29, call; 30, identifier:root; 31, call; 32, identifier:users; 33, call; 34, expression_statement; 35, expression_statement; 36, for_statement; 37, for_statement; 38, expression_statement; 39, identifier:status; 40, identifier:result; 41, identifier:_query; 42, argument_list; 43, attribute; 44, argument_list; 45, attribute; 46, argument_list; 47, assignment; 48, assignment; 49, identifier:item; 50, call; 51, block; 52, identifier:item; 53, call; 54, block; 55, assignment; 56, keyword_argument; 57, keyword_argument; 58, identifier:ET; 59, identifier:fromstring; 60, identifier:result; 61, identifier:root; 62, identifier:getchildren; 63, identifier:user_id; 64, None; 65, identifier:user_ret; 66, dictionary; 67, attribute; 68, argument_list; 69, expression_statement; 70, if_statement; 71, attribute; 72, argument_list; 73, expression_statement; 74, subscript; 75, identifier:user_ret; 76, identifier:action; 77, string; 78, identifier:command; 79, string; 80, identifier:user; 81, identifier:items; 82, assignment; 83, comparison_operator:item[0] == 'id'; 84, block; 85, identifier:user; 86, identifier:getchildren; 87, assignment; 88, identifier:ret; 89, subscript; 90, string_content:meta; 91, string_content:users; 92, subscript; 93, subscript; 94, subscript; 95, string; 96, expression_statement; 97, subscript; 98, attribute; 99, identifier:user_ret; 100, identifier:order_by; 101, identifier:user_ret; 102, subscript; 103, identifier:item; 104, integer:1; 105, identifier:item; 106, integer:0; 107, string_content:id; 108, assignment; 109, identifier:user_ret; 110, attribute; 111, identifier:item; 112, identifier:text; 113, identifier:item; 114, integer:0; 115, identifier:user_id; 116, subscript; 117, identifier:item; 118, identifier:tag; 119, identifier:item; 120, integer:1
code: def list_users(order_by='id'):
      '''
      Show all users for this company.
  
      CLI Example:
  
          salt myminion bamboohr.list_users
  
      By default, the return data will be keyed by ID. However, it can be ordered
      by any other field. Keep in mind that if the field that is chosen contains
      duplicate values (i.e., location is used, for a company which only has one
      location), then each duplicate value will be overwritten by the previous.
      Therefore, it is advisable to only sort by fields that are guaranteed to be
      unique.
  
      CLI Examples:
  
          salt myminion bamboohr.list_users order_by=id
          salt myminion bamboohr.list_users order_by=email
      '''
      ret = {}
      status, result = _query(action='meta', command='users')
      root = ET.fromstring(result)
      users = root.getchildren()
      for user in users:
          user_id = None
          user_ret = {}
          for item in user.items():
              user_ret[item[0]] = item[1]
              if item[0] == 'id':
                  user_id = item[1]
          for item in user.getchildren():
              user_ret[item.tag] = item.text
          ret[user_ret[order_by]] = user_ret
      return ret