def check_commands(self, cmd_list):
        """
        Checks to see if commands in list are available using shutil.which().

        returns the first available command.

        If a string is passed then that command will be checked for.
        """
        # if a string is passed then convert it to a list.  This prevents an
        # easy mistake that could be made
        if isinstance(cmd_list, str):
            cmd_list = [cmd_list]

        for cmd in cmd_list:
            if which(cmd) is not None:
                return cmd

        Checks to see if commands in list are available using shutil.which().

        returns the first available command.

        If a string is passed then that command will be checked for.
        
py3status/py3.py