See above about calling directly into libsodium.
485842
function encryptAndSeal(plainText, AAD, nonce, key) {
    const cipherText =
        Sodium
            .crypto_stream_chacha20_xor_ic(plainText, nonce, 1, key);

    const hmac =
        computePoly1305(cipherText, AAD, nonce, key);

    return [ cipherText, hmac ];
}
28893
def call():
    """"""
    args = get_arguments()

    # Set up logging
    if args.debug:
        log_level = logging.DEBUG
    elif args.quiet:
        log_level = logging.WARN
    else:
        log_level = logging.INFO

    setup_logging(log_level)

    skybell = None

    try:
        # Create skybellpy instance.
        skybell = skybellpy.Skybell(username=args.username,
                                    password=args.password,
                                    get_devices=True)

    # # Set setting
    # for setting in args.set or []:
    #     keyval = setting.split("=")
    #     if skybell.set_setting(keyval[0], keyval[1]):
    #         _LOGGER.info("Setting %s changed to %s", keyval[0], keyval[1])

        # Output Json
        for device_id in args.json or []:
            device = skybell.get_device(device_id)

            if device:
                # pylint: disable=protected-access
                _LOGGER.info(device_id + " JSON:\n" +
                             json.dumps(device._device_json, sort_keys=True,
                                        indent=4, separators=(',', ': ')))
            else:
                _LOGGER.warning("Could not find device with id: %s", device_id)

        # Print
        def _device_print(dev, append=''):
            _LOGGER.info("%s%s",
                         dev.desc, append)

        # Print out all devices.
        if args.devices:
            for device in skybell.get_devices():
                _device_print(device)

        # Print out specific devices by device id.
        if args.device:
            for device_id in args.device:
                device = skybell.get_device(device_id)

                if device:
                    _device_print(device)
                else:
                    _LOGGER.warning(
                        "Could not find device with id: %s", device_id)

        # Print out last motion event
        if args.activity_json:
            for device_id in args.activity_json:
                device = skybell.get_device(device_id)

                if device:
                    _LOGGER.info(device.latest(CONST.EVENT_MOTION))
                else:
                    _LOGGER.warning(
                        "Could not find device with id: %s", device_id)

        # Print out avatar image
        if args.avatar_image:
            for device_id in args.avatar_image:
                device = skybell.get_device(device_id)

                if device:
                    _LOGGER.info(device.image)
                else:
                    _LOGGER.warning(
                        "Could not find device with id: %s", device_id)

        # Print out last motion event image
        if args.activity_image:
            for device_id in args.activity_image:
                device = skybell.get_device(device_id)

                if device:
                    _LOGGER.info(device.activity_image)
                else:
                    _LOGGER.warning(
                        "Could not find device with id: %s", device_id)

    except SkybellException as exc:
        _LOGGER.error(exc)
410894
function(opts) {
  // If opts is a string, assume libpath
  if(_.isString(opts)) {
    opts = { path: opts }
  }

  if(!opts) opts = {};
  var libpath = opts['path'];

  this._library = this._createLibrary(libpath);
}
423835
@Override
    public Void call() {
        if (shouldAnalyze()) {
            LOGGER.debug("Begin Analysis of '{}' ({})", dependency.getActualFilePath(), analyzer.getName());
            try {
                analyzer.analyze(dependency, engine);
            } catch (AnalysisException ex) {
                LOGGER.warn("An error occurred while analyzing '{}' ({}).", dependency.getActualFilePath(), analyzer.getName());
                LOGGER.debug("", ex);
                exceptions.add(ex);
            } catch (Throwable ex) {
                LOGGER.warn("An unexpected error occurred during analysis of '{}' ({}): {}",
                        dependency.getActualFilePath(), analyzer.getName(), ex.getMessage());
                LOGGER.error("", ex);
                exceptions.add(ex);
            }
        }
        return null;
    }
690798
private static RuntimeDialect resolveDialect() {
		if (getJavaVersion() >= MINIMUM_VERSION_MODERN_JAVA) {
			return new ModernJavaRuntime();
		} else if ("Android Runtime".equalsIgnoreCase(System.getProperty("java.runtime.name"))) {
			return new AndroidRuntime();
		} else {
			return new LegacyJavaRuntime();
		}
	}
