MCPcopy Index your code
hub / github.com/clips/pattern / string

Function string

pattern/db/__init__.py:225–231  ·  view source on GitHub ↗

Returns the value cast to unicode, or default if it is None/empty.

(value, default="")

Source from the content-addressed store, hash-verified

223encode_utf8 = encode_string
224
225def string(value, default=""):
226 """ Returns the value cast to unicode, or default if it is None/empty.
227 """
228 # Useful for HTML interfaces.
229 if value is None or value == "": # Don't do value != None because this includes 0.
230 return default
231 return decode_utf8(value)
232
233RE_AMPERSAND = re.compile("\&(?!\#)") # & not followed by #
234RE_UNICODE = re.compile(r'&(#?)(x|X?)(\w+);') # É

Callers 2

finalizeMethod · 0.85
csv_header_decodeFunction · 0.85

Calls 1

decode_utf8Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…