def use_select_poll_workaround(nose_only=True):
    """
    Work around for eventlet monkey patched code which relies on select.poll() functionality
    which is blocking and not green / async.

    Keep in mind that this was always the case in old eventlet versions, but v0.20.0 removed
    select.poll() to avoid users shooting themselves in the foot and rely on blocking code.

    This code inserts original blocking select.poll() into the sys.modules so it can be used
    where needed.

    Keep in mind that this code should only be uses in scenarios where blocking is not a problem.

    For example:

    1) Inside tests which rely on subprocess.poll() / select.poll().
    2) Inside code which relies on 3rd party libraries which use select.poll() and are ran
       inside a subprocess so blocking is not an issue (e.g. actions, sensors).

    :param nose_only: True to only perform monkey patch when running tests under nose tests
                      runner.
    :type nose_only: ``bool``
    """
    import sys
    import select
    import subprocess
    import eventlet

    # Work around to get tests to pass with eventlet >= 0.20.0
    if not nose_only or (
        nose_only
        # sys._called_from_test set in conftest.py for pytest runs
        and ("nose" in sys.modules.keys() or hasattr(sys, "_called_from_test"))
    ):
        # Add back blocking poll() to eventlet monkeypatched select
        original_poll = eventlet.patcher.original("select").poll
        select.poll = original_poll

        sys.modules["select"] = select
        subprocess.select = select

        if sys.version_info >= (3, 6, 5):
            # If we also don't patch selectors.select, it will fail with Python >= 3.6.5
            import selectors  # pylint: disable=import-error

            sys.modules["selectors"] = selectors
            selectors.select = sys.modules["select"]

    Work around for eventlet monkey patched code which relies on select.poll() functionality
    which is blocking and not green / async.

    Keep in mind that this was always the case in old eventlet versions, but v0.20.0 removed
    select.poll() to avoid users shooting themselves in the foot and rely on blocking code.

    This code inserts original blocking select.poll() into the sys.modules so it can be used
    where needed.

    Keep in mind that this code should only be uses in scenarios where blocking is not a problem.

    For example:

    1) Inside tests which rely on subprocess.poll() / select.poll().
    2) Inside code which relies on 3rd party libraries which use select.poll() and are ran
       inside a subprocess so blocking is not an issue (e.g. actions, sensors).

    :param nose_only: True to only perform monkey patch when running tests under nose tests
                      runner.
    :type nose_only: ``bool``
    
st2common/st2common/util/monkey_patch.py