code: def connect(db, host=HACR_DATABASE_SERVER, user=HACR_DATABASE_USER,
              passwd=HACR_DATABASE_PASSWD):
      
      try:
          import pymysql
      except ImportError as e:
          e.args = ('pymysql is required to fetch HACR triggers',)
          raise
      return pymysql.connect(host=host, user=user, passwd=passwd, db=db)
docs: Connect to the given SQL database