def handle_noargs(self, **options):
        call_command('syncdb', database=self.DB, interactive=False,
                     migrate_all=True)

        # reset data in needed models
        for reset_model in self.reset_models:
            model = get_model(*reset_model.split('.'))
            model.objects.using(self.DB).delete()

        ignore_models = []
        ignore_apps = []

        self.verbosity = int(options.get('verbosity', 1))

        for label in self.ignore_models:
            to_ignore = label.split('.')

            if len(to_ignore) == 1:
                ignore_apps.append(label)
            else:
                ignore_models.append(to_ignore)

        only_latest = [x.split('.') for x in self.only_latest]

        app_list = get_apps()
        untracked_m2m = []

        all_models = get_models()

        for app in app_list:
            for model in get_models(app):
                app_label = model._meta.app_label
                module_name = model._meta.module_name

                name_pair = [app_label, module_name]

                if not (app_label in ignore_apps or name_pair in ignore_models):

                    # m2m fields without through table won't be tracked here, so we
                    # need to collect it and handle it later
                    for field in model._meta.many_to_many:
                        try:
                            through_model = getattr(model, field.name).through
                            if through_model not in all_models:
                                untracked_m2m.append(through_model)
                        # ReverseGenericRelatedObjectsDescriptor have no
                        # through attribute, ignore
                        except __HOLE__,e :
                            pass
                    self.sync_model(model, name_pair in only_latest)

        for model in set(untracked_m2m):
            self.sync_model(model)

        users = UserProfile.objects.using(self.DB).filter(public_profile=False).select_related()
        followobjs = Follow.objects.using(self.DB).filter(user__in=users)
        followobjs.delete()
dataset/ETHPy150Open ofri/Open-Knesset/simple/management/commands/sync_dev.py/Command.handle_noargs