class_docstr: Simple HTTP request handler with GET and HEAD commands.
  
  This serves files from the current directory and any of its
  subdirectories.  The MIME type for files is determined by
  calling the .guess_type() method.
  
  The GET and HEAD requests are identical except that the HEAD
  request omits the actual contents of the file.
class_docstr_tok: ["Simple","HTTP","request","handler","with","GET","and","HEAD","commands",".","This","serves","files","from","the","current","directory","and","any","of","its","subdirectories",".","The","MIME","type","for","files","is","determined","by","calling","the",".guess_type","(",")","method",".","The","GET","and","HEAD","requests","are","identical","except","that","the","HEAD","request","omits","the","actual","contents","of","the","file","."]
docstr: Translate a /-separated PATH to the local filename syntax.
  
  Components that mean special things to the local file system
  (e.g. drive or directory names) are ignored.  (XXX They should
  probably be diagnosed.)
docstr_tok: ["Translate","a","\/-separated","PATH","to","the","local","filename","syntax",".","Components","that","mean","special","things","to","the","local","file","system","(","e.g",".","drive","or","directory","names",")","are","ignored",".","(","XXX","They","should","probably","be","diagnosed",".",")"]
code: def translate_path(self, path):
      """Translate a /-separated PATH to the local filename syntax.
  
      Components that mean special things to the local file system
      (e.g. drive or directory names) are ignored.  (XXX They should
      probably be diagnosed.)
  
      """
      # abandon query parameters
      path = path.split("?", 1)[0]
      path = path.split("#", 1)[0]
      # Don't forget explicit trailing slash when normalizing. Issue17324
      trailing_slash = path.rstrip().endswith("/")
      try:
          path = urllib.parse.unquote(path, errors="surrogatepass")
      except UnicodeDecodeError:
          path = urllib.parse.unquote(path)
      path = posixpath.normpath(path)
      words = path.split("/")
      words = filter(None, words)
      path = self.directory
      for word in words:
          if os.path.dirname(word) or word in (os.curdir, os.pardir):
              # Ignore components that are not a simple file/directory name
              continue
          path = os.path.join(path, word)
      if trailing_slash:
          path += "/"
      return path
  
imports: import copy
  import datetime
  import email.utils
  import html
  import http.client
  import io
  import itertools
  import mimetypes
  import os
  import posixpath
  import select
  import shutil
  import socket
  import socketserver
  import sys
  import time
  import urllib.parse
  from http import HTTPStatus
label_desc: Use image node_id 6 for calling the SimpleHTTPRequestHandler obj's underlying member method code with example usage: obj.translate_path(path) and returns: path