def prepare_plugins(plugins, parameters={}):
required_plugins = [<EOL>DefaultDefinitionBodyPlugin(),<EOL>make_implicit_api_plugin(),<EOL>GlobalsPlugin(),<EOL>make_policy_template_for_function_plugin(),<EOL>]<EOL>plugins = [] if not plugins else plugins<EOL>if not any(isinstance(plugin, ServerlessAppPlugin) for plugin in plugins):<EOL><INDENT>required_plugins.insert(<NUM_LIT:0>, ServerlessAppPlugin(parameters=parameters))<EOL><DEDENT>return SamPlugins(plugins + required_plugins)<EOL>
Creates & returns a plugins object with the given list of plugins installed. In addition to the given plugins,
we will also install a few "required" plugins that are necessary to provide complete support for SAM template spec.

:param plugins: list of samtranslator.plugins.BasePlugin plugins: List of plugins to install
:param parameters: Dictionary of parameter values
:return samtranslator.plugins.SamPlugins: Instance of `SamPlugins`