Incorporates reprompt in the SDK 2015-05
517801
def say_response_with_reprompt(speech, reprompt_speech, end_session = true, speech_ssml = false, reprompt_ssml = false)
      output_speech = add_speech(speech,speech_ssml)
      reprompt_speech = add_reprompt(reprompt_speech,reprompt_ssml)
      { :outputSpeech => output_speech, :reprompt => reprompt_speech, :shouldEndSession => end_session }
    end
461179
@Override
  public final void makeFirstPrepareForSave(final Map<String, Object> pAddParam,
    final Manufacture pEntity,
      final IRequestData pRequestData) throws Exception {
    // Beige-ORM refresh:
    pEntity.setManufacturingProcess(getSrvOrm()
      .retrieveEntity(pAddParam, pEntity.getManufacturingProcess()));
    pEntity.setInvItem(getSrvOrm()
      .retrieveEntity(pAddParam, pEntity.getInvItem()));
    if (!(InvItem.FINISHED_PRODUCT_ID.equals(pEntity.getInvItem()
      .getItsType().getItsId()) || InvItem.MATERIAL_ID
        .equals(pEntity.getInvItem().getItsType().getItsId()))) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "type_must_be_product_material");
    }
    if (pEntity.getItsQuantity().compareTo(pEntity.getManufacturingProcess()
      .getItsQuantity()) > 0) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "source_has_no_enough_item");
    }
    if (!pEntity.getUnitOfMeasure().getItsId().equals(pEntity
      .getManufacturingProcess().getUnitOfMeasure().getItsId())) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "UnitOfMeasure_fiffer_with_source");
    }
    if (pEntity.getItsQuantity().doubleValue() < 0
      && pEntity.getReversedId() == null) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "reversed_manufacture_is_null");
    }
    pEntity.setItsQuantity(pEntity.getItsQuantity().setScale(
      getSrvAccSettings().lazyGetAccSettings(pAddParam).getQuantityPrecision(),
        getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode()));
    if (pEntity.getReversedId() != null) {
      Manufacture reversed = getSrvOrm().retrieveEntityById(pAddParam,
        Manufacture.class, pEntity.getReversedId());
      if (reversed.getReversedId() != null) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
          "Attempt to double reverse" + pAddParam.get("user"));
      }
      if (!reversed.getItsQuantity().equals(reversed.getTheRest())) {
        throw new ExceptionWithCode(ExceptionWithCode
          .WRONG_PARAMETER, "where_is_withdrawals_from_this_source");
      }
      reversed.setTheRest(BigDecimal.ZERO);
      getSrvOrm().updateEntity(pAddParam, reversed);
      pEntity.setTheRest(BigDecimal.ZERO);
    } else {
      pEntity.setTheRest(pEntity.getItsQuantity());
    }
    pEntity.setItsCost(pEntity.getManufacturingProcess().getItsCost());
    if (pEntity.getItsQuantity()
      .compareTo(pEntity.getManufacturingProcess().getItsQuantity()) == 0) {
      //to reduce rounding error:
      pEntity.setItsTotal(pEntity.getManufacturingProcess().getItsTotal());
    } else {
      pEntity.setItsTotal(pEntity.getItsCost()
        .multiply(pEntity.getItsQuantity()).setScale(getSrvAccSettings()
          .lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings()
            .lazyGetAccSettings(pAddParam).getRoundingMode()));
    }
  }
