code: def normalize_path(path, encoding='utf-8'):
      '''Normalize a path string.
  
      Flattens a path by removing dot parts,
      percent-encodes unacceptable characters and ensures percent-encoding is
      uppercase.
      '''
      if not path.startswith('/'):
          path = '/' + path
      path = percent_encode(flatten_path(path, flatten_slashes=True), encoding=encoding)
      return uppercase_percent_encoding(pathf normalize_path(path, encoding='utf-8'):
      '''Normalize a path string.
  
      Flattens a path by removing dot parts,
      percent-encodes unacceptable characters and ensures percent-encoding is
      uppercase.
      '''
      if not path.startswith('/'):
          path = '/' + path
      path = percent_encode(flatten_path(path, flatten_slashes=True), encoding=encoding)
      return uppercase_percent_encoding(path)
docs: Normalize a path string.
  
      Flattens a path by removing dot parts,
      percent-encodes unacceptable characters and ensures percent-encoding is
      uppercase.