DOC: added type annotations and tests to check for multiple warning match
- [x] closes #47829 
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.


Hello @shourya5! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-08-03 05:49:49 UTC @github-actions pre-commit > @github-actions pre-commit

this was removed not long ago (the stable docs will only update after the 1.5 release, but the dev docs already don't show it) - can you run it locally?

Just
```
pre-commit run --files <file_1> <file_2> ... <file_n>
```
where you put any files you've modified after `--files`
 I am failing one test besides the pre-commit test You need to update the type annotation in _assert_caught_no_extra_warnings    too Does this look correct? the pre-commit action is changing 'Tuple' to tuple. Should I change it or leave it as is? Yeah that's fine, just git add, git commit, git push I think it should pass all tests now
