/ return a list of everyone you have blocked privately
14577
function ({ live }, cb) {
      var stream = PullPushAbort()

      var result = {}
      var sync = null

      pull(
        ssb.query.read({
          query: [{ $filter: {
            value: {
              author: ssb.id,
              content: {
                type: 'contact'
              }
            }
          } }],
          private: true,
          live
        }),
        stream.aborter,
        pull.drain((msg) => {
          if (msg.sync) {
            sync = true
            if (live) {
              stream.push(result)
            }
            return
          }

          var isPrivate = msg.value && msg.value.meta && msg.value.meta.private
          var content = msg.value.content

          // if a non-private state has been set since last private, revert to null
          // patchwork will always try to set a new ignore status after the public if it differs
          // this is just to handle the case where the private state was set by another client
          // (which will override ignore due to the way ssb-friends handles private blocks)

          var value = isPrivate ? !!content.blocking : null

          if (sync) {
            stream.push({ [content.contact]: value })
          } else {
            result[content.contact] = value
          }
        }, (err) => {
          if (err) return stream.end(err)
          if (stream.ended || sync) return

          if (!live) {
            stream.push(result)
          }

          stream.end()
        })
      )

      return stream
    }
628717
def _blockedPairs(self, blocks):
        

        block, blocks = core.peek(blocks)
        self._checkBlock(block)

        product = itertools.product

        pairs = (product(base, target) for base, target in blocks)

        return pairs
1244174
function make_private() {
  return {
    stats: {
      start: Date.now(),
      act: {
        calls: 0,
        done: 0,
        fails: 0,
        cache: 0
      },
      actmap: {}
    },
    actdef: {},
    transport: {
      register: []
    },
    plugins: {},
    ignore_plugins: {}
  }
}
586096
def deny(self, ip):
        
        self.blacklist.append(ip)
        self.whitelist.clear()
749267
def get_team_push_restrictions(self):
        
        return github.PaginatedList.PaginatedList(
            github.Team.Team,
            self._requester,
            self.protection_url + "/restrictions/teams",
            None
        )
799158
def block_before(self):
        
        # To avoid unnecessary database queries, ignore the IP check for
        # requests for static files
        if request.path.startswith(url_for('static', filename='')):
            return

        # Some static files might be served from the root path (e.g.
        # favicon.ico, robots.txt, etc.). Ignore the IP check for most
        # common extensions of those files.
        ignored_extensions = ('ico', 'png', 'txt', 'xml')
        if request.path.rsplit('.', 1)[-1] in ignored_extensions:
            return

        ips = request.headers.getlist('X-Forwarded-For')
        if not ips:
            return

        # If the X-Forwarded-For header contains multiple comma-separated
        # IP addresses, we're only interested in the last one.
        ip = ips[0].strip()
        if ip[-1] == ',':
            ip = ip[:-1]
        ip = ip.rsplit(',', 1)[-1].strip()

        if self.matches_ip(ip):
            if self.logger is not None:
                self.logger.info("IPBlock: matched {}, {}".format(ip, self.block_msg))
            if self.blocking_enabled:
                return 'IP Blocked', 200
994790
def blockUser(self, user_id):
        
        data = {"fbid": user_id}
        r = self._post(self.req_url.BLOCK_USER, data)
        return r.ok
201932
def getUncleByBlock(self, block_identifier, uncle_index):
        
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getUncleByBlockNumberAndIndex',
            if_hash='eth_getUncleByBlockHashAndIndex',
            if_number='eth_getUncleByBlockNumberAndIndex',
        )
        result = self.web3.manager.request_blocking(
            method,
            [block_identifier, uncle_index],
        )
        if result is None:
            raise BlockNotFound(
                f"Uncle at index: {uncle_index} of block with id: {block_identifier} not found."
            )
        return result
720030
def set_blocked(self, name):
        
        self.unregister(name=name)
        self._name2plugin[name] = None
1068402
def block_view(request):
    
    blocked_ip_list = get_blocked_ips()
    blocked_username_list = get_blocked_usernames()

    context = {'blocked_ip_list': blocked_ip_list,
               'blocked_username_list': blocked_username_list}
    return render(request, 'defender/admin/blocks.html', context)
