<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_args(kwargs, defaults=None):
 """Apply command line arguments or show help. Use this in conjunction with the fire library to quickly build command line interfaces for your scripts. This function returns another function that must be called with the estimator (e.g. ``NeuralNet``) to apply the parsed command line arguments. If the --help option is found, show the estimator-specific help instead. Examples -------- Content of my_script.py: Parameters kwargs : dict The arguments as parsed by fire. defautls : dict or None (default=None) Optionally, change the default values to use custom defaults. Commandline arguments have precedence over defaults. Returns ------- print_help_and_exit : callable If --help is in the arguments, print help and exit. set_params : callable If --help is not in the options, apply command line arguments to the estimator and return it. """

    try:
        import fire
    except ImportError:
        raise ImportError("Using skorch cli helpers requires the fire library,"
                          " you can install it with pip: pip install fire.")
    try:
        import numpydoc.docscrape
    except ImportError:
        raise ImportError("Using skorch cli helpers requires the numpydoc library,"
                          " you can install it with pip: pip install numpydoc.")

    defaults = defaults or {}

    def print_help_and_exit(estimator):
        print_help(estimator, defaults=defaults)
        sys.exit()

    def set_params(estimator):
        estimator.set_params(**defaults)
        return estimator.set_params(**parse_net_kwargs(kwargs))

    if kwargs.get('help'):
        return print_help_and_exit
    return set_params