Get JWE recipient index from context.
328150
protected function getRecipientIndex(array $context): int
    {
        $recipientIndex = 0;

        if (isset($context['recipient_index']) && \is_int($context['recipient_index'])) {
            $recipientIndex = $context['recipient_index'];
        }

        return $recipientIndex;
    }
1007872
function getIndexDetails(client, namespace, done) {
  var tasks = {
    client: attach.bind(null, client),
    namespace: attach.bind(null, namespace),
    getIndexes: ['client', 'namespace', getIndexes],
    getIndexStats: ['client', 'namespace', getIndexStats],
    getIndexSizes: ['client', 'namespace', getIndexSizes],
    indexes: [
      'getIndexes',
      'getIndexStats',
      'getIndexSizes',
      combineStatsAndIndexes
    ]
  };

  async.auto(tasks, function(err, results) {
    if (err) {
      // report error
      return done(err);
    }
    // all info was collected in indexes
    return done(null, results.indexes);
  });
}
744454
def get_email_context(self, activation_key):
        
        scheme = 'https' if self.request.is_secure() else 'http'
        return {
            'scheme': scheme,
            'activation_key': activation_key,
            'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
            'site': get_current_site(self.request)
        }
1006901
private function getKeyManagementMode(JWEInterface $jwe)
    {
        $mode = null;
        $recipients = $jwe->getRecipients();

        foreach ($recipients as $recipient) {
            $complete_headers = array_merge($jwe->getSharedProtectedHeaders(), $jwe->getSharedHeaders(), $recipient->getHeaders());
            Assertion::keyExists($complete_headers, 'alg', 'Parameter "alg" is missing.');

            $key_encryption_algorithm = $this->getJWAManager()->getAlgorithm($complete_headers['alg']);
            Assertion::isInstanceOf($key_encryption_algorithm, Algorithm\KeyEncryptionAlgorithmInterface::class, sprintf('The key encryption algorithm "%s" is not supported or not a key encryption algorithm instance.', $complete_headers['alg']));

            if (null === $mode) {
                $mode = $key_encryption_algorithm->getKeyManagementMode();
            } else {
                Assertion::true($this->areKeyManagementModesCompatible($mode, $key_encryption_algorithm->getKeyManagementMode()), 'Foreign key management mode forbidden.');
            }
        }

        return $mode;
    }
323031
def getent(refresh=False):
    '''
    
    '''
    if 'user.getent' in __context__ and not refresh:
        return __context__['user.getent']

    ret = []
    for data in pwd.getpwall():
        ret.append(info(data.pw_name))
    __context__['user.getent'] = ret
    return ret
1084492
private static String getJmxResult(MBeanServerConnection connetion, String url) throws Exception {
        ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME);

        return (String) conn.invoke(name, "service", new String[]{url},
                new String[]{String.class.getName()});
    }
234663
def recv(self):
        """"""
        try:
            message = self.ws.recv()
            return json.loads(message)
        except websocket._exceptions.WebSocketConnectionClosedException as ex:
            raise SelenolWebSocketClosedException() from ex
25989
private String getBearerToken(HttpConnectionInterceptorContext context) {
        final AtomicReference<String> iamTokenResponse = new AtomicReference<String>();
        boolean result = super.requestCookie(context, iamServerUrl, iamTokenRequestBody,
                "application/x-www-form-urlencoded", "application/json",
                new StoreBearerCallable(iamTokenResponse));
        if (result) {
            return iamTokenResponse.get();
        } else {
            return null;
        }
    }
766398
public int getIndex(TimelineEvent event) {
        int index = -1;

        if (event != null) {
            for (int i = 0; i < events.size(); i++) {
                if (events.get(i).equals(event)) {
                    index = i;

                    break;
                }
            }
        }

        return index;
    }
299909
private int indexOf(ApptentiveNotificationObserver observer) {
		for (int i = 0; i < observers.size(); ++i) {
			final ApptentiveNotificationObserver other = observers.get(i);
			if (other == observer) {
				return i;
			}

			final ObserverWeakReference otherReference = ObjectUtils.as(other, ObserverWeakReference.class);
			if (otherReference != null && otherReference.get() == observer) {
				return i;
			}
		}
		return -1;
	}
937426
function getEventType(inboundMessage) {
    let recipientAddresses = _.map(inboundMessage.recipients, 'email');
    let ccAddresses = _.map(inboundMessage.cc, 'email');

    if (_.max([recipientAddresses.indexOf(fuse.config.inbound_address),
               recipientAddresses.indexOf(inboundMessage.to.email)]) >= 0) {
      return 'direct_email';
    }
    else if (_.max([ccAddresses.indexOf(fuse.config.inbound_address),
                    ccAddresses.indexOf(inboundMessage.to.email)]) >= 0) {
      return 'cc_email';
    }
    else {
      return 'bcc_email';
    }
  }
256383
private int getIndex(CharSequence name) {
        if (length() == 0 || name == null) {
            return -1;
        }
        int h = AsciiString.hashCode(name);
        int i = index(h);
        for (HeaderEntry e = headerFields[i]; e != null; e = e.next) {
            if (e.hash == h && equalsConstantTime(name, e.name) != 0) {
                return getIndex(e.index);
            }
        }
        return -1;
    }
460989
def get_email_context(self,**kwargs):
        '''  '''
        context = super(Invoice,self).get_email_context(**kwargs)
        context.update({
            'id': self.id,
            'url': '%s?v=%s' % (self.url, self.validationString),
            'amountPaid': self.amountPaid,
            'outstandingBalance': self.outstandingBalance,
            'status': self.statusLabel,
            'creationDate': self.creationDate,
            'modifiedDate': self.modifiedDate,
            'paidOnline': self.paidOnline,
            'grossTotal': self.grossTotal,
            'total': self.total,
            'adjustments': self.adjustments,
            'taxes': self.taxes,
            'fees': self.fees,
            'comments': self.comments,
        })
        return context
61202
def index(ctx, message):
    """"""
    config = ctx.obj["CONFIG"]

    if not exists(config):
        handle_no_cache(ctx)

    from wily.commands.index import index

    index(config=config, include_message=message)
155711
public String getContextStr(Sentence sent, int wordIdx){
		String cpStr = "";
		
		for (int i = 0; i < cntxGenVector.size(); ++i){
			String [] context = cntxGenVector.get(i).getContext(sent, wordIdx);
			if (context != null){
				for (int j = 0; j < context.length; ++j){
					if (context[j].trim().equals("")) continue;
					cpStr += context[j] + " ";
				}
			}
		}
		
		return cpStr.trim();
	}
1079628
private String getIndex() {

        try {
            return parseMandatoryStringValue(XML_ELEMENT_INDEX);
        } catch (final Exception e) {
            LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_SPECIFIED_0), e);
            return null;
        }
    }
217148
public static Object getObjectIndex(Object obj, double dblIndex,
                                        Context cx, Scriptable scope)
    {
        Scriptable sobj = toObjectOrNull(cx, obj, scope);
        if (sobj == null) {
            throw undefReadError(obj, toString(dblIndex));
        }

        int index = (int)dblIndex;
        if (index == dblIndex) {
            return getObjectIndex(sobj, index, cx);
        }
        String s = toString(dblIndex);
        return getObjectProp(sobj, s, cx);
    }