code: def __init__(self, name: str = None, **kwargs):
      super().__init__(name)
      args = kwargs.get("connection_data", {})
      self.connection_args = {}
      self.credentials_path = None
      if "service_account_file" in args:
          if os.path.isfile(args["service_account_file"]) is False:
              raise Exception(
                  "service_account_file must be a path to the credentials.json file"
              )
          self.credentials_path = args["service_account_file"]
      elif "service_account_json" in args:
          self.connection_args = args["service_account_json"]
          if (
              not isinstance(self.connection_args, dict)
              or (
                  ("redirect_uris" not in self.connection_args.keys())
                  and len(self.connection_args) != 6
              )
              or ("redirect_uris" in self.connection_args.keys())
              and len(self.connection_args) != 7
          ):
              raise Exception(
                  "service_account_json has to be a dictionary with all 6 required fields"
              )
          self.connection_args["redirect_uris"] = ["http://localhost"]
          self.credentials_path = "mindsdb/integrations/handlers/google_fit_handler/credentials.json"
      else:
          raise Exception(
              "Connection args have to content ether service_account_file or service_account_json"
          )
  
      self.api = None
      self.is_connected = False
  
      aggregated_data = GoogleFitTable(self)
      self._register_table("aggregated_data", aggregated_data)
  
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 1 to create a new GoogleFitHandler object from inherited base classes: APIHandler with example: obj = GoogleFitHandler(name)