def METHOD_NAME(project):
  """Return service account ID for project."""
  # From
  # cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/create:
  #
  # The account id that is used to generate the service account email address
  # and a stable unique id. It is unique within a project, must be 6-30
  # characters long, and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])
  # to comply with RFC1035.
  account_id = _ACCOUNT_PREFIX + project.replace('_', '-')
  if not account_id[-1].isalnum():
    # Must end in '[a-z][0-9]'.
    account_id += '0'
  if len(account_id) < _MIN_LEN:
    # Must be at least |min_len| in length.
    account_id = account_id.ljust(_MIN_LEN, '0')
  # Use a hash prefix as the service account name if the project name is too
  # long.
  if len(account_id) > _MAX_LEN:
    account_id = _ACCOUNT_PREFIX + utils.string_hash(project)[:_HASH_PREFIX_LEN]
  assert len(account_id) >= _MIN_LEN and len(account_id) <= _MAX_LEN
  return account_id