943183
private void init(InputSource is) throws FunctionLibException {

	try {

	    xmlReader = XMLUtil.createXMLReader();
	    xmlReader.setContentHandler(this);
	    xmlReader.setErrorHandler(this);
	    xmlReader.setEntityResolver(new FunctionLibEntityResolver());
	    xmlReader.parse(is);
	}
	catch (IOException e) {

	    throw new FunctionLibException("IO Exception: " + e.getMessage());
	}
	catch (SAXException e) {
	    throw new FunctionLibException("SaxException: " + e.getMessage());
	}

    }
1107716
private static CallFrame initFrameForNoSuchMethod(Context cx,
            CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
            int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
            NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
    {
        // create an args array from the stack
        Object[] argsArray = null;
        // exactly like getArgsArray except that the first argument
        // is the method name from the shim
        int shift = stackTop + 2;
        Object[] elements = new Object[indexReg];
        for (int i=0; i < indexReg; ++i, ++shift) {
            Object val = stack[shift];
            if (val == DOUBLE_MARK) {
                val = ScriptRuntime.wrapNumber(sDbl[shift]);
            }
            elements[i] = val;
        }
        argsArray = new Object[2];
        argsArray[0] = noSuchMethodShim.methodName;
        argsArray[1] = cx.newArray(calleeScope, elements);

        // exactly the same as if it's a regular InterpretedFunction
        CallFrame callParentFrame = frame;
        if (op == Icode_TAIL_CALL) {
            callParentFrame = frame.parentFrame;
            exitFrame(cx, frame, null);
        }
        // init the frame with the underlying method with the
        // adjusted args array and shim's function
        CallFrame calleeFrame = initFrame(cx, calleeScope, funThisObj, argsArray, null,
          0, 2, ifun, callParentFrame);
        if (op != Icode_TAIL_CALL) {
            frame.savedStackTop = stackTop;
            frame.savedCallOp = op;
        }
        return calleeFrame;
    }
123391
def propagate_type_and_convert_call(result, node):
    '''
        
    '''
    calls_value = {}
    calls_gas = {}

    call_data = []

    idx = 0
    # use of while len() as result can be modified during the iteration
    while idx < len(result):
        ins = result[idx]

        if isinstance(ins, TmpCall):
            new_ins = extract_tmp_call(ins, node.function.contract)
            if new_ins:
                new_ins.set_node(ins.node)
                ins = new_ins
                result[idx] = ins

        if isinstance(ins, Argument):
            if ins.get_type() in [ArgumentType.GAS]:
                assert not ins.call_id in calls_gas
                calls_gas[ins.call_id] = ins.argument
            elif ins.get_type() in [ArgumentType.VALUE]:
                assert not ins.call_id in calls_value
                calls_value[ins.call_id] = ins.argument
            else:
                assert ins.get_type() == ArgumentType.CALL
                call_data.append(ins.argument)

        if isinstance(ins, (HighLevelCall, NewContract, InternalDynamicCall)):
            if ins.call_id in calls_value:
                ins.call_value = calls_value[ins.call_id]
            if ins.call_id in calls_gas:
                ins.call_gas = calls_gas[ins.call_id]

        if isinstance(ins, (Call, NewContract, NewStructure)):
            ins.arguments = call_data
            call_data = []

        if is_temporary(ins):
            del result[idx]
            continue

        new_ins = propagate_types(ins, node)
        if new_ins:
            if isinstance(new_ins, (list,)):
                if len(new_ins) == 2:
                    new_ins[0].set_node(ins.node)
                    new_ins[1].set_node(ins.node)
                    del result[idx]
                    result.insert(idx, new_ins[0])
                    result.insert(idx+1, new_ins[1])
                    idx = idx + 1
                else:
                    assert len(new_ins) == 3
                    new_ins[0].set_node(ins.node)
                    new_ins[1].set_node(ins.node)
                    new_ins[2].set_node(ins.node)
                    del result[idx]
                    result.insert(idx, new_ins[0])
                    result.insert(idx+1, new_ins[1])
                    result.insert(idx+2, new_ins[2])
                    idx = idx + 2
            else:
                new_ins.set_node(ins.node)
                result[idx] = new_ins
        idx = idx +1
    return result
497745
public void invoke(Object service,
                       AbstractHessianInput in,
                       AbstractHessianOutput out)
        throws Exception
    {
        ServiceContext context = ServiceContext.getContext();

        // backward compatibility for some frameworks that don't read
        // the call type first
        in.skipOptionalCall();

        // Hessian 1.0 backward compatibility
        String header;
        while ((header = in.readHeader()) != null) {
            Object value = in.readObject();

            context.addHeader(header, value);
        }

        String methodName = in.readMethod();
        int argLength = in.readMethodArgLength();

        Method method;

        method = getMethod(methodName + "__" + argLength);

        if (method == null)
            method = getMethod(methodName);

        if (method != null) {
        }
        else if ("_hessian_getAttribute".equals(methodName)) {
            String attrName = in.readString();
            in.completeCall();

            String value = null;

            if ("java.api.class".equals(attrName))
                value = getAPIClassName();
            else if ("java.home.class".equals(attrName))
                value = getHomeClassName();
            else if ("java.object.class".equals(attrName))
                value = getObjectClassName();

            out.writeReply(value);
            out.close();
            return;
        }
        else if (method == null) {
            out.writeFault("NoSuchMethodException",
                escapeMessage("The service has no method named: " + in.getMethod()),
                null);
            out.close();
            return;
        }

        Class<?>[] args = method.getParameterTypes();

        if (argLength != args.length && argLength >= 0) {
            out.writeFault("NoSuchMethod",
                escapeMessage("method " + method + " argument length mismatch, received length=" + argLength),
                null);
            out.close();
            return;
        }

        Object[] values = new Object[args.length];

        for (int i = 0; i < args.length; i++) {
            // XXX: needs Marshal object
            values[i] = in.readObject(args[i]);
        }

        Object result = null;

        try {
            result = method.invoke(service, values);
        } catch (Exception e) {
            Throwable e1 = e;
            if (e1 instanceof InvocationTargetException)
                e1 = ((InvocationTargetException) e).getTargetException();

            log.log(Level.FINE, this + " " + e1.toString(), e1);

            out.writeFault("ServiceException",
                escapeMessage(e1.getMessage()),
                e1);
            out.close();
            return;
        }

        // The complete call needs to be after the invoke to handle a
        // trailing InputStream
        in.completeCall();

        out.writeReply(result);

        out.close();
    }
1164972
def _call_java(sc, java_obj, name, *args):
    
    m = getattr(java_obj, name)
    java_args = [_py2java(sc, arg) for arg in args]
    return _java2py(sc, m(*java_args))
63560
def _call(ins):
    
    output = []
    output.append('call %s' % str(ins.quad[1]))

    try:
        val = int(ins.quad[2])
        if val == 1:
            output.append('push af')  # Byte
        else:
            if val > 4:
                output.extend(_fpush())
            else:
                if val > 2:
                    output.append('push de')
                if val > 1:
                    output.append('push hl')

    except ValueError:
        pass

    return output
8904
protected void importLit(final int lit) {
        final int idx = Math.abs(lit);
        assert lit != 0;
        int newIdx;
        while (idx >= (newIdx = this.vars.size())) {
            this.vars.push(new CLVar());
            this.vals.push((byte) 0);
            this.phases.push((byte) 1);
            this.watches.push(new LNGVector<CLWatch>());
            this.watches.push(new LNGVector<CLWatch>());
            if (newIdx == 0) { continue; }
            this.decisions.push(newIdx);
        }
    }
735030
function() {
    var lib, name, names, _i, _len;
    lib = arguments[0], names = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = names.length; _i < _len; _i++) {
      name = names[_i];
      if (lib[name] == null) {
        return;
      }
      if (this[name] == null) {
        this[name] = {};
      }
      if (!isObject(this[name])) {
        return;
      }
      mixin(this[name], lib[name]);
    }
    return this;
  }
