def block_search(dict_or_list, block_name, default=None):
    """Find block_name in dict_or_list where block_name in the form 'keya.keyb.keyc'"""
    current = dict_or_list
    if block_name is None or block_name == "" or block_name == ".":
        return current
    for part in block_name.split("."):
        if isinstance(current, list):
            try:
                idx = int(part)
            except ValueError:
                return default
            if 0 <= idx < len(current):
                current = current[idx]
            else:
                return default
        elif isinstance(current, dict):
            current = current.get(part)
            if current is None:
                return default
    return current