python mock library extension