def prepare_headers(self, headers):
self.headers = CaseInsensitiveDict()<EOL>if headers:<EOL><INDENT>for header in headers.items():<EOL><INDENT>check_header_validity(header)<EOL>name, value = header<EOL>self.headers[to_native_string(name)] = value<EOL><DEDENT><DEDENT>
Prepares the given HTTP headers.