1361406
def call(self, name, *a):
        """"""
        return callJavaFunc(self._sc, getattr(self._java_model, name), *a)
1365650
public static CallSite callLambdaMetaFactory(ReloadableType rtype, Object[] bsmArgs, Object lookup,
			String indyNameAndDescriptor, Class<?> executorClass) throws Exception {
		MethodHandles.Lookup caller = (MethodHandles.Lookup) lookup;

		ClassLoader callerLoader = caller.lookupClass().getClassLoader();

		int descriptorStart = indyNameAndDescriptor.indexOf('(');
		String invokedName = indyNameAndDescriptor.substring(0, descriptorStart);
		MethodType invokedType = MethodType.fromMethodDescriptorString(
				indyNameAndDescriptor.substring(descriptorStart), callerLoader);

		// Use bsmArgs to build the parameters
		MethodType samMethodType = MethodType.fromMethodDescriptorString(
				(((Type) bsmArgs[0]).getDescriptor()), callerLoader);

		Handle bsmArgsHandle = (Handle) bsmArgs[1];
		String owner = bsmArgsHandle.getOwner();
		String name = bsmArgsHandle.getName();
		String descriptor = bsmArgsHandle.getDesc();
		MethodType implMethodType = MethodType.fromMethodDescriptorString(descriptor, callerLoader);
		// Looking up the lambda$run method in the caller class (note the caller class is the executor, which gets us around the
		// problem of having to hack into LambdaMetafactory to intercept reflection)
		MethodHandle implMethod = null;
		switch (bsmArgsHandle.getTag()) {
			case Opcodes.H_INVOKESTATIC:
				implMethod = caller.findStatic(caller.lookupClass(), name, implMethodType);
				break;
			case Opcodes.H_INVOKESPECIAL:
				// If there is an executor, the lambda function is actually modified from 'private instance' to 'public static' so adjust lookup. The method
				// will be static with a new leading parameter.
				if (executorClass == null) {
					// TODO is final parameter here correct?
					implMethod = caller.findSpecial(caller.lookupClass(), name, implMethodType, caller.lookupClass());
				}
				else {
					implMethod = caller.findStatic(caller.lookupClass(), name, MethodType.fromMethodDescriptorString(
							"(L" + owner + ";" + descriptor.substring(1), callerLoader));
				}
				break;
			case Opcodes.H_INVOKEVIRTUAL:
				// There is a possibility to 'shortcut' here. Basically we are trying to resolve a callsite reference
				// to the method that satisfies it. The easiest option is to just find the method on the originally
				// loaded version of the target class and return that. A more optimal shortcut could return the
				// method on the executor class if the target has been reloaded (effectively bypassing the method
				// on the originally loaded version since we know that it will be acting as a pass through). But this
				// opens up a can of worms related to visibility. The executor is loaded into the child classloader,
				// and if the caller has not been reloaded it will not be able to 'see' the executor (since it is in
				// a child classloader). So, basically keep this dumb (but reliable) for now.

				TypeRegistry typeRegistry = rtype.getTypeRegistry();
				ReloadableType ownerRType = typeRegistry.getReloadableType(owner);
				if (null == ownerRType || !ownerRType.hasBeenReloaded()) {
					// target containing the reference/lambdaMethod has not been reloaded, no need to get over
					// complicated.
					Class<?> clazz = callerLoader.loadClass(owner.replace("/", "."));
					implMethod = caller.findVirtual(clazz, name, implMethodType);
				}
				else {
					MethodMember targetReferenceMethodMember = ownerRType.getCurrentMethod(name, descriptor);
					String targetReferenceDescriptor = targetReferenceMethodMember.getDescriptor();
					MethodType targetReferenceMethodType = MethodType.fromMethodDescriptorString(
							targetReferenceDescriptor, callerLoader);
					Class<?> targetReferenceClass = ownerRType.getClazz();
					MethodMember currentMethod = ownerRType.getCurrentMethod(name, descriptor);

					if (currentMethod.original == null) {
						// null means this method did not exist on the original version of the target.
						// Assert that the caller must have been reloaded, otherwise how would it
						// have a reference to something that did not exist on the first version of the type. In that
						// case we know we can return the method on the executor class because both the reloaded
						// caller and reloaded target are in the same child classloader (no visibility problem).
						if (!rtype.hasBeenReloaded()) {
							throw new IllegalStateException(
									"Assertion violated: When a method added on reload is being referenced"
											+ "in target type '" + ownerRType.getName()
											+ "', expected the caller to also have been reloaded: '"
											+ rtype.getName() + "'");
						}
						CurrentLiveVersion ownerLiveVersion = ownerRType.getLiveVersion();
						Class<?> ownerExecutorClass = ownerLiveVersion.getExecutorClass();
						Method executorMethod = ownerLiveVersion.getExecutorMethod(currentMethod);
						String methodDescriptor = Type.getType(executorMethod).getDescriptor();
						MethodType type = MethodType.fromMethodDescriptorString(methodDescriptor, callerLoader);
						implMethod = caller.findStatic(ownerExecutorClass, name, type);
					}
					else {
						// This finds the reference method on the originally loaded class. It will pass through
						// to the actual code on the reloaded version.
						implMethod = caller.findVirtual(targetReferenceClass, name, targetReferenceMethodType);
					}
				}
				break;
			case Opcodes.H_NEWINVOKESPECIAL:
				Class<?> clazz = callerLoader.loadClass(owner.replace("/", "."));
				implMethod = caller.findConstructor(clazz, implMethodType);
				break;
			case Opcodes.H_INVOKEINTERFACE:
				Handle h = (Handle) bsmArgs[1];
				String interfaceOwner = h.getOwner();
				// TODO Should there not be a more direct way to this than classloading?
				// TODO What about when this is a method added to the interface on a reload? It won't really exist, should we point
				// to the executor? or something else? (maybe just directly the real method that will satisfy the interface - if it can be worked out)
				Class<?> interfaceClass = callerLoader.loadClass(interfaceOwner.replace('/', '.')); // interface type, eg StreamB$Foo
				implMethod = caller.findVirtual(interfaceClass, name, implMethodType);
				break;
			default:
				throw new IllegalStateException("nyi " + bsmArgsHandle.getTag());
		}

		MethodType instantiatedMethodType = MethodType.fromMethodDescriptorString(
				(((Type) bsmArgs[2]).getDescriptor()), callerLoader);

		return LambdaMetafactory.metafactory(caller, invokedName, invokedType, samMethodType, implMethod,
				instantiatedMethodType);

	}
