code: def get_region(service, region, profile):
      
      _, region, _, _ = _get_profile(service, region, None, None, profile)
  
      return region
docs: Retrieve the region for a particular AWS service based on configured region and/or profile.