code: def node_is_upstream_leaf(graph: BELGraph, node: BaseEntity) -> bool:
      
      return 0 == len(graph.predecessors(node)) and 1 == len(graph.successors(node))
docs: Return if the node is an upstream leaf.
  
      An upstream leaf is defined as a node that has no in-edges, and exactly 1 out-edge.