def method_overwritten(instance, method):
            """Test if this method has been overridden."""
            return (getattr(
                instance, method).__func__ != getattr(base, method).__func__)
Test if this method has been overridden.
stackoverflow/venv/lib/python3.6/site-packages/pymongo/database.py