def remove_from_groups(self, groups=None, all_groups=False, group_type=None):
if all_groups:<EOL><INDENT>if groups or group_type:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>glist = "<STR_LIT:all>"<EOL><DEDENT>else:<EOL><INDENT>if not groups:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>if not group_type:<EOL><INDENT>group_type = GroupTypes.product<EOL><DEDENT>elif group_type in GroupTypes.__members__:<EOL><INDENT>group_type = GroupTypes[group_type]<EOL><DEDENT>if group_type not in GroupTypes:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>glist = {group_type.name: [group for group in groups]}<EOL><DEDENT>return self.append(remove=glist)<EOL>
Remove user from some PLC groups, or all of them.
:param groups: list of group names the user should be removed from
:param all_groups: a boolean meaning remove from all (don't specify groups or group_type in this case)
:param group_type: the type of group (defaults to "product")
:return: the User, so you can do User(...).remove_from_groups(...).add_role(...)