code: def lookup_profiles(self, provider, lookup):
          '''
          Return a dictionary describing the configured profiles
          '''
          if provider is None:
              provider = 'all'
          if lookup is None:
              lookup = 'all'
  
          if lookup == 'all':
              profiles = set()
              provider_profiles = set()
              for alias, info in six.iteritems(self.opts['profiles']):
                  providers = info.get('provider')
  
                  if providers:
                      given_prov_name = providers.split(':')[0]
                      salt_prov_name = providers.split(':')[1]
                      if given_prov_name == provider:
                          provider_profiles.add((alias, given_prov_name))
                      elif salt_prov_name == provider:
                          provider_profiles.add((alias, salt_prov_name))
                      profiles.add((alias, given_prov_name))
  
              if not profiles:
                  raise SaltCloudSystemExit(
                      'There are no cloud profiles configured.'
                  )
  
              if provider != 'all':
                  return provider_profiles
  
              return profilef lookup_profiles(self, provider, lookup):
          '''
          Return a dictionary describing the configured profiles
          '''
          if provider is None:
              provider = 'all'
          if lookup is None:
              lookup = 'all'
  
          if lookup == 'all':
              profiles = set()
              provider_profiles = set()
              for alias, info in six.iteritems(self.opts['profiles']):
                  providers = info.get('provider')
  
                  if providers:
                      given_prov_name = providers.split(':')[0]
                      salt_prov_name = providers.split(':')[1]
                      if given_prov_name == provider:
                          provider_profiles.add((alias, given_prov_name))
                      elif salt_prov_name == provider:
                          provider_profiles.add((alias, salt_prov_name))
                      profiles.add((alias, given_prov_name))
  
              if not profiles:
                  raise SaltCloudSystemExit(
                      'There are no cloud profiles configured.'
                  )
  
              if provider != 'all':
                  return provider_profiles
  
              return profiles
docs: Return a dictionary describing the configured profiles