code: def _get_updated_rows(self, auth, function):
          
  
          # Get dicts for all rows which were edited by building a query for
          # search_*. Each row returned from UPDATE ... RETURNING id gives us one
          # query part (qp) which then are combined to one big query for the
          # search_* API call.
          qps = []
          for row in self._curs_pg:
              qps.append(
                  {
                      'operator': 'equals',
                      'val1': 'id',
                      'val2': row['id']
                  }
              )
  
          # if we didn't update anything return empty list
          if len(qps) == 0:
              return []
  
          # fetch list of objects based on IDs
          q = qps[0]
  
          for qp in qps[1:]:
              q = {
                  'operator': 'or',
                  'val1': q,
                  'val2': qp
              }
  
          updated = function(auth, q, { 'max_result': 10000 })['result']
  
          return updated
docs: Get rows updated by last update query
  
              * `function` [function]
                  Function to use for searching (one of the search_* functions).
  
              Helper function used to fetch all rows which was updated by the
              latest UPDATE ... RETURNING id query.