class_docstr: `ISQLQuote` adapter for `Range` subclasses.
  
  This is an abstract class: concrete classes must set a `name` class
  attribute or override `getquoted()`.
class_docstr_tok: ["`","ISQLQuote","`","adapter","for","`","Range","`","subclasses",".","This","is","an","abstract","class",":","concrete","classes","must","set","a","`","name","`","class","attribute","or","override","`","getquoted","(",")","`","."]
code: def getquoted(self):
      if self.name is None:
          raise NotImplementedError(
              "RangeAdapter must be subclassed overriding its name "
              "or the getquoted() method"
          )
  
      r = self.adapted
      if r.isempty:
          return b"'empty'::" + self.name.encode("utf8")
  
      if r.lower is not None:
          a = adapt(r.lower)
          if hasattr(a, "prepare"):
              a.prepare(self._conn)
          lower = a.getquoted()
      else:
          lower = b"NULL"
  
      if r.upper is not None:
          a = adapt(r.upper)
          if hasattr(a, "prepare"):
              a.prepare(self._conn)
          upper = a.getquoted()
      else:
          upper = b"NULL"
  
      return (
          self.name.encode("utf8")
          + b"("
          + lower
          + b", "
          + upper
          + b", '"
          + r._bounds.encode("utf8")
          + b"')"
      )
  
imports: import re
  from psycopg2._psycopg import ProgrammingError, InterfaceError
  from psycopg2.extensions import ISQLQuote, adapt, register_adapter
  from psycopg2.extensions import new_type, new_array_type, register_type
label_desc: Use image node_id 4 for calling the RangeAdapter obj's underlying member method code with example usage: obj.getquoted() and returns: unknown, unknown