class_docstr: Base for interaction with Databricks.
  
  :param databricks_conn_id: Reference to the :ref:`Databricks connection <howto/connection:databricks>`.
  :param timeout_seconds: The amount of time in seconds the requests library
      will wait before timing-out.
  :param retry_limit: The number of times to retry the connection in case of
      service outages.
  :param retry_delay: The number of seconds to wait between retries (it
      might be a floating point number).
  :param retry_args: An optional dictionary with arguments passed to ``tenacity.Retrying`` class.
class_docstr_tok: ["Base","for","interaction","with","Databricks",".",":","param","databricks_conn_id",":","Reference","to","the",":","ref",":","`","Databricks","connection","<","howto\/connection",":","databricks",">","`",".",":","param","timeout_seconds",":","The","amount","of","time","in","seconds","the","requests","library","will","wait","before","timing-out",".",":","param","retry_limit",":","The","number","of","times","to","retry","the","connection","in","case","of","service","outages",".",":","param","retry_delay",":","The","number","of","seconds","to","wait","between","retries","(","it","might","be","a","floating","point","number",")",".",":","param","retry_args",":","An","optional","dictionary","with","arguments","passed","to","``","tenacity.Retrying","``","class","."]
docstr: Check if an OAuth token is valid and hasn't expired yet.
  
  :param sp_token: dict with properties of OAuth token
  :param time_key: name of the key that holds the time of expiration
  :return: true if token is valid, false otherwise
docstr_tok: ["Check","if","an","OAuth","token","is","valid","and","has","n't","expired","yet",".",":","param","sp_token",":","dict","with","properties","of","OAuth","token",":","param","time_key",":","name","of","the","key","that","holds","the","time","of","expiration",":","return",":","true","if","token","is","valid",",","false","otherwise"]
code: def _is_oauth_token_valid(token: dict, time_key="expires_on") -> bool:
      """
      Check if an OAuth token is valid and hasn't expired yet.
  
      :param sp_token: dict with properties of OAuth token
      :param time_key: name of the key that holds the time of expiration
      :return: true if token is valid, false otherwise
      """
      if (
          "access_token" not in token
          or token.get("token_type", "") != "Bearer"
          or time_key not in token
      ):
          raise AirflowException(
              f"Can't get necessary data from OAuth token: {token}"
          )
  
      return int(token[time_key]) > (
          int(time.time()) + TOKEN_REFRESH_LEAD_TIME
      )
  
imports: from __future__ import annotations
  import copy
  import platform
  import time
  from functools import cached_property
  from typing import TYPE_CHECKING, Any
  from urllib.parse import urlsplit
  import aiohttp
  import requests
  from requests import PreparedRequest, exceptions
  from requests.auth import AuthBase, HTTPBasicAuth
  from requests.exceptions import JSONDecodeError
  from tenacity import AsyncRetrying, RetryError, Retrying, retry_if_exception, stop_after_attempt, wait_exponential
  from airflow import __version__
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.providers_manager import ProvidersManager
label_desc: Use image node_id 13 for calling the BaseDatabricksHook obj's underlying member method code with example usage: obj._is_oauth_token_valid(token, time_key) and returns: unknown