def MockModel(self, model_name, *args, **kwargs):
    """Mock creating an instance of a model, and return the mock instance.

    Args:
      name: str, name of model, like 'Package'
      *args: list, optional arguments supplied to model instantiation
      **kwargs: dict, optional arguments supplied to model instantiation
    Returns:
      a new mocked instance of the model
    """
    test_class_models = self.GetTestClassModule().models

    if model_name % 'models_%s' not in self._set_mock:
      self.mox.StubOutWithMock(
          getattr(self.GetTestClassModule(), 'models'),
          model_name)
      # we need to put back any stubs which MockModelStaticBase placed
      for mock in self._set_mock:
        if mock.startswith('%s:' % model_name):
          self.stubs.Set(
              getattr(test_class_models, model_name),
              mock.split(':')[1],
              self._set_mock[mock])
      self._set_mock['models_%s' % model_name] = 1

    model = self.mox.CreateMockAnything()
    getattr(
        self.GetTestClassModule().models,
        model_name)(*args, **kwargs).AndReturn(model)
    return model
dataset/ETHPy150Open google/simian/src/tests/simian/mac/common/test.py/RequestHandlerTest.MockModel/swapped operands of `%`