Initializes a new instance of @see Client
@param (String) key the api key obtained from scottyapp.com/developers
@param (String) secret the api secret
@param (String) scope defaults to "read write".
553816
function Client(key, secret, scope) {
      this.key = key;
      this.secret = secret;
      this.scope = scope != null ? scope : "read write";
      this._request = __bind(this._request, this);
      this._delete = __bind(this._delete, this);
      this._put = __bind(this._put, this);
      this._post = __bind(this._post, this);
      this._postAsForm = __bind(this._postAsForm, this);
      this._get = __bind(this._get, this);
      this.info = __bind(this.info, this);
      this.deleteApp = __bind(this.deleteApp, this);
      this.updateApp = __bind(this.updateApp, this);
      this.app = __bind(this.app, this);
      this.createApp = __bind(this.createApp, this);
      this.appsForOrganization = __bind(this.appsForOrganization, this);
      this.deleteOrganization = __bind(this.deleteOrganization, this);
      this.createOrganization = __bind(this.createOrganization, this);
      this.updateOrganization = __bind(this.updateOrganization, this);
      this.organization = __bind(this.organization, this);
      this.organizations = __bind(this.organizations, this);
      this.organizationsForUser = __bind(this.organizationsForUser, this);
      this.updateUser = __bind(this.updateUser, this);
      this.createUser = __bind(this.createUser, this);
      this.updateMe = __bind(this.updateMe, this);
      this.me = __bind(this.me, this);
      this.authenticate = __bind(this.authenticate, this);
      this.setAccessToken = __bind(this.setAccessToken, this);
      if (!(this.key && this.secret)) {
        throw new Error("You need to pass a key and secret");
      }
    }
1163071
function Q(redisClient, key) {
  // handle forgetting a 'new'
  if (!(this instanceof Q)) {
    return new Q(redisClient, key);
  }

  this._redis = redisClient;
  this._key = key;
}
62713
public void setScope(String key) {
        Integer value = key != null ? SCOPES.get(key.toLowerCase()) : null;
        varScope = value != null ? value : null;
    }
1009901
public Void visitScope(Scope scope) {
    messages.add(new Message(PrettyPrinter.format("Explicit scope unsupported: key=%s scope=%s",
        targetKey, scope)));
    return null;
  }
874806
@Override
	public void enterScope() {
		checkState(inheritableScopeCache.get() == null, "Scope has already been entered. Forgot to call exitScope()?");
		Map<Key<?>, Object> scopeMap = newHashMap();
		inheritableScopeCache.set(scopeMap);
		log.debug("Entered inheritable scope.");
	}
795388
public void initialize(NewRelicCache cache)
    {
        String apiKey = cache.getApiKey();
        if(apiKey == null)
            throw new IllegalArgumentException("null API key");

        logger.info("Initialising the clients");

        initialized = false;
        if(cache.isAlertsEnabled())
        {
            apiClient = NewRelicApi.builder().apiKey(apiKey).build();
            infraApiClient = NewRelicInfraApi.builder().apiKey(apiKey).build();
            syntheticsApiClient = NewRelicSyntheticsApi.builder().apiKey(apiKey).build();
        }

        logger.info("Initialised the clients");

        initialized = true;
    }
335779
public HMac init(String algorithm, byte[] key){
		return init(algorithm, (null == key) ? null : new SecretKeySpec(key, algorithm));
	}
