_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q15000
ListNodePoolsResponse.setNodePools
train
public function setNodePools($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\NodePool::class); $this->node_pools = $arr; return $this; }
php
{ "resource": "" }
q15001
Metadata.getProjectId
train
public function getProjectId() { if (!isset($this->projectId)) { $this->projectId = $this->get('project/project-id'); } return $this->projectId; }
php
{ "resource": "" }
q15002
Metadata.getNumericProjectId
train
public function getNumericProjectId() { if (!isset($this->numericProjectId)) { $this->numericProjectId = $this->get('project/numeric-project-id'); } return $this->numericProjectId; }
php
{ "resource": "" }
q15003
IndexField.setArrayConfig
train
public function setArrayConfig($var) { GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class); $this->writeOneof(3, $var); return $this; }
php
{ "resource": "" }
q15004
TransferRun.setState
train
public function setState($var) { GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); $this->state = $var; return $this; }
php
{ "resource": "" }
q15005
ComponentVersionTrait.addToComponentManifest
train
private function addToComponentManifest($version, array $component) { $manifest = $this->getManifest($this->manifest()); $index = $this->getManifestComponentModuleIndex($manifest, $component['id']); array_unshift($manifest['modules'][$index]['versions'], 'v'. $version); $content = ...
php
{ "resource": "" }
q15006
ComponentVersionTrait.updateComponentVersionConstant
train
private function updateComponentVersionConstant($version, $componentPath, $componentEntry) { if (is_null($componentEntry)) { return false; } $path = $this->rootPath() .'/'. $componentPath .'/'. $componentEntry; if (!file_exists($path)) { throw new \RuntimeExc...
php
{ "resource": "" }
q15007
ComponentVersionTrait.updateComponentVersionFile
train
private function updateComponentVersionFile($version, array $component) { $path = $this->rootPath() .'/'. $component['path'] .'/VERSION'; $result = file_put_contents($path, $version); if (!$result) { throw new \RuntimeException('File write failed'); } return tru...
php
{ "resource": "" }
q15008
ComponentVersionTrait.updateComposerReplacesVersion
train
private function updateComposerReplacesVersion($version, array $component) { $composer = $this->rootPath() .'/composer.json'; if (!file_exists($composer)) { throw new \Exception('Invalid composer.json path'); } $data = json_decode(file_get_contents($composer), true); ...
php
{ "resource": "" }
q15009
KeyRange.setStart
train
public function setStart($type, array $start) { $rangeKey = $this->fromDefinition($type, 'start'); $this->startType = $rangeKey; $this->start = $start; }
php
{ "resource": "" }
q15010
KeyRange.setEnd
train
public function setEnd($type, array $end) { if (!in_array($type, array_keys($this->definition))) { throw new \InvalidArgumentException(sprintf( 'Invalid KeyRange type. Allowed values are %s', implode(', ', array_keys($this->definition)) )); } ...
php
{ "resource": "" }
q15011
KeyRange.keyRangeObject
train
public function keyRangeObject() { if (!$this->start || !$this->end) { throw new \BadMethodCallException('Key Range must supply a start and an end'); } return [ $this->startType => $this->start, $this->endType => $this->end ]; }
php
{ "resource": "" }
q15012
KeyRange.fromDefinition
train
private function fromDefinition($type, $startOrEnd) { if (!array_key_exists($type, $this->definition)) { throw new \InvalidArgumentException(sprintf( 'Invalid KeyRange %s type. Allowed values are %s.', $startOrEnd, implode(', ', array_keys($this->d...
php
{ "resource": "" }
q15013
LanguageClient.analyzeSentiment
train
public function analyzeSentiment($content, array $options = []) { return new Annotation( $this->connection->analyzeSentiment( $this->formatRequest($content, $options) ) ); }
php
{ "resource": "" }
q15014
LanguageClient.analyzeEntitySentiment
train
public function analyzeEntitySentiment($content, array $options = []) { return new Annotation( $this->connection->analyzeEntitySentiment( $this->formatRequest($content, $options) ) ); }
php
{ "resource": "" }
q15015
LanguageClient.analyzeSyntax
train
public function analyzeSyntax($content, array $options = []) { $syntaxResponse = $this->connection->analyzeSyntax( $this->formatRequest($content, $options) ); return new Annotation($syntaxResponse + ['entities' => []]); }
php
{ "resource": "" }
q15016
LanguageClient.normalizeFeatures
train
private function normalizeFeatures(array $features) { $results = []; foreach ($features as $feature) { $featureName = array_key_exists($feature, $this->featureShortNames) ? $this->featureShortNames[$feature] : $feature; $results[$featureName]...
php
{ "resource": "" }
q15017
NotificationChannelServiceGrpcClient.SendNotificationChannelVerificationCode
train
public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', $a...
php
{ "resource": "" }
q15018
NotificationChannelServiceGrpcClient.VerifyNotificationChannel
train
public function VerifyNotificationChannel(\Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel', $argument, ['\Google\Cloud\Monitorin...
php
{ "resource": "" }
q15019
RawIndices.setIndices
train
public function setIndices($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); $this->indices = $arr; return $this; }
php
{ "resource": "" }
q15020
WorkflowTemplateServiceGapicClient.workflowTemplateName
train
public static function workflowTemplateName($project, $region, $workflowTemplate) { return self::getWorkflowTemplateNameTemplate()->render([ 'project' => $project, 'region' => $region, 'workflow_template' => $workflowTemplate, ]); }
php
{ "resource": "" }
q15021
ListAlertPoliciesResponse.setAlertPolicies
train
public function setAlertPolicies($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy::class); $this->alert_policies = $arr; return $this; }
php
{ "resource": "" }
q15022
Patent.setInventors
train
public function setInventors($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->inventors = $arr; return $this; }
php
{ "resource": "" }
q15023
Patent.setSkillsUsed
train
public function setSkillsUsed($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Talent\V4beta1\Skill::class); $this->skills_used = $arr; return $this; }
php
{ "resource": "" }
q15024
ListProductsResponse.setProducts
train
public function setProducts($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\Product::class); $this->products = $arr; return $this; }
php
{ "resource": "" }
q15025
ProductSearchResults.setResults
train
public function setResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\ProductSearchResults\Result::class); $this->results = $arr; return $this; }
php
{ "resource": "" }
q15026
ProductSearchResults.setProductGroupedResults
train
public function setProductGroupedResults($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Vision\V1\ProductSearchResults\GroupedResult::class); $this->product_grouped_results = $arr; return $this; }
php
{ "resource": "" }
q15027
ItemIteratorTrait.current
train
public function current() { $page = $this->pageIterator->current(); return isset($page[$this->pageIndex]) ? $page[$this->pageIndex] : null; }
php
{ "resource": "" }
q15028
ItemIteratorTrait.next
train
public function next() { $this->pageIndex++; $this->position++; if (count($this->pageIterator->current()) <= $this->pageIndex && $this->nextResultToken()) { $this->pageIterator->next(); $this->pageIndex = 0; } }
php
{ "resource": "" }
q15029
ItemIteratorTrait.valid
train
public function valid() { $page = $this->pageIterator->current(); if (isset($page[$this->pageIndex])) { return true; } // If there are no results, but a token for the next page // exists let's continue paging until there are results. while ($this->nextRe...
php
{ "resource": "" }
q15030
SparkSqlJob.setQueryList
train
public function setQueryList($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\QueryList::class); $this->writeOneof(2, $var); return $this; }
php
{ "resource": "" }
q15031
SparkSqlJob.setProperties
train
public function setProperties($var) { $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); $this->properties = $arr; return $this; }
php
{ "resource": "" }
q15032
SparkSqlJob.setJarFileUris
train
public function setJarFileUris($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->jar_file_uris = $arr; return $this; }
php
{ "resource": "" }
q15033
SparkSqlJob.setLoggingConfig
train
public function setLoggingConfig($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1beta2\LoggingConfig::class); $this->logging_config = $var; return $this; }
php
{ "resource": "" }
q15034
BatchDeleteEntityTypesRequest.setEntityTypeNames
train
public function setEntityTypeNames($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->entity_type_names = $arr; return $this; }
php
{ "resource": "" }
q15035
ModelEvaluation.setClassificationEvaluationMetrics
train
public function setClassificationEvaluationMetrics($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics::class); $this->writeOneof(8, $var); return $this; }
php
{ "resource": "" }
q15036
ModelEvaluation.setTranslationEvaluationMetrics
train
public function setTranslationEvaluationMetrics($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\TranslationEvaluationMetrics::class); $this->writeOneof(9, $var); return $this; }
php
{ "resource": "" }
q15037
ReleaseBuilder.updateComponentVersions
train
private function updateComponentVersions(array $release) { foreach ($release as $key => $releaseComponent) { $component = $this->getComponentComposer($this->rootPath(), $key); $this->addToComponentManifest($releaseComponent['version'], $component); foreach ((arra...
php
{ "resource": "" }
q15038
ReleaseBuilder.determineUmbrellaLevel
train
private function determineUmbrellaLevel(array $release) { $levels = []; array_walk($release, function ($component) use (&$levels) { $levels[] = $component['level']; }); $levels = array_unique($levels); rsort($levels); // Since we don't use major versions...
php
{ "resource": "" }
q15039
ReleaseBuilder.createReleaseNotes
train
private function createReleaseNotes(array $release) { $buildDir = $this->rootPath .'/build'; $locationTemplate = $buildDir . '/release-%s.md'; if (!is_dir($buildDir)) { mkdir($buildDir); } $umbrella = $release[self::DEFAULT_COMPONENT]; $location = sprint...
php
{ "resource": "" }
q15040
ReleaseBuilder.mergeCommitIntoRelease
train
private function mergeCommitIntoRelease(array $release, array $commitRelease) { foreach ($commitRelease as $key => $commit) { if (!isset($release[$key])) { $release[$key] = [ 'level' => $commit['level'], 'messages' => [$commit['message']] ...
php
{ "resource": "" }
q15041
ReleaseBuilder.interactiveCommitRelease
train
private function interactiveCommitRelease(OutputInterface $output, array $commit, array $components) { $commitRelease = $this->processCommit($output, $commit, $components); $proceed = false; do { $this->displayCommitSummary($output, $commitRelease); $output->writeln...
php
{ "resource": "" }
q15042
ReleaseBuilder.handleChange
train
public function handleChange(OutputInterface $output, array $commitRelease, $level = null) { $choices = array_keys($commitRelease); if (count($choices) > 1) { $options = array_merge([ 'All Components' ], $choices, [ 'Go Back' ]); ...
php
{ "resource": "" }
q15043
ReleaseBuilder.processCommit
train
private function processCommit(OutputInterface $output, array $commit, array $components) { $output->writeln(sprintf( 'Processing Commit: <info>%s</info>', $commit['message'] )); $output->writeln(sprintf('View on GitHub: %s', $commit['htmlUrl'])); $output->wri...
php
{ "resource": "" }
q15044
ReleaseBuilder.displayCommitSummary
train
private function displayCommitSummary(OutputInterface $output, array $commitRelease) { $output->writeln('Commit Summary'); $output->writeln('-----'); foreach ($commitRelease as $key => $releaseInfo) { $output->writeln(sprintf('<info>google/%s</info> [<info>%s</info>]', $key, $th...
php
{ "resource": "" }
q15045
ReleaseBuilder.determineSuggestedLevel
train
private function determineSuggestedLevel(array $levelChoices, $suggestedLevel, array $files) { $reasons = []; if ($levelChoices !== $this->levels) { $suggestedLevel = array_keys($levelChoices)[0]; $reasons[] = 'Another change specified a higher minimum release level.'; ...
php
{ "resource": "" }
q15046
ReleaseBuilder.getOrgAndRepo
train
private function getOrgAndRepo(array $composer) { $target = $composer['target']; $matches = []; preg_match(self::TARGET_REGEX, $target, $matches); $org = $matches[1]; $repo = $matches[2]; return [$org, $repo]; }
php
{ "resource": "" }
q15047
ReleaseBuilder.hasExpectedBase
train
private function hasExpectedBase($org, $repo, $version) { $url = sprintf( self::GITHUB_RELEASES_ENDPOINT, $org, $repo, $version ); try { $res = $this->http->get($url, [ 'auth' => [null, $this->token] ]);...
php
{ "resource": "" }
q15048
ReleaseBuilder.getCommits
train
private function getCommits($org, $repo, $version) { $url = sprintf( self::GITHUB_COMPARE_ENDPOINT, $org, $repo, $version ); $res = json_decode($this->http->get($url, [ 'auth' => [null, $this->token] ])->getBody(), true); ...
php
{ "resource": "" }
q15049
ReleaseBuilder.getCommitComponentModifiedList
train
private function getCommitComponentModifiedList($url) { $commit = json_decode($this->http->get($url, [ 'auth' => [null, $this->token] ])->getBody(), true); $changedComponents = []; $fileDirectoryComponent = []; foreach ($commit['files'] as $file) { $f...
php
{ "resource": "" }
q15050
SpannerClient.batch
train
public function batch($instanceId, $databaseId) { $operation = new Operation( $this->connection, $this->returnInt64AsObject ); return new BatchClient( $operation, GapicSpannerClient::databaseName( $this->projectId, ...
php
{ "resource": "" }
q15051
SpannerClient.instanceConfigurations
train
public function instanceConfigurations(array $options = []) { $resultLimit = $this->pluck('resultLimit', $options, false) ?: 0; return new ItemIterator( new PageIterator( function (array $config) { return $this->instanceConfiguration($config['name'], ...
php
{ "resource": "" }
q15052
SpannerClient.instanceConfiguration
train
public function instanceConfiguration($name, array $config = []) { return new InstanceConfiguration($this->connection, $this->projectId, $name, $config); }
php
{ "resource": "" }
q15053
SpannerClient.instance
train
public function instance($name, array $instance = []) { return new Instance( $this->connection, $this->lroConnection, $this->lroCallables, $this->projectId, $name, $this->returnInt64AsObject, $instance ); }
php
{ "resource": "" }
q15054
SpannerClient.instances
train
public function instances(array $options = []) { $options += [ 'filter' => null ]; $resultLimit = $this->pluck('resultLimit', $options, false); return new ItemIterator( new PageIterator( function (array $instance) { $name =...
php
{ "resource": "" }
q15055
SpannerClient.connect
train
public function connect($instance, $name, array $options = []) { if (is_string($instance)) { $instance = $this->instance($instance); } $database = $instance->database($name, $options); return $database; }
php
{ "resource": "" }
q15056
Aggregation.setPerSeriesAligner
train
public function setPerSeriesAligner($var) { GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Aligner::class); $this->per_series_aligner = $var; return $this; }
php
{ "resource": "" }
q15057
Aggregation.setCrossSeriesReducer
train
public function setCrossSeriesReducer($var) { GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Reducer::class); $this->cross_series_reducer = $var; return $this; }
php
{ "resource": "" }
q15058
Aggregation.setGroupByFields
train
public function setGroupByFields($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->group_by_fields = $arr; return $this; }
php
{ "resource": "" }
q15059
ResumableUploader.resume
train
public function resume($resumeUri) { if (!$this->data->isSeekable()) { throw new GoogleException('Cannot resume upload on a stream which cannot be seeked.'); } $this->resumeUri = $resumeUri; $response = $this->getStatusResponse(); if ($response->getBody()->getSi...
php
{ "resource": "" }
q15060
ResumableUploader.getStatusResponse
train
protected function getStatusResponse() { $request = new Request( 'PUT', $this->resumeUri, ['Content-Range' => 'bytes */*'] ); return $this->requestWrapper->send($request, $this->requestOptions); }
php
{ "resource": "" }
q15061
MaintenancePolicy.setWindow
train
public function setWindow($var) { GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MaintenanceWindow::class); $this->window = $var; return $this; }
php
{ "resource": "" }
q15062
PredictRequest.setPayload
train
public function setPayload($var) { GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ExamplePayload::class); $this->payload = $var; return $this; }
php
{ "resource": "" }
q15063
ListDocumentsResponse.setDocuments
train
public function setDocuments($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Document::class); $this->documents = $arr; return $this; }
php
{ "resource": "" }
q15064
Grpc.getInstanceAdminClient
train
private function getInstanceAdminClient() { //@codeCoverageIgnoreStart if ($this->instanceAdminClient) { return $this->instanceAdminClient; } //@codeCoverageIgnoreEnd $this->instanceAdminClient = new InstanceAdminClient($this->grpcConfig); return $this->...
php
{ "resource": "" }
q15065
Grpc.getDatabaseAdminClient
train
private function getDatabaseAdminClient() { //@codeCoverageIgnoreStart if ($this->databaseAdminClient) { return $this->databaseAdminClient; } //@codeCoverageIgnoreEnd $this->databaseAdminClient = new DatabaseAdminClient($this->grpcConfig); return $this->...
php
{ "resource": "" }
q15066
AppEngineFlexFormatter.format
train
public function format(array $record) { $message = parent::format($record); list($usec, $sec) = explode(" ", microtime()); $usec = (int)(((float)$usec)*1000000000); $sec = (int)$sec; $payload = [ 'message' => $message, 'timestamp'=> ['seconds' => $sec,...
php
{ "resource": "" }
q15067
HadoopJob.setArgs
train
public function setArgs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->args = $arr; return $this; }
php
{ "resource": "" }
q15068
Condition.setConditionThreshold
train
public function setConditionThreshold($var) { GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold::class); $this->writeOneof(1, $var); return $this; }
php
{ "resource": "" }
q15069
Condition.setConditionAbsent
train
public function setConditionAbsent($var) { GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricAbsence::class); $this->writeOneof(2, $var); return $this; }
php
{ "resource": "" }
q15070
Iam.setPolicy
train
public function setPolicy($policy, array $options = []) { if ($policy instanceof PolicyBuilder) { $policy = $policy->result(); } if (!is_array($policy)) { throw new \InvalidArgumentException('Given policy data must be an array or an instance of PolicyBuilder.'); ...
php
{ "resource": "" }
q15071
Iam.reload
train
public function reload(array $options = []) { return $this->policy = $this->connection->getPolicy([ 'resource' => $this->resource ] + $options + $this->options['args']); }
php
{ "resource": "" }
q15072
WorkflowTemplate.setJobs
train
public function setJobs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataproc\V1\OrderedJob::class); $this->jobs = $arr; return $this; }
php
{ "resource": "" }
q15073
WorkflowTemplate.setParameters
train
public function setParameters($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataproc\V1\TemplateParameter::class); $this->parameters = $arr; return $this; }
php
{ "resource": "" }
q15074
RunQueryRequest.setPartitionId
train
public function setPartitionId($var) { GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); $this->partition_id = $var; return $this; }
php
{ "resource": "" }
q15075
RunQueryRequest.setReadOptions
train
public function setReadOptions($var) { GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); $this->read_options = $var; return $this; }
php
{ "resource": "" }
q15076
RunQueryRequest.setQuery
train
public function setQuery($var) { GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); $this->writeOneof(3, $var); return $this; }
php
{ "resource": "" }
q15077
RunQueryRequest.setGqlQuery
train
public function setGqlQuery($var) { GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class); $this->writeOneof(7, $var); return $this; }
php
{ "resource": "" }
q15078
PublishRequest.setMessages
train
public function setMessages($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\PubSub\V1\PubsubMessage::class); $this->messages = $arr; return $this; }
php
{ "resource": "" }
q15079
GetComponentsTrait.getComponentManifest
train
private function getComponentManifest($manifestPath, $componentId) { $manifest = $this->getManifest($manifestPath); $index = $this->getManifestComponentModuleIndex($manifest, $componentId); return $manifest['modules'][$index]; }
php
{ "resource": "" }
q15080
GetComponentsTrait.getManifestComponentModuleIndex
train
private function getManifestComponentModuleIndex($manifest, $componentId) { $manifest = is_array($manifest) ? $manifest : $this->getManifest($manifest); $modules = array_filter($manifest['modules'], function ($module) use ($componentId) { return ($module['id'] ==...
php
{ "resource": "" }
q15081
GetComponentsTrait.getManifest
train
private function getManifest($manifestPath) { if (self::$__manifest) { $manifest = self::$__manifest; } else { $manifest = json_decode(file_get_contents($manifestPath), true); if (json_last_error() !== JSON_ERROR_NONE) { throw new \RuntimeExceptio...
php
{ "resource": "" }
q15082
GetComponentsTrait.getComponentComposer
train
private function getComponentComposer($libraryRootPath, $componentId, $defaultComposerPath = null) { if (!$defaultComposerPath) { $defaultComposerPath = isset($this->defaultComponentComposer) ? $this->defaultComponentComposer : null; } $components...
php
{ "resource": "" }
q15083
ImageProperties.setDominantColors
train
public function setDominantColors($var) { GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\DominantColorsAnnotation::class); $this->dominant_colors = $var; return $this; }
php
{ "resource": "" }
q15084
ComponentManager.componentsExtra
train
public function componentsExtra($componentId = null) { $components = $this->components ?: $this->loadComponents(); array_walk($components, function (&$component) { $name = $component['composer']['name']; $component = $component['composer']['extra']['component']; ...
php
{ "resource": "" }
q15085
ComponentManager.componentsManifest
train
public function componentsManifest($componentId = null) { $manifest = $this->manifest ?: $this->loadManifest; $modules = $manifest['modules']; if ($componentId) { $modules = array_filter($modules, function ($module) use ($componentId) { return $module['id'] === $...
php
{ "resource": "" }
q15086
ComponentManager.componentsVersion
train
public function componentsVersion($componentId = null) { $components = $this->components ?: $this->loadComponents(); array_walk($components, function (&$component) { $component = $component['version']; }); return $componentId ? [$componentId => $components[$...
php
{ "resource": "" }
q15087
Mutations.deleteFromFamily
train
public function deleteFromFamily($family) { $this->mutations[] = (new Mutation) ->setDeleteFromFamily( (new DeleteFromFamily)->setFamilyName($family) ); return $this; }
php
{ "resource": "" }
q15088
Mutations.deleteFromColumn
train
public function deleteFromColumn($family, $qualifier, array $timeRange = []) { $deleteFromColumn = (new DeleteFromColumn) ->setFamilyName($family) ->setColumnQualifier($qualifier); if (!empty($timeRange)) { $timestampRange = new TimestampRange; if (iss...
php
{ "resource": "" }
q15089
DatastoreOptions.setPartitionId
train
public function setPartitionId($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\PartitionId::class); $this->partition_id = $var; return $this; }
php
{ "resource": "" }
q15090
DatastoreOptions.setKind
train
public function setKind($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\KindExpression::class); $this->kind = $var; return $this; }
php
{ "resource": "" }
q15091
StorageObject.exists
train
public function exists(array $options = []) { try { $this->connection->getObject($this->identity + $options + ['fields' => 'name']); } catch (NotFoundException $ex) { return false; } return true; }
php
{ "resource": "" }
q15092
StorageObject.update
train
public function update(array $metadata, array $options = []) { $options += $metadata; // can only set predefinedAcl or acl if (isset($options['predefinedAcl'])) { $options['acl'] = null; } return $this->info = $this->connection->patchObject($options + array_filt...
php
{ "resource": "" }
q15093
StorageObject.copy
train
public function copy($destination, array $options = []) { $key = isset($options['encryptionKey']) ? $options['encryptionKey'] : null; $keySHA256 = isset($options['encryptionKeySHA256']) ? $options['encryptionKeySHA256'] : null; $response = $this->connection->copyObject( $this->f...
php
{ "resource": "" }
q15094
StorageObject.rewrite
train
public function rewrite($destination, array $options = []) { $options['useCopySourceHeaders'] = true; $destinationKey = isset($options['destinationEncryptionKey']) ? $options['destinationEncryptionKey'] : null; $destinationKeySHA256 = isset($options['destinationEncryptionKeySHA256']) ...
php
{ "resource": "" }
q15095
StorageObject.rename
train
public function rename($name, array $options = []) { $destinationBucket = isset($options['destinationBucket']) ? $options['destinationBucket'] : $this->identity['bucket']; unset($options['destinationBucket']); $copiedObject = $this->copy($destinationBucket, [ ...
php
{ "resource": "" }
q15096
StorageObject.downloadToFile
train
public function downloadToFile($path, array $options = []) { $destination = Psr7\stream_for(fopen($path, 'w')); Psr7\copy_to_stream( $this->downloadAsStream($options), $destination ); $destination->seek(0); return $destination; }
php
{ "resource": "" }
q15097
StorageObject.downloadAsStream
train
public function downloadAsStream(array $options = []) { return $this->connection->downloadObject( $this->formatEncryptionHeaders( $options + $this->encryptionData + array_filter($this->identity) ) ); }
php
{ "resource": "" }
q15098
StorageObject.downloadAsStreamAsync
train
public function downloadAsStreamAsync(array $options = []) { return $this->connection->downloadObjectAsync( $this->formatEncryptionHeaders( $options + $this->encryptionData + array_filter($this->identity) ) ); }
php
{ "resource": "" }
q15099
StorageObject.signedUploadUrl
train
public function signedUploadUrl($expires, array $options = []) { $options += [ 'headers' => [] ]; $options['headers']['x-goog-resumable'] = 'start'; unset( $options['cname'], $options['saveAsName'], $options['responseDisposition'], ...
php
{ "resource": "" }