def resource_exists(name):
 try:
  open_resource(name).close()
  return True
 except IOError:
  return False

def resource_exists ( name ) : try : open_resource ( name ) . close ( ) return True except IOError : return False
return true if the given resource exists .