def _python_version_is_compatible(warning_str=
    'pyTorch supports Python version 2.7, 3.5, 3.6, 3.7.',
    warning_already_issued=False, list_of_compatible_versions=[2.7, 3.5, 3.6]):
    """Helper function for VersionWarning class that issues
    a warning (if a warning has not already been issued),
    whenever the python version is not in the 
    list_of_compatible_versions.
    """
    import sys
    v = sys.version_info[0] + 0.1 * sys.version_info[1]
    if v in list_of_compatible_versions:
        return True
    elif not warning_already_issued:
        import warnings
        warning = (
            """
        {}
        cleanlab supports Python versions 2.7, 3.4, 3.5, 3.6.
        You are using Python version {}.
        You'll need to use a version compatible with both."""
            .format(warning_str, v))
        warnings.warn(warning)
        warning_already_issued = True
    return False
