Skip to content

Commit

Permalink
fix: synth.py clean up for multiple version (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored and NimJay committed Nov 10, 2022
1 parent dd7e66b commit c3cc2ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions cloud-language/snippets/automl/automlNaturalLanguageDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* https://cloud.google.com/natural-language/automl/docs/
*/

`use strict`;
'use strict';

async function createDataset(
projectId,
Expand Down Expand Up @@ -135,7 +135,9 @@ async function getDataset(projectId, computeRegion, datasetId) {
const datasetFullId = client.datasetPath(projectId, computeRegion, datasetId);

// Get complete detail of the dataset.
const [dataset] = await client.getDataset({name: datasetFullId});
const [dataset] = await client.getDataset({
name: datasetFullId,
});
// Display the dataset information.
console.log(`Dataset name: ${dataset.name}`);
console.log(`Dataset id: ${dataset.name.split('/').pop(-1)}`);
Expand Down Expand Up @@ -241,7 +243,9 @@ async function deleteDataset(projectId, computeRegion, datasetId) {
const datasetFullId = client.datasetPath(projectId, computeRegion, datasetId);

// Delete a dataset.
const [operation] = await client.deleteDataset({name: datasetFullId});
const [operation] = await client.deleteDataset({
name: datasetFullId,
});
const response = await operation.promise();
// The final result of the operation.
if (response[2].done === true) console.log('Dataset deleted.');
Expand Down
10 changes: 7 additions & 3 deletions cloud-language/snippets/automl/automlNaturalLanguageModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* https://cloud.google.com/natural-language/automl/docs/
*/

`use strict`;
'use strict';

async function createModel(projectId, computeRegion, datasetId, modelName) {
// [START automl_language_createModel]
Expand Down Expand Up @@ -180,7 +180,9 @@ async function getModel(projectId, computeRegion, modelId) {
const modelFullId = client.modelPath(projectId, computeRegion, modelId);

// Get complete detail of the model.
const [model] = await client.getModel({name: modelFullId});
const [model] = await client.getModel({
name: modelFullId,
});

// Display the model information.
console.log(`Model name: ${model.name}`);
Expand Down Expand Up @@ -398,7 +400,9 @@ async function deleteModel(projectId, computeRegion, modelId) {
const modelFullId = client.modelPath(projectId, computeRegion, modelId);

// Delete a model.
const [operation] = client.deleteModel({name: modelFullId});
const [operation] = client.deleteModel({
name: modelFullId,
});
const response = await operation.promise();
// The final result of the operation.
if (response[2].done === true) console.log('Model deleted.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* https://cloud.google.com/natural-language/automl/docs/
*/

`use strict`;
'use strict';

async function predict(projectId, computeRegion, modelId, filePath) {
// [START automl_language_predict]
Expand Down

0 comments on commit c3cc2ff

Please sign in to comment.