MCPcopy
hub / github.com/eldraco/domain_analyzer / _native_str

Function _native_str

geoip.py:20–25  ·  view source on GitHub ↗

Attempts to coerce a string into native if it's ASCII safe.

(x)

Source from the content-addressed store, hash-verified

18
19
20def _native_str(x):
21 """Attempts to coerce a string into native if it's ASCII safe."""
22 try:
23 return str(x)
24 except UnicodeError:
25 return x
26
27
28def pack_ip(ip):

Callers 5

countryMethod · 0.85
continentMethod · 0.85
subdivisionsMethod · 0.85
timezoneMethod · 0.85
get_infoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected