def update(self, res_id=None, attributes=None):

        monitor = attributes.get('monitor')
        if monitor is False:
            self.comply(monitor=False)
            return "%s unmonitored" % res_id

        password = attributes.get("password")
        login_group = attributes.get("login_group")
        groups = self._sanitize_groups(attributes.get('groups', []))
        homedir = attributes.get('homedir')
        move_home = attributes.get('move_home')
        comment = attributes.get('full_name')
        uid = "%s" % attributes.get('uid')
        gid = "%s" % attributes.get('gid')
        shell = attributes.get('shell')

        if self.module.user_exists(res_id):
            self.module.user_mod(res_id, password, login_group, groups,
                                 homedir, move_home, comment, uid, gid, shell)
            state = {
                'present': True,
                'password': self.module.get_pw(res_id),
                'groups': groups.append(login_group),
                'homedir': homedir,
                'gecos': comment,
                'uid': uid,
                'gid': gid,
                'shell': shell
            }

            self.save_state(res_id, state, monitor=monitor)

            self.response = self.module.get_user_infos(res_id)
        else:
            self.response = self.create(res_id=res_id, attributes=attributes)

        return self.read(res_id)
dataset/ETHPy150Open comodit/synapse-agent/synapse/resources/users-plugin/users.py/UsersController.update/original