code: def _has_pg_extension(self, name):
      def check(config):
          if not exclusions.against(config, "postgresql"):
              return False
          with config.db.connect() as conn:
              count = conn.scalar(
                  text(
                      "SELECT count(*) FROM pg_extension "
                      "WHERE extname='%s'" % name
                  )
              )
          return bool(count)
  
      return exclusions.only_if(check, "needs %s extension" % name)
  
imports: from sqlalchemy import exc
  from sqlalchemy import Index
  from sqlalchemy import text
  from alembic.testing import exclusions
  from alembic.testing.requirements import SuiteRequirements
  from alembic.util import compat
  from alembic.util import sqla_compat
label_desc: Use image node_id 34 for calling the DefaultRequirements obj's underlying member method code with example usage: obj._has_pg_extension(name) and returns: exclusions, bool, False