def get_value_from_dict(key_path, input_dict):
    """
    Returns the value of a key in input_dict
    key_path must be given in string format with dots
    Example: result.dir
    """
    if not isinstance(key_path, str) or not isinstance(input_dict, dict):
        return None
    for key in key_path.split('.'):
        input_dict = input_dict.get(key)
        if not input_dict:
            return None
    return input_dict