import click


def kernel_options(f):
    """Create common options for compute kernel functions"""
    f = click.option('--kernel_parameter', '-kp', type=float,
                     help='Parameter used in the kernel function.',
                     default=None)(f)
    f = click.option('--kernel', '-k',
                     type=click.Choice(['linear', 'polynomial', 'cosine'], case_sensitive=False),
                     help='Kernel function for converting design matrix to kernel matrix.',
                     show_default=True, default='linear')(f)
    return f