import configparser


def has_rc_key(rc_file, key):
    """Checks if a given key exists in
    a given rc_file.

    Parameters:
        rc_file (str): Specified rc file.
        key (str): The key.

    Returns:
        bool: Does the key exist.

    Raises:
        NoSectionError: Kaleidoscope section does
                        not exist.
    """
    config = configparser.ConfigParser()
    config.read(rc_file)
    if config.has_section('kaleidoscope'):
        opts = config.options('kaleidoscope')
        return key in opts
    else:
        raise configparser.NoSectionError('kaleidoscope')