100155
private void repartitionSplitState(
			Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> nameToDistributeState,
			int newParallelism,
			List<Map<StreamStateHandle, OperatorStateHandle>> mergeMapList) {

		int startParallelOp = 0;
		// Iterate all named states and repartition one named state at a time per iteration
		for (Map.Entry<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> e :
				nameToDistributeState.entrySet()) {

			List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>> current = e.getValue();

			// Determine actual number of partitions for this named state
			int totalPartitions = 0;
			for (Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo> offsets : current) {
				totalPartitions += offsets.f1.getOffsets().length;
			}

			// Repartition the state across the parallel operator instances
			int lstIdx = 0;
			int offsetIdx = 0;
			int baseFraction = totalPartitions / newParallelism;
			int remainder = totalPartitions % newParallelism;

			int newStartParallelOp = startParallelOp;

			for (int i = 0; i < newParallelism; ++i) {

				// Preparation: calculate the actual index considering wrap around
				int parallelOpIdx = (i + startParallelOp) % newParallelism;

				// Now calculate the number of partitions we will assign to the parallel instance in this round ...
				int numberOfPartitionsToAssign = baseFraction;

				// ... and distribute odd partitions while we still have some, one at a time
				if (remainder > 0) {
					++numberOfPartitionsToAssign;
					--remainder;
				} else if (remainder == 0) {
					// We are out of odd partitions now and begin our next redistribution round with the current
					// parallel operator to ensure fair load balance
					newStartParallelOp = parallelOpIdx;
					--remainder;
				}

				// Now start collection the partitions for the parallel instance into this list

				while (numberOfPartitionsToAssign > 0) {
					Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo> handleWithOffsets =
							current.get(lstIdx);

					long[] offsets = handleWithOffsets.f1.getOffsets();
					int remaining = offsets.length - offsetIdx;
					// Repartition offsets
					long[] offs;
					if (remaining > numberOfPartitionsToAssign) {
						offs = Arrays.copyOfRange(offsets, offsetIdx, offsetIdx + numberOfPartitionsToAssign);
						offsetIdx += numberOfPartitionsToAssign;
					} else {
						if (OPTIMIZE_MEMORY_USE) {
							handleWithOffsets.f1 = null; // GC
						}
						offs = Arrays.copyOfRange(offsets, offsetIdx, offsets.length);
						offsetIdx = 0;
						++lstIdx;
					}

					numberOfPartitionsToAssign -= remaining;

					// As a last step we merge partitions that use the same StreamStateHandle in a single
					// OperatorStateHandle
					Map<StreamStateHandle, OperatorStateHandle> mergeMap = mergeMapList.get(parallelOpIdx);
					OperatorStateHandle operatorStateHandle = mergeMap.get(handleWithOffsets.f0);
					if (operatorStateHandle == null) {
						operatorStateHandle = new OperatorStreamStateHandle(
							new HashMap<>(nameToDistributeState.size()),
							handleWithOffsets.f0);
						mergeMap.put(handleWithOffsets.f0, operatorStateHandle);
					}
					operatorStateHandle.getStateNameToPartitionOffsets().put(
							e.getKey(),
							new OperatorStateHandle.StateMetaInfo(offs, OperatorStateHandle.Mode.SPLIT_DISTRIBUTE));
				}
			}
			startParallelOp = newStartParallelOp;
			e.setValue(null);
		}
	}
507424
public CompletableFuture<RepositoryMetadata> getRepo(String projectName, String repoName) {
        requireNonNull(projectName, "projectName");
        requireNonNull(repoName, "repoName");

        return getProject(projectName).thenApply(project -> project.repo(repoName));
    }
443339
def _selectedRepoRow(self):
        
        # TODO - figure out what happens if no repo is selected
        selectedModelIndexes = \
            self.reposTableWidget.selectionModel().selectedRows()
        for index in selectedModelIndexes:
            return index.row()
617512
@Override
  public Streamlet<R> repartition(int numPartitions,
                           SerializableBiFunction<R, Integer, List<Integer>> partitionFn) {
    checkNotNull(partitionFn, "partitionFn cannot be null");

    RemapStreamlet<R> retval = new RemapStreamlet<>(this, partitionFn);
    retval.setNumPartitions(numPartitions);
    addChild(retval);
    return retval;
  }
1042267
def updateSolutionTerminal(self):
        '''
        
        '''
        RepAgentConsumerType.updateSolutionTerminal(self)

        # Make replicated terminal period solution
        StateCount = self.MrkvArray.shape[0]
        self.solution_terminal.cFunc   = StateCount*[self.cFunc_terminal_]
        self.solution_terminal.vPfunc  = StateCount*[self.solution_terminal.vPfunc]
        self.solution_terminal.mNrmMin = StateCount*[self.solution_terminal.mNrmMin]
444583
function getRecursivePublishedPutOperations(locals) {
  return rootComponentRef => {
    /**
     * 1) Get reference (could be latest, could be other)
     * 2) Get all references within reference
     * 3) Replace all references with @published (including root reference)
     * 4) Get list of put operations needed
     */
    return components.get(rootComponentRef, locals)
      .then(data => composer.resolveComponentReferences(data, locals))
      .then(data => dbOps.getPutOperations(components.cmptPut, replaceVersion(rootComponentRef, 'published'), data, locals));
  };
}
1106135
@Override
	protected void submitRedoMeta(final int futureUse) {
		if (!useRedo) {
			return;
		}
		createRedoThread();
		final ByteBuffer buf = bufstack.pop();
		buf.putInt(0x0C0C0C0C); // META HEADER/FOOTER
		buf.flip();
		if (useRedoThread) {
			try {
				redoQueue.put(buf);
			} catch (InterruptedException e) {
				log.error("InterruptedException in submitRedoMeta(" + futureUse + ")", e);
			}
		} else {
			redoStore.write(buf);
			bufstack.push(buf);
		}
	}
444331
function buildRoutes(name, mutator, mutatorOptions) {
	var basePath = '/' + name

	// POST - run the content through the mutator and return a revisit.link compatible object
	plugin.route({
		method: 'POST',
		path: basePath + '/service',
		handler: mutatorOptions.rawPayload ? postHandlerRawPayload : postHandler,
		config: {
			validate: {
				payload: revisitorSchema
			},
			response: {
				schema: revisitorSchema
			}
		}
	})

	function postHandler(request, reply) {
		var imgBuf = dataUriToBuffer(request.payload.content.data),
			imgType = imgBuf.type

		mutator(imgBuf, function(err, mutatedBuffer) {
			if (err) {
				return reply(err).code(400)
			}

			var resp = {
				content: {
					data: 'data:image/' + imgType + ';base64,' + mutatedBuffer.toString('base64')
				},
				meta: request.payload.meta
			}

			reply(resp).code(200)
		})
	}

	function postHandlerRawPayload(request, reply) {
		var rawPayload = request.payload

		mutator(rawPayload, function(err, rawPayloadReply) {
			if (err) {
				return reply(err).code(400)
			}

			reply(rawPayloadReply).code(200)
		})
	}
}
744834
async function renovateRepository(repoConfig) {
  let config = { ...repoConfig };
  logger.setMeta({ repository: config.repository });
  logger.info('Renovating repository');
  logger.trace({ config });
  let repoResult;
  try {
    await fs.ensureDir(config.localDir);
    logger.debug('Using localDir: ' + config.localDir);
    config = await initRepo(config);
    const { res, branches, branchList, packageFiles } = await processRepo(
      config
    );
    await ensureOnboardingPr(config, packageFiles, branches);
    await ensureMasterIssue(config, branches);
    await finaliseRepo(config, branchList);
    repoResult = processResult(config, res);
  } catch (err) /*  */ {
    const errorRes = await handleError(config, err);
    repoResult = processResult(config, errorRes);
  }
  await platform.cleanRepo();
  if (config.localDir && !config.persistRepoData) {
    await fs.remove(config.localDir);
  }
  logger.info('Finished repository');
  return repoResult;
}
1008205
private void repartitionBroadcastState(
			Map<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> broadcastState,
			List<Map<StreamStateHandle, OperatorStateHandle>> mergeMapList) {

		int newParallelism = mergeMapList.size();
		for (int i = 0; i < newParallelism; ++i) {

			final Map<StreamStateHandle, OperatorStateHandle> mergeMap = mergeMapList.get(i);

			// for each name, pick the i-th entry
			for (Map.Entry<String, List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>>> e :
					broadcastState.entrySet()) {

				int previousParallelism = e.getValue().size();

				Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo> handleWithMetaInfo =
					e.getValue().get(i % previousParallelism);

				OperatorStateHandle operatorStateHandle = mergeMap.get(handleWithMetaInfo.f0);
				if (operatorStateHandle == null) {
					operatorStateHandle = new OperatorStreamStateHandle(
						new HashMap<>(broadcastState.size()),
						handleWithMetaInfo.f0);
					mergeMap.put(handleWithMetaInfo.f0, operatorStateHandle);
				}
				operatorStateHandle.getStateNameToPartitionOffsets().put(e.getKey(), handleWithMetaInfo.f1);
			}
		}
	}
