code: def test_degree_sequence_tree():
      z = [1, 1, 1, 1, 1, 2, 2, 2, 3, 4]
      G = nx.degree_sequence_tree(z)
      assert len(G) == len(z)
      assert len(list(G.edges())) == sum(z) / 2
  
      pytest.raises(
          nx.NetworkXError,
          nx.degree_sequence_tree,
          z,
          create_using=nx.DiGraph(),
      )
  
      z = [1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4]
      pytest.raises(nx.NetworkXError, nx.degree_sequence_tree, z)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 10 for calling a global function with example usage: test_degree_sequence_tree() without return types