parameters: (lc, lc_var=locale.LC_ALL)
docstring: Check to see if we can set a locale, and subsequently get the locale,
      without raising an Exception.
  
      Parameters
      ----------
      lc : str
          The locale to attempt to set.
      lc_var : int, default `locale.LC_ALL`
          The category of the locale being set.
  
      Returns
      -------
      is_valid : bool
          Whether the passed locale can be set
docstring_summary: Check to see if we can set a locale, and subsequently get the locale,
      without raising an Exception.
docstring_tokens: Check to see if we can set a locale and subsequently get the locale without raising an Exception .
function: def can_set_locale(lc, lc_var=locale.LC_ALL):
      """
      Check to see if we can set a locale, and subsequently get the locale,
      without raising an Exception.
  
      Parameters
      ----------
      lc : str
          The locale to attempt to set.
      lc_var : int, default `locale.LC_ALL`
          The category of the locale being set.
  
      Returns
      -------
      is_valid : bool
          Whether the passed locale can be set
      """
  
      try:
          with set_locale(lc, lc_var=lc_var):
              pass
      except (ValueError, locale.Error):
          # horrible name for a Exception subclass
          return False
      else:
          return True
function_tokens: def can_set_locale ( lc , lc_var = locale . LC_ALL ) : try : with set_locale ( lc , lc_var = lc_var ) : pass except ( ValueError , locale . Error ) : # horrible name for a Exception subclass return False else : return True