code: def connect(self) -> Resource:
      if self.is_connected is True and self.api:
          return self.api
      if self.connection_args:
          credentialDict = {"installed": self.connection_args}
          f = open(self.credentials_path, "w")
          f.write(json.dumps(credentialDict).replace(" ", ""))
          f.close()
  
      creds = None
  
      if os.path.isfile(
          "mindsdb/integrations/handlers/google_fit_handler/token.json"
      ):
          creds = Credentials.from_authorized_user_file(
              "mindsdb/integrations/handlers/google_fit_handler/token.json",
              SCOPES,
          )
      if not creds or not creds.valid:
          if creds and creds.expired and creds.refresh_token:
              creds.refresh(Request())
          else:
              flow = InstalledAppFlow.from_client_secrets_file(
                  self.credentials_path, SCOPES
              )
              creds = flow.run_local_server(port=0)
          with open(
              "mindsdb/integrations/handlers/google_fit_handler/token.json",
              "w",
          ) as token:
              token.write(creds.to_json())
      self.api = build("fitness", "v1", credentials=creds)
  
      self.is_connected = True
      return self.api
  
imports: import os.path
  import json
  import pandas
  import pytz
  from tzlocal import get_localzone
  from datetime import datetime
  from google.auth.transport.requests import Request
  from google.oauth2.credentials import Credentials
  from google_auth_oauthlib.flow import InstalledAppFlow
  from googleapiclient.discovery import Resource
  from googleapiclient.discovery import build
  from googleapiclient.errors import HttpError
  from mindsdb_sql import parse_sql
  from mindsdb.utilities import log
  from mindsdb.integrations.handlers.google_fit_handler.google_fit_tables import GoogleFitTable
  from mindsdb.integrations.libs.api_handler import APIHandler, FuncParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
label_desc: Use image node_id 2 for calling the GoogleFitHandler obj's underlying member method code with example usage: obj.connect() and returns: self, self