Implement take for EA mixins
State: closed

Also _concat_same_type and copy (both based on implementations in #22862)

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/0971615f4a78a99f7f1e8684b1e97f10dae57b41/pandas/core/arrays/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/datetimes.py`](https://github.com/jbrockmendel/pandas/blob/0971615f4a78a99f7f1e8684b1e97f10dae57b41/pandas/core/arrays/datetimes.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/period.py`](https://github.com/jbrockmendel/pandas/blob/0971615f4a78a99f7f1e8684b1e97f10dae57b41/pandas/core/arrays/period.py) !

 - There are no PEP8 issues in the file [`pandas/core/arrays/timedeltas.py`](https://github.com/jbrockmendel/pandas/blob/0971615f4a78a99f7f1e8684b1e97f10dae57b41/pandas/core/arrays/timedeltas.py) !

 - There are no PEP8 issues in the file [`pandas/tests/arrays/test_datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/0971615f4a78a99f7f1e8684b1e97f10dae57b41/pandas/tests/arrays/test_datetimelike.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=h1) Report
> Merging [#23159](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/913f71f74709e4d4814e50f21768b97ce2c6ef8d?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23159/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #23159      +/-   ##
==========================================
+ Coverage   92.19%    92.2%   +<.01%     
==========================================
  Files         169      169              
  Lines       50959    51008      +49     
==========================================
+ Hits        46980    47030      +50     
+ Misses       3979     3978       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.62% <100%> (+0.01%)` | :arrow_up: |
| #single | `42.27% <24.07%> (-0.03%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23159/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YXMucHk=) | `94.2% <100%> (+0.23%)` | :arrow_up: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/23159/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `95.07% <100%> (+0.17%)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/23159/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `95.7% <100%> (+0.13%)` | :arrow_up: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23159/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.48% <100%> (+0.1%)` | :arrow_up: |
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/23159/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `97.36% <0%> (+0.08%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=footer). Last update [913f71f...23d2724](https://codecov.io/gh/pandas-dev/pandas/pull/23159?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Closing this.  @TomAugspurger i think some of the “take” code/tests may be worth salvaging for the PeriodArray PR.
We could also leave this open, so you can rebase once the PeriodArray PR is merged?
> We could also leave this open, so you can rebase once the PeriodArray PR is merged?

I'd wait to re-open until it becomes actionable.
> but the take implementation missed fill_value that is a Period with non-matching freq

Is that fixed on Tom's PR, or is there an issue for it? Or is that already tested through existing tests?
Fixed locally. Haven't pushed yet.