import requests


def refresh_token(token):
    """Check token status and refresh if required.

    Args:
        token(Token):   Google auth token

    Returns
        token(Token):   Refreshed google token
    """
    if token.expired and token.refresh_token:
        token.refresh(requests.Request())

    return token