REF: "bare_pytest_raises" to use the ast module
- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

---

There is also a performance boost:

```
In [1]: import os                                                                                             

In [2]: from scripts.validate_unwanted_patterns import bare_pytest_raises, main                               

In [3]: SOURCE_PATH = "pandas/tests/"                                                                         

In [4]: %timeit main(function=bare_pytest_raises, source_path=SOURCE_PATH, output_format="{source_path}:{line_number}:{msg}.") 

12.6 s ± 76.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # Master
4.33 s ± 27 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # PR
```
@MomIsBestFriend tangential to this bc I was thinking about an ast-based check: one anti-pattern we have is using private functions across modules (e.g. core.indexing._maybe_numeric_slice used in io.formats.style).  How hard would it be to track those down? > @MomIsBestFriend tangential to this bc I was thinking about an ast-based check: one anti-pattern we have is using private functions across modules (e.g. core.indexing._maybe_numeric_slice used in io.formats.style). How hard would it be to track those down?

@jbrockmendel If you meant tracking every use of private function that is not defined is the exact same file, I spouse is doable. One problem I think is going to be with ```.pyx``` files, but I can start small and add that feature later on. Dont go out of your way on my account; focus on what you're most interested in.  We appreciate the effort your putting in. > Dont go out of your way on my account; focus on what you're most interested in. We appreciate the effort your putting in.

I want to make progress, I am not really familiar with the code base, I really like when you give me issues you'd like to see me work on, because this is how I make progress.
I will never make progress if I don't do things I am not 100% sure on them.

---



> > @MomIsBestFriend tangential to this bc I was thinking about an ast-based check: one anti-pattern we have is using private functions across modules (e.g. core.indexing._maybe_numeric_slice used in io.formats.style). How hard would it be to track those down?
> 
> @jbrockmendel If you meant tracking every use of private function that is not defined is the exact same file, I spouse is doable. One problem I think is going to be with `.pyx` files, but I can start small and add that feature later on.

@jbrockmendel Can you confirm I got it correctly? thanks @MomIsBestFriend 