def get_values_of_matching_keys(pattern_dict, user_name):
 ret = []
 for expr in pattern_dict:
  if expr_match(user_name, expr):
   ret.extend(pattern_dict[expr])
 return ret

def get_values_of_matching_keys ( pattern_dict , user_name ) : ret = [ ] for expr in pattern_dict : if expr_match ( user_name , expr ) : ret . extend ( pattern_dict [ expr ] ) return ret
check a whitelist and/or blacklist to see if the value matches it .