def user(self, login, password, firstName=None,
             lastName=None, email=None, admin=False, folders=None):

        if self.module.params['state'] == 'present':

            # Fail if we don't have firstName, lastName and email
            for var_name, var in [('firstName', firstName),
                                  ('lastName', lastName), ('email', email)]:
                if var is None:
                    self.fail("%s must be set if state "
                              "is 'present'" % var_name)

            try:
                ret = self.authenticate(username=login,
                                        password=password)

                me = self.get("user/me")

                # List of fields that can actually be updated
                updateable = ['firstName', 'lastName', 'email', 'admin']
                passed_in = [firstName, lastName, email, admin]

                # If there is actually an update to be made
                if set([(k, v) for k, v in me.items() if k in updateable]) ^ \
                   set(zip(updateable, passed_in)):

                    self.put(me['_id'] % "user/%s",
                             parameters={
                                 "login": login,
                                 "firstName": firstName,
                                 "lastName": lastName,
                                 "password": password,
                                 "email": email,
                                 "admin": "true" if admin else "false"})
                    self.changed = True
            # User does not exist (with this login info)
            except AuthenticationError:
                ret = self.post("user", parameters={
                    "login": login,
                    "firstName": firstName,
                    "lastName": lastName,
                    "password": password,
                    "email": email,
                    "admin": "true" if admin else "false"
                })
                self.changed = True

            if folders is not None:
                _id = self.get("resource/lookup",
                               {"path": "/user/{}".format(login)})["_id"]
                self._process_folders(folders, _id, "user")

        elif self.module.params['state'] == 'absent':
            ret = []
            try:
                ret = self.authenticate(username=login,
                                        password=password)

                me = self.get("user/me")

                self.delete('user/%s' % me['_id'])
                self.changed = True
            # User does not exist (with this login info)
            except AuthenticationError:
                ret = []

        return ret
dataset/ETHPy150Open girder/girder/clients/ansible/girder.py/GirderClientModule.user/swapped operands of `%`