  def AddLabels(self,
                new_labels_dict: Dict[str, Any],
                blocking_call: bool = False) -> Optional[Any]:
    """Add or update labels of a compute resource.

    Args:
      new_labels_dict (Dict): A dictionary containing the labels to be added,
          ex:{"incident_id": "1234abcd"}.
      blocking_call (bool): Optional. A boolean to decide whether the API call
          should be blocking or not, default is False.

    Returns:
      Optional[Any]: The response of the API operation (a Dict if the call is
          successful).

    Raises:
      RuntimeError: If the Compute resource Type is not one of instance,
          disk or snapshot.
    """

    get_operation = self.GetOperation()
    label_fingerprint = get_operation['labelFingerprint']

    existing_labels_dict = {}  # type: Dict[str, Any]
    if self.GetLabels() is not None:
      existing_labels_dict = self.GetLabels()
    existing_labels_dict.update(new_labels_dict)
    labels_dict = existing_labels_dict
    request_body = {
        'labels': labels_dict, 'labelFingerprint': label_fingerprint
    }

    resource_type = self.GetResourceType()
    response = {}
    if resource_type not in ['compute#instance',
                             'compute#Snapshot',
                             'compute#disk']:
      error_msg = (
          'Compute resource Type {0:s} is not one of the defined '
          'types in libcloudforensics library '
          '(Instance, Disk or Snapshot) ').format(resource_type)
      raise RuntimeError(error_msg)
    if resource_type == 'compute#instance':
      response = self.FormOperation('setLabels')(
          instance=self.name,
          project=self.project_id,
          zone=self.zone,
          body=request_body).execute()
    elif resource_type == 'compute#disk':
      response = self.FormOperation('setLabels')(
          resource=self.name,
          project=self.project_id,
          zone=self.zone,
          body=request_body).execute()
    elif resource_type == 'compute#Snapshot':
      response = self.FormOperation('setLabels')(
          resource=self.name, project=self.project_id,
          body=request_body).execute()
    if blocking_call:
      self.BlockOperation(response, zone=self.zone)

    return response
Add or update labels of a compute resource.

Args:
new_labels_dict (Dict): A dictionary containing the labels to be added,
ex:{"incident_id": "1234abcd"}.
blocking_call (bool): Optional. A boolean to decide whether the API call
should be blocking or not, default is False.

Returns:
Optional[Any]: The response of the API operation (a Dict if the call is
successful).

Raises:
RuntimeError: If the Compute resource Type is not one of instance,
disk or snapshot.
libcloudforensics/providers/gcp/internal/compute_base_resource.py