-- Should only pass done for single user 'to'
481537
function send(to, done) {
    if (to.constructor !== Array) to = [to]

    var sent = []
    var cb = !done ? null : ((e,r) => {
      sent.push(e||r)
      if (sent.length == to.length)
        done(null, to.length == 1 ? sent[0] : sent)
    })

    for (var user of to) {
      var msg = opts.raw ||
                Composer.render(Object.assign({to:user},opts))
      dispatch.toUser(user, msg, opts, cb)
    }
  }
586580
function() {
      if (Parse.User._currentUser !== null) {
        Parse.User._currentUser._logOutWithAll();
        Parse.User._currentUser._isCurrentUser = false;
      }
      Parse.User._currentUserMatchesDisk = true;
      Parse.User._currentUser = null;
      Parse.localStorage.removeItem(
          Parse._getParsePath(Parse.User._CURRENT_USER_KEY));
    }
932898
def auth_as(self, user):
        """"""
        old_user = self._user
        self.auth(user)
        try:
            yield
        finally:
            self.auth(old_user)
1205267
function cmd_load_user(args, done) {
    seneca
      .make(user_canon)
      .load$(_.omit(args, ['role', 'get']), function(err, user) {
        if (err) return done(err)
        return done(null, { ok: true, user: user })
      })
  }
621859
def permitted_to? (privilege, options = {}, &block)
      options = {
        :user =>  Authorization.current_user,
        :object => self
      }.merge(options)
      Authorization::Engine.instance.permit?(privilege,
          {:user => options[:user],
           :object => options[:object]},
          &block)
    end
826477
def passed?
      passed = nil
      @report.each { |r|
        if passed == nil
          passed = (r[:status] == PS_OK)
        else
          passed &= (r[:status] == PS_OK)
        end
      }

      passed
    end
1134541
function (done) {
      var index = 'users:' + user._id + ':clients'
      Client.__client.zrevrange(index, 0, -1, function (err, ids) {
        if (err) { return done(err) }
        done(null, ids)
      })
    }
1055996
public boolean isGranted(AuthzTrans trans, String user, String ns, String type,String instance, String action) {
		Result<List<PermDAO.Data>> perms = getPermsByUser(trans, user, false);
		if (perms.isOK()) {
			for (PermDAO.Data pd : perms.value) {
				if (ns.equals(pd.ns)) {
					if (type.equals(pd.type)) {
						if (PermEval.evalInstance(pd.instance, instance)) {
							if(PermEval.evalAction(pd.action, action)) { // don't return action here, might miss other action 
								return true;
							}
						}
					}
				}
			}
		}
		return false;
	}
1103802
function removeUserFromProject(user, project) {
		return sharedProject.findOne({'location': project}).exec()
		.then(function(doc) {
			return sharedProject.findOneAndUpdate({'location': project}, {$pull: {'users': { $in: [user]}} }, {
				safe: true,
				w: 'majority'
			}).exec();
		});
	}
1087710
def user=(new_user)
      if new_user && !new_user.respond_to?(:to_str)
        raise TypeError, "Can't convert #{new_user.class} into String."
      end
      @user = new_user ? new_user.to_str : nil

      # You can't have a nil user with a non-nil password
      if password != nil
        @user = EMPTY_STR if @user.nil?
      end

      # Reset dependent values
      remove_instance_variable(:@userinfo) if defined?(@userinfo)
      remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo)
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_user) if defined?(@normalized_user)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
114513
function deleteUser(user) {
  if (!runningAsRoot()) return;
  if (!user) throw new Error('You must provide an username');
  if (!userExists(user)) {
    return;
  }
  const userdelBin = _safeLocateBinary('userdel');
  const deluserBin = _safeLocateBinary('deluser');

  if (isPlatform('linux')) {
    if (userdelBin !== null) { // most modern systems
      runProgram(userdelBin, [user]);
    } else {
      if (_isBusyboxBinary(deluserBin)) { // busybox-based systems
        runProgram(deluserBin, [user]);
      } else {
        throw new Error(`Don't know how to delete user ${user} on this strange linux`);
      }
    }
  } else if (isPlatform('osx')) {
    runProgram('dscl', ['.', '-delete', `/Users/${user}`]);
  } else if (isPlatform('windows')) {
    throw new Error('Don\'t know how to delete user in Windows');
  } else {
    throw new Error('Don\'t know how to delete user in current platform');
  }
}
1015531
def remove_from_user(self, name, *args):
        
        user = self.get_user(name=name)
        attrs_ = user['user']
        for a in args:
            del attrs_[a]
809253
def clean(self, *args, **kwargs):
        
        if self.from_user and self.from_user_id == self.to_user_id:
            raise ValidationError(_('A user cannot send a notification to herself/himself'))
903459
function (data) {
    var user = this$1.onSuccess(data);
    if (isFunction(onSuccess)) {
      onSuccess(user);
    }
    return user
  }
802628
def currentUser(extras=nil)
      method = 'currentUser'
      type = User
      args = {}
      args[:extras] = extras if extras
      return_object type,method,args,true
    end
3338
function(user) {
        var promise;
        if (AV.User._currentUser !== user) {
          promise = AV.User.logOut();
        } else {
          promise = Promise.resolve();
        }
        return promise.then(function() {
          user._isCurrentUser = true;
          AV.User._currentUser = user;

          var json = user._toFullJSON();
          json._id = user.id;
          json._sessionToken = user._sessionToken;
          return AV.localStorage
            .setItemAsync(
              AV._getAVPath(AV.User._CURRENT_USER_KEY),
              JSON.stringify(json)
            )
            .then(function() {
              AV.User._currentUserMatchesDisk = true;
              return AV._refreshSubscriptionId();
            });
        });
      }
612264
def handle(self, user, **options):
        
        monkeypatch_remove_pages_site_restrictions()
        user_model = get_user_model()
        for match in ('username', 'pk', 'email'):
            try:
                u = user_model.objects.get(**{match: user})
                break
            except (user_model.DoesNotExist, ValueError):
                continue
        else:
            raise CommandError(_("User with username/id/email = '%s' not found")
                % user)

        json = sys.stdin.read()
        errors, pages_created = json_to_pages(json, u)
        if errors:
            for e in errors:
                sys.stderr.write(e + '\n')
            raise CommandError(_("Errors encountered while importing JSON"))
        for page, created, messages in pages_created:
            print((_("%s created.") if created else _("%s modified.")) % (
                page.get_complete_slug()))
            for m in messages:
                print(" - " + m)