MCPcopy Index your code
hub / github.com/google/python-fire / Decode

Function Decode

fire/console/console_attr.py:798–811  ·  view source on GitHub ↗

Converts the given string, bytes, or object to a text string. Args: data: Any bytes, string, or object that has str() or unicode() methods. encoding: A suggesting encoding used to decode. If this encoding doesn't work, other defaults are tried. Defaults to GetConsoleAttr().Get

(data, encoding=None)

Source from the content-addressed store, hash-verified

796
797
798def Decode(data, encoding=None):
799 """Converts the given string, bytes, or object to a text string.
800
801 Args:
802 data: Any bytes, string, or object that has str() or unicode() methods.
803 encoding: A suggesting encoding used to decode. If this encoding doesn't
804 work, other defaults are tried. Defaults to
805 GetConsoleAttr().GetEncoding().
806
807 Returns:
808 A text string representation of the data.
809 """
810 encoding = encoding or GetConsoleAttr().GetEncoding()
811 return encoding_util.Decode(data, encoding=encoding)

Callers

nothing calls this directly

Calls 2

GetConsoleAttrFunction · 0.85
GetEncodingMethod · 0.80

Tested by

no test coverage detected