def set_members(self, name, members, mode=None):
        commands = list()
        grpid = re.search(r'(\d+)', name).group()
        current_members = self.get_members(name)
        lacp_mode = self.get_lacp_mode(name)
        if mode and mode != lacp_mode:
            lacp_mode = mode
            self.set_lacp_mode(grpid, lacp_mode)

        # remove members from the current port-channel interface
        for member in set(current_members).difference(members):
            commands.append('interface %s' % member)
            commands.append('no channel-group %s' % grpid)

        # add new member interfaces to the port-channel interface
        for member in set(members).difference(current_members):
            commands.append('interface %s' % member)
            commands.append('channel-group %s mode %s' % (grpid, lacp_mode))

        return self.configure(commands) if commands else True
Check can user access
dataset/ETHPy150Open arista-eosplus/pyeapi/pyeapi/api/interfaces.py/PortchannelInterface.set_members--crossover with--dataset/ETHPy150Open nvbn/coviolations_web/projects/utils.py/ProjectAccessMixin.check_can_access