'Prepares the given HTTP cookie data.'

def prepare_cookies(self, cookies):

    if isinstance(cookies, cookielib.CookieJar):
        cookies = cookies
    else:
        cookies = cookiejar_from_dict(cookies)
    if ('cookie' not in self.headers):
        cookie_header = get_cookie_header(cookies, self)
        if (cookie_header is not None):
            self.headers['Cookie'] = cookie_header
