def _resolve_model(obj):
if isinstance(obj, six.string_types) and len(obj.split("<STR_LIT:.>")) == <NUM_LIT:2>:<EOL><INDENT>app_name, model_name = obj.split("<STR_LIT:.>")<EOL>resolved_model = apps.get_model(app_name, model_name)<EOL>if resolved_model is None:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ImproperlyConfigured(msg.format(app_name, model_name))<EOL><DEDENT>return resolved_model<EOL><DEDENT>elif inspect.isclass(obj) and issubclass(obj, Model):<EOL><INDENT>return obj<EOL><DEDENT>raise ValueError("<STR_LIT>".format(obj))<EOL>
Resolve supplied `obj` to a Django model class.

`obj` must be a Django model class itself, or a string
representation of one.  Useful in situations like GH #1225 where
Django may not have resolved a string-based reference to a model in
another model's foreign key definition.

String representations should have the format:
    'appname.ModelName'