495801
Scope enterScope() {
    final Map<VarKey, Variable> currentFrame = new LinkedHashMap<>();
    final Label scopeExit = new Label();
    frames.push(currentFrame);
    return new Scope() {
      boolean exited;

      @Override
      Variable createSynthetic(
          SyntheticVarName varName, Expression initExpr, SaveStrategy strategy) {
        checkState(!exited, "Scope already exited");
        VarKey key = VarKey.create(Kind.SYNTHETIC, varName.name());
        // synthetics are prefixed by $ by convention
        String name = fieldNames.generateName("$" + varName.name());
        return doCreate(name, new Label(), scopeExit, initExpr, key, strategy);
      }

      @Override
      Variable createTemporary(String name, Expression initExpr) {
        checkState(!exited, "Scope already exited");
        VarKey key = VarKey.create(Kind.TEMPORARY, name);
        name = fieldNames.generateName("$$" + name);
        return doCreate(name, new Label(), scopeExit, initExpr, key, SaveStrategy.NEVER);
      }

      @Override
      Variable create(String name, Expression initExpr, SaveStrategy strategy) {
        checkState(!exited, "Scope already exited");
        VarKey key = VarKey.create(Kind.USER_DEFINED, name);
        name = fieldNames.generateName(name);
        return doCreate(name, new Label(), scopeExit, initExpr, key, strategy);
      }

      @Override
      Statement exitScope() {
        checkState(!exited, "Scope already exited");
        exited = true;
        frames.pop();
        // Use identity semantics to make sure we visit each label at most once.  visiting a label
        // more than once tends to corrupt internal asm state.
        final Set<Label> endLabels = Sets.newIdentityHashSet();
        for (Variable var : currentFrame.values()) {
          endLabels.add(var.local.end());
          availableSlots.clear(
              var.local.index(), var.local.index() + var.local.resultType().getSize());
        }
        return new Statement() {
          // TODO(lukes): we could generate null writes for when object typed fields go out of
          // scope.  This would potentially allow intermediate results to be collected sooner.
          @Override
          protected void doGen(CodeBuilder adapter) {
            for (Label label : endLabels) {
              adapter.visitLabel(label);
            }
          }
        };
      }

      private Variable doCreate(
          String name,
          Label start,
          Label end,
          Expression initExpr,
          VarKey key,
          SaveStrategy strategy) {
        int index = reserveSlotFor(initExpr.resultType());
        LocalVariable local =
            LocalVariable.createLocal(name, index, initExpr.resultType(), start, end);
        Variable var;
        switch (strategy) {
          case DERIVED:
            var = new DerivedVariable(initExpr, local);
            break;
          case NEVER:
            var = new TemporaryVariable(initExpr, local);
            break;
          case STORE:
            var = new FieldSavedVariable(initExpr, local);
            break;
          default:
            throw new AssertionError();
        }
        currentFrame.put(key, var);
        allVariables.add(var);
        return var;
      }
    };
  }
971791
public static function init($key = null, $secret = null) {
        $patrol = new Patrol;

        if ($key && $secret) {
            $patrol->setApiKey($key);
            $patrol->setApiSecret($secret);
        }

        return $patrol;
    }
1154262
public void setScope(String scope) {
        SystemAssert.requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
        this.scope = scope;
    }
143306
public void addScope(ApiAppOauthScopeType scope) {
        if (oauth == null) {
            oauth = new ApiAppOauth();
        }
        oauth.addScope(scope);
    }
1326657
protected void setAttribute(String key, Object value, int scope) {
        Map<String, Object> replacedInScope = getReplacedAttributes(scope);
        if (!replacedInScope.containsKey(key)) {
            Object current = pageContext.getAttribute(key, scope);
            replacedInScope.put(key, current);
        }
        pageContext.setAttribute(key, value, scope);
    }
478455
public void setScope(java.util.Collection<String> scope) {
        if (scope == null) {
            this.scope = null;
            return;
        }

        this.scope = new java.util.ArrayList<String>(scope);
    }
1355614
private synchronized void writeObject(java.io.ObjectOutputStream s)
        throws IOException
    {
        if (scope_ifname_set) {
            ifname = scope_ifname.getName();
        }
        s.defaultWriteObject();
    }
886315
private Cache getScopeCache(String scope) throws InvalidScopeException {
        Cache scopeCache = scopeManager.getCache(scope);
        if (scopeCache == null) {
            throw new InvalidScopeException("The scope " + scope + " doesn't exist");
        } else {
            return scopeCache;
        }
    }
405757
function initClient() {
	gapi.client.init({
		apiKey: config.api.google.web.key,
		clientId: config.api.google.web.client_id,
		discoveryDocs: DISCOVERY_DOCS,
		scope: SCOPES
	}).then(function () {
		// Listen for sign-in state changes.
		gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);

		// Handle the initial sign-in state.
		updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get());
		authorizeButton.onclick = handleAuthClick;
		signoutButton.onclick = handleSignoutClick;
	}, function(error) {
		appendPre(JSON.stringify(error, null, 2));
	});
}
250745
@Beta
  public GoogleCredential createScoped(Collection<String> scopes) {
    if (serviceAccountPrivateKey == null) {
      return this;
    }
    return toBuilder()
        .setServiceAccountScopes(scopes)
        .build();
  }