class_docstr: A dict-like class that stores secrets.
  Parses secrets.toml on-demand. Cannot be externally mutated.
  
  Safe to use from multiple threads.
class_docstr_tok: ["A","dict-like","class","that","stores","secrets",".","Parses","secrets.toml","on-demand",".","Can","not","be","externally","mutated",".","Safe","to","use","from","multiple","threads","."]
docstr: Parse our secrets.toml files if they're not already parsed.
  This function is safe to call from multiple threads.
  
  Parameters
  ----------
  print_exceptions : bool
      If True, then exceptions will be printed with `st.error` before
      being re-raised.
  
  Raises
  ------
  FileNotFoundError
      Raised if secrets.toml doesn't exist.
docstr_tok: ["Parse","our","secrets.toml","files","if","they","'re","not","already","parsed",".","This","function","is","safe","to","call","from","multiple","threads",".","Parameters","--","--","--","--","--","print_exceptions",":","bool","If","True",",","then","exceptions","will","be","printed","with","`","st.error","`","before","being","re-raised",".","Raises","--","--","--","FileNotFoundError","Raised","if","secrets.toml","does","n't","exist","."]
code: def _parse(self, print_exceptions: bool) -> Mapping[str, Any]:
      """Parse our secrets.toml files if they're not already parsed.
      This function is safe to call from multiple threads.
  
      Parameters
      ----------
      print_exceptions : bool
          If True, then exceptions will be printed with `st.error` before
          being re-raised.
  
      Raises
      ------
      FileNotFoundError
          Raised if secrets.toml doesn't exist.
  
      """
      # Avoid taking a lock for the common case where secrets are already
      # loaded.
      secrets = self._secrets
      if secrets is not None:
          return secrets
  
      with self._lock:
          if self._secrets is not None:
              return self._secrets
  
          # It's fine for a user to only have one secrets.toml file defined, so
          # we ignore individual FileNotFoundErrors when attempting to read files
          # below and only raise an exception if we weren't able read *any* secrets
          # file.
          found_secrets_file = False
          secrets = {}
  
          for path in self._file_paths:
              try:
                  with open(path, encoding="utf-8") as f:
                      secrets_file_str = f.read()
                  found_secrets_file = True
              except FileNotFoundError:
                  continue
  
              try:
                  secrets.update(toml.loads(secrets_file_str))
              except:
                  if print_exceptions:
                      st.error(f"Error parsing secrets file at {path}")
                  raise
  
          if not found_secrets_file:
              err_msg = f"No secrets files found. Valid paths for a secrets.toml file are: {', '.join(self._file_paths)}"
              if print_exceptions:
                  st.error(err_msg)
              raise FileNotFoundError(err_msg)
  
          if (
              len([p for p in self._file_paths if os.path.exists(p)])
              > 1
          ):
              _LOGGER.info(
                  f"Secrets found in multiple locations: {', '.join(self._file_paths)}. "
                  "When multiple secret.toml files exist, local secrets will take precedence over global secrets."
              )
  
          for k, v in secrets.items():
              self._maybe_set_environment_variable(k, v)
  
          self._secrets = secrets
          self._maybe_install_file_watchers()
  
          return self._secrets
  
imports: import os
  import threading
  from copy import deepcopy
  from typing import Any, Dict, ItemsView, Iterator, KeysView, List, Mapping, NoReturn, Optional, ValuesView
  import toml
  from blinker import Signal
  from typing_extensions import Final
  import streamlit
  import streamlit.watcher.path_watcher
  from streamlit import file_util, runtime
  from streamlit.logger import get_logger
label_desc: Use image node_id 4 for calling the Secrets obj's underlying member method code with example usage: obj._parse(print_exceptions) and returns: secrets, self, self