def configure_uploads(app, upload_sets):
if isinstance(upload_sets, UploadSet):<EOL><INDENT>upload_sets = (upload_sets,)<EOL><DEDENT>if not hasattr(app, '<STR_LIT>'):<EOL><INDENT>app.upload_set_config = {}<EOL><DEDENT>set_config = app.upload_set_config<EOL>defaults = dict(dest=app.config.get('<STR_LIT>'),<EOL>url=app.config.get('<STR_LIT>'))<EOL>for uset in upload_sets:<EOL><INDENT>config = config_for_set(uset, app, defaults)<EOL>set_config[uset.name] = config<EOL><DEDENT>should_serve = any(s.base_url is None for s in set_config.values())<EOL>if '<STR_LIT>' not in app.blueprints and should_serve:<EOL><INDENT>app.register_blueprint(uploads_mod)<EOL><DEDENT>
Call this after the app has been configured. It will go through all the
upload sets, get their configuration, and store the configuration on the
app. It will also register the uploads module if it hasn't been set. This
can be called multiple times with different upload sets.

.. versionchanged:: 0.1.3
   The uploads module/blueprint will only be registered if it is needed
   to serve the upload sets.

:param app: The `~flask.Flask` instance to get the configuration from.
:param upload_sets: The `UploadSet` instances to configure.