code: def is_virtual_host(endpoint_url, bucket_name):
      
      is_valid_bucket_name(bucket_name)
  
      parsed_url = urlsplit(endpoint_url)
      # bucket_name can be valid but '.' in the hostname will fail
      # SSL certificate validation. So do not use host-style for
      # such buckets.
      if 'https' in parsed_url.scheme and '.' in bucket_name:
          return False
      for host in ['s3.amazonaws.com', 'aliyuncs.com']:
          if host in parsed_url.netloc:
              return True
      return False
docs: Check to see if the ``bucket_name`` can be part of virtual host
      style.
  
      :param endpoint_url: Endpoint url which will be used for virtual host.
      :param bucket_name: Bucket name to be validated against.