DOC: Improve the docstring of pd.Index.contains
- [x] closes #20211 
- [ ] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

This PR updates the previous PR #20211, based on reviews and docstring standards. It was worked upon with the help of @datapythonista

Kindly review, I will make all the necessary changes to it.
Hello @Tanya-Jain! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/indexes/base.py`](https://github.com/Tanya-Jain/pandas/blob/a75fc7c48702a3327b4e3eddf3a9bcfd0993a63b/pandas/core/indexes/base.py) !

 is this different from #23100? I review that, I'd probably keep the work in there. Any problem with git to open a new PR for the same changes? Let me know if you need help.

If you prefer to continue on this one, please check the review in #23100. #23100 contained an additional commit for merging commits from the pandas-dev/pandas master. 
To have only the commit for the file changes made in base.py, I closed #23100 and opened #23107
I believe it would be easier to edit and merge this PR #23107 over #23100  Having additional commits for merging master into your branch is expected, and not a problem at all. And same for having additional commits for the improvements based on the code reviews. As far as the diff in the PR shows only your changes, all is good, the commits will be squashed into one when the PR is merged, so don't worry about that.

The other PR has the advantage that has the first review on it, but if you prefer to continue working on this one, that's also all right. Just close the one that you won't be working on, and update the other whenever you have time.  Thanks for clarifying this out! Since I am now working on #23100 I am closing this PR and will continue updating the original one, that is, #23100.