Unban user from channel. Target can be either a user or a host.
        See ban documentation for the range parameter.
966930
async def unban(self, channel, target, range=0):
        
        if target in self.users:
            host = self.users[target]['hostname']
        else:
            host = target

        host = self._format_host_range(host, range)
        mask = self._format_host_mask('*', '*', host)
        await self.rawmsg('MODE', channel, '-b', mask)
913803
def cmd(send, msg, args):
    
    c, nick = args['handler'].connection, args['nick']
    channel = args['target'] if args['target'] != 'private' else args['config']['core']['channel']
    if not msg:
        send("Nuke who?")
        return
    with args['handler'].data_lock:
        users = args['handler'].channels[channel].users()
    if msg in users:
        do_nuke(c, nick, msg, channel)
    elif msg == args['botnick']:
        send("Sorry, Self-Nuking is disabled pending aquisition of a Lead-Lined Fridge.")
    else:
        send("I'm sorry. Anonymous Nuking is not allowed")
458092
def _cleanup_channel(self, channel_id):
        
        with self.lock:
            if channel_id not in self._channels:
                return
            del self._channels[channel_id]
325481
def ban_user(self, room_id, user_id, reason=""):
        
        body = {
            "user_id": user_id,
            "reason": reason
        }
        return self._send("POST", "/rooms/" + room_id + "/ban", body)
12842
def unsubscribe(self, client):
        """"""
        if client in self.clients:
            self.clients.remove(client)
            log("Unsubscribed client {} from channel {}".format(client, self.name))
162230
def ban_member_from_group(self, group_jid, peer_jid):
        
        log.info("[+] Requesting ban of user {} from group {}".format(peer_jid, group_jid))
        return self._send_xmpp_element(group_adminship.BanMemberRequest(group_jid, peer_jid))
1173278
def unsubscribe_user_from_discussion(recID, uid):
    
    query = """DELETE FROM "cmtSUBSCRIPTION"
                     WHERE id_bibrec=%s AND id_user=%s"""
    params = (recID, uid)
    try:
        res = run_sql(query, params)
    except:
        return 0
    if res > 0:
        return 1
    return 0
1154173
def remove_user(self, name):
        
        user = self.get_user(name)
        users = self.get_users()
        users.remove(user)
1016400
def RemoveUser(self, user):
    
    self.logger.info('Removing user %s.', user)
    if self.remove:
      command = self.userdel_cmd.format(user=user)
      try:
        subprocess.check_call(command.split(' '))
      except subprocess.CalledProcessError as e:
        self.logger.warning('Could not remove user %s. %s.', user, str(e))
      else:
        self.logger.info('Removed user account %s.', user)
    self._RemoveAuthorizedKeys(user)
    self._UpdateSudoer(user, sudoer=False)
840984
async def kickban(self, channel, target, reason=None, range=0):
        
        await self.ban(channel, target, range)
        await self.kick(channel, target, reason)
940287
def remove_group_users(user_ids)
      raise 'Attempted to remove a user from a non-group channel!' unless group?

      user_ids = [user_ids] unless user_ids.is_a? Array
      user_ids.each do |user_id|
        API::Channel.remove_group_user(@bot.token, @id, user_id.resolve_id)
      end
      self
    end
411182
def DeleteUser(self, user_link, options=None):
        
        if options is None:
            options = {}

        path = base.GetPathFromLink(user_link)
        user_id = base.GetResourceIdOrFullNameFromLink(user_link)
        return self.DeleteResource(path,
                                   'users',
                                   user_id,
                                   None,
                                   options)
340581
def finish(request, socket, context):
    
    try:
        user = context["user"]
    except KeyError:
        return
    left = {"action": "leave", "name": user.name, "id": user.id}
    socket.broadcast_channel(left)
    user.delete()
325775
def add_user(self, user):
        """"""
        if not isinstance(user, User):
            user = User(user)
        if user.nick in self.members:
            _log.warning("Ignoring request to add user '%s' to channel '%s' "
                         "because that user is already in the member list.",
                         user, self.name)
            return
        self.members[user.nick] = user
        _log.debug("Added '%s' to channel '%s'", user, self.name)
102591
def unban_member_from_group(self, group_jid, peer_jid):
        
        log.info("[+] Requesting un-banning of user {} from the group {}".format(peer_jid, group_jid))
        return self._send_xmpp_element(group_adminship.UnbanRequest(group_jid, peer_jid))
959368
def unsubscribe(self, channel, *channels):
        
        conn = self._pool_or_conn
        return conn.execute_pubsub(b'UNSUBSCRIBE', channel, *channels)
952571
def _handle_unsubscribed(self, *args, chanId=None, **kwargs):
        
        log.debug("_handle_unsubscribed: %s - %s", chanId, kwargs)
        try:
            self.channels.pop(chanId)
        except KeyError:
            raise NotRegisteredError()

        try:
            self._heartbeats.pop(chanId)
        except KeyError:
            pass

        try:
            self._late_heartbeats.pop(chanId)
        except KeyError:
            pass