code: def get_object(self, catalog, portal_type, title=None, **kwargs):
          
          if not title and not kwargs:
              return None
          contentFilter = {"portal_type": portal_type}
          if title:
              contentFilter['title'] = to_unicode(title)
          contentFilter.update(kwargs)
          brains = catalog(contentFilter)
          if len(brains) > 1:
              logger.info("More than one object found for %s" % contentFilter)
              return None
          elif len(brains) == 0:
              if portal_type == 'AnalysisService':
                  brains = catalog(portal_type=portal_type, getKeyword=title)
                  if brains:
                      return brains[0].getObject()
              logger.info("No objects found for %s" % contentFilter)
              return None
          else:
              return brains[0].getObject()
docs: This will return an object from the catalog.
          Logs a message and returns None if no object or multiple objects found.
          All keyword arguments are passed verbatim to the contentFilter