def _check_blocklist(self, pkg_name):
        """
        Check if a package is blocklisted.
        The result is a tuple:
            - element 0 is True if the package is blocklisted
            - element 1 is the reason
            - element 2 is True if the install should fail due to this
            - element 3 is an optional alternative package to use instead.
        :param pkg_name: name of package to check
        :type pkg_name: str
        :return: a tuple of (blocklisted, reason, fatal, alt).
        :rtype: (bool, str, bool, str or None)
        """
        if (BLOCKLIST_PATH is None) or (not os.path.exists(BLOCKLIST_PATH)):
            # blocklist not available
            return (False, "", False, None)
        with open(BLOCKLIST_PATH) as fin:
            content = json.load(fin)
        if pkg_name not in content["blocklist"]:
            # package not blocklisted
            return (False, "", False, None)
        else:
            # package blocklisted
            reasonid, fatal, alt = content["blocklist"][pkg_name]
            reason = content["reasons"].get(reasonid, reasonid)
            return (True, reason, fatal, alt)

        Check if a package is blocklisted.
        The result is a tuple:
            - element 0 is True if the package is blocklisted
            - element 1 is the reason
            - element 2 is True if the install should fail due to this
            - element 3 is an optional alternative package to use instead.
        :param pkg_name: name of package to check
        :type pkg_name: str
        :return: a tuple of (blocklisted, reason, fatal, alt).
        :rtype: (bool, str, bool, str or None)
        
bin/pip.py