code: def insert(self, query: ast.Insert):
      # https://docs.tweepy.org/en/stable/client.html#tweepy.Client.create_tweet
      columns = [col.name for col in query.columns]
  
      insert_params = (
          "consumer_key",
          "consumer_secret",
          "access_token",
          "access_token_secret",
      )
      for p in insert_params:
          if p not in self.handler.connection_args:
              raise Exception(
                  f"To insert data into Twitter, you need to provide the following parameters when connecting it to MindsDB: {insert_params}"
              )  # noqa
  
      for row in query.values:
          params = dict(zip(columns, row))
  
          # split long text over 280 symbols
          max_text_len = 280
          text = params["text"]
  
          # Post image if column media_url is provided, only do this on last tweet
          media_ids = None
          if "media_url" in params:
              media_url = params.pop("media_url")
  
              # create an in memory file
              resp = requests.get(media_url)
              img = io.BytesIO(resp.content)
  
              # upload media to twitter
              api_v1 = self.handler.create_connection(api_version=1)
              content_type = resp.headers["Content-Type"]
              file_type = content_type.split("/")[-1]
              media = api_v1.media_upload(
                  filename="img.{file_type}".format(
                      file_type=file_type
                  ),
                  file=img,
              )
  
              media_ids = [media.media_id]
  
          words = re.split("( )", text)
  
          messages = []
  
          text2 = ""
          pattern = r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
          for word in words:
              # replace the links in word to string with the length as twitter short url (23)
              word2 = re.sub(pattern, "-" * 23, word)
              if (
                  len(text2) + len(word2) > max_text_len - 3 - 7
              ):  # 3 is for ..., 7 is for (10/11)
                  messages.append(text2.strip())
  
                  text2 = ""
              text2 += word
  
          # the last message
          if text2.strip() != "":
              messages.append(text2.strip())
  
          len_messages = len(messages)
          for i, text in enumerate(messages):
              if i < len_messages - 1:
                  text += "..."
              else:
                  text += " "
                  # publish media with the last message
                  if media_ids is not None:
                      params["media_ids"] = media_ids
  
              text += f"({i + 1}/{len_messages})"
  
              params["text"] = text
              ret = self.handler.call_twitter_api(
                  "create_tweet", params
              )
              inserted_id = ret.id[0]
              params["in_reply_to_tweet_id"] = inserted_id
  
imports: import re
  import os
  import datetime
  import ast
  import time
  from collections import defaultdict
  import pytz
  import io
  import requests
  import pandas
  import tweepy
  from mindsdb.utilities import log
  from mindsdb.utilities.config import Config
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.libs.api_handler import APIHandler, APITable, FuncParser
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.integrations.utilities.date_utils import parse_utc_date
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
label_desc: Use image node_id 3 for calling the TweetsTable obj's underlying member method code with example usage: obj.insert(query) without return types