def setup_parser(parser):
    """
    Setup argument parser.
    :param parser: argument parser
    :return: configured parser
    """
    parser.add_argument('--master', required=False, default="local[*]",
                        help="Spark master URL defaults to 'local'.")
    parser.add_argument('--driver-cores', required=False, type=int, default="3",
                        help="Number of cores.")
    parser.add_argument('--driver-memory', required=False, default="8g",
                        help="Memory limit of Spark driver.")
    parser.add_argument('--executor-cores', required=False, type=int, default="4",
                        help="Number of cores for each executor.")
    parser.add_argument('--executor-memory', required=False, default="8g",
                        help="Memory limit of Spark executor.")
    parser.add_argument('--jars', required=False, default="",
                        help="Additional JARs to be included in driver and executors(comma-seperated).")
    return parser