deeptrack.utils Module#

Utility functions.

This module defines utility functions that enhance code readability, streamline common operations, and ensure type and argument consistency.

Module Structure#

Functions:

  • hasmethod: Checks if an object has a callable method named method_name.

  • as_list: Ensures that the input is a list.

  • get_kwarg_names: Retrieves keyword argument names accepted by a function.

  • kwarg_has_default: Checks if a function argument has a default value.

  • safe_call: Calls a function, passing only valid arguments.

Functions#

as_list(obj)

Ensure that the input is a list.

get_kwarg_names(function)

Retrieve the names of the keyword arguments accepted by a function.

hasmethod(obj, method_name)

Check if an object has a callable method named method_name.

kwarg_has_default(function, argument)

Check if a specific argument of a function has a default value.

safe_call(function[, positional_args])

Calls a function with valid arguments from a dictionary of arguments.