docs: def _parse_and_validate_args(args):
      """
      Parse and validate arguments. During validation, it is checked whether the given
      files/directories exist, while also converting relative paths to absolute ones.
  
      Parameters
      ----------
      args (List): Command-line arguments
      """
      class ExtendAction(argparse.Action):
          def __call__(self, parser, namespace, values, option_string=None):
              if getattr(namespace, self.dest, None) is None:
                  setattr(namespace, self.dest, [])
              getattr(namespace, self.dest).extend(values)
  
      parser = argparse.ArgumentParser(description='Submitting a lane to spark.')
      parser.add_argument('-y', '--yaml', type=str, required=True,
                          help='Path to the yaml definition file.')
      parser.add_argument('-p', '--package', type=str, required=True,
                          help='Path to the python package containing your tasks.')
      parser.add_argument('-r', '--requirements', type=str, required=False,
                          help='Path to a `requirements.txt` specifying any additional dependencies '
                               'of your tasks.')
      parser.add_argument('-e', '--extra-data', nargs='*', required=False, action=ExtendAction,
                          help='Path to any additional files or directories that should be packaged '
                               'and sent to Spark.')
      parser.add_argument('-m', '--main', type=str, required=False,
                          help='Path to a custom main python file')
      parser.add_argument('-d', '--spark-home', type=str, required=False,
                          help='Custom path to the directory containing your Spark installation. If '
                               'none is given, sparklanes will try to use the `spark-submit` command '
                               'from your PATH')
      parser.add_argument('-s', '--spark-args', nargs='*', required=False,
                          help='Any additional arguments that should be sent to Spark via '
                               'spark-submit. '
                               '(e.g. `--spark-args executor-memory=20G total-executor-cores=100`)')
      parser.add_argument('--silent', help='If set, no output will be sent to console',
                          action='store_true')
      args = parser.parse_args(args).__dict__
  
      # Check/fix files/dirs
      for param in ('package', 'spark_home'):
          args[param] = __validate_and_fix_path(args[param], check_dir=True)
      for param in ('yaml', 'requirements', 'main'):
          args[param] = __validate_and_fix_path(args[param], check_file=True)
      if args['extra_data']:
          for i in range(len(args['extra_data'])):
              args['extra_data'][i] = __validate_and_fix_path(args['extra_data'][i],
                                                              check_file=True, check_dir=True)
  
      # Check if python package
      if not os.path.isfile(os.path.join(args['package'], '__init__.py')):
          raise SystemExit('Could not confirm `%s` is a python package. Make sure it contains an '
                           '`__init__.py`.')
  
      # Check/fix spark args
      if args['spark_args']:
          args['spark_args'] = __validate_and_fix_spark_args(args['spark_args'])
  
      return args