def METHOD_NAME() -> int:
    """Get the maximum number of open files allowed for the current process"""
    try:
        if os.name == "nt":
            import ctypes
            return ctypes.cdll.ucrtbase._getmaxstdio()
        else:
            import resource
            soft_limit, _ = resource.getrlimit(resource.RLIMIT_NOFILE)
            return soft_limit
    except Exception:
        # Catch all exceptions, as ctypes can raise several errors
        # depending on what went wrong. Return a safe default if we
        # can't get the limit from the OS.
        return 200