Return the plain and html versions of our contents.

        Return: tuple
        Exceptions: None
196634
def body(self, **kwargs):
        
        text_content, html_content = None, None
        if self.plain:
            text_content = mold.cast(self.plain, **kwargs)
        if self.html:
            html_content = mold.cast(self.html, **kwargs)
        return text_content, html_content
948217
def get_version():
    
    contents = read(os.path.join(PATH_BASE, 'srptools', '__init__.py'))
    version = re.search('VERSION = \(([^)]+)\)', contents)
    version = version.group(1).replace(', ', '.').strip()
    return version
935287
def html(self, page, version=None):
        
        return (self._dokuwiki.send('wiki.getPageHTMLVersion', page, version)
                if version is not None
                else self._dokuwiki.send('wiki.getPageHTML', page))
76364
def content(self, output=None, str_output=None, **kwargs):
        """"""
        if self.response.mimetype != "text/html":
            raise Failure(_("expected request to return HTML, but it returned {}").format(
                self.response.mimetype))

        # TODO: Remove once beautiful soup updates to accomodate python 3.7
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            content = BeautifulSoup(self.response.data, "html.parser")

        return self._search_page(
            output,
            str_output,
            content,
            lambda regex, content: any(regex.search(str(tag)) for tag in content.find_all(**kwargs)))
208385
def get_version(self):
        
        return Version.objects.get(
            content_type=self.content_type,
            object_id=self.object_id,
            version_number=self.publish_version,
        )
880690
def _repr_html_(self):
        
        # Use StringIO to avoid a large number of memory allocations with string concat
        with io.StringIO() as out:
            out.write('<{tag}'.format(tag=escape(self.tag_name)))
            if self.style:
                # Important values are in double quotes - cgi.escape only escapes double quotes, not single quotes!
                out.write(' style="{css}"'.format(
                    css=escape(self._to_inline_css(self.style))))

            for k, v in self.attributes.items():
                k2 = k
                if k2 == 'class_':
                    k2 = 'class'
                # Important values are in double quotes - cgi.escape only escapes double quotes, not single quotes!
                if isinstance(v, string_types):
                    out.write(' {key}="{value}"'.format(
                        key=escape(k2), value=escape(v)))
                if isinstance(v, bool) and v:
                    out.write(' {key}'.format(key=escape(k2)))
            out.write('>')

            for c in self.children:
                if isinstance(c, string_types):
                    out.write(escape(safe_unicode(c)))
                else:
                    out.write(c._repr_html_())

            out.write('</{tag}>'.format(tag=escape(self.tag_name)))

            return out.getvalue()
152685
def get_html_string(self):
        """"""
        if self.__htmltree is not None:
            return htmltostring(self.__htmltree)
        else:
            self.__make_tree()
            return htmltostring(self.__htmltree)
1236064
def all_versions(req):
    """"""
    import requests
    url = "https://pypi.python.org/pypi/" + req + "/json"
    return tuple(requests.get(url).json()["releases"].keys())
573789
def as_html(self):
        
        url = '{prefix}{code}.html?download'.format(prefix=EPSG_IO_URL,
                                                    code=self.id)
        return requests.get(url).text
309538
def _repr_html_(self):
        
        if self._info_repr():
            buf = StringIO("")
            self.info(buf=buf)
            # need to escape the <class>, should be the first line.
            val = buf.getvalue().replace('<', r'&lt;', 1)
            val = val.replace('>', r'&gt;', 1)
            return '<pre>' + val + '</pre>'

        if get_option("display.notebook_repr_html"):
            max_rows = get_option("display.max_rows")
            max_cols = get_option("display.max_columns")
            show_dimensions = get_option("display.show_dimensions")

            return self.to_html(max_rows=max_rows, max_cols=max_cols,
                                show_dimensions=show_dimensions, notebook=True)
        else:
            return None
639000
def contents(self):
        
        if not hasattr(self, "_content"):
            self._content = self.get_content()
        return self._content
33569
def _get_html_contents(html):
    """"""
    parser = MyHTMLParser()
    parser.feed(html)
    if parser.is_code:
        return ('code', parser.data.strip())
    elif parser.is_math:
        return ('math', parser.data.strip())
    else:
        return '', ''
957442
def content(self):  # type: () -> object
        
        as_text = self.content_type in _content_types.UTF8_TYPES

        return self.get_data(as_text=as_text)
1051750
def get_version():
    
    try:
        wk_version = _string_execute('-V')
    except Exception as e:
        # we catch all errors here to make sure we get a version no matter what
        wk_version = '%s: %s' % (e.__class__.__name__, e)
    return 'pydf version: %s\nwkhtmltopdf version: %s' % (VERSION, wk_version)
194176
def html(self):
    '''
    
    '''

    if not getattr(self, '_html', False):
      query_params = {
        'prop': 'revisions',
        'rvprop': 'content',
        'rvlimit': 1,
        'rvparse': '',
        'titles': self.title
      }

      request = _wiki_request(query_params)
      self._html = request['query']['pages'][self.pageid]['revisions'][0]['*']

    return self._html
509058
def version(self, content_type="*/*"):
        
        v = ""
        accept_header = self.get_header('accept', "")
        if accept_header:
            a = AcceptHeader(accept_header)
            for mt in a.filter(content_type):
                v = mt[2].get("version", "")
                if v: break

        return v
968134
def _repr_html_(self):
        """"""
        TileServer.run_tileserver(self, self.footprint())
        capture = "raster: %s" % self._filename
        mp = TileServer.folium_client(self, self.footprint(), capture=capture)
        return mp._repr_html_()