class_docstr: The Twelve Labs API client for the Twelve Labs handler.
  This client is used for accessing the Twelve Labs API endpoints.
class_docstr_tok: ["The","Twelve","Labs","API","client","for","the","Twelve","Labs","handler",".","This","client","is","used","for","accessing","the","Twelve","Labs","API","endpoints","."]
docstr: Submit a request to the Twelve Labs API.
  
  Parameters
  ----------
  endpoint : str
      API endpoint.
  
  headers : Dict, Optional
      Headers to be used in the request.
  
  data : Dict, Optional
      Data to be used in the request.
  
  method : str, Optional
      HTTP method to be used in the request. Defaults to GET.
  
  Returns
  -------
  Dict
      Response from the API.
docstr_tok: ["Submit","a","request","to","the","Twelve","Labs","API",".","Parameters","--","--","--","--","--","endpoint",":","str","API","endpoint",".","headers",":","Dict",",","Optional","Headers","to","be","used","in","the","request",".","data",":","Dict",",","Optional","Data","to","be","used","in","the","request",".","method",":","str",",","Optional","HTTP","method","to","be","used","in","the","request",".","Defaults","to","GET",".","Returns","--","--","--","-","Dict","Response","from","the","API","."]
code: def _submit_request(
      self,
      endpoint: str,
      headers: Dict = None,
      data: Dict = None,
      method: str = "GET",
  ) -> Dict:
      """
      Submit a request to the Twelve Labs API.
  
      Parameters
      ----------
      endpoint : str
          API endpoint.
  
      headers : Dict, Optional
          Headers to be used in the request.
  
      data : Dict, Optional
          Data to be used in the request.
  
      method : str, Optional
          HTTP method to be used in the request. Defaults to GET.
  
      Returns
      -------
      Dict
          Response from the API.
      """
  
      url = f"{twelve_labs_handler_config.BASE_URL}/{endpoint}"
  
      headers = headers if headers else self.headers
  
      if method == "GET":
          response = requests.get(
              url=url,
              headers=headers,
              params=data if data else {},
          )
  
      elif method == "POST":
          response = requests.post(
              url=url,
              headers=headers,
              json=data if data else {},
          )
  
      else:
          raise Exception(f"Method {method} not supported yet.")
  
      result = response.json()
      if response.status_code in (200, 201):
          logger.info("API request was successful.")
          return result
      else:
          logger.error(f"API request has failed: {result['message']}")
          # TODO: update Exception to be more specific
          raise Exception(
              f"API request has failed: {result['message']}"
          )
  
file_path: mindsdb/mindsdb/integrations/handlers/twelve_labs_handler/twelve_labs_api_client.py
imports: import time
  import requests
  from typing import Dict, List, Optional
  from requests_toolbelt.multipart.encoder import MultipartEncoder
  from mindsdb.utilities import log
  from mindsdb.integrations.handlers.twelve_labs_handler.settings import twelve_labs_handler_config
label_desc: Use image node_id 9 for calling the TwelveLabsAPIClient obj's underlying member method code with example usage: obj._submit_request(endpoint, headers, data, method) and returns: result