895955
void tos_into_slot( int d, int n, String id ) {
    // In a copy-on-modify language, only update the local scope, or return val
    assert d==0 || (d==1 && _display[_tod]==n+1);
    int idx = _display[_tod-d]+n;
    // Temporary solution to kill a UDF from global name space. Needs to fix in the future.
    if (_tod == 0) ASTOp.removeUDF(id);
    subRef(_ary[idx], _key[idx]);
    subRef(_fcn[idx]);
    Frame fr =                   _ary[_sp-1];
    _ary[idx] = fr==null ? null : addRef(new Frame(fr));
    _d  [idx] =                  _d  [_sp-1] ;
    _str[idx] =                  _str[_sp-1] ;
    _fcn[idx] =           addRef(_fcn[_sp-1]);
    _key[idx] = d==0 && fr!=null ? id : null;
    // Temporary solution to add a UDF to global name space. Needs to fix in the future.
    if (_tod == 0 && _fcn[_sp-1] != null) ASTOp.putUDF(_fcn[_sp-1], id);
    assert _ary[0]== null || check_refcnt(_ary[0].anyVec());
  }
727817
private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmName,
            List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs,
            Name methName) {
        int prevPos = make.pos;
        try {
            make.at(pos);
            List<Type> bsm_staticArgs = List.of(syms.methodHandleLookupType,
                    syms.stringType,
                    syms.methodTypeType).appendList(bsmStaticArgToTypes(staticArgs));

            Symbol bsm = rs.resolveInternalMethod(pos, attrEnv, site,
                    bsmName, bsm_staticArgs, List.<Type>nil());

            DynamicMethodSymbol dynSym =
                    new DynamicMethodSymbol(methName,
                                            syms.noSymbol,
                                            bsm.isStatic() ?
                                                ClassFile.REF_invokeStatic :
                                                ClassFile.REF_invokeVirtual,
                                            (MethodSymbol)bsm,
                                            indyType,
                                            staticArgs.toArray());

            JCFieldAccess qualifier = make.Select(make.QualIdent(site.tsym), bsmName);
            qualifier.sym = dynSym;
            qualifier.type = indyType.getReturnType();

            JCMethodInvocation proxyCall = make.Apply(List.<JCExpression>nil(), qualifier, indyArgs);
            proxyCall.type = indyType.getReturnType();
            return proxyCall;
        } finally {
            make.at(prevPos);
        }
    }