code: def _find_module_ptr(self, module_ptr):
          
          ptr = cast(module_ptr, c_void_p).value
          for module in self._modules:
              if cast(module._ptr, c_void_p).value == ptr:
                  return module
          return None
docs: Find the ModuleRef corresponding to the given pointer.