def handle(self, *args, **options):
        if len(args) == 0:
            raise CommandError("Usage: python manage.py resync_location_user_data %s" % self.args)

        domain = args[0]
        ids = (
            CommCareUser.ids_by_domain(domain, is_active=True) +
            CommCareUser.ids_by_domain(domain, is_active=False)
        )
        for doc in iter_docs(CommCareUser.get_db(), ids):
            user = CommCareUser.wrap(doc)
            try:
                self.process_user(user)
            except Exception as e:
                print "Error processing user %s: %s" % (user._id, e)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/users/management/commands/resync_location_user_data.py/Command.handle/original