code: def _bake_css(link):
      
      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"]
docs: Takes a link element and turns it into an inline style link if applicable