@staticmethod<EOL><INDENT>def normalize_options(options):<DEDENT>
normalized_options = []<EOL>def _add(option, arg=None):<EOL><INDENT>normalized_options.append(option)<EOL>arg and normalized_options.append(arg)<EOL><DEDENT>for option, arg in options.viewitems():<EOL><INDENT>prefixed_option = Build.prefix_option(option)<EOL>if isinstance(arg, list) and arg:<EOL><INDENT>for a in arg:<EOL><INDENT>_add(prefixed_option, a)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>_add(prefixed_option, arg)<EOL><DEDENT><DEDENT>return normalized_options<EOL>
Turns a mapping of 'option: arg' to a list and prefix the options.
arg can be a list of arguments.

for example:

dict = {
    o1: a1,
    o2: ,
    o3: [a31, a32]
    o4: []
}

will be transformed to:

[
    prefix_option(o1), a1, prefix_option(o2),
    prefix_option(o3), a31, prefix_option(o3), a32
    prefix_option(o4)
]

note that empty arguments are omitted

Args:
    options (dict): A mapping between options and arguments

Returns:
    lst: A normalized version of 'options' as mentioned above