parameters: (executable)
return_statement: return magic == '#!'
docstring: Determine if the specified executable is a .sh (contains a #! line)
docstring_summary: Determine if the specified executable is a .sh (contains a #! line)
docstring_tokens: Determine if the specified executable is a . sh ( contains a #! line )
function: def is_sh(executable):
      """Determine if the specified executable is a .sh (contains a #! line)"""
      try:
          with io.open(executable, encoding='latin-1') as fp:
              magic = fp.read(2)
      except (OSError, IOError):
          return executable
      return magic == '#!'
function_tokens: 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 == '#!'