def cmdline_args_to_dict(args):
    """
    Convenience function converting command line arguments obtained from add_coordinate_search_args
    to a dictionary that can be passed as-is to ptq_coordinate_search.

    Example:
        # Assume pre-existing parser
        add_coordinate_search_args(parser)
        args = parser.parse_args()

        # Assume quantizer, dummy_input, eval_fn, and test_fn have been set up
        lapq_args_dict = cmdline_args_to_dict(args)
        ptq_coordinate_search(quantizer, dummy_input, eval_fn, test_fn=test_fn, **lapq_args_dict)
    """
    prefix = 'lapq_'
    len_prefix = len(prefix)
    lapq_args = {k[len_prefix:]: v for k, v in vars(args).items() if k.startswith(prefix)}
    lapq_args.pop('eval_size')
    lapq_args.pop('eval_memoize_dataloader')
    return lapq_args