def __init__(
        self,
        internal_key: 'PubkeyProvider',
        desc_tree: List[Union['Descriptor', List]] = None,
    ) -> None:
        r"""
        :param internal_key: The :class:`PubkeyProvider` that is the internal key for this descriptor
        :param desc_tree: Taproot script binary tree, as a nested list of Descriptors
        """
        if desc_tree is None:
            desc_tree = []
        self.desc_tree = desc_tree
        desc_list = []
        if desc_tree:
            if self.get_max_tree_depth() > MAX_TAPROOT_DEPTH:
                raise ValueError(f"tr() supports at most {MAX_TAPROOT_DEPTH} nesting levels")
            def flatten(tree_node):
                if isinstance(tree_node, Descriptor):
                    return [tree_node]
                assert len(tree_node) == 2, len(tree_node)
                return flatten(tree_node[0]) + flatten(tree_node[1])
            desc_list = flatten(desc_tree)
        super().__init__(
            pubkeys=[internal_key],
            subdescriptors=desc_list,  # FIXME we could do without the flattened list (dupl)
            name="tr",
        )

        :param internal_key: The :class:`PubkeyProvider` that is the internal key for this descriptor
        :param desc_tree: Taproot script binary tree, as a nested list of Descriptors
        
electrum/descriptor.py