+def write_bearer_token_file(filename, oauth2_bearer_token):
+ """
+ Write a token file to hold the oauth2 bearer token.
+ """
+ oauth_file = open(filename, 'w')
+ print(oauth2_bearer_token, file=oauth_file)
+ oauth_file.close()
+
+def read_bearer_token_file(filename):
+ """
+ Read a token file and return the oauth2 bearer token.
+ """
+ f = open(filename)
+ return f.readline().strip()