code: def get_values_of_matching_keys(pattern_dict, user_name):
      '''
      Check a whitelist and/or blacklist to see if the value matches it.
      '''
      ret = []
      for expr in pattern_dict:
          if salt.utils.stringutils.expr_match(user_name, expr):
              ret.extend(pattern_dict[expr])
      return ref get_values_of_matching_keys(pattern_dict, user_name):
      '''
      Check a whitelist and/or blacklist to see if the value matches it.
      '''
      ret = []
      for expr in pattern_dict:
          if salt.utils.stringutils.expr_match(user_name, expr):
              ret.extend(pattern_dict[expr])
      return ret
docs: Check a whitelist and/or blacklist to see if the value matches it.