What exactly does scipy.stats.ttest_ind test? From the description: "This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values."
Taken literally, this seems to be saying that we're testing $H_0: \bar{x} = \bar{y}$, but since we know both $\bar{x}$ and $\bar{y}$, it doesn't make sense.
Therefore I'm thinking what they really mean is that the Null Hypothesis is that both samples come from the same distribution, or that the mean of the respective populations is the same. Is that correct? 
 A: The quoted sentence:

This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values.

is a reference to the population means not the sample means; it is otherwise misleading and should certainly be clearer but they do t least say "(expected) values", which can only be a reference to population means from which the samples were drawn. 
However, you were understandably misled by it and if a student wrote that I would certainly mark it wrong (since it does seem to suggest that it is the sample means being tested for equality, just as it did to you).

Therefore I'm thinking what they really mean is that the Null Hypothesis is that both samples come from the same distribution. Is that correct? 

Usually the hypothesis that people wish to test with this hypothesis test is $H_0: \mu_X=\mu_Y$, but when accompanied by the assumptions of the usual equal variance two sample t-test, that's the same as saying they come from the same distribution. The assumption of equal variances is the default for the scipy implementation of this test, but set otherwise it doesn't assume equal variances and then the null doesn't imply that distributions are the same. 
That's true of many of the commonly used hypothesis tests -- that the null (when combined with the assumptions) amounts to assuming equal distributions. 
A: A bit more exact, see the docs you quoted

equal_var : bool, optional
If True (default), perform a standard independent 2 sample test that
assumes equal population variances [R263]. If False, perform Welch’s
t-test, which does not assume equal population variance [R264].

So it either performs student's or Welch's t-test for independent samples. BTW, Welch's test is recommended as of When conducting a t-test why would one prefer to assume (or test for) equal variances rather than always use a Welch approximation of the df?.
