deffcode.utils
Following are the helper methods required by the DeFFcode APIs.
For usage examples, kindly refer our Basic Recipes and Advanced Recipes
logger_handler¶
Returns the logger handler
Returns: A logger handler
Source code in deffcode/utils.py
dict2Args¶
Converts dictionary attributes to list(args)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
param_dict | dict | Parameters dictionary | required |
Returns: Arguments list
Source code in deffcode/utils.py
delete_ext_safe¶
Safely deletes files at given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path | string | path to the file | required |
Source code in deffcode/utils.py
validate_device_index¶
Validates if given device index is valid or not? Only Integers or String of integers are valid indexes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index | int / str | Index of the device | required |
Returns: A boolean value, confirming whether valid, or not?.
Source code in deffcode/utils.py