code: def fetch_bot_discussion(
      dataset: str,
  ) -> Optional[DiscussionWithDetails]:
      """
      Fetch the discussion for a dataset and a user.
      """
      hf_api = HfApi(endpoint=CI_HUB_ENDPOINT, token=CI_USER_TOKEN)
      discussions = hf_api.get_repo_discussions(
          repo_id=dataset, repo_type=REPO_TYPE_DATASET
      )
      discussion = next(
          (
              discussion
              for discussion in discussions
              if discussion.author == CI_PARQUET_CONVERTER_USER
          ),
          None,
      )
      if not discussion:
          return None
      return hf_api.get_discussion_details(
          repo_id=dataset,
          repo_type=REPO_TYPE_DATASET,
          discussion_num=discussion.num,
      )
  
imports: import time
  from contextlib import suppress
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import Any, Optional, Union
  import requests
  from huggingface_hub.community import DiscussionComment, DiscussionWithDetails
  from huggingface_hub.constants import REPO_TYPE_DATASET, REPO_TYPES, REPO_TYPES_URL_PREFIXES
  from huggingface_hub.hf_api import HfApi
  from huggingface_hub.utils._errors import hf_raise_for_status
  from libcommon.resources import Resource
  from .constants import CI_HUB_ENDPOINT, CI_PARQUET_CONVERTER_USER, CI_USER, CI_USER_TOKEN
label_desc: Use image node_id 5 for calling a global function with example usage: fetch_bot_discussion(dataset) and returns: hf_api, None