original_docstring: Returns true if healthcheck on url succeeds, false otherwise
  
      :param url: the healthcheck url
      :param timeout: timeout in seconds
      :returns: True if healthcheck succeeds within number of seconds specified by timeout, false otherwise
      
docstring: Returns true if healthcheck on url succeeds, false otherwise
docstring_tokens: Returns true if healthcheck on url succeeds false otherwise
code: def perform_http_healthcheck(url, timeout):
      """Returns true if healthcheck on url succeeds, false otherwise
  
      :param url: the healthcheck url
      :param timeout: timeout in seconds
      :returns: True if healthcheck succeeds within number of seconds specified by timeout, false otherwise
      """
      try:
          with Timeout(seconds=timeout):
              try:
                  res = requests.get(url, verify=False)
              except requests.ConnectionError:
                  return (False, "http request failed: connection failed")
      except TimeoutError:
          return (False, "http request timed out after %d seconds" % timeout)
  
      if 'content-type' in res.headers and ',' in res.headers['content-type']:
          paasta_print(PaastaColors.yellow(
              "Multiple content-type headers detected in response."
              " The Mesos healthcheck system will treat this as a failure!",
          ))
          return (False, "http request succeeded, code %d" % res.status_code)
      # check if response code is valid per https://mesosphere.github.io/marathon/docs/health-checks.html
      elif res.status_code >= 200 and res.status_code < 400:
          return (True, "http request succeeded, code %d" % res.status_code)
      else:
          return (False, "http request failed, code %s" % str(res.status_code))
code_tokens: def perform_http_healthcheck ( url , timeout ) : try : with Timeout ( seconds = timeout ) : try : res = requests . get ( url , verify = False ) except requests . ConnectionError : return ( False , "http request failed: connection failed" ) except TimeoutError : return ( False , "http request timed out after %d seconds" % timeout ) if 'content-type' in res . headers and ',' in res . headers [ 'content-type' ] : paasta_print ( PaastaColors . yellow ( "Multiple content-type headers detected in response." " The Mesos healthcheck system will treat this as a failure!" , ) ) return ( False , "http request succeeded, code %d" % res . status_code ) elif res . status_code >= 200 and res . status_code < 400 : return ( True , "http request succeeded, code %d" % res . status_code ) else : return ( False , "http request failed, code %s" % str ( res . status_code ) )
short_docstring: Returns true if healthcheck on url succeeds, false otherwise
short_docstring_tokens: Returns true if healthcheck on url succeeds false otherwise
comment: """Returns true if healthcheck on url succeeds, false otherwise
  
      :param url: the healthcheck url
      :param timeout: timeout in seconds
      :returns: True if healthcheck succeeds within number of seconds specified by timeout, false otherwise
      """$SEP$# check if response code is valid per https://mesosphere.github.io/marathon/docs/health-checks.html