Follow-up to #17419
State: closed

This moves a few other 3ish line functions from tslib to tslibs.timezones.

One non-trivial function `_get_zone` is cut/pasted over.

Replaces imports in inference.pyx and period.pyx with imports from tslibs.timezones.  In the inference, case, replaces the import of the python version `get_timezone` with the cython version `_get_zone`

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=h1) Report
> Merging [#17497](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/46856c3936540a47df719d10a7699eb35673e4a4?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #17497      +/-   ##
==========================================
- Coverage   91.15%   91.13%   -0.02%     
==========================================
  Files         163      163              
  Lines       49534    49534              
==========================================
- Hits        45153    45144       -9     
- Misses       4381     4390       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.92% <ø> (ø)` | :arrow_up: |
| #single | `40.22% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?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/17497?src=pr&el=footer). Last update [46856c3...6958c68](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=h1) Report
> Merging [#17497](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/46856c3936540a47df719d10a7699eb35673e4a4?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #17497      +/-   ##
==========================================
- Coverage   91.15%   91.13%   -0.02%     
==========================================
  Files         163      163              
  Lines       49534    49534              
==========================================
- Hits        45153    45144       -9     
- Misses       4381     4390       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.92% <ø> (ø)` | :arrow_up: |
| #single | `40.22% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?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/17497?src=pr&el=footer). Last update [46856c3...6958c68](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=h1) Report
> Merging [#17497](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/46856c3936540a47df719d10a7699eb35673e4a4?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #17497      +/-   ##
==========================================
- Coverage   91.15%   91.13%   -0.02%     
==========================================
  Files         163      163              
  Lines       49534    49534              
==========================================
- Hits        45153    45144       -9     
- Misses       4381     4390       +9
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.92% <ø> (ø)` | :arrow_up: |
| #single | `40.22% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17497?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/17497?src=pr&el=footer). Last update [46856c3...6958c68](https://codecov.io/gh/pandas-dev/pandas/pull/17497?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Looks pretty benign:

```
asv continuous -E virtualenv -f 1.1 master HEAD -b tz -b timezone -b tzone -b utc -b date
       before           after         ratio
     [46856c39]       [6958c680]
+           290ms            407ms     1.40  gil.nogil_read_csv.time_read_csv_datetime
-           16.3s            14.2s     0.87  gil.nogil_datetime_fields.time_datetime_to_period
-           48.3s            41.3s     0.86  gil.nogil_datetime_fields.time_period_to_datetime
-           37.6s            31.6s     0.84  gil.nogil_datetime_fields.time_datetime_field_normalize
-           20.2s            16.3s     0.81  gil.nogil_datetime_fields.time_datetime_field_year
SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
```
thanks.

before moving on, can you rename all ``_*`` functions in the new modules (``tslis/*``) to remove the _. These modules themselves are private, not need to have a double layer of indirection. 

e.g. ``_get_zone`` -> ``get_zone`` (actually rename this back to get_timezone), not sure why changed originally.
Will do.

> e.g. `_get_zone` -> `get_zone` (actually rename this back to `get_timezone`), not sure why changed originally.

Maybe this predates the `cpdef` syntax?  `get_timezone` is currently a regular `def` function that just passes through to the `cdef`'d `_get_zone`.

Speaking of privateness, I've been leaving behind in `tslib` unused imports `from tslibs.foo import _bar  # noqa` so as to leave the namespace unchanged for backward compat.  Are these unnecessary?