def dict_to_opts(d):
    """ We assume that if a value is None then k is a flag and should be appended with no value"""
    opts = list()
    for k, v in d.items():
        opts.append(f"--{k}")
        if type(v) is list:
            for sub_v in v:
                opts.append(str(sub_v))
        elif v is None:
            pass  # k is a flag
        else:
            opts.append(str(v))
    return opts