def is_vagrant_plugin_installed(plugin, use_sudo=False):
cmd = '<STR_LIT>'<EOL>if use_sudo:<EOL><INDENT>results = sudo(cmd)<EOL><DEDENT>else:<EOL><INDENT>results = run(cmd)<EOL><DEDENT>installed_plugins = []<EOL>for line in results.split('<STR_LIT:\n>'):<EOL><INDENT>if line:<EOL><INDENT>plugin = re.search('<STR_LIT>', line)<EOL>installed_plugins.append({'<STR_LIT:name>': plugin.group(<NUM_LIT:1>),<EOL>'<STR_LIT:version>': plugin.group(<NUM_LIT:2>)})<EOL>return installed_plugins<EOL><DEDENT><DEDENT>
checks if vagrant plugin is installed