def _get_sort_keys(sort_keys, mapping):
 if isinstance(sort_keys, six.string_types):
  sort_keys = [sort_keys]
 return [mapping[key] for key in (sort_keys or []) if (key in mapping)]

def _get_sort_keys ( sort_keys , mapping ) : if isinstance ( sort_keys , six . string_types ) : sort_keys = [ sort_keys ] return [ mapping [ key ] for key in ( sort_keys or [ ] ) if ( key in mapping ) ]
returns an array containing only whitelisted keys .