# Path: core/conf/logconfig.py
# LOG_FORMAT = '%(asctime)s %(name)s[%(process)d] %(levelname)s %(message)s'
# LOG_LEVELS = {
#     'info': logging.INFO,
#     'warning': logging.WARNING,
#     'error': logging.ERROR,
#     'debug': logging.DEBUG,
# }
# HIDDEN_ALL = ['warnings', 'stdout', 'stderr', 'running']
# HIDDEN_KEEP_STDERR = ['warnings', 'stdout', 'running']
# def set_logging(lvl='info'):


from copy import deepcopy
from jinja2 import Environment, FileSystemLoader
from math import sqrt
from os import listdir, makedirs, rename
from os.path import basename, dirname, exists, expanduser, isdir, isfile, join, split, splitext
from re import findall, finditer, search, sub, DOTALL, MULTILINE
from six import string_types
from core.common.helpers import *
from core.common.wsngenerator import *
from core.conf.constants import *
from core.conf.logconfig import logger
    from core.common.wsngenerator import __all__
        from core.common.wsngenerator import __all__ as wsn_algos
    'list_campaigns',
    'list_experiments',
    'list_wsn_gen_algorithms',
    'render_campaign',
    'render_templates',
    'validated_parameters',
]


# *********************************************** GET FUNCTIONS ************************************************
def get_available_platforms():
    """
    This function retrieves the list of available platforms from the Contiki directory.

    :return: List of strings representing the available platforms
    """
    platforms = []
    for item in listdir(join(CONTIKI_FOLDER, 'platform')):
        if isdir(join(CONTIKI_FOLDER, 'platform', item)):
            platforms.append(item)
    return platforms


def get_building_blocks():
    """
    This function retrieves the list of available building blocks for the malicious mote.

    :return: List of strings representing the available building blocks
    """
    return is_valid_commented_json(join(TEMPLATES_FOLDER, 'building-blocks.json'),

# Path: core/conf/logconfig.py
# LOG_FORMAT = '%(asctime)s %(name)s[%(process)d] %(levelname)s %(message)s'
# LOG_LEVELS = {
#     'info': logging.INFO,
#     'warning': logging.WARNING,
#     'error': logging.ERROR,
#     'debug': logging.DEBUG,
# }
# HIDDEN_ALL = ['warnings', 'stdout', 'stderr', 'running']
# HIDDEN_KEEP_STDERR = ['warnings', 'stdout', 'running']
# def set_logging(lvl='info'):


# Path: core/utils/rpla.py
from copy import deepcopy
from jinja2 import Environment, FileSystemLoader
from math import sqrt
from os import listdir, makedirs, rename
from os.path import basename, dirname, exists, expanduser, isdir, isfile, join, split, splitext
from re import findall, finditer, search, sub, DOTALL, MULTILINE
from six import string_types
from core.common.helpers import *
from core.common.wsngenerator import *
from core.conf.constants import *
from core.conf.logconfig import logger
    from core.common.wsngenerator import __all__
        from core.common.wsngenerator import __all__ as wsn_algos

    'list_campaigns',
    'list_experiments',
    'list_wsn_gen_algorithms',
    'render_campaign',
    'render_templates',
    'validated_parameters',
]


# *********************************************** GET FUNCTIONS ************************************************
def get_available_platforms():
    """
    This function retrieves the list of available platforms from the Contiki directory.

    :return: List of strings representing the available platforms
    """
    platforms = []
    for item in listdir(join(CONTIKI_FOLDER, 'platform')):
        if isdir(join(CONTIKI_FOLDER, 'platform', item)):
            platforms.append(item)
    return platforms


def get_building_blocks():
    """
    This function retrieves the list of available building blocks for the malicious mote.

    :return: List of strings representing the available building blocks
    """
    return is_valid_commented_json(join(TEMPLATES_FOLDER, 'building-blocks.json'),

                                   return_json=True, logger=logger) or {}