class_docstr: A class for handling connections and interactions with the Binance API.
  
  Attributes:
      client (binance.spot.Spot): The `binance.spot.Spot` object for interacting with the Binance API.
      api_key (str): API key, only required for user data endpoints.
      api_secret (str): API secret, only required for user data endpoints.
      is_connected (bool): Whether or not the API client is connected to Binance.
docstr: Gets aggregate trade data for a symbol based on given parameters
  
  Returns results as a pandas DataFrame.
  
  Args:
      params (Dict): Trade data params (symbol, interval, limit, start_time, end_time)
docstr_tok: ["Gets","aggregate","trade","data","for","a","symbol","based","on","given","parameters","Returns","results","as","a","pandas","DataFrame",".","Args",":","params","(","Dict",")",":","Trade","data","params","(","symbol",",","interval",",","limit",",","start_time",",","end_time",")"]
code: def _get_klines(self, params: Dict = None) -> pd.DataFrame:
      """Gets aggregate trade data for a symbol based on given parameters
  
      Returns results as a pandas DataFrame.
  
      Args:
          params (Dict): Trade data params (symbol, interval, limit, start_time, end_time)
      """
      if "symbol" not in params:
          raise ValueError(
              'Missing "symbol" param to fetch trade data for.'
          )
      if "interval" not in params:
          raise ValueError('Missing "interval" param (1m, 1d, etc).')
  
      client = self.connect()
      symbol = params["symbol"]
      interval = params["interval"]
      limit = (
          params["limit"]
          if "limit" in params
          else BinanceAggregatedTradesTable.DEFAULT_AGGREGATE_TRADE_LIMIT
      )
      start_time = (
          params["start_time"] if "start_time" in params else None
      )
      end_time = params["end_time"] if "end_time" in params else None
      raw_klines = client.klines(
          symbol,
          interval,
          limit=limit,
          startTime=start_time,
          endTime=end_time,
      )
  
      open_time_i = 0
      close_time_i = 6
      for i in range(len(raw_klines)):
          # To train we need timestamps to be in seconds since Unix epoch and Binance returns it in ms.
          raw_klines[i][open_time_i] = int(
              raw_klines[i][open_time_i] / 1000
          )
          raw_klines[i][close_time_i] = int(
              raw_klines[i][close_time_i] / 1000
          )
  
      df = pd.DataFrame(raw_klines)
      df.insert(0, "symbol", [symbol] * len(raw_klines), True)
      # Remove last unnecessary column (unused API field)
      if len(raw_klines) > 0:
          num_cols = len(df.columns)
          df = df.drop(df.columns[[num_cols - 1]], axis=1)
      return df
  
file_path: mindsdb/mindsdb/integrations/handlers/binance_handler/binance_handler.py
imports: import pandas
  from typing import Dict
  from binance.spot import Spot
  from mindsdb.integrations.handlers.binance_handler.binance_tables import BinanceAggregatedTradesTable
  from mindsdb.integrations.libs.api_handler import APIHandler
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse
  from mindsdb.utilities import log
  from mindsdb_sql import parse_sql
label_desc: Use image node_id 4 for calling the BinanceHandler obj's underlying member method code with example usage: obj._get_klines(params) and returns: df