_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q15800
CacheSessionPool.validateConfig
train
private function validateConfig() { $mustBePositiveKeys = ['maxCyclesToWaitForSession', 'maxSessions', 'minSessions', 'sleepIntervalSeconds']; foreach ($mustBePositiveKeys as $key) { if ($this->config[$key] < 0) { throw new \InvalidArgumentException("$key may not be nega...
php
{ "resource": "" }
q15801
CacheSessionPool.deleteSessions
train
private function deleteSessions(array $sessions) { // gRPC calls appear to cancel when the corresponding UnaryCall object // goes out of scope. Keeping the calls in scope allows time for the // calls to complete at the expense of a small memory footprint. $this->deleteCalls = []; ...
php
{ "resource": "" }
q15802
ReadModifyWriteRowResponse.setRow
train
public function setRow($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15803
HandleFailureTrait.initFailureFile
train
private function initFailureFile() { $this->baseDir = getenv('GOOGLE_CLOUD_BATCH_DAEMON_FAILURE_DIR'); if ($this->baseDir === false) { $this->baseDir = sprintf( '%s/batch-daemon-failure', sys_get_temp_dir() ); } if (! is_dir($th...
php
{ "resource": "" }
q15804
HandleFailureTrait.handleFailure
train
public function handleFailure($idNum, array $items) { if (!$this->failureFile) { $this->initFailureFile(); }
php
{ "resource": "" }
q15805
BreakpointActionValue.setValue
train
public function setValue($var) { GPBUtil::checkEnum($var, \Google\Cloud\Debugger\V2\Breakpoint_Action::class);
php
{ "resource": "" }
q15806
ListClustersResponse.setClusters
train
public function setClusters($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15807
Span.setAttributes
train
public function setAttributes($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15808
Span.setStackTrace
train
public function setStackTrace($var) { GPBUtil::checkMessage($var, \Google\Cloud\Trace\V2\StackTrace::class);
php
{ "resource": "" }
q15809
Span.setTimeEvents
train
public function setTimeEvents($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15810
Span.setLinks
train
public function setLinks($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15811
FirestoreAdminGapicClient.fieldName
train
public static function fieldName($project, $database, $collectionId, $fieldId) { return self::getFieldNameTemplate()->render([ 'project' => $project, 'database' => $database,
php
{ "resource": "" }
q15812
FirestoreAdminGapicClient.indexName
train
public static function indexName($project, $database, $collectionId, $indexId) { return self::getIndexNameTemplate()->render([ 'project' => $project, 'database' => $database,
php
{ "resource": "" }
q15813
FirestoreAdminGapicClient.parentName
train
public static function parentName($project, $database, $collectionId) { return self::getParentNameTemplate()->render([ 'project' => $project,
php
{ "resource": "" }
q15814
Parameter.setPrompts
train
public function setPrompts($var) { $arr = GPBUtil::checkRepeatedField($var,
php
{ "resource": "" }
q15815
DateShiftConfig.setCryptoKey
train
public function setCryptoKey($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CryptoKey::class);
php
{ "resource": "" }
q15816
PubSubClient.topics
train
public function topics(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); return new ItemIterator( new PageIterator( function (array $topic) { return $this->topicFactory($topic['name'], $topic); }, ...
php
{ "resource": "" }
q15817
PubSubClient.subscriptions
train
public function subscriptions(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); return new ItemIterator( new PageIterator( function (array $subscription) { return $this->subscriptionFactory( $s...
php
{ "resource": "" }
q15818
PubSubClient.snapshot
train
public function snapshot($name, array $info = []) { return new Snapshot($this->connection,
php
{ "resource": "" }
q15819
PubSubClient.snapshots
train
public function snapshots(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false); return new ItemIterator( new PageIterator( function (array $snapshot) { return new Snapshot( $this->connection, ...
php
{ "resource": "" }
q15820
PubSubClient.consume
train
public function consume(array $requestData) { return
php
{ "resource": "" }
q15821
PubSubClient.topicFactory
train
private function topicFactory($name, array $info = []) { return new Topic( $this->connection, $this->projectId, $name,
php
{ "resource": "" }
q15822
EmploymentRecord.setAddress
train
public function setAddress($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Address::class);
php
{ "resource": "" }
q15823
AutoMlGapicClient.datasetName
train
public static function datasetName($project, $location, $dataset) { return self::getDatasetNameTemplate()->render([ 'project' => $project,
php
{ "resource": "" }
q15824
AutoMlGapicClient.modelEvaluationName
train
public static function modelEvaluationName($project, $location, $model, $modelEvaluation) { return self::getModelEvaluationNameTemplate()->render([
php
{ "resource": "" }
q15825
Query.documents
train
public function documents(array $options = []) { $maxRetries = $this->pluck('maxRetries', $options, false); $maxRetries = $maxRetries === null ? FirestoreClient::MAX_RETRIES : $maxRetries; $rows = (new ExponentialBackoff($maxRetries))->execute(function () use ($optio...
php
{ "resource": "" }
q15826
Query.select
train
public function select(array $fieldPaths) { $fields = []; foreach ($fieldPaths as $field) { if (!($field instanceof FieldPath)) { $field = FieldPath::fromString($field); } $fields[] = [ 'fieldPath' => $field->pathString() ...
php
{ "resource": "" }
q15827
Query.where
train
public function where($fieldPath, $operator, $value) { if ($value instanceof FieldValueInterface) { throw new \InvalidArgumentException(sprintf( 'Value cannot be a `%s` value.', FieldValue::class )); } if (!($fieldPath instanceof Field...
php
{ "resource": "" }
q15828
Query.orderBy
train
public function orderBy($fieldPath, $direction = self::DIR_ASCENDING) { $direction = array_key_exists(strtoupper($direction), $this->shortDirections) ? $this->shortDirections[strtoupper($direction)] : $direction; if (!in_array($direction, $this->allowedDirections)) { ...
php
{ "resource": "" }
q15829
Query.snapshotPosition
train
private function snapshotPosition(DocumentSnapshot $snapshot, array $orderBy) { $appendName = true; foreach ($orderBy as $order) { if ($order['field']['fieldPath'] === self::DOCUMENT_ID) { $appendName = false; break; } } if ($a...
php
{ "resource": "" }
q15830
Query.snapshotCursorValues
train
private function snapshotCursorValues(DocumentSnapshot $snapshot, array $orderBy) { $fieldValues = []; foreach ($orderBy as $order) { $path = $order['field']['fieldPath']; if ($path === self::DOCUMENT_ID) { continue;
php
{ "resource": "" }
q15831
Query.newQuery
train
private function newQuery(array $additionalConfig, $overrideTopLevelKeys = false) { $query = $this->query; if ($overrideTopLevelKeys) { $keys = array_keys($additionalConfig);
php
{ "resource": "" }
q15832
Query.finalQueryPrepare
train
private function finalQueryPrepare(array $query) { if (isset($query['where']['compositeFilter']) && count($query['where']['compositeFilter']['filters']) ===
php
{ "resource": "" }
q15833
CommitResponse.setMutationResults
train
public function setMutationResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15834
CloudRedisGapicClient.instanceName
train
public static function instanceName($project, $location, $instance) { return self::getInstanceNameTemplate()->render([ 'project' => $project,
php
{ "resource": "" }
q15835
BigtableInstanceAdminGrpcClient.CreateInstance
train
public function CreateInstance(\Google\Cloud\Bigtable\Admin\V2\CreateInstanceRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance',
php
{ "resource": "" }
q15836
StreamingRecognizeRequest.setStreamingConfig
train
public function setStreamingConfig($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15837
Image.setSource
train
public function setSource($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\ImageSource::class);
php
{ "resource": "" }
q15838
BatchDmlResult.rowCounts
train
public function rowCounts() { if (!$this->rowCounts) { foreach ($this->data['resultSets'] as $resultSet) {
php
{ "resource": "" }
q15839
DocumentSnapshot.get
train
public function get($fieldPath) { $res = null; if (is_string($fieldPath)) { $parts = explode('.', $fieldPath); } elseif ($fieldPath instanceof FieldPath) { $parts = $fieldPath->path(); } else { throw new \InvalidArgumentException('Given path was n...
php
{ "resource": "" }
q15840
ListEntityTypesResponse.setEntityTypes
train
public function setEntityTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15841
ScheduleTransferRunsResponse.setRuns
train
public function setRuns($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15842
ProfileEvent.setType
train
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\ProfileEvent_Pr
php
{ "resource": "" }
q15843
CreateContextRequest.setContext
train
public function setContext($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15844
InspectResult.setFindings
train
public function setFindings($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15845
ListDebuggeesResponse.setDebuggees
train
public function setDebuggees($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15846
OrganizationSettings.setAssetDiscoveryConfig
train
public function setAssetDiscoveryConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1\OrganizationSettings_AssetDiscoveryConfig::class);
php
{ "resource": "" }
q15847
Job.setJobBenefits
train
public function setJobBenefits($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15848
Job.setDegreeTypes
train
public function setDegreeTypes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15849
Job.setJobLevel
train
public function setJobLevel($var) { GPBUtil::checkEnum($var,
php
{ "resource": "" }
q15850
Job.setDerivedInfo
train
public function setDerivedInfo($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Job_DerivedInfo::class);
php
{ "resource": "" }
q15851
Job.setProcessingOptions
train
public function setProcessingOptions($var) { GPBUtil::checkMessage($var, \Google\Cloud\Talent\V4beta1\Job_ProcessingOptions::class);
php
{ "resource": "" }
q15852
Write.setUpdate
train
public function setUpdate($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\Document::class);
php
{ "resource": "" }
q15853
Write.setTransform
train
public function setTransform($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\DocumentTransform::class);
php
{ "resource": "" }
q15854
Write.setUpdateMask
train
public function setUpdateMask($var) { GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1beta1\DocumentMask::class);
php
{ "resource": "" }
q15855
ReplaceValueConfig.setNewValue
train
public function setNewValue($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Value::class);
php
{ "resource": "" }
q15856
Command.execute
train
protected function execute(InputInterface $input, OutputInterface $output) { if (PHP_VERSION_ID < 50600) { throw new \RuntimeException('This command is only available in PHP 5.6 and later.'); } $execDir = $this->rootPath . '/' . self::EXEC_DIR; $token = $this->githubToke...
php
{ "resource": "" }
q15857
Command.processComponent
train
private function processComponent( OutputInterface $output, GitHub $github, Split $split, array $component, $splitBinaryPath, $parentTagSource ) { $output->writeln(''); $localVersion = current($this->componentManager->componentsVersion($component['id']...
php
{ "resource": "" }
q15858
Command.githubToken
train
protected function githubToken($userToken) { $token = $userToken ?: getenv(self::TOKEN_ENV); if (!$token) { throw new \RuntimeException(sprintf( 'Could not find GitHub auth token. Please set the environment ' .
php
{ "resource": "" }
q15859
Command.githubClient
train
protected function githubClient(OutputInterface $output, RunShell $shell, Client $guzzle, $token) {
php
{ "resource": "" }
q15860
Command.splitshInstall
train
protected function splitshInstall(OutputInterface $output, RunShell $shell, $execDir, $binaryPath) { if ($binaryPath) { $output->writeln('<comment>[info]</comment> Using User-Provided Splitsh binary.'); return $binaryPath; } $output->writeln('<comment>[info]</comment...
php
{ "resource": "" }
q15861
Table.mutateRows
train
public function mutateRows(array $rowMutations, array $options = []) { if (!$this->isAssoc($rowMutations)) { throw new \InvalidArgumentException( 'Expected rowMutations to be of type associative array, instead got list.' ); }
php
{ "resource": "" }
q15862
Table.mutateRow
train
public function mutateRow($rowKey, Mutations $mutations, array $options = []) { $this->gapicClient->mutateRow( $this->tableName, $rowKey,
php
{ "resource": "" }
q15863
Table.readRows
train
public function readRows(array $options = []) { $rowKeys = $this->pluck('rowKeys', $options, false) ?: []; $ranges = $this->pluck('rowRanges', $options, false) ?: []; $filter = $this->pluck('filter', $options, false) ?: null; array_walk($ranges, function (&$range) { $ran...
php
{ "resource": "" }
q15864
Table.readRow
train
public function readRow($rowKey, array $options = []) { return $this->readRows( ['rowKeys' => [$rowKey]] + $options +
php
{ "resource": "" }
q15865
Table.checkAndMutateRow
train
public function checkAndMutateRow($rowKey, array $options = []) { $hasSetMutations = false; if (isset($options['predicateFilter'])) { $this->convertToProto($options, 'predicateFilter', FilterInterface::class); } if (isset($options['trueMutations'])) { $this->...
php
{ "resource": "" }
q15866
LogMetric.setLabelExtractors
train
public function setLabelExtractors($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING,
php
{ "resource": "" }
q15867
LogMetric.setVersion
train
public function setVersion($var) { GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\LogMetric_ApiVersion::class);
php
{ "resource": "" }
q15868
BatchWriteSpansRequest.setSpans
train
public function setSpans($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15869
DeidentifyConfig.setInfoTypeTransformations
train
public function setInfoTypeTransformations($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15870
DeidentifyConfig.setRecordTransformations
train
public function setRecordTransformations($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\RecordTransformations::class);
php
{ "resource": "" }
q15871
Task.setStatus
train
public function setStatus($var) { GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2beta2\TaskStatus::class);
php
{ "resource": "" }
q15872
ByteContentItem.setType
train
public function setType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Dlp\V2\ByteContentItem_BytesType::class);
php
{ "resource": "" }
q15873
CloudSchedulerGapicClient.jobName
train
public static function jobName($project, $location, $job) { return self::getJobNameTemplate()->render([ 'project' => $project,
php
{ "resource": "" }
q15874
CloudSchedulerGapicClient.deleteJob
train
public function deleteJob($name, array $optionalArgs = []) { $request = new DeleteJobRequest(); $request->setName($name); $requestParams = new RequestParamsHeaderDescriptor([ 'name' => $request->getName(), ]); $optionalArgs['headers'] = isset($optionalArgs['headers...
php
{ "resource": "" }
q15875
RepoId.setProjectRepoId
train
public function setProjectRepoId($var) { GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\ProjectRepoId::class);
php
{ "resource": "" }
q15876
Operation.setOperationType
train
public function setOperationType($var) { GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\Operation_Type::class);
php
{ "resource": "" }
q15877
LogEntry.setSeverity
train
public function setSeverity($var) { GPBUtil::checkEnum($var,
php
{ "resource": "" }
q15878
LogEntry.setHttpRequest
train
public function setHttpRequest($var) { GPBUtil::checkMessage($var,
php
{ "resource": "" }
q15879
LogEntry.setOperation
train
public function setOperation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntryOperation::class);
php
{ "resource": "" }
q15880
LogEntry.setSourceLocation
train
public function setSourceLocation($var) { GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogEntrySourceLocation::class);
php
{ "resource": "" }
q15881
ListDevicesRequest.setGatewayListOptions
train
public function setGatewayListOptions($var) { GPBUtil::checkMessage($var, \Google\Cloud\Iot\V1\GatewayListOptions::class);
php
{ "resource": "" }
q15882
UpdateTransferConfigRequest.setTransferConfig
train
public function setTransferConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferConfig::class);
php
{ "resource": "" }
q15883
ListIndexesResponse.setIndexes
train
public function setIndexes($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15884
LockTrait.synchronize
train
public function synchronize(callable $func, array $options = []) { $result = null; $exception = null; if ($this->acquire($options)) { try { $result = $func(); } catch (\Exception $ex) { $exception = $ex; }
php
{ "resource": "" }
q15885
Modification.setCreate
train
public function setCreate($var) { GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class);
php
{ "resource": "" }
q15886
NotificationChannelDescriptor.setLabels
train
public function setLabels($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15887
NotificationChannelDescriptor.setSupportedTiers
train
public function setSupportedTiers($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15888
ClusterManagerGapicClient.listClusters
train
public function listClusters($projectId, $zone, array $optionalArgs = []) { $request = new ListClustersRequest(); $request->setProjectId($projectId); $request->setZone($zone); if (isset($optionalArgs['parent'])) { $request->setParent($optionalArgs['parent']); } ...
php
{ "resource": "" }
q15889
ClusterManagerGapicClient.getCluster
train
public function getCluster($projectId, $zone, $clusterId, array $optionalArgs = []) { $request = new GetClusterRequest(); $request->setProjectId($projectId); $request->setZone($zone); $request->setClusterId($clusterId); if (isset($optionalArgs['name'])) { $request...
php
{ "resource": "" }
q15890
ListBreakpointsRequest.setAction
train
public function setAction($var) { GPBUtil::checkMessage($var, \Google\Cloud\
php
{ "resource": "" }
q15891
AsyncBatchAnnotateFilesResponse.setResponses
train
public function setResponses($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15892
AnnotateVideoRequest.setFeatures
train
public function setFeatures($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM,
php
{ "resource": "" }
q15893
RequestWrapperTrait.setCommonDefaults
train
public function setCommonDefaults(array $config) { $config += [ 'authCache' => new MemoryCacheItemPool(), 'authCacheOptions' => [], 'credentialsFetcher' => null, 'keyFile' => null, 'requestTimeout' => null, 'retries' => 3, '...
php
{ "resource": "" }
q15894
CropHintsAnnotation.setCropHints
train
public function setCropHints($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE,
php
{ "resource": "" }
q15895
DatastoreGapicClient.beginTransaction
train
public function beginTransaction($projectId, array $optionalArgs = []) { $request = new BeginTransactionRequest(); $request->setProjectId($projectId); if (isset($optionalArgs['transactionOptions'])) { $request->setTransactionOptions($optionalArgs['transactionOptions']); }...
php
{ "resource": "" }
q15896
DatastoreGapicClient.commit
train
public function commit($projectId, $mode, $mutations, array $optionalArgs = []) { $request = new CommitRequest(); $request->setProjectId($projectId); $request->setMode($mode); $request->setMutations($mutations); if (isset($optionalArgs['transaction'])) { $request-...
php
{ "resource": "" }
q15897
PsrLogger.log
train
public function log($level, $message, array $context = []) { $this->validateLogLevel($level); $options = []; if (isset($context['exception']) && ($context['exception'] instanceof \Exception || $context['exception'] instanceof \Throwable)) { $context['exception'] = (s...
php
{ "resource": "" }
q15898
PsrLogger.serialize
train
public function serialize() { $debugOutputResource = null; if (is_resource($this->debugOutputResource)) { $metadata = stream_get_meta_data($this->debugOutputResource); $debugOutputResource = [ 'uri' => $metadata['uri'], 'mode' => $metadata['mod...
php
{ "resource": "" }
q15899
PsrLogger.unserialize
train
public function unserialize($data) { list( $this->messageKey, $this->batchEnabled, $this->metadataProvider, $this->debugOutput, $this->clientConfig, $this->batchMethod, $this->logName, $debugOutputResource
php
{ "resource": "" }