code: def sign_request(private_key, method, endpoint, body_bytes, headers):
      
  
      head_bytes = _generate_request_head_bytes(method, endpoint, headers)
      bytes_to_sign = head_bytes + body_bytes
      signer = PKCS1_v1_5.new(private_key)
      digest = SHA256.new()
      digest.update(bytes_to_sign)
      sign = signer.sign(digest)
  
      return b64encode(sign)
docs: :type private_key: RSA.RsaKey
      :type method: str
      :type endpoint: str
      :type body_bytes: bytes
      :type headers: dict[str, str]
  
      :rtype: str