# Path: core/modules/ini.py
# _CONFIG_ = None
#         _CONFIG_ = configparser.ConfigParser()
# def init(filename):
# def getenv(env_var, default=None):
# def config(section, option, env_var=None, default=None, boolean=False):
# def test():


import re
import json
from core.modules import ini
from core.modules import logger
from core.modules import request
    'int': re.compile('^\d+$'),
    'double': re.compile('^\d+(\.\d+)?$'),
    'phone': re.compile('^(\+\d{2}(\s)?\d|\d{2})(\s)?(\d{2}(\s)?){4}$'),
    'year': re.compile('^\d{4}$'),
    'timestamp': re.compile('^\d{4}(-\d{2}){2}$')
}
#===============================================================================
# FUNCTIONS
#===============================================================================
#-------------------------------------------------------------------------------
# validate
#   (In)Validates data based on its type using regular expressions
#-------------------------------------------------------------------------------
def validate(field, vtype=None):
    if vtype in _VALIDATORS_.keys():
        return True if _VALIDATORS_[vtype].match(str(field)) else False
    else:
        return False
#-------------------------------------------------------------------------------
# is_empty
#   Tests if a field is empty
#-------------------------------------------------------------------------------
def is_empty(field):
    return len(str(field).strip()) == 0
#-------------------------------------------------------------------------------
# check_captcha 
#   Google ReCaptcha validation process
#-------------------------------------------------------------------------------
def check_captcha(request):
    payload = {

# Path: core/modules/ini.py
# _CONFIG_ = None
#         _CONFIG_ = configparser.ConfigParser()
# def init(filename):
# def getenv(env_var, default=None):
# def config(section, option, env_var=None, default=None, boolean=False):
# def test():


# Path: core/modules/validator.py
import re
import json
from core.modules import ini
from core.modules import logger
from core.modules import request

    'int': re.compile('^\d+$'),
    'double': re.compile('^\d+(\.\d+)?$'),
    'phone': re.compile('^(\+\d{2}(\s)?\d|\d{2})(\s)?(\d{2}(\s)?){4}$'),
    'year': re.compile('^\d{4}$'),
    'timestamp': re.compile('^\d{4}(-\d{2}){2}$')
}
#===============================================================================
# FUNCTIONS
#===============================================================================
#-------------------------------------------------------------------------------
# validate
#   (In)Validates data based on its type using regular expressions
#-------------------------------------------------------------------------------
def validate(field, vtype=None):
    if vtype in _VALIDATORS_.keys():
        return True if _VALIDATORS_[vtype].match(str(field)) else False
    else:
        return False
#-------------------------------------------------------------------------------
# is_empty
#   Tests if a field is empty
#-------------------------------------------------------------------------------
def is_empty(field):
    return len(str(field).strip()) == 0
#-------------------------------------------------------------------------------
# check_captcha 
#   Google ReCaptcha validation process
#-------------------------------------------------------------------------------
def check_captcha(request):
    payload = {

        'secret': ini.config('RECAPTCHA','recaptcha_secret_key'),