  The Kepler Mission revolutionized exoplanet science and stellar astrophysics
by obtaining highly precise photometry of over 200,000 stars over 4 years. A
critical piece of information to exploit Kepler data is its selection function,
since all targets had to be selected from a sample of half a million stars on
the Kepler CCDs using limited information. Here we use Gaia DR2 to reconstruct
the Kepler selection function and explore possible biases with respect to
evolutionary state, stellar multiplicity, and kinematics. We find that the
Kepler target selection is nearly complete for stars brighter than $Kp < 14$
mag and was effective at selecting main-sequence stars, with the fraction of
observed stars decreasing from 95% to 60% between $14 < Kp < 16$ mag. We find
that the observed fraction for subgiant stars is only 10% lower, confirming
that a significant number of subgiants selected for observation were believed
to be main-sequence stars. Conversely we find a strong selection bias against
low-luminosity red giant stars ($R \approx 3-5 R_\odot$, $T_{eff} \approx
5500$K), dropping from 90% at $Kp = 14$ mag to below 30% at $Kp = 16$ mag,
confirming that the target selection was efficient at distinguishing dwarfs
from giants. We compare the Gaia Re-normalized Unit Weight Error (RUWE) values
of the observed and non-observed main sequence stars and find a difference in
elevated ($>$ 1.2) RUWE values at $\sim\,5\,\sigma$ significance, suggesting
that the Kepler target selection shows some bias against either close or wide
binaries. We furthermore use the Gaia proper motions to show that the Kepler
selection function was unbiased with respect to kinematics.
