from typing import Optional


def format_str(value: Optional[str], default_value: str = '?') -> str:
    """Format an output string. Simply puts single quotes around the value if
    it contains a space character. If the given argument is none the default
    value is returned

    Parameters
    ----------
    value: string
        Given input value. Expected to be of type string
    default_value: string
        Default value that is returned in case value is None

    Returns
    -------
    string
    """
    if value is None:
        return default_value
    if ' ' in str(value):
        return '\'' + str(value) + '\''
    else:
        return str(value)