def unwrap_args(args_ns):
    """
    "Unwrap" the given `argparse` namespace into a dict.

    :type args_ns: argparse.Namespace
    :rtype: dict
    """
    args_dict = {}
    for key, value in vars(args_ns).items():
        if isinstance(value, list):
            value = value[0]
        args_dict[key] = value
    return args_dict