R`i! d dl mZ d dlZd dlZd dlZddlmZ ddZd Z ddd Z
e
j ed d
D ci c]' } | dvr!ej | dj | ) c} d
Zd ZeZ G d de Zyc c} w ) )absolute_importN )sixc B | rt j | d xs |S |S )z
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Content-Type" can be guessed, default to `default`.
r ) mimetypes
guess_type)filenamedefaults /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/urllib3/fields.pyguess_content_typer
s' ##H-a0;G;N c t t j rj d t fddD s| dd} |j d |S t j rj d t j j d | dt j rj d S # t t f$ r Y |w xY w)a!
Helper function to format and quote a single header parameter using the
strategy defined in RFC 2231.
Particularly useful for header parameters which might contain
non-ASCII values, like file names. This follows
`RFC 2388 Section 4.4