class_docstr: Have one place to retrieve data from Yahoo API in order to ease caching and speed up operations.
  Singleton means one session one cookie shared by all threads.
class_docstr_tok: ["Have","one","place","to","retrieve","data","from","Yahoo","API","in","order","to","ease","caching","and","speed","up","operations",".","Singleton","means","one","session","one","cookie","shared","by","all","threads","."]
code: def _get_cookie_and_crumb(self, proxy=None, timeout=30):
      cookie, crumb, strategy = None, None, None
  
      utils.get_yf_logger().debug(
          f"cookie_mode = '{self._cookie_strategy}'"
      )
  
      with self._cookie_lock:
          if self._cookie_strategy == "csrf":
              crumb = self._get_crumb_csrf()
              if crumb is None:
                  # Fail
                  self._set_cookie_strategy("basic", have_lock=True)
                  cookie, crumb = self._get_cookie_and_crumb_basic(
                      proxy, timeout
                  )
          else:
              # Fallback strategy
              cookie, crumb = self._get_cookie_and_crumb_basic(
                  proxy, timeout
              )
              if cookie is None or crumb is None:
                  # Fail
                  self._set_cookie_strategy("csrf", have_lock=True)
                  crumb = self._get_crumb_csrf()
          strategy = self._cookie_strategy
      return cookie, crumb, strategy
  
imports: import functools
  from functools import lru_cache
  import requests
  from bs4 import BeautifulSoup
  import datetime
  from frozendict import frozendict
  from .None import utils, cache
  import threading
label_desc: Use image node_id 13 for calling the YfData obj's underlying member method code with example usage: obj._get_cookie_and_crumb(proxy, timeout) and returns: cookie,  crumb,  strategy