Repository: modin-project/modin

Issue:
BUG: `scripts/doc_checker.py` throws error when using pandas `cache_readonly` decorator
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: macOS 12.2.1
- **Modin version** (`modin.__version__`): 0.15.2
- **Python version**: 3.9.12
- **Code we can use to reproduce**:
```python
from pandas.util._decorators import cache_readonly

class A:

    def __init__(self):
        self._thing = 5

    @cache_readonly
    def thing(self):
        """Return the value of thing."""
        self._thing += 5
        return self._thing
```


### Describe the problem
If we have a class like the one above, our doc_checker script seems to throw an error when trying to complete its check. You can see more information in the logs below.

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->

<details>
<summary>Show stack trace</summary>

```
INFO:Note: NumExpr detected 10 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
Traceback (most recent call last):
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 631, in <module>
    if not validate(args.paths, args.add_ignore, not args.disable_numpydoc):
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 563, in validate
    if not numpydoc_validate(path):
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 444, in numpydoc_validate
    results = list(map(validate_object, to_validate))
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 369, in validate_object
    results = validate_modin_error(doc, results)
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 257, in validate_modin_error
    errors += check_spelling_words(doc)
  File "/Users/kvelayutham/Documents/modin/scripts/doc_checker.py", line 188, in check_spelling_words
    for idx, line in enumerate(inspect.getsourcelines(doc.code_obj)[0]):
  File "/Users/kvelayutham/opt/anaconda3/envs/modin/lib/python3.9/inspect.py", line 1006, in getsourcelines
    lines, lnum = findsource(object)
  File "/Users/kvelayutham/opt/anaconda3/envs/modin/lib/python3.9/inspect.py", line 817, in findsource
    file = getsourcefile(object)
  File "/Users/kvelayutham/opt/anaconda3/envs/modin/lib/python3.9/inspect.py", line 697, in getsourcefile
    filename = getfile(object)
  File "/Users/kvelayutham/opt/anaconda3/envs/modin/lib/python3.9/inspect.py", line 677, in getfile
    raise TypeError('module, class, method, function, traceback, frame, or '
TypeError: module, class, method, function, traceback, frame, or code object was expected, got CachedProperty
```

</details>


Discussion:
@vnlitvinov I'm assigning this to you since you knew what the problem was.

Resolving patch:
diff --git a/scripts/doc_checker.py b/scripts/doc_checker.py
--- a/scripts/doc_checker.py
+++ b/scripts/doc_checker.py
@@ -498,6 +498,7 @@ def pydocstyle_validate(
 def monkeypatching():
     """Monkeypatch not installed modules and decorators which change __doc__ attribute."""
     import ray
+    import pandas.util
     import modin.utils
     from unittest.mock import Mock
 
@@ -508,6 +509,7 @@ def monkeypatch(*args, **kwargs):
         return lambda cls_or_func: cls_or_func
 
     ray.remote = monkeypatch
+    pandas.util.cache_readonly = property
 
     # We are mocking packages we don't need for docs checking in order to avoid import errors
     sys.modules["pyarrow.gandiva"] = Mock()


Test patch: