def _validate_groupby_fields(groupby_fields):
 valid_fields = set(['user_id', 'resource_id', 'project_id', 'source', 'resource_metadata.instance_type'])
 invalid_fields = (set(groupby_fields) - valid_fields)
 if invalid_fields:
  raise wsme.exc.UnknownArgument(invalid_fields, 'Invalid groupby fields')
 return list(set(groupby_fields))

def _validate_groupby_fields ( groupby_fields ) : valid_fields = set ( [ 'user_id' , 'resource_id' , 'project_id' , 'source' , 'resource_metadata.instance_type' ] ) invalid_fields = ( set ( groupby_fields ) - valid_fields ) if invalid_fields : raise wsme . exc . UnknownArgument ( invalid_fields , 'Invalid groupby fields' ) return list ( set ( groupby_fields ) )
checks that the list of groupby fields from request is valid .