docstr: Serve a GET request 
docstr_tok: ["Serve","a","GET","request"]
code: def do_GET(self):  # pylint: disable=invalid-name
      """Serve a GET request"""
      path = urllib.parse.urlparse(self.path).path
      path = "/index.html" if path == "/" else path
      status_code = 404
      content = None
      content_type = None
      if path.startswith("/data/"):
          path = urllib.parse.unquote(path[len("/data/") :])
          content = self.content.read(path)
          if content:
              content_type = "application/octet-stream"
              status_code = 200
      else:
          base_dir = os.path.dirname(os.path.realpath(__file__))
          filename = os.path.normpath(os.path.realpath(base_dir + path))
          extension = os.path.splitext(filename)[1]
          if (
              os.path.commonprefix([base_dir, filename]) == base_dir
              and os.path.exists(filename)
              and not os.path.isdir(filename)
              and extension in self.mime_types
          ):
              content_type = self.mime_types[extension]
              with open(filename, "rb") as file:
                  content = file.read()
              if path == "/index.html":
                  content = content.decode("utf-8")
                  meta = [
                      '<meta name="type" content="Python">',
                      '<meta name="version" content="'
                      + __version__
                      + '">',
                  ]
                  base = self.content.base
                  identifier = self.content.identifier
                  if base and identifier:
                      meta.append(
                          '<meta name="file" content="/data/'
                          + base
                          + '">'
                      )
                      meta.append(
                          '<meta name="identifier" content="'
                          + identifier
                          + '">'
                      )
                  meta = "\n".join(meta)
                  content = re.sub(
                      r'<meta name="version" content=".*">',
                      meta,
                      content,
                  )
                  content = content.encode("utf-8")
              status_code = 200
      _log(
          self.verbosity > 1,
          str(status_code)
          + " "
          + self.command
          + " "
          + self.path
          + "\n",
      )
      self._write(status_code, content_type, content)
  
imports: import errno
  import http.server
  import importlib.util
  import json
  import os
  import random
  import re
  import socket
  import socketserver
  import sys
  import threading
  import time
  import webbrowser
  import urllib.parse
label_desc: Use image node_id 2 for calling the _HTTPRequestHandler obj's underlying member method code with example usage: obj.do_GET() without return types