<s> '''<STR_LIT>''' <EOL> from __future__ import unicode_literals <EOL> from pyinfra . api import operation <EOL> from . util . packaging import ensure_packages <EOL> @ operation <EOL> def packages ( state , host , packages = None , present = True , pkg_path = None ) : <EOL> '''<STR_LIT>''' <EOL> if present is True : <EOL> if not pkg_path : <EOL> host_os = host . fact . os or '<STR_LIT>' <EOL> pkg_path = '<STR_LIT>' . format ( <EOL> http = host_os . lower ( ) , <EOL> os = host_os , <EOL> version = host . fact . os_version , <EOL> arch = host . fact . arch <EOL> ) <EOL> return ensure_packages ( <EOL> packages , host . fact . pkg_packages , present , <EOL> install_command = '<STR_LIT>' . format ( pkg_path ) , <EOL> uninstall_command = '<STR_LIT>' <EOL> ) </s>
