code: def credentials_to_dict(credentials):
      return {
          "token": credentials.token,
          "refresh_token": credentials.refresh_token,
          "token_uri": credentials.token_uri,
          "client_id": credentials.client_id,
          "client_secret": credentials.client_secret,
          "scopes": credentials.scopes,
          "expiry": dt.datetime.strftime(
              credentials.expiry, "%Y-%m-%dT%H:%M:%S"
          ),
      }
  
file_path: mindsdb/mindsdb/integrations/handlers/gmail_handler/utils.py
imports: import datetime
  import json
  from google_auth_oauthlib.flow import Flow
label_desc: Use image node_id 1 for calling a global function with example usage: credentials_to_dict(credentials) and returns: dict