The current PyMongo documentation includes an example using the copydb command which was deprecated in MongoDB 4.0 and removed in MongoDB 4.2.
This example should be removed or updated with pointers to a supported approach: https://pymongo.readthedocs.io/en/stable/examples/copydb.html
Recommendation in the 4.2 release notes:
As alternatives, users can use mongodump and mongorestore (with the mongorestore options --nsFrom and --nsTo) or write a script using the drivers.