def render_grid_file(context, f):
f.seek(<NUM_LIT:0>)  <EOL>response = context.response  <EOL>if __debug__:  <EOL><INDENT>response.headers['<STR_LIT>'] = str(f._id)  <EOL>log.debug("<STR_LIT>", extra=dict(<EOL>identifier = str(f._id),<EOL>filename = f.filename,<EOL>length = f.length,<EOL>mimetype = f.content_type<EOL>))<EOL><DEDENT>response.conditional_response = True<EOL>response.accept_ranges = '<STR_LIT>'  <EOL>response.content_type = f.content_type  <EOL>response.content_length = f.length  <EOL>response.content_md5 = response.etag = f.md5  <EOL>response.last_modified = f.metadata.get('<STR_LIT>', None)  <EOL>response.content_disposition = '<STR_LIT>' + f.name  <EOL>if context.request.if_range.match_response(response):<EOL><INDENT>response.body_file = f  <EOL><DEDENT>else:<EOL><INDENT>response.app_iter = iter(f)  <EOL><DEDENT>return True<EOL>
Allow direct use of GridOut GridFS file wrappers as endpoint responses.