def METHOD_NAME(self, cur, query):
    """ Run a query on cursor `cur` using osm ID, type and class. The
        `query` string must contain exactly one placeholder '{}' where
        the 'where' query should go.
    """
    where = 'osm_type = %s and osm_id = %s'
    params = [self.typ, self. oid]
    if self.cls is not None:
        where += ' and class = %s'
        params.append(self.cls)
    cur.execute(query.format(where), params)