chore(api/core): apply ruff reformatting (#7624)
This commit is contained in:
@@ -73,10 +73,10 @@ def pin_position_map(original_position_map: dict[str, int], pin_list: list[str])
|
||||
|
||||
|
||||
def is_filtered(
|
||||
include_set: set[str],
|
||||
exclude_set: set[str],
|
||||
data: Any,
|
||||
name_func: Callable[[Any], str],
|
||||
include_set: set[str],
|
||||
exclude_set: set[str],
|
||||
data: Any,
|
||||
name_func: Callable[[Any], str],
|
||||
) -> bool:
|
||||
"""
|
||||
Check if the object should be filtered out.
|
||||
@@ -102,9 +102,9 @@ def is_filtered(
|
||||
|
||||
|
||||
def sort_by_position_map(
|
||||
position_map: dict[str, int],
|
||||
data: list[Any],
|
||||
name_func: Callable[[Any], str],
|
||||
position_map: dict[str, int],
|
||||
data: list[Any],
|
||||
name_func: Callable[[Any], str],
|
||||
) -> list[Any]:
|
||||
"""
|
||||
Sort the objects by the position map.
|
||||
@@ -117,13 +117,13 @@ def sort_by_position_map(
|
||||
if not position_map or not data:
|
||||
return data
|
||||
|
||||
return sorted(data, key=lambda x: position_map.get(name_func(x), float('inf')))
|
||||
return sorted(data, key=lambda x: position_map.get(name_func(x), float("inf")))
|
||||
|
||||
|
||||
def sort_to_dict_by_position_map(
|
||||
position_map: dict[str, int],
|
||||
data: list[Any],
|
||||
name_func: Callable[[Any], str],
|
||||
position_map: dict[str, int],
|
||||
data: list[Any],
|
||||
name_func: Callable[[Any], str],
|
||||
) -> OrderedDict[str, Any]:
|
||||
"""
|
||||
Sort the objects into a ordered dict by the position map.
|
||||
|
Reference in New Issue
Block a user