Understanding helper and supporting libraries
The helper and supporting functions are implemented in the helpers.py
file, which can be found in the lib/util
folder of the fl_main
directory.
Importing libraries for helper libraries
In this helpers.py
code example, the file imports general libraries such as json
and time
:
import json, time, pickle, pathlib, socket, asyncio from getmac import get_mac_address as gma from typing import Dict, List, Any from hashlib import sha256 from fl_main.lib.util.states import IDPrefix, ClientState
Next, let’s move on to the list of functions of the helper library.
Functions of the helper library
The following is a list of functions related to the helper library.
The set_config_file function
The set_config_file
function takes the type of the config file, such as db
, aggregator
, or agent
, as a parameter and returns a string of the path to the configuration file:
def set_config_file(config_type: str) -> str: ...