def replace_environment_value(self, obj):
    if (not obj):
        return None
    if (type(obj) is str):
        result = self.pattern_environment_variable.search(obj)
        replacement = str(obj)
        if result:
            for m in self.pattern_shell_command.finditer(obj):
                command = m.group(0)
                env_result = self.pattern_environment_variable.search(command)
                env_variable = env_result.group('VALUE')
                replacement = replacement.replace(command, self.find_environment_variable_value(env_variable))
        return replacement
    elif (type(obj) is list):
        return [self.replace_environment_value(a) for a in obj]
    elif (type(obj) is dict):
        return {k: self.replace_environment_value(v) for (k, v) in obj.items()}
    else:
        return obj
def replace_environment_value(self, obj):
    if (not obj):
        return None
    if (type(obj) is str):
        result = self.pattern_environment_variable.search(obj)
        replacement = str(obj)
        if result:
            for m in self.pattern_shell_command.finditer(obj):
                command = m.group(0)
                env_result = self.pattern_environment_variable.search(command)
                env_variable = env_result.group('VALUE')
                replacement = replacement.replace(command, self.find_environment_variable_value(env_variable))
        return replacement
    elif (type(obj) is list):
        return [self.replace_environment_value(a) for a in obj]
    elif (type(obj) is dict):
        return {k: self.replace_environment_value(v) for (k, v) in obj.items()}
    else:
        return obj