code: def parse_args(kwargs, defaults=None):
      
      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
docs: 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:
  
      >>> def main(**kwargs):
      >>>     X, y = get_data()
      >>>     my_model = get_model()
      >>>     parsed = parse_args(kwargs)
      >>>     my_model = parsed(my_model)
      >>>     my_model.fit(X, y)
      >>>
      >>> if __name__ == '__main__':
      >>>     fire.Fire(main)
  
      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.