code: def is_sh(executable):
      
      try:
          with io.open(executable, encoding='latin-1') as fp:
              magic = fp.read(2)
      except (OSError, IOError):
          return executable
      return magic == '#!'
docs: Determine if the specified executable is a .sh (contains a #! line)