code: def check_tool_aux(command):
      
      assert isinstance(command, basestring)
      dirname = os.path.dirname(command)
      if dirname:
          if os.path.exists(command):
              return command
          # Both NT and Cygwin will run .exe files by their unqualified names.
          elif on_windows() and os.path.exists(command + '.exe'):
              return command
          # Only NT will run .bat files by their unqualified names.
          elif os_name() == 'NT' and os.path.exists(command + '.bat'):
              return command
      else:
          paths = path.programs_path()
          if path.glob(paths, [command]):
              return command
docs: Checks if 'command' can be found either in path
          or is a full name to an existing file.