unitxt.utils module

class unitxt.utils.Singleton

Bases: type

unitxt.utils.flatten_dict(d: Dict[str, Any], parent_key: str = '', sep: str = '_') Dict[str, Any]
unitxt.utils.is_module_available(module_name)

Check if a module is available in the current Python environment.

Parameters: - module_name (str): The name of the module to check.

Returns: - bool: True if the module is available, False otherwise.

unitxt.utils.is_package_installed(package_name)

Check if a package is installed.

Parameters: - package_name (str): The name of the package to check.

Returns: - bool: True if the package is installed, False otherwise.

unitxt.utils.load_json(path)
unitxt.utils.save_json(path, data)