If a callable may be passed, that should be documented. Also, the type should be

    affinity : string, array-like or callable

in one line.

(Note the space before the colon, which the rest of this module is missing.)

The text below can then summarize the meanings of the options. In fact, `sklearn.metrics.pairwise_kernels` supports quite a few more kernels, so you might want to refer there for the complete list and only explicitly mention `"rbf"` from the string options.