1011580
public void repr(StringBuilder buf, String sep) {
    if (style != null) {
      buf.append("style=").append(style);
    }
    super.repr(buf, sep);
  }
652377
function(repo, version, hash, meta, outDir) {

    var url, tempRepoDir, packageJSONData, self = this;

    if (meta.vPrefix) {
      version = 'v' + version;
    }

    // Automatically track and cleanup files at exit
    temp.track();

    url = createGitUrl(self.options.baseurl, repo, self.options.reposuffix, self.auth);

    return createTempDir().then(function(tempDir) {
      tempRepoDir = tempDir;
      return exportGitRepo(tempRepoDir, version, url, self.execOpt, self.options.shallowclone);
    }).then(function() {
      return readPackageJSON(tempRepoDir);
    }).then(function(data) {
      packageJSONData = data;
      return moveRepoToOutDir(tempRepoDir, outDir);
    }).then(function() {
      return packageJSONData;
    });
  }
572871
private static void replaceRepositoryInputForValues(ArtifactoryClientConfiguration configuration,
                                                        Run build, String resolverReleaseInput,
                                                        String resolverSnapshotInput, Map<String, String> env) {
        if (StringUtils.isBlank(resolverReleaseInput) || StringUtils.isBlank(resolverSnapshotInput)) {
            build.setResult(Result.FAILURE);
            throw new IllegalStateException("Input for resolve repositories cannot be empty.");
        }
        String resolveReleaseRepo = Util.replaceMacro(resolverReleaseInput, env);
        String resolveSnapshotRepo = Util.replaceMacro(resolverSnapshotInput, env);
        if (StringUtils.isBlank(resolveReleaseRepo) || StringUtils.isBlank(resolveSnapshotRepo)) {
            build.setResult(Result.FAILURE);
            throw new IllegalStateException("Resolver repository variable cannot be replaces with empty value.");
        }
        configuration.resolver.setDownloadSnapshotRepoKey(resolveSnapshotRepo);
        configuration.resolver.setRepoKey(resolveReleaseRepo);
    }
162847
function resolveUse (appendList, increment, options, resolver) {
    return function resolveUseClosure (value) {
      // TODO This should state.options('update..
      // TODO look at all of options.xxxx
      if (resolver.settled && !options.updateAfterSettlement) {
        return;
      }

      var promise = resolver.promise;
      resolver[appendList].push(value);
      promise[increment] += 1;
      promise.pending -= 1;

      if (resolver.i >= 0) {
        var resume = resolver.resume;

        resumeSubscriptionDispatcher(
          resume.topic, resume.data, options, resume.subscriptions,
          resolver, resume.fulfill, resume.reject
        );
        return;
      }

      evaluateLatch(resolver, options);
    };
  }
403145
def set_reprompt_ssml(self, ssml):
        
        self.response.reprompt.outputSpeech.type = 'SSML'
        self.response.reprompt.outputSpeech.ssml = ssml