Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–75 unchanged (75 lines)
76 Whether the passed locale can be set
77 """
78 try:
79 with set_locale(lc, lc_var=lc_var):
80 pass
81 except (ValueError, locale.Error):
82 # horrible name for a Exception subclass
83 return False
84 else:
85 return True
86
87
88def _valid_locales(locales: list[str] | str, normalize: bool) -> list[str]:
…lines 89–177 unchanged (89 lines)

After

…lines 1–75 unchanged (75 lines)
76 Whether the passed locale can be set
77 """
78 try:
79 with set_locale(lc, lc_var=lc_var):
80 pass
81 except (ValueError, locale.Error):
82 # horrible name for an Exception subclass
83 return False
84 else:
85 return True
86
87
88def _valid_locales(locales: list[str] | str, normalize: bool) -> list[str]:
…lines 89–177 unchanged (89 lines)

Before

module
expression_statement
string
string_start "\"\"\""
string_content "\nHelpers for configuring locale settings.\n\nName `localizatio"...
string_end "\"\"\""
future_import_statement
from "from"
__future__ "__future__"
import "import"
dotted_name
identifier "annotations"
import_from_statement
from "from"
dotted_name
identifier "contextlib"
import "import"
dotted_name
identifier "contextmanager"
import_statement
import "import"
dotted_name
identifier "locale"
import_statement
import "import"
dotted_name
identifier "platform"
import_statement
import "import"
dotted_name
identifier "re"
import_statement
import "import"
dotted_name
identifier "subprocess"
import_from_statement
from "from"
dotted_name
identifier "typing"
import "import"
( "("
dotted_name
identifier "TYPE_CHECKING"
, ","
dotted_name
identifier "cast"
, ","
) ")"
import_from_statement
from "from"
dotted_name
identifier "pandas"
. "."
identifier "_config"
. "."
identifier "config"
import "import"
dotted_name
identifier "options"
if_statement
if "if"
identifier "TYPE_CHECKING"
: ":"
block
import_from_statement
from "from"
dotted_name
identifier "collections"
. "."
identifier "abc"
import "import"
dotted_name
identifier "Generator"
decorated_definition (+162 nodes collapsed)
function_definition
def "def"
identifier "can_set_locale"
parameters
( "("
typed_parameter
identifier "lc"
: ":"
type
identifier "str"
, ","
typed_default_parameter
identifier "lc_var"
: ":"
type
identifier "int"
= "="
attribute
identifier "locale"
. "."
identifier "LC_ALL"
) ")"
-> "->"
type
identifier "bool"
: ":"
block
expression_statement
string
string_start "\"\"\""
string_content "\n Check to see if we can set a locale, and subsequently g"...
string_end "\"\"\""
try_statement
try "try"
: ":"
block
with_statement
with "with"
with_clause
with_item
call
identifier "set_locale"
argument_list
( "("
identifier "lc"
, ","
keyword_argument
identifier "lc_var"
= "="
identifier "lc_var"
) ")"
: ":"
block
pass_statement
pass "pass"
except_clause
except "except"
tuple
( "("
identifier "ValueError"
, ","
attribute
identifier "locale"
. "."
identifier "Error"
) ")"
: ":"
comment "# horrible name for a Exception subclass"
block
return_statement
return "return"
false "False"
else_clause
else "else"
: ":"
block
return_statement
return "return"
true "True"
function_definition (+98 nodes collapsed)
function_definition (+290 nodes collapsed)

After

module
expression_statement
string
string_start "\"\"\""
string_content "\nHelpers for configuring locale settings.\n\nName `localizatio"...
string_end "\"\"\""
future_import_statement
from "from"
__future__ "__future__"
import "import"
dotted_name
identifier "annotations"
import_from_statement
from "from"
dotted_name
identifier "contextlib"
import "import"
dotted_name
identifier "contextmanager"
import_statement
import "import"
dotted_name
identifier "locale"
import_statement
import "import"
dotted_name
identifier "platform"
import_statement
import "import"
dotted_name
identifier "re"
import_statement
import "import"
dotted_name
identifier "subprocess"
import_from_statement
from "from"
dotted_name
identifier "typing"
import "import"
( "("
dotted_name
identifier "TYPE_CHECKING"
, ","
dotted_name
identifier "cast"
, ","
) ")"
import_from_statement
from "from"
dotted_name
identifier "pandas"
. "."
identifier "_config"
. "."
identifier "config"
import "import"
dotted_name
identifier "options"
if_statement
if "if"
identifier "TYPE_CHECKING"
: ":"
block
import_from_statement
from "from"
dotted_name
identifier "collections"
. "."
identifier "abc"
import "import"
dotted_name
identifier "Generator"
decorated_definition (+162 nodes collapsed)
function_definition
def "def"
identifier "can_set_locale"
parameters
( "("
typed_parameter
identifier "lc"
: ":"
type
identifier "str"
, ","
typed_default_parameter
identifier "lc_var"
: ":"
type
identifier "int"
= "="
attribute
identifier "locale"
. "."
identifier "LC_ALL"
) ")"
-> "->"
type
identifier "bool"
: ":"
block
expression_statement
string
string_start "\"\"\""
string_content "\n Check to see if we can set a locale, and subsequently g"...
string_end "\"\"\""
try_statement
try "try"
: ":"
block
with_statement
with "with"
with_clause
with_item
call
identifier "set_locale"
argument_list
( "("
identifier "lc"
, ","
keyword_argument
identifier "lc_var"
= "="
identifier "lc_var"
) ")"
: ":"
block
pass_statement
pass "pass"
except_clause
except "except"
tuple
( "("
identifier "ValueError"
, ","
attribute
identifier "locale"
. "."
identifier "Error"
) ")"
: ":"
comment "# horrible name for an Exception subclass"
block
return_statement
return "return"
false "False"
else_clause
else "else"
: ":"
block
return_statement
return "return"
true "True"
function_definition (+98 nodes collapsed)
function_definition (+290 nodes collapsed)