docstr: Returns the singleton Installation
docstr_tok: ["Returns","the","singleton","Installation"]
code: def instance(cls) -> "Installation":
      """Returns the singleton Installation"""
      # We use a double-checked locking optimization to avoid the overhead
      # of acquiring the lock in the common case:
      # https://en.wikipedia.org/wiki/Double-checked_locking
      if cls._instance is None:
          with cls._instance_lock:
              if cls._instance is None:
                  cls._instance = Installation()
      return cls._instance
  
imports: import contextlib
  import inspect
  import os
  import sys
  import threading
  import time
  import uuid
  from collections.abc import Sized
  from functools import wraps
  from timeit import default_timer
  from typing import Any, Callable, List, Optional, Set, TypeVar, Union, cast, overload
  from typing_extensions import Final
  from streamlit import config, util
  from streamlit.logger import get_logger
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.proto.PageProfile_pb2 import Argument, Command
label_desc: Use image node_id 1 for calling the Installation obj's underlying member method code with example usage: obj.instance(cls) and returns: cls