code: def _get_bucket_name(**values):
      
      app = current_app
      # manage other special values, all have no meaning for static urls
      values.pop('_external', False)  # external has no meaning here
      values.pop('_anchor', None)  # anchor as well
      values.pop('_method', None)  # method too
  
      url_style = get_setting('FLASKS3_URL_STYLE', app)
      if url_style == 'host':
          url_format = '{bucket_name}.{bucket_domain}'
      elif url_style == 'path':
          url_format = '{bucket_domain}/{bucket_name}'
      else:
          raise ValueError('Invalid S3 URL style: "{}"'.format(url_style))
  
      if get_setting('FLASKS3_CDN_DOMAIN', app):
          bucket_path = '{}'.format(get_setting('FLASKS3_CDN_DOMAIN', app))
  
      else:
          bucket_path = url_format.format(
              bucket_name=get_setting('FLASKS3_BUCKET_NAME', app),
              bucket_domain=get_setting('FLASKS3_BUCKET_DOMAIN', app),
          )
  
      bucket_path += _get_statics_prefix(app).rstrip('/')
  
      return bucket_path, values
docs: Generates the bucket name for url_for.