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_crumb_csrf(self, proxy=None, timeout=30):
      # Credit goes to @bot-unit #1729
  
      if self._crumb is not None:
          utils.get_yf_logger().debug("reusing crumb")
          return self._crumb
  
      if not self._get_cookie_csrf(proxy, timeout):
          # This cookie stored in session
          return None
  
      get_args = {
          "url": "https://query2.finance.yahoo.com/v1/test/getcrumb",
          "headers": self.user_agent_headers,
          "proxies": proxy,
          "timeout": timeout,
      }
      if self._session_is_caching:
          get_args["expire_after"] = self._expire_after
          r = self._session.get(**get_args)
      else:
          r = self._session.get(**get_args)
      self._crumb = r.text
  
      if (
          self._crumb is None
          or "<html>" in self._crumb
          or self._crumb == ""
      ):
          utils.get_yf_logger().debug("Didn't receive crumb")
          return None
  
      utils.get_yf_logger().debug(f"crumb = '{self._crumb}'")
      return self._crumb
  
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 12 for calling the YfData obj's underlying member method code with example usage: obj._get_crumb_csrf(proxy, timeout) and returns: self, self, None, None