code: def _to_service(self, thing):
          
  
          # Convert UIDs to objects
          if api.is_uid(thing):
              thing = api.get_object_by_uid(thing, None)
  
          # Bail out if the thing is not a valid object
          if not api.is_object(thing):
              logger.warn("'{}' is not a valid object!".format(repr(thing)))
              return None
  
          # Ensure we have an object here and not a brain
          obj = api.get_object(thing)
  
          if IAnalysisService.providedBy(obj):
              return obj
  
          if IAnalysis.providedBy(obj):
              return obj.getAnalysisService()
  
          # An object, but neither an Analysis nor AnalysisService?
          # This should never happen.
          portal_type = api.get_portal_type(obj)
          logger.error("ARAnalysesField doesn't accept objects from {} type. "
                       "The object will be dismissed.".format(portal_type))
          return None
docs: Convert to Analysis Service
  
          :param thing: UID/Catalog Brain/Object/Something
          :returns: Analysis Service object or None