MCPcopy Create free account
hub / github.com/datapane/datapane / decode

Method decode

python-client/src/datapane/_vendor/bottle.py:2205–2214  ·  view source on GitHub ↗

Returns a copy with all keys and values de- or recoded to match :attr:`input_encoding`. Some libraries (e.g. WTForms) want a unicode dictionary.

(self, encoding=None)

Source from the content-addressed store, hash-verified

2203 return s
2204
2205 def decode(self, encoding=None):
2206 """ Returns a copy with all keys and values de- or recoded to match
2207 :attr:`input_encoding`. Some libraries (e.g. WTForms) want a
2208 unicode dictionary. """
2209 copy = FormsDict()
2210 enc = copy.input_encoding = encoding or self.input_encoding
2211 copy.recode_unicode = False
2212 for key, value in self.allitems():
2213 copy.append(self._fix(key, enc), self._fix(value, enc))
2214 return copy
2215
2216 def getunicode(self, name, default=None, encoding=None):
2217 """ Return the value as a unicode string, or the default. """

Callers 13

parseJsonPropFunction · 0.80
touniFunction · 0.80
start_responseMethod · 0.80
_handleMethod · 0.80
_wsgi_status_lineMethod · 0.80
headerlistMethod · 0.80
_fixMethod · 0.80
__getitem__Method · 0.80
filenameMethod · 0.80
loaderMethod · 0.80
utf_read_textFunction · 0.80
get_notebook_jsonMethod · 0.80

Calls 4

_fixMethod · 0.95
FormsDictClass · 0.85
allitemsMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected