def VMRemoveServiceAccount(args: 'argparse.Namespace') -> None:
  """Removes an attached service account from a VM instance.

  Requires the instance to be stopped, if it isn't already.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.

  Raises:
    AttributeError: If no project_id was provided and none was inferred
        from the gcloud environment.
  """

  AssignProjectID(args)

  forensics.VMRemoveServiceAccount(args.project, args.instance_name,
      args.leave_stopped)
Removes an attached service account from a VM instance.

Requires the instance to be stopped, if it isn't already.

Args:
args (argparse.Namespace): Arguments from ArgumentParser.

Raises:
AttributeError: If no project_id was provided and none was inferred
from the gcloud environment.
tools/gcp_cli.py