<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_instance(model, instance_id):
 """Get an instance by id. :param model: a string, model name in rio.models :param id: an integer, instance id. :return: None or a SQLAlchemy Model instance. """

    try:
        model = get_model(model)
    except ImportError:
        return None

    return model.query.get(instance_id)