def METHOD_NAME(self, options):
    try:
        return User.objects.get(username=options["user"])
    except User.DoesNotExist:
        if options["create_user"]:
            self.stdout.write(self.style.MIGRATE_HEADING(
                f"Creating user: {options['user']}"))
            return User.objects.create_user(options["user"], "", options["user"])
        else:
            raise CommandError("There is no user called {user!r}. Use the --create-user option to create it.".format(user=options["user"]))