<commit_before>#!/usr/bin/env python

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
A sample script showing how to start and stop Google Compute Engine instances.
"""
from google.cloud import compute_v1


# [START compute_start_instance]
def start_instance(project_id: str, zone: str, instance_name: str):
    """
    Starts a stopped Google Compute Engine instance (with unencrypted disks).

    Args:
        project_id: project ID or project number of the Cloud project your instance belongs to.
        zone: name of the zone your instance belongs to.
        instance_name: name of the instance your want to start.
    """
    instance_client = compute_v1.InstancesClient()
    op_client = compute_v1.ZoneOperationsClient()

    op = instance_client.start(project=project_id, zone=zone, instance=instance_name)

    while op.status != compute_v1.Operation.Status.DONE:
        op = op_client.wait(
            operation=op.name, zone=zone, project=project_id
        )
    return
# [END compute_start_instance]<commit_msg>chore(samples): fix region tag import (#142)<commit_after>#!/usr/bin/env python

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
A sample script showing how to start and stop Google Compute Engine instances.
"""

# [START compute_start_instance]
# [START compute_start_enc_instance]
# [START compute_stop_instance]
# [START compute_reset_instance]
from google.cloud import compute_v1

# [END compute_reset_instance]
# [END compute_stop_instance]
# [END compute_start_enc_instance]
# [END compute_start_instance]


# [START compute_start_instance]
def start_instance(project_id: str, zone: str, instance_name: str):
    """
    Starts a stopped Google Compute Engine instance (with unencrypted disks).

    Args:
        project_id: project ID or project number of the Cloud project your instance belongs to.
        zone: name of the zone your instance belongs to.
        instance_name: name of the instance your want to start.
    """
    instance_client = compute_v1.InstancesClient()
    op_client = compute_v1.ZoneOperationsClient()

    op = instance_client.start(project=project_id, zone=zone, instance=instance_name)

    while op.status != compute_v1.Operation.Status.DONE:
        op = op_client.wait(
            operation=op.name, zone=zone, project=project_id
        )
    return
# [END compute_start_instance]
{'fraction_non_alphanumeric': 0.07730600292825769, 'fraction_numerical': 0.007906295754026354, 'mean_word_length': 4.008797653958944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2122433', 'n_tokens_mistral': 946, 'n_tokens_neox': 917, 'n_words': 364}