We can share tokens across threads for scope so if we are fetching
multiple layers of the same container, let's reuse the token rather than
duplicating the token request. Additionally we can verify if a token
needs to be refreshed based on the expiration time.
Note: python2 code was added to build the token variable.
Change-Id: I4a3149b08013f493e13b592f064e3ff2ed4074f7
(cherry picked from commit f52b1e1a46)