# ======================================================================
# MODULE DETAILS
# This section provides metadata about the module, including its
# creation date, author, copyright information, and a brief description
# of the module's purpose and functionality.
# ======================================================================
# __| \ _ \ | _ \ __| __ __| __ __|
# ( _ \ / | ( | (_ | | |
# \___| _/ _\ _|_\ ____| \___/ \___| _| _|
# src/carlogtt_python_library/utils/miscs.py
# Created 8/9/23 - 11:34 AM UK Time (London) by carlogtt
"""
This module provides a set of various utilities.
"""
# ======================================================================
# EXCEPTIONS
# This section documents any exceptions made or code quality rules.
# These exceptions may be necessary due to specific coding requirements
# or to bypass false positives.
# ======================================================================
#
# ======================================================================
# IMPORTS
# Importing required libraries and modules for the application.
# ======================================================================
# Standard Library Imports
import ctypes
import logging
# END IMPORTS
# ======================================================================
# List of public names in the module
__all__ = [
'ref_count',
]
# Setting up logger for current module
module_logger = logging.getLogger(__name__)
# Type aliases
#
[docs]
def ref_count(obj_id: int) -> int:
return ctypes.c_long.from_address(obj_id).value