22
33
44def get_list_of_wagons (* args ):
5- """Return a list of wagons.
5+ """Return a list of wagons, given an arbitrary amount of wagon numbers .
66
7- :param *args: arbitrary number of wagons.
8- :return: list - list of wagons.
7+ Parameters:
8+ *args: An arbitrary number of wagon numbers, unpacked.
9+
10+ Returns:
11+ list: A list of wagon numbers, assembled from *args..
912 """
1013
1114 return list (args )
@@ -14,9 +17,12 @@ def get_list_of_wagons(*args):
1417def fix_list_of_wagons (each_wagons_id , missing_wagons ):
1518 """Fix the list of wagons.
1619
17- :param each_wagons_id: list - the list of wagons.
18- :param missing_wagons: list - the list of missing wagons.
19- :return: list - list of wagons.
20+ Parameters:
21+ each_wagons_id (list[int]): The list of wagons.
22+ missing_wagons (list[int]) The list of missing wagons.
23+
24+ Returns:
25+ list[int]: The corrected list of wagons.
2026 """
2127
2228 first , second , locomotive , * rest = each_wagons_id
@@ -27,9 +33,12 @@ def fix_list_of_wagons(each_wagons_id, missing_wagons):
2733def add_missing_stops (route , ** kwargs ):
2834 """Add missing stops to route dict.
2935
30- :param route: dict - the dict of routing information.
31- :param **kwargs: arbitrary number of stops.
32- :return: dict - updated route dictionary.
36+ Parameters:
37+ route (dict): The dict of routing information.
38+ **kwargs: arbitrary number of stops.
39+
40+ Returns:
41+ dict: The updated route dictionary.
3342 """
3443
3544 return {** route , "stops" : list (kwargs .values ())}
@@ -38,9 +47,12 @@ def add_missing_stops(route, **kwargs):
3847def extend_route_information (route , more_route_information ):
3948 """Extend route information with more_route_information.
4049
41- :param route: dict - the route information.
42- :param more_route_information: dict - extra route information.
43- :return: dict - extended route information.
50+ Parameters:
51+ route (dict): The route information.
52+ more_route_information (dict): The extra route information.
53+
54+ Returns:
55+ dict: The extended route information.
4456 """
4557
4658 return {** route , ** more_route_information }
@@ -49,8 +61,11 @@ def extend_route_information(route, more_route_information):
4961def fix_wagon_depot (wagons_rows ):
5062 """Fix the list of rows of wagons.
5163
52- :param wagons_rows: list[tuple] - the list of rows of wagons.
53- :return: list[tuple] - list of rows of wagons.
64+ Parameters:
65+ wagons_rows (list[tuple]) The list of rows of wagons.
66+
67+ Returns:
68+ list[tuple]: the list of rows of wagons.
5469 """
5570
5671 [* row_one ], [* row_two ], [* row_three ] = zip (* wagons_rows )
0 commit comments