137505
def get_delete_security_group_commands(self, sg_id):
        """"""
        cmds = []
        cmds.append("no ip access-list %s" %
                    self._acl_name(sg_id, n_const.INGRESS_DIRECTION))
        cmds.append("no ip access-list %s" %
                    self._acl_name(sg_id, n_const.EGRESS_DIRECTION))
        return cmds
260040
def get_private_channel(user)
            @users.keys
                .map { |channel| @channels[channel] }
                .compact
                .find { |channel| channel.private }
            # the server doesn't send PMs you don't have access to
        end
58734
function(messageContent) {
                /**
                 * + BlockedUser              {object}
                 *    - id                    {long}
                 *    - firstName             {string}
                 *    - lastName              {string}
                 *    - nickName              {string}
                 */

                var blockedUser = {
                    blockId: messageContent.id,
                    firstName: messageContent.firstName,
                    lastName: messageContent.lastName,
                    nickName: messageContent.nickName
                };

                return blockedUser;
            }
220084
function checknick(next) {
        if (args.nick) {
          userent.list$({ nick: args.nick }, function(err, users) {
            if (err) return done(err, { ok: false, user: user })
            for (var i = 0; i < users.length; i++) {
              var each = users[i]
              if (each.id !== user.id) {
                return done(null, {
                  ok: false,
                  why: 'nick-exists',
                  nick: args.nick
                })
              }
            }

            next()
          })
          return
        }
        next()
      }
1028823
function(callback) {
        /**
         * Callback for QB.chat.privacylist.getNames().
         * @param {Object} error - The error object
         * @param {Object} response - The privacy list object (var names = response.names;)
         * @callback getNamesPrivacylistCallback
         * */

        var self = this,
            iq,
            stanzaParams = {
                'type': 'get',
                'from': self.helpers.getUserCurrentJid(),
                'id': chatUtils.getUniqueId('getNames')
            };

        if(Utils.getEnv().browser){
            iq = $iq(stanzaParams).c('query', {
                xmlns: Strophe.NS.PRIVACY_LIST
            });

            self.connection.sendIQ(iq, function(stanzaResult) {
                var allNames = [], namesList = {},
                    defaultList = stanzaResult.getElementsByTagName('default'),
                    activeList = stanzaResult.getElementsByTagName('active'),
                    allLists = stanzaResult.getElementsByTagName('list');

                var defaultName = defaultList && defaultList.length > 0 ? defaultList[0].getAttribute('name') : null;
                var activeName = activeList && activeList.length > 0 ? activeList[0].getAttribute('name') : null;

                for (var i = 0, len = allLists.length; i < len; i++) {
                    allNames.push(allLists[i].getAttribute('name'));
                }

                namesList = {
                    'default': defaultName,
                    'active': activeName,
                    'names': allNames
                };

                callback(null, namesList);
            }, function(stanzaError){
                if(stanzaError){
                    var errorObject = chatUtils.getErrorFromXMLNode(stanzaError);
                    callback(errorObject, null);
                }else{
                    callback(Utils.getError(408), null);
                }
            });
        } else {
            iq = new XMPP.Stanza('iq', stanzaParams);

            iq.c('query', {
                xmlns: chatUtils.MARKERS.PRIVACY
            });

            self.nodeStanzasCallbacks[iq.attrs.id] = function(stanza){
                if(stanza.attrs.type !== 'error'){

                    var allNames = [], namesList = {},
                        query = stanza.getChild('query'),
                        defaultList = query.getChild('default'),
                        activeList = query.getChild('active'),
                        allLists = query.getChildElements('list');

                    var defaultName = defaultList ? defaultList.attrs.name : null,
                        activeName = activeList ? activeList.attrs.name : null;

                    for (var i = 0, len = allLists.length; i < len; i++) {
                        allNames.push(allLists[i].attrs.name);
                    }

                    namesList = {
                        'default': defaultName,
                        'active': activeName,
                        'names': allNames
                    };

                    callback(null, namesList);
                } else {
                    callback(Utils.getError(408));
                }
            };

            self.Client.send(iq);
        }
    }
579469
function whitelist_remove($params, $post_data) {
		// version 2 only.
		$request_url = "{$this->url_base}/track/site";
		$response = $this->curl($request_url, $post_data, "DELETE", "tracking_whitelist");
		return $response;
	}
520397
def list(self):
        
        params = {'user': self.user_id}
        response = self.session.get(self.url, params=params)
        blocks = response.data['blocks']
        return [Block(self, **block) for block in blocks]