This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Basic API call (TypeScript) | |
description: Performs a basic Excel API call using TypeScript. | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#run").click(() => tryCatch(run)); | |
async function run() { | |
await Excel.run(async (context) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ete3 | |
def get_node_pos(node): | |
if node.up is None: | |
return 0 | |
pos = node.up.children.index(node) | |
return pos | |
def post_traverse_from_node(node1, is_leaf_fn=None, node_end=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_nodes_between_nodes_in_tree(node1=None, node2=None, only_order=False): | |
""" | |
This procedure searches a tree for all nodes between node1 and node2. | |
In case node1 is None: it should start in the first node | |
If node2 is None: it should end in the last node | |
:param node1: | |
:param node2: | |
:param only_order: we only care about which nodes comes before. | |
Not the nodes in between. | |
:return: (n1, n2, list): the order of the nodes and a list of nodes in between. |