diff --git a/anta/catalog.py b/anta/catalog.py index 142640ecb..e94b8f750 100644 --- a/anta/catalog.py +++ b/anta/catalog.py @@ -254,8 +254,8 @@ def __init__( ) -> None: """Instantiate an AntaCatalog instance. - Args: - ---- + Parameters + ---------- tests: A list of AntaTestDefinition instances. filename: The path from which the catalog is loaded. @@ -301,8 +301,8 @@ def tests(self, value: list[AntaTestDefinition]) -> None: def parse(filename: str | Path) -> AntaCatalog: """Create an AntaCatalog instance from a test catalog file. - Args: - ---- + Parameters + ---------- filename: Path to test catalog YAML file """ @@ -325,8 +325,8 @@ def from_dict(data: RawCatalogInput, filename: str | Path | None = None) -> Anta It is the data structure returned by `yaml.load()` function of a valid YAML Test Catalog file. - Args: - ---- + Parameters + ---------- data: Python dictionary used to instantiate the AntaCatalog instance filename: value to be set as AntaCatalog instance attribute @@ -359,8 +359,8 @@ def from_list(data: ListAntaTestTuples) -> AntaCatalog: See ListAntaTestTuples type alias for details. - Args: - ---- + Parameters + ---------- data: Python list used to instantiate the AntaCatalog instance """ @@ -375,8 +375,8 @@ def from_list(data: ListAntaTestTuples) -> AntaCatalog: def merge(self, catalog: AntaCatalog) -> AntaCatalog: """Merge two AntaCatalog instances. - Args: - ---- + Parameters + ---------- catalog: AntaCatalog instance to merge to this instance. Returns @@ -427,8 +427,8 @@ def build_indexes(self, filtered_tests: set[str] | None = None) -> None: def get_tests_by_tags(self, tags: set[str], *, strict: bool = False) -> set[AntaTestDefinition]: """Return all tests that match a given set of tags, according to the specified strictness. - Args: - ---- + Parameters + ---------- tags: The tags to filter tests by. If empty, return all tests without tags. strict: If True, returns only tests that contain all specified tags (intersection). If False, returns tests that contain any of the specified tags (union). diff --git a/anta/cli/get/utils.py b/anta/cli/get/utils.py index 5308f4414..ba4d886d5 100644 --- a/anta/cli/get/utils.py +++ b/anta/cli/get/utils.py @@ -82,8 +82,8 @@ def get_cv_token(cvp_ip: str, cvp_username: str, cvp_password: str, *, verify_ce TODO: need to handle requests error - Args: - ---- + Parameters + ---------- cvp_ip: IP address of CloudVision. cvp_username: Username to connect to CloudVision. cvp_password: Password to connect to CloudVision. @@ -161,8 +161,8 @@ def deep_yaml_parsing(data: dict[str, Any], hosts: list[AntaInventoryHost] | Non def create_inventory_from_ansible(inventory: Path, output: Path, ansible_group: str = "all") -> None: """Create an ANTA inventory from an Ansible inventory YAML file. - Args: - ---- + Parameters + ---------- inventory: Ansible Inventory file to read output: ANTA inventory file to generate. ansible_group: Ansible group from where to extract data. diff --git a/anta/cli/utils.py b/anta/cli/utils.py index 71d99b8ae..f769de7a7 100644 --- a/anta/cli/utils.py +++ b/anta/cli/utils.py @@ -60,8 +60,8 @@ def exit_with_code(ctx: click.Context) -> None: * 1 if status is `failure` * 2 if status is `error`. - Args: - ---- + Parameters + ---------- ctx: Click Context """ diff --git a/anta/decorators.py b/anta/decorators.py index dc57e13ec..c9f8b6d28 100644 --- a/anta/decorators.py +++ b/anta/decorators.py @@ -20,8 +20,8 @@ def deprecated_test(new_tests: list[str] | None = None) -> Callable[[F], F]: """Return a decorator to log a message of WARNING severity when a test is deprecated. - Args: - ---- + Parameters + ---------- new_tests: A list of new test classes that should replace the deprecated test. Returns @@ -33,8 +33,8 @@ def deprecated_test(new_tests: list[str] | None = None) -> Callable[[F], F]: def decorator(function: F) -> F: """Actual decorator that logs the message. - Args: - ---- + Parameters + ---------- function: The test function to be decorated. Returns @@ -64,8 +64,8 @@ def skip_on_platforms(platforms: list[str]) -> Callable[[F], F]: This decorator factory generates a decorator that will check the hardware model of the device the test is run on. If the model is in the list of platforms specified, the test will be skipped. - Args: - ---- + Parameters + ---------- platforms: List of hardware models on which the test should be skipped. Returns @@ -77,8 +77,8 @@ def skip_on_platforms(platforms: list[str]) -> Callable[[F], F]: def decorator(function: F) -> F: """Actual decorator that either runs the test or skips it based on the device's hardware model. - Args: - ---- + Parameters + ---------- function: The test function to be decorated. Returns diff --git a/anta/device.py b/anta/device.py index f0ec6a00c..087f3b57b 100644 --- a/anta/device.py +++ b/anta/device.py @@ -55,8 +55,8 @@ class AntaDevice(ABC): def __init__(self, name: str, tags: set[str] | None = None, *, disable_cache: bool = False) -> None: """Initialize an AntaDevice. - Args: - ---- + Parameters + ---------- name: Device name. tags: Tags for this device. disable_cache: Disable caching for all commands for this device. @@ -130,8 +130,8 @@ async def _collect(self, command: AntaCommand, *, collection_id: str | None = No exception and implement proper logging, the `output` attribute of the `AntaCommand` object passed as argument would be `None` in this case. - Args: - ---- + Parameters + ---------- command: The command to collect. collection_id: An identifier used to build the eAPI request ID. """ @@ -147,8 +147,8 @@ async def collect(self, command: AntaCommand, *, collection_id: str | None = Non When caching is NOT enabled, either at the device or command level, the method directly collects the output via the private `_collect` method without interacting with the cache. - Args: - ---- + Parameters + ---------- command: The command to collect. collection_id: An identifier used to build the eAPI request ID. """ @@ -170,8 +170,8 @@ async def collect(self, command: AntaCommand, *, collection_id: str | None = Non async def collect_commands(self, commands: list[AntaCommand], *, collection_id: str | None = None) -> None: """Collect multiple commands. - Args: - ---- + Parameters + ---------- commands: The commands to collect. collection_id: An identifier used to build the eAPI request ID. """ @@ -192,8 +192,8 @@ async def copy(self, sources: list[Path], destination: Path, direction: Literal[ It is not mandatory to implement this for a valid AntaDevice subclass. - Args: - ---- + Parameters + ---------- sources: List of files to copy to or from the device. destination: Local or remote destination when copying the files. Can be a folder. direction: Defines if this coroutine copies files to or from the device. @@ -237,8 +237,8 @@ def __init__( ) -> None: """Instantiate an AsyncEOSDevice. - Args: - ---- + Parameters + ---------- host: Device FQDN or IP. username: Username to connect to eAPI and SSH. password: Password to connect to eAPI and SSH. @@ -313,8 +313,8 @@ async def _collect(self, command: AntaCommand, *, collection_id: str | None = No Gain privileged access using the `enable_password` attribute of the `AntaDevice` instance if populated. - Args: - ---- + Parameters + ---------- command: The command to collect. collection_id: An identifier used to build the eAPI request ID. """ @@ -405,8 +405,8 @@ async def refresh(self) -> None: async def copy(self, sources: list[Path], destination: Path, direction: Literal["to", "from"] = "from") -> None: """Copy files to and from the device using asyncssh.scp(). - Args: - ---- + Parameters + ---------- sources: List of files to copy to or from the device. destination: Local or remote destination when copying the files. Can be a folder. direction: Defines if this coroutine copies files to or from the device. diff --git a/anta/inventory/__init__.py b/anta/inventory/__init__.py index 5e66d84b2..46609676a 100644 --- a/anta/inventory/__init__.py +++ b/anta/inventory/__init__.py @@ -44,8 +44,8 @@ def __str__(self) -> str: def _update_disable_cache(kwargs: dict[str, Any], *, inventory_disable_cache: bool) -> dict[str, Any]: """Return new dictionary, replacing kwargs with added disable_cache value from inventory_value if disable_cache has not been set by CLI. - Args: - ---- + Parameters + ---------- inventory_disable_cache: The value of disable_cache in the inventory kwargs: The kwargs to instantiate the device @@ -62,8 +62,8 @@ def _parse_hosts( ) -> None: """Parse the host section of an AntaInventoryInput and add the devices to the inventory. - Args: - ---- + Parameters + ---------- inventory_input: AntaInventoryInput used to parse the devices inventory: AntaInventory to add the parsed devices to **kwargs: Additional keyword arguments to pass to the device constructor @@ -91,8 +91,8 @@ def _parse_networks( ) -> None: """Parse the network section of an AntaInventoryInput and add the devices to the inventory. - Args: - ---- + Parameters + ---------- inventory_input: AntaInventoryInput used to parse the devices inventory: AntaInventory to add the parsed devices to **kwargs: Additional keyword arguments to pass to the device constructor @@ -124,8 +124,8 @@ def _parse_ranges( ) -> None: """Parse the range section of an AntaInventoryInput and add the devices to the inventory. - Args: - ---- + Parameters + ---------- inventory_input: AntaInventoryInput used to parse the devices inventory: AntaInventory to add the parsed devices to **kwargs: Additional keyword arguments to pass to the device constructor @@ -175,8 +175,8 @@ def parse( The inventory devices are AsyncEOSDevice instances. - Args: - ---- + Parameters + ---------- filename: Path to device inventory YAML file. username: Username to use to connect to devices. password: Password to use to connect to devices. @@ -254,8 +254,8 @@ def devices(self) -> list[AntaDevice]: def get_inventory(self, *, established_only: bool = False, tags: set[str] | None = None, devices: set[str] | None = None) -> AntaInventory: """Return a filtered inventory. - Args: - ---- + Parameters + ---------- established_only: Whether or not to include only established devices. tags: Tags to filter devices. devices: Names to filter devices. @@ -293,8 +293,8 @@ def __setitem__(self, key: str, value: AntaDevice) -> None: def add_device(self, device: AntaDevice) -> None: """Add a device to final inventory. - Args: - ---- + Parameters + ---------- device: Device object to be added """ diff --git a/anta/logger.py b/anta/logger.py index e532ace2c..b64fbe7b4 100644 --- a/anta/logger.py +++ b/anta/logger.py @@ -49,8 +49,8 @@ def setup_logging(level: LogLevel = Log.INFO, file: Path | None = None) -> None: If a file is provided and logging level is DEBUG, only the logging level INFO and higher will be logged to stdout while all levels will be logged in the file. - Args: - ---- + Parameters + ---------- level: ANTA logging level file: Send logs to a file @@ -104,8 +104,8 @@ def anta_log_exception(exception: BaseException, message: str | None = None, cal If `anta.__DEBUG__` is True then the `logger.exception` method is called to get the traceback, otherwise `logger.error` is called. - Args: - ---- + Parameters + ---------- exception: The Exception being logged. message: An optional message. calling_logger: A logger to which the exception should be logged. If not present, the logger in this file is used. diff --git a/anta/models.py b/anta/models.py index c44f7e8b4..499fb3536 100644 --- a/anta/models.py +++ b/anta/models.py @@ -95,8 +95,8 @@ def render(self, **params: str | int | bool) -> AntaCommand: Keep the parameters used in the AntaTemplate instance. - Args: - ---- + Parameters + ---------- params: dictionary of variables with string values to render the Python f-string Returns @@ -245,8 +245,8 @@ class AntaTemplateRenderError(RuntimeError): def __init__(self, template: AntaTemplate, key: str) -> None: """Initialize an AntaTemplateRenderError. - Args: - ---- + Parameters + ---------- template: The AntaTemplate instance that failed to render key: Key that has not been provided to render the template @@ -381,8 +381,8 @@ def __init__( ) -> None: """AntaTest Constructor. - Args: - ---- + Parameters + ---------- device: AntaDevice instance on which the test will be run inputs: dictionary of attributes used to instantiate the AntaTest.Input instance eos_data: Populate outputs of the test commands instead of collecting from devices. @@ -556,8 +556,8 @@ async def wrapper( ) -> TestResult: """Inner function for the anta_test decorator. - Args: - ---- + Parameters + ---------- self: The test instance. eos_data: Populate outputs of the test commands instead of collecting from devices. This list must have the same length and order than the `instance_commands` instance attribute. diff --git a/anta/reporter/__init__.py b/anta/reporter/__init__.py index 63a1fe5b2..685608dc2 100644 --- a/anta/reporter/__init__.py +++ b/anta/reporter/__init__.py @@ -30,8 +30,8 @@ class ReportTable: def _split_list_to_txt_list(self, usr_list: list[str], delimiter: str | None = None) -> str: """Split list to multi-lines string. - Args: - ---- + Parameters + ---------- usr_list (list[str]): List of string to concatenate delimiter (str, optional): A delimiter to use to start string. Defaults to None. @@ -49,8 +49,8 @@ def _build_headers(self, headers: list[str], table: Table) -> Table: First key is considered as header and is colored using RICH_COLOR_PALETTE.HEADER - Args: - ---- + Parameters + ---------- headers: List of headers. table: A rich Table instance. @@ -72,8 +72,8 @@ def _build_headers(self, headers: list[str], table: Table) -> Table: def _color_result(self, status: TestStatus) -> str: """Return a colored string based on the status value. - Args: - ---- + Parameters + ---------- status (TestStatus): status value to color. Returns @@ -89,8 +89,8 @@ def report_all(self, manager: ResultManager, title: str = "All tests results") - Create table with full output: Host / Test / Status / Message - Args: - ---- + Parameters + ---------- manager: A ResultManager instance. title: Title for the report. Defaults to 'All tests results'. @@ -123,8 +123,8 @@ def report_summary_tests( Create table with full output: Test | Number of success | Number of failure | Number of error | List of nodes in error or failure - Args: - ---- + Parameters + ---------- manager: A ResultManager instance. tests: List of test names to include. None to select all tests. title: Title of the report. @@ -171,8 +171,8 @@ def report_summary_devices( Create table with full output: Host | Number of success | Number of failure | Number of error | List of nodes in error or failure - Args: - ---- + Parameters + ---------- manager: A ResultManager instance. devices: List of device names to include. None to select all devices. title: Title of the report. @@ -239,8 +239,8 @@ def render(self, data: list[dict[str, Any]], *, trim_blocks: bool = True, lstrip } ] - Args: - ---- + Parameters + ---------- data: List of results from ResultManager.results trim_blocks: enable trim_blocks for J2 rendering. lstrip_blocks: enable lstrip_blocks for J2 rendering. diff --git a/anta/result_manager/__init__.py b/anta/result_manager/__init__.py index a5fcf9755..4278c0da3 100644 --- a/anta/result_manager/__init__.py +++ b/anta/result_manager/__init__.py @@ -119,8 +119,8 @@ def json(self) -> str: def add(self, result: TestResult) -> None: """Add a result to the ResultManager instance. - Args: - ---- + Parameters + ---------- result: TestResult to add to the ResultManager instance. """ @@ -145,8 +145,8 @@ def get_status(self, *, ignore_error: bool = False) -> str: def filter(self, hide: set[TestStatus]) -> ResultManager: """Get a filtered ResultManager based on test status. - Args: - ---- + Parameters + ---------- hide: set of TestStatus literals to select tests to hide based on their status. Returns @@ -160,8 +160,8 @@ def filter(self, hide: set[TestStatus]) -> ResultManager: def filter_by_tests(self, tests: set[str]) -> ResultManager: """Get a filtered ResultManager that only contains specific tests. - Args: - ---- + Parameters + ---------- tests: Set of test names to filter the results. Returns @@ -175,8 +175,8 @@ def filter_by_tests(self, tests: set[str]) -> ResultManager: def filter_by_devices(self, devices: set[str]) -> ResultManager: """Get a filtered ResultManager that only contains specific devices. - Args: - ---- + Parameters + ---------- devices: Set of device names to filter the results. Returns diff --git a/anta/result_manager/models.py b/anta/result_manager/models.py index c53947ee4..e1171c88a 100644 --- a/anta/result_manager/models.py +++ b/anta/result_manager/models.py @@ -36,8 +36,8 @@ class TestResult(BaseModel): def is_success(self, message: str | None = None) -> None: """Set status to success. - Args: - ---- + Parameters + ---------- message: Optional message related to the test """ @@ -46,8 +46,8 @@ def is_success(self, message: str | None = None) -> None: def is_failure(self, message: str | None = None) -> None: """Set status to failure. - Args: - ---- + Parameters + ---------- message: Optional message related to the test """ @@ -56,8 +56,8 @@ def is_failure(self, message: str | None = None) -> None: def is_skipped(self, message: str | None = None) -> None: """Set status to skipped. - Args: - ---- + Parameters + ---------- message: Optional message related to the test """ @@ -66,8 +66,8 @@ def is_skipped(self, message: str | None = None) -> None: def is_error(self, message: str | None = None) -> None: """Set status to error. - Args: - ---- + Parameters + ---------- message: Optional message related to the test """ @@ -76,8 +76,8 @@ def is_error(self, message: str | None = None) -> None: def _set_status(self, status: TestStatus, message: str | None = None) -> None: """Set status and insert optional message. - Args: - ---- + Parameters + ---------- status: status of the test message: optional message diff --git a/anta/runner.py b/anta/runner.py index 898296372..df4c70cc4 100644 --- a/anta/runner.py +++ b/anta/runner.py @@ -59,8 +59,8 @@ def adjust_rlimit_nofile() -> tuple[int, int]: def log_cache_statistics(devices: list[AntaDevice]) -> None: """Log cache statistics for each device in the inventory. - Args: - ---- + Parameters + ---------- devices: List of devices in the inventory. """ for device in devices: @@ -78,8 +78,8 @@ def log_cache_statistics(devices: list[AntaDevice]) -> None: async def setup_inventory(inventory: AntaInventory, tags: set[str] | None, devices: set[str] | None, *, established_only: bool) -> AntaInventory | None: """Set up the inventory for the ANTA run. - Args: - ---- + Parameters + ---------- inventory: AntaInventory object that includes the device(s). tags: Tags to filter devices from the inventory. devices: Devices on which to run tests. None means all devices. @@ -116,8 +116,8 @@ def prepare_tests( ) -> defaultdict[AntaDevice, set[AntaTestDefinition]] | None: """Prepare the tests to run. - Args: - ---- + Parameters + ---------- inventory: AntaInventory object that includes the device(s). catalog: AntaCatalog object that includes the list of tests. tests: Tests to run against devices. None means all tests. @@ -160,8 +160,8 @@ def prepare_tests( def get_coroutines(selected_tests: defaultdict[AntaDevice, set[AntaTestDefinition]]) -> list[Coroutine[Any, Any, TestResult]]: """Get the coroutines for the ANTA run. - Args: - ---- + Parameters + ---------- selected_tests: A mapping of devices to the tests to run. The selected tests are generated by the `prepare_tests` function. Returns @@ -205,8 +205,8 @@ async def main( # noqa: PLR0913 Use this as an entrypoint to the test framework in your script. ResultManager object gets updated with the test results. - Args: - ---- + Parameters + ---------- manager: ResultManager object to populate with the test results. inventory: AntaInventory object that includes the device(s). catalog: AntaCatalog object that includes the list of tests. diff --git a/anta/tests/logging.py b/anta/tests/logging.py index b05b0a0dd..b520fc1e1 100644 --- a/anta/tests/logging.py +++ b/anta/tests/logging.py @@ -25,8 +25,8 @@ def _get_logging_states(logger: logging.Logger, command_output: str) -> str: """Parse `show logging` output and gets operational logging states used in the tests in this module. - Args: - ---- + Parameters + ---------- logger: The logger object. command_output: The `show logging` output. diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py index 41c24958b..a29216b2d 100644 --- a/anta/tests/routing/bgp.py +++ b/anta/tests/routing/bgp.py @@ -24,8 +24,8 @@ def _add_bgp_failures(failures: dict[tuple[str, str | None], dict[str, Any]], af Note: This function modifies `failures` in-place. - Args: - ---- + Parameters + ---------- failures: The dictionary to which the failure will be added. afi: The address family identifier. vrf: The VRF name. @@ -63,8 +63,8 @@ def _add_bgp_failures(failures: dict[tuple[str, str | None], dict[str, Any]], af def _check_peer_issues(peer_data: dict[str, Any] | None) -> dict[str, Any]: """Check for issues in BGP peer data. - Args: - ---- + Parameters + ---------- peer_data: The BGP peer data dictionary nested in the `show bgp summary` command. Returns @@ -104,8 +104,8 @@ def _add_bgp_routes_failure( It identifies any missing routes as well as any routes that are invalid or inactive. The results are returned in a dictionary. - Args: - ---- + Parameters + ---------- bgp_routes: The list of expected routes. bgp_output: The BGP output from the device. peer: The IP address of the BGP peer. diff --git a/anta/tests/routing/isis.py b/anta/tests/routing/isis.py index afa75b548..dee472571 100644 --- a/anta/tests/routing/isis.py +++ b/anta/tests/routing/isis.py @@ -638,7 +638,8 @@ def _check_tunnel_type(self, via_input: VerifyISISSegmentRoutingTunnels.Input.En """ Check if the tunnel type specified in `via_input` matches any of the tunnel types in `eos_entry`. - Args: + Parameters + ---------- via_input (VerifyISISSegmentRoutingTunnels.Input.Entry.Vias): The input tunnel type to check. eos_entry (dict[str, Any]): The EOS entry containing the tunnel types. @@ -662,7 +663,8 @@ def _check_tunnel_nexthop(self, via_input: VerifyISISSegmentRoutingTunnels.Input """ Check if the tunnel nexthop matches the given input. - Args: + Parameters + ---------- via_input (VerifyISISSegmentRoutingTunnels.Input.Entry.Vias): The input via object. eos_entry (dict[str, Any]): The EOS entry dictionary. @@ -686,7 +688,8 @@ def _check_tunnel_interface(self, via_input: VerifyISISSegmentRoutingTunnels.Inp """ Check if the tunnel interface exists in the given EOS entry. - Args: + Parameters + ---------- via_input (VerifyISISSegmentRoutingTunnels.Input.Entry.Vias): The input via object. eos_entry (dict[str, Any]): The EOS entry dictionary. @@ -710,7 +713,8 @@ def _check_tunnel_id(self, via_input: VerifyISISSegmentRoutingTunnels.Input.Entr """ Check if the tunnel ID matches any of the tunnel IDs in the EOS entry's vias. - Args: + Parameters + ---------- via_input (VerifyISISSegmentRoutingTunnels.Input.Entry.Vias): The input vias to check. eos_entry (dict[str, Any]): The EOS entry to compare against. diff --git a/anta/tests/routing/ospf.py b/anta/tests/routing/ospf.py index 5910bf04e..342ada2f4 100644 --- a/anta/tests/routing/ospf.py +++ b/anta/tests/routing/ospf.py @@ -18,8 +18,8 @@ def _count_ospf_neighbor(ospf_neighbor_json: dict[str, Any]) -> int: """Count the number of OSPF neighbors. - Args: - ---- + Parameters + ---------- ospf_neighbor_json: The JSON output of the `show ip ospf neighbor` command. Returns @@ -37,8 +37,8 @@ def _count_ospf_neighbor(ospf_neighbor_json: dict[str, Any]) -> int: def _get_not_full_ospf_neighbors(ospf_neighbor_json: dict[str, Any]) -> list[dict[str, Any]]: """Return the OSPF neighbors whose adjacency state is not `full`. - Args: - ---- + Parameters + ---------- ospf_neighbor_json: The JSON output of the `show ip ospf neighbor` command. Returns @@ -63,8 +63,8 @@ def _get_not_full_ospf_neighbors(ospf_neighbor_json: dict[str, Any]) -> list[dic def _get_ospf_max_lsa_info(ospf_process_json: dict[str, Any]) -> list[dict[str, Any]]: """Return information about OSPF instances and their LSAs. - Args: - ---- + Parameters + ---------- ospf_process_json: OSPF process information in JSON format. Returns diff --git a/anta/tools.py b/anta/tools.py index b3760da0c..55748b492 100644 --- a/anta/tools.py +++ b/anta/tools.py @@ -32,8 +32,8 @@ def get_failed_logs(expected_output: dict[Any, Any], actual_output: dict[Any, An Returns the failed log or an empty string if there is no difference between the expected and actual output. - Args: - ---- + Parameters + ---------- expected_output (dict): Expected output of a test. actual_output (dict): Actual output of a test @@ -302,8 +302,8 @@ def cprofile(sort_by: str = "cumtime") -> Callable[[F], F]: profile is conditionally enabled based on the presence of ANTA_CPROFILE environment variable. Expect to decorate an async function. - Args: - ---- + Parameters + ---------- sort_by (str): The criterion to sort the profiling results. Default is 'cumtime'. Returns @@ -318,8 +318,8 @@ async def wrapper(*args: Any, **kwargs: Any) -> Any: If `ANTA_CPROFILE` is set, cProfile is enabled and dumps the stats to the file. - Args: - ---- + Parameters + ---------- *args: Arbitrary positional arguments. **kwargs: Arbitrary keyword arguments.