def get_files(request):
files = dict()<EOL>for k, v in request.files.items():<EOL><INDENT>content_type = (<EOL>request.files[k].content_type or '<STR_LIT>'<EOL>)<EOL>val = json_safe(v.read(), content_type)<EOL>if files.get(k):<EOL><INDENT>if not isinstance(files[k], list):<EOL><INDENT>files[k] = [files[k]]<EOL><DEDENT>files[k].append(val)<EOL><DEDENT>else:<EOL><INDENT>files[k] = val<EOL><DEDENT><DEDENT>return files<EOL>
Returns files dict from request context.