def _format_options(virtualenv_ops):
    """Formats the a dictionary of options to be passed as flags to virtualenv."""
    options = []
    for option_name, option_value in virtualenv_ops.items():
        if option_value:
            option = option_name.replace('_', '-')
            option = f'--{option}'
            if not isinstance(option_value, bool):
                option_value = option_value.replace('=', '')
                option += f'={option_value}'
            options.append(option)
    return options
