MCPcopy Index your code
hub / github.com/python/cpython / _get_normal_name

Function _get_normal_name

Lib/tokenize.py:347–356  ·  view source on GitHub ↗

Imitates get_normal_name in Parser/tokenizer/helpers.c.

(orig_enc)

Source from the content-addressed store, hash-verified

345
346
347def _get_normal_name(orig_enc):
348 """Imitates get_normal_name in Parser/tokenizer/helpers.c."""
349 # Only care about the first 12 characters.
350 enc = orig_enc[:12].lower().replace("_", "-")
351 if enc == "utf-8" or enc.startswith("utf-8-"):
352 return "utf-8"
353 if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \
354 enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")):
355 return "iso-8859-1"
356 return orig_enc
357
358def detect_encoding(readline):
359 """

Callers 1

find_cookieFunction · 0.85

Calls 3

replaceMethod · 0.45
lowerMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…