def _upload_instances(self, path):
        instances_count = 0
        dirs, not_in_use = default_storage.listdir(path)

        for instance_dir in dirs:
            instance_dir_path = os.path.join(path, instance_dir)
            i_dirs, files = default_storage.listdir(instance_dir_path)
            xml_file = None

            if files in 'submission.xml':
                file_obj = default_storage.open(
                    os.path.join(instance_dir_path, 'submission.xml'))
                xml_file = file_obj

            if xml_file:
                try:
                    self._upload_instance(xml_file, instance_dir_path, files)
                except ExpatError:
                    continue
                except Exception:
                    pass
                else:
                    instances_count += 1

        return instances_count
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/utils/briefcase_client.py/BriefcaseClient._upload_instances/swapped operands of `in`