code: def getAnalysisServiceSettings(self, uid):
          
          sets = [s for s in self.getAnalysisServicesSettings()
                  if s.get('uid', '') == uid]
  
          # Created by using an ARTemplate?
          if not sets and self.getTemplate():
              adv = self.getTemplate().getAnalysisServiceSettings(uid)
              sets = [adv] if 'hidden' in adv else []
  
          # Created by using an AR Profile?
          if not sets and self.getProfiles():
              adv = []
              adv += [profile.getAnalysisServiceSettings(uid) for profile in
                      self.getProfiles()]
              sets = adv if 'hidden' in adv[0] else []
  
          return sets[0] if sets else {'uid': uid}
docs: Returns a dictionary with the settings for the analysis service that
          match with the uid provided.
  
          If there are no settings for the analysis service and
          analysis requests:
  
          1. looks for settings in AR's ARTemplate. If found, returns the
             settings for the AnalysisService set in the Template
          2. If no settings found, looks in AR's ARProfile. If found, returns the
             settings for the AnalysisService from the AR Profile. Otherwise,
             returns a one entry dictionary with only the key 'uid'