def has_pattern():
 try:
  from pattern.en import parse
  return True
 except ImportError:
  return False

def has_pattern ( ) : try : from pattern . en import parse return True except ImportError : return False
function which returns a flag indicating whether pattern is installed or not .