Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/services/ml_helpers.py b/services/ml_helpers.py
index d05a582..6db23d4 100644
--- a/services/ml_helpers.py
+++ b/services/ml_helpers.py
@@ -1,7 +1,6 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2018 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""
Helper functions for spam and component classification. These are mostly for
@@ -16,7 +15,6 @@
import csv
import hashlib
-import httplib2
import logging
import re
import sys
@@ -31,7 +29,7 @@
SPAM_COLUMNS = ['verdict', 'subject', 'content', 'email']
LEGACY_CSV_COLUMNS = ['verdict', 'subject', 'content']
-DELIMITERS = ['\s', '\,', '\.', '\?', '!', '\:', '\(', '\)']
+DELIMITERS = [r'\s', r'\,', r'\.', r'\?', '!', r'\:', r'\(', r'\)']
# Must be identical to settings.spam_feature_hashes.
SPAM_FEATURE_HASHES = 500
@@ -175,7 +173,7 @@
"""Sets up an instance of ml engine for ml classes."""
try:
credentials = GoogleCredentials.get_application_default()
- ml_engine = build('ml', 'v1', http=httplib2.Http(), credentials=credentials)
+ ml_engine = build('ml', 'v1', credentials=credentials)
return ml_engine
except (Oauth2ClientError, ApiClientError):