_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q15000 | ListNodePoolsResponse.setNodePools | train | public function setNodePools($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15001 | Metadata.getProjectId | train | public function getProjectId()
{
if (!isset($this->projectId)) {
| php | {
"resource": ""
} |
q15002 | Metadata.getNumericProjectId | train | public function getNumericProjectId()
{
if (!isset($this->numericProjectId)) {
| php | {
"resource": ""
} |
q15003 | IndexField.setArrayConfig | train | public function setArrayConfig($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class); | php | {
"resource": ""
} |
q15004 | TransferRun.setState | train | public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferState::class); | 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 = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n"; | 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 \RuntimeException(sprintf(
'Component entry file %s does not exist',
$path
));
}
$entry = file_get_contents($path);
| php | {
"resource": ""
} |
q15007 | ComponentVersionTrait.updateComponentVersionFile | train | private function updateComponentVersionFile($version, array $component)
{
$path = $this->rootPath() .'/'. $component['path'] .'/VERSION';
$result = file_put_contents($path, $version);
| 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 | php | {
"resource": ""
} |
q15009 | KeyRange.setStart | train | public function setStart($type, array $start)
{
$rangeKey = $this->fromDefinition($type, '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 [
| 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.',
| php | {
"resource": ""
} |
q15013 | LanguageClient.analyzeSentiment | train | public function analyzeSentiment($content, array $options = [])
{
return new Annotation(
$this->connection->analyzeSentiment(
| php | {
"resource": ""
} |
q15014 | LanguageClient.analyzeEntitySentiment | train | public function analyzeEntitySentiment($content, array $options = [])
{
return new Annotation(
$this->connection->analyzeEntitySentiment(
| php | {
"resource": ""
} |
q15015 | LanguageClient.analyzeSyntax | train | public function analyzeSyntax($content, array $options = [])
{
$syntaxResponse = $this->connection->analyzeSyntax(
$this->formatRequest($content, $options)
| php | {
"resource": ""
} |
q15016 | LanguageClient.normalizeFeatures | train | private function normalizeFeatures(array $features)
{
$results = [];
foreach ($features as $feature) {
$featureName = array_key_exists($feature, $this->featureShortNames)
| php | {
"resource": ""
} |
q15017 | NotificationChannelServiceGrpcClient.SendNotificationChannelVerificationCode | train | public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument,
$metadata = [], $options = []) {
| 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',
| php | {
"resource": ""
} |
q15019 | RawIndices.setIndices | train | public function setIndices($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
| php | {
"resource": ""
} |
q15020 | WorkflowTemplateServiceGapicClient.workflowTemplateName | train | public static function workflowTemplateName($project, $region, $workflowTemplate)
{
return self::getWorkflowTemplateNameTemplate()->render([
'project' => $project,
| php | {
"resource": ""
} |
q15021 | ListAlertPoliciesResponse.setAlertPolicies | train | public function setAlertPolicies($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15022 | Patent.setInventors | train | public function setInventors($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
| php | {
"resource": ""
} |
q15023 | Patent.setSkillsUsed | train | public function setSkillsUsed($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15024 | ListProductsResponse.setProducts | train | public function setProducts($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15025 | ProductSearchResults.setResults | train | public function setResults($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15026 | ProductSearchResults.setProductGroupedResults | train | public function setProductGroupedResults($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15027 | ItemIteratorTrait.current | train | public function current()
{
$page = $this->pageIterator->current();
return isset($page[$this->pageIndex])
| php | {
"resource": ""
} |
q15028 | ItemIteratorTrait.next | train | public function next()
{
$this->pageIndex++;
$this->position++;
if (count($this->pageIterator->current()) <= $this->pageIndex && $this->nextResultToken()) {
| 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->nextResultToken()) {
| php | {
"resource": ""
} |
q15030 | SparkSqlJob.setQueryList | train | public function setQueryList($var)
{
GPBUtil::checkMessage($var, | php | {
"resource": ""
} |
q15031 | SparkSqlJob.setProperties | train | public function setProperties($var)
{
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, | php | {
"resource": ""
} |
q15032 | SparkSqlJob.setJarFileUris | train | public function setJarFileUris($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
| php | {
"resource": ""
} |
q15033 | SparkSqlJob.setLoggingConfig | train | public function setLoggingConfig($var)
{
GPBUtil::checkMessage($var, | php | {
"resource": ""
} |
q15034 | BatchDeleteEntityTypesRequest.setEntityTypeNames | train | public function setEntityTypeNames($var)
{
$arr = GPBUtil::checkRepeatedField($var, | php | {
"resource": ""
} |
q15035 | ModelEvaluation.setClassificationEvaluationMetrics | train | public function setClassificationEvaluationMetrics($var)
{
GPBUtil::checkMessage($var, | php | {
"resource": ""
} |
q15036 | ModelEvaluation.setTranslationEvaluationMetrics | train | public function setTranslationEvaluationMetrics($var)
{
GPBUtil::checkMessage($var, | 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 ((array) $component['entry'] as $entry) {
| 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 of the umbrella, major versions of
// components only bump the umbrella | 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 = sprintf($locationTemplate, $umbrella['version']);
unset($release[self::DEFAULT_COMPONENT]);
ksort($release);
$notes = [];
foreach ($release as $key => $component) {
$messages = [];
foreach ($component['messages'] as $message) {
$messages[] = sprintf('* %s', $message);
| 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']]
];
} else {
$release[$key]['messages'][] = | 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('');
$choices = [
'Proceed without changes',
'Change Release Message',
'Change Release Type to Patch',
'Change Release Type to Minor',
'Change Release Type to Major',
'Start over'
];
$q = $this->choice('Choose an action', $choices, $choices[0]);
$action = $this->askQuestion($q);
$action = $this->removeDefaultFromChoice($action);
switch ($action) {
case $choices[0]:
$proceed = true;
break;
case $choices[1]:
$commitRelease = $this->handleChange($output, $commitRelease);
| 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'
]);
// By default, all components are batch modified in this method.
$q = $this->choice('Choose a component to modify.', $options, $options[0]);
$component = $this->removeDefaultFromChoice($this->askQuestion($q));
if ($component === 'Go Back') {
return $commitRelease;
}
if ($component === 'All Components') {
$component = null;
}
} else {
$component = $choices[0];
}
if ($level === null) {
if ($component) {
$componentOverview = sprintf(
| 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->writeln('----------');
$output->writeln('');
$message = trim($this->ask('Enter a release summary for this commit. You can change this later.', $commit['message']));
$commitRelease = [];
foreach ($components as $key => $component) {
$componentRelease = isset($commitRelease[$key])
? $commitRelease[$key]
: ['level' => self::LEVEL_PATCH, 'message' => '', 'reasons' => []];
$lowestAllowedLevel = $componentRelease['level'];
$suggestedLevel = $lowestAllowedLevel;
$allowedLevels = array_filter($this->levels, function ($name, $key) use ($lowestAllowedLevel) {
return $key >= $lowestAllowedLevel;
}, ARRAY_FILTER_USE_BOTH);
$output->writeln(sprintf('Component <comment>%s</comment> modified by commit.', $key));
list ($suggestedLevel, $reasons) =
$this->determineSuggestedLevel($allowedLevels, $suggestedLevel, $component['files']);
$output->writeln(sprintf(
'We suggest a <info>%s</info> release because of the following reasons. Please do not use this as an ' . | 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> | 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.';
}
if (isset($levelChoices[self::LEVEL_MINOR]) && (bool) array_filter($files, function ($file) {
$parts = explode('/', $file);
return isset($parts[1]) && $parts[1] === 'src' && count($parts) > 2;
})) {
$suggestedLevel = self::LEVEL_MINOR;
$reasons[] = 'There are changes in the component `src` folder.';
| php | {
"resource": ""
} |
q15046 | ReleaseBuilder.getOrgAndRepo | train | private function getOrgAndRepo(array $composer)
{
$target = $composer['target'];
$matches = [];
preg_match(self::TARGET_REGEX, $target, $matches);
| php | {
"resource": ""
} |
q15047 | ReleaseBuilder.hasExpectedBase | train | private function hasExpectedBase($org, $repo, $version)
{
$url = sprintf(
self::GITHUB_RELEASES_ENDPOINT,
$org,
$repo,
| 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);
$commits = [];
foreach ($res['commits'] as $commit) {
$message = $commit['commit']['message'];
$description = explode("\n", $message)[0];
$matches = [];
| 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) {
$filename = $file['filename'];
if (strpos($filename, '/') === false) {
continue;
}
$fileParts = explode('/', $filename);
$componentDirectory = $fileParts[0];
$composerPath = $this->rootPath .'/'. $componentDirectory .'/composer.json';
| php | {
"resource": ""
} |
q15050 | SpannerClient.batch | train | public function batch($instanceId, $databaseId)
{
$operation = new Operation(
$this->connection,
$this->returnInt64AsObject
);
return new BatchClient(
$operation,
| 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'], $config);
},
[$this->connection, | php | {
"resource": ""
} |
q15052 | SpannerClient.instanceConfiguration | train | public function instanceConfiguration($name, array $config = [])
{
| php | {
"resource": ""
} |
q15053 | SpannerClient.instance | train | public function instance($name, array $instance = [])
{
return new Instance(
$this->connection,
$this->lroConnection,
$this->lroCallables,
$this->projectId,
| 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 = InstanceAdminClient::parseName($instance['name'])['instance'];
return $this->instance($name, $instance);
},
[$this->connection, 'listInstances'],
| php | {
"resource": ""
} |
q15055 | SpannerClient.connect | train | public function connect($instance, $name, array $options = [])
{
if (is_string($instance)) {
| php | {
"resource": ""
} |
q15056 | Aggregation.setPerSeriesAligner | train | public function setPerSeriesAligner($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Aligner::class); | php | {
"resource": ""
} |
q15057 | Aggregation.setCrossSeriesReducer | train | public function setCrossSeriesReducer($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Reducer::class); | php | {
"resource": ""
} |
q15058 | Aggregation.setGroupByFields | train | public function setGroupByFields($var)
{
$arr = GPBUtil::checkRepeatedField($var, | 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()->getSize() > 0) {
| php | {
"resource": ""
} |
q15060 | ResumableUploader.getStatusResponse | train | protected function getStatusResponse()
{
$request = new Request(
'PUT',
$this->resumeUri, | php | {
"resource": ""
} |
q15061 | MaintenancePolicy.setWindow | train | public function setWindow($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MaintenanceWindow::class); | php | {
"resource": ""
} |
q15062 | PredictRequest.setPayload | train | public function setPayload($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ExamplePayload::class);
| php | {
"resource": ""
} |
q15063 | ListDocumentsResponse.setDocuments | train | public function setDocuments($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15064 | Grpc.getInstanceAdminClient | train | private function getInstanceAdminClient()
{
//@codeCoverageIgnoreStart
if ($this->instanceAdminClient) {
return $this->instanceAdminClient;
}
| php | {
"resource": ""
} |
q15065 | Grpc.getDatabaseAdminClient | train | private function getDatabaseAdminClient()
{
//@codeCoverageIgnoreStart
if ($this->databaseAdminClient) {
return $this->databaseAdminClient;
}
| 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,
'nanos' => $usec],
'thread' => '',
'severity' => $record['level_name'],
| php | {
"resource": ""
} |
q15067 | HadoopJob.setArgs | train | public function setArgs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
| php | {
"resource": ""
} |
q15068 | Condition.setConditionThreshold | train | public function setConditionThreshold($var)
{
GPBUtil::checkMessage($var, \Google\ | php | {
"resource": ""
} |
q15069 | Condition.setConditionAbsent | train | public function setConditionAbsent($var)
{
GPBUtil::checkMessage($var, \Google\C | 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.');
}
$request = [];
if ($this->options['parent']) {
$parent = $this->options['parent'];
$request[$parent] = $policy;
| php | {
"resource": ""
} |
q15071 | Iam.reload | train | public function reload(array $options = [])
{
return $this->policy = $this->connection->getPolicy([
| php | {
"resource": ""
} |
q15072 | WorkflowTemplate.setJobs | train | public function setJobs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15073 | WorkflowTemplate.setParameters | train | public function setParameters($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15074 | RunQueryRequest.setPartitionId | train | public function setPartitionId($var)
{
GPBUtil::checkMessage($var, | php | {
"resource": ""
} |
q15075 | RunQueryRequest.setReadOptions | train | public function setReadOptions($var)
{
GPBUtil::checkMessage($var, | php | {
"resource": ""
} |
q15076 | RunQueryRequest.setQuery | train | public function setQuery($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class);
| php | {
"resource": ""
} |
q15077 | RunQueryRequest.setGqlQuery | train | public function setGqlQuery($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class);
| php | {
"resource": ""
} |
q15078 | PublishRequest.setMessages | train | public function setMessages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, | php | {
"resource": ""
} |
q15079 | GetComponentsTrait.getComponentManifest | train | private function getComponentManifest($manifestPath, $componentId)
{
$manifest = $this->getManifest($manifestPath);
$index | php | {
"resource": ""
} |
q15080 | GetComponentsTrait.getManifestComponentModuleIndex | train | private function getManifestComponentModuleIndex($manifest, $componentId)
{
$manifest = is_array($manifest)
? $manifest
: $this->getManifest($manifest);
| 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 | php | {
"resource": ""
} |
q15082 | GetComponentsTrait.getComponentComposer | train | private function getComponentComposer($libraryRootPath, $componentId, $defaultComposerPath = null)
{
if (!$defaultComposerPath) {
$defaultComposerPath = isset($this->defaultComponentComposer)
? $this->defaultComponentComposer
: null;
}
$componentsDir = isset($this->components)
? $this->components
: $libraryRootPath;
$components = $this->getComponents($libraryRootPath, $componentsDir, $defaultComposerPath);
| php | {
"resource": ""
} |
q15083 | ImageProperties.setDominantColors | train | public function setDominantColors($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\DominantColorsAnnotation::class);
| php | {
"resource": ""
} |
q15084 | ComponentManager.componentsExtra | train | public function componentsExtra($componentId = null)
{
$components = $this->components ?: $this->loadComponents();
array_walk($components, function (&$component) {
| php | {
"resource": ""
} |
q15085 | ComponentManager.componentsManifest | train | public function componentsManifest($componentId = null)
{
$manifest = $this->manifest ?: $this->loadManifest;
$modules = $manifest['modules'];
if ($componentId) {
| php | {
"resource": ""
} |
q15086 | ComponentManager.componentsVersion | train | public function componentsVersion($componentId = null)
{
$components = $this->components ?: $this->loadComponents();
array_walk($components, function (&$component) {
$component = $component['version'];
});
| php | {
"resource": ""
} |
q15087 | Mutations.deleteFromFamily | train | public function deleteFromFamily($family)
{
$this->mutations[] = (new Mutation)
->setDeleteFromFamily(
| 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 (isset($timeRange['start'])) {
$timestampRange->setStartTimestampMicros($timeRange['start']);
}
if (isset($timeRange['end'])) {
| php | {
"resource": ""
} |
q15089 | DatastoreOptions.setPartitionId | train | public function setPartitionId($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\PartitionId::class);
| php | {
"resource": ""
} |
q15090 | DatastoreOptions.setKind | train | public function setKind($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\KindExpression::class);
| php | {
"resource": ""
} |
q15091 | StorageObject.exists | train | public function exists(array $options = [])
{
try {
$this->connection->getObject($this->identity + | 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;
} | 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(
| 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'])
? $options['destinationEncryptionKeySHA256']
: null;
$options = $this->formatDestinationRequest($destination, $options);
do {
$response = $this->connection->rewriteObject($options);
$options['rewriteToken'] = isset($response['rewriteToken']) ? $response['rewriteToken'] : null;
} while ($options['rewriteToken']);
return new StorageObject(
| 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, [
'name' => $name
| php | {
"resource": ""
} |
q15096 | StorageObject.downloadToFile | train | public function downloadToFile($path, array $options = [])
{
$destination = Psr7\stream_for(fopen($path, 'w'));
| php | {
"resource": ""
} |
q15097 | StorageObject.downloadAsStream | train | public function downloadAsStream(array $options = [])
{
return $this->connection->downloadObject(
$this->formatEncryptionHeaders(
$options
| php | {
"resource": ""
} |
q15098 | StorageObject.downloadAsStreamAsync | train | public function downloadAsStreamAsync(array $options = [])
{
return $this->connection->downloadObjectAsync(
$this->formatEncryptionHeaders(
$options
| 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'],
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.