code: def _generate_request_head_bytes(method, endpoint, headers):
      
  
      head_string = _FORMAT_METHOD_AND_ENDPOINT.format(method, endpoint)
      header_tuples = sorted((k, headers[k]) for k in headers)
  
      for name, value in header_tuples:
          if _should_sign_request_header(name):
              head_string += _FORMAT_HEADER_STRING.format(name, value)
  
      return (head_string + _DELIMITER_NEWLINE).encode()
docs: :type method: str
      :type endpoint: str
      :type headers: dict[str, str]
  
      :rtype: bytes