def _get_drive_api(credentials):
    """
    For a given set of credentials, return a drive API object.
    """
    http = httplib2.Http()
    http = credentials.authorize(http)
    service = discovery.build('drive', 'v2', http=http)
    service.credentials = credentials  # duck punch service obj. with credentials
    return service
For a given set of credentials, return a drive API object.