blocks a friendship
552676
def block(user)
      friendship = find_any_friendship_with(user)
      return false if friendship.nil? || !friendship.can_block?(self)
      friendship.update_attribute(:blocker, self)
    end
1210842
def setblocking(self, blocking):
        ''''''
        for sock in self.socket():
            sock.setblocking(blocking)
            self._blocking = blocking
293874
def invite(user)
      return false if user == self || find_any_friendship_with(user)
      Amistad.friendship_class.new{ |f| f.friendable = self ; f.friend = user }.save
    end
675208
function prohibits(p) {
	var s = '';
	var m = toArray(p.mixin);
	for (var i in m) {
		s += '* Prohibits mixin '+m[i].name+'\n';
	}
	var f = toArray(p.filter);
	for (var i in f) {
		s += '* Prohibits filter '+f[i].name+'\n';
	}
	return s;
}
717589
def barrier(events, sid, kind='neighbour'):
    
    events[sid].set()
    # only wait for the neighbours
    if kind=='neighbour':
        if sid > 0:
            logging.debug("{0} is waiting for {1}".format(sid, sid - 1))
            events[sid - 1].wait()
        if sid < len(bkg_events) - 1:
            logging.debug("{0} is waiting for {1}".format(sid, sid + 1))
            events[sid + 1].wait()
    # wait for all
    else:
        [e.wait() for e in events]
    return
553248
def approve(user)
      friendship = find_any_friendship_with(user)
      return false if friendship.nil? || invited?(user)
      friendship.update_attribute(:pending, false)
    end
230924
def removeFriend(self, user):
        
        user = self.user(user)
        url = self.FRIENDUPDATE if user.friend else self.REMOVEINVITE
        url = url.format(userId=user.id)
        return self.query(url, self._session.delete)
971629
def blocked=(val)
      if ! [ true, false ].include?(val)
        raise ArgumentError, "value must be a boolean"
      end
      @o_dev[I_DEVICE]['Blocked'] = val
    end
1297805
def block(bdaddr):
    '''
    
    '''
    if not salt.utils.validate.net.mac(bdaddr):
        raise CommandExecutionError(
            'Invalid BD address passed to bluetooth.block'
        )

    cmd = 'hciconfig {0} block'.format(bdaddr)
    __salt__['cmd.run'](cmd).splitlines()
925947
def block_events(self):
        
        self._widget.blockSignals(True)
        self._widget.setUpdatesEnabled(False)
699845
def removeFriend(user)
      method = 'removeFriend'
      type = Boolean
      args = {:user=>user}
      return_object type,method,args,true
    end
1369428
def _blockedPairs(self, blocks):
        

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

        combinations = itertools.combinations

        pairs = (combinations(sorted(block), 2) for block in blocks)

        return pairs
693343
protected void onBlock(ConnectionFilter filter, String remoteAddr,
			int connections, int requests, int bytes) {
		filter.disconnect();
		filter.onDisconnect();
	}
263863
def invite(user)
      return false if friendshiped_with?(user) or user == self or blocked?(user)
      pending_friend_ids << user.id
      user.pending_inverse_friend_ids << self.id
      self.save && user.save
    end
584070
def on_connection_blocked(self, method_frame):
        
        LOGGER.warning('Connection blocked: %s', method_frame)
        self.state = self.STATE_BLOCKED
        if self.on_unavailable:
            self.on_unavailable(self)
537458
def deny(ip,
        port=None,
        proto='tcp',
        direction='in',
        port_origin='d',
        ip_origin='d',
        ttl=None,
        comment=''):
    '''
    
    '''
    return _access_rule('deny', ip, port, proto, direction, port_origin, ip_origin, comment)
91846
public function canBefriend($recipient)
    {
        // if user has Blocked the recipient and changed his mind
        // he can send a friend request after unblocking
        if ($this->hasBlocked($recipient)) {
            $this->unblockFriend($recipient);
            return true;
        }

        // if sender has a friendship with the recipient return false
        if ($friendship = $this->getFriendship($recipient)) {
            // if previous friendship was Denied then let the user send fr
            if ($friendship->status != Status::DENIED) {
                return false;
            }
        }
        return true;
    }