def _get_file(db, user_id, api_path, query_fields, decrypt_func):
result = db.execute(<EOL>_select_file(user_id, api_path, query_fields, limit=<NUM_LIT:1>),<EOL>).first()<EOL>if result is None:<EOL><INDENT>raise NoSuchFile(api_path)<EOL><DEDENT>if files.c.content in query_fields:<EOL><INDENT>return to_dict_with_content(query_fields, result, decrypt_func)<EOL><DEDENT>else:<EOL><INDENT>return to_dict_no_content(query_fields, result)<EOL><DEDENT>
Get file data for the given user_id, path, and query_fields.  The
query_fields parameter specifies which database fields should be
included in the returned file data.