<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _bake_css(link):
 """ Takes a link element and turns it into an inline style link if applicable """

    if "href" in link.attrs and (re.search("\.css$", link["href"])) or ("rel" in link.attrs and link["rel"] is "stylesheet") or ("type" in link.attrs and link["type"] is "text/css"):
        if re.match("https?://", link["href"]):
            css_data = _load_url(link["href"]).read()
        else:
            css_data = _load_file(link["href"]).read()
        link.clear()
        if USING_PYTHON2:
            link.string = css_data
        else:
            link.string = str(css_data)
        link.name = "style"
        del link["rel"]
        del link["href"]