<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_commands(self, cmd_list):
 """ Checks to see if commands in list are available using ``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, basestring):
            cmd_list = [cmd_list]

        for cmd in cmd_list:
            if self.command_run("which {}".format(cmd)) == 0:
                return cmd