class_docstr: Interact with Alibaba Cloud OSS, using the oss2 library.
class_docstr_tok: ["Interact","with","Alibaba","Cloud","OSS",",","using","the","oss2","library","."]
docstr: Check if object exists.
  
  :param key: the path of the object
  :param bucket_name: the name of the bucket
  :return: True if it exists and False if not.
docstr_tok: ["Check","if","object","exists",".",":","param","key",":","the","path","of","the","object",":","param","bucket_name",":","the","name","of","the","bucket",":","return",":","True","if","it","exists","and","False","if","not","."]
code: def object_exists(
      self, key: str, bucket_name: str | None = None
  ) -> bool:
      """
      Check if object exists.
  
      :param key: the path of the object
      :param bucket_name: the name of the bucket
      :return: True if it exists and False if not.
      """
      try:
          return self.get_bucket(bucket_name).object_exists(key)
      except ClientError as e:
          self.log.error(e.message)
          return False
  
imports: from __future__ import annotations
  from functools import wraps
  from inspect import signature
  from typing import TYPE_CHECKING, Callable, TypeVar, cast
  from urllib.parse import urlsplit
  import oss2
  from oss2.exceptions import ClientError
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 4 for calling the OSSHook obj's underlying member method code with example usage: obj.object_exists(key, bucket_name) and returns: self, False