code: def avail_locations(call=None):
      '''
      List all available locations
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_locations function must be called with '
              '-f or --function, or with the --list-locations option'
          )
  
      ret = {}
  
      params = {'Action': 'DescribeRegions'}
      result = aws.query(params,
                         location=get_location(),
                         provider=get_provider(),
                         opts=__opts__,
                         sigver='4')
  
      for region in result:
          ret[region['regionName']] = {
              'name': region['regionName'],
              'endpoint': region['regionEndpoint'],
          }
  
      return ref avail_locations(call=None):
      '''
      List all available locations
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_locations function must be called with '
              '-f or --function, or with the --list-locations option'
          )
  
      ret = {}
  
      params = {'Action': 'DescribeRegions'}
      result = aws.query(params,
                         location=get_location(),
                         provider=get_provider(),
                         opts=__opts__,
                         sigver='4')
  
      for region in result:
          ret[region['regionName']] = {
              'name': region['regionName'],
              'endpoint': region['regionEndpoint'],
          }
  
      return ret
docs: List all available locations