code: def sample_fanout_layerwise_each_node(
      nodes, edge_types, counts, default_node=-1
  ):
      """
      sample fanout layerwise for each node
      """
      edge_types = [
          type_ops.get_edge_type_id(edge_type)
          for edge_type in edge_types
      ]
      neighbors_list = [tf.reshape(nodes, [-1])]
      adj_list = []
      for hop_edge_types, count in zip(edge_types, counts):
          if len(neighbors_list) == 1:
              neighbors, _, _ = sample_neighbor(
                  neighbors_list[-1],
                  hop_edge_types,
                  count,
                  default_node=default_node,
              )
              neighbors_list.append(tf.reshape(neighbors, [-1]))
          else:
              neighbors, adj = sample_neighbor_layerwise(
                  tf.reshape(neighbors_list[-1], [-1, last_count]),
                  hop_edge_types,
                  count,
                  default_node=default_node,
              )
              neighbors_list.append(tf.reshape(neighbors, [-1]))
              adj_list.append(adj)
          last_count = count
      return neighbors_list, adj_list
  
file_path: euler/tf_euler/python/euler_ops/neighbor_ops.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_euler.python.euler_ops import base
  from tf_euler.python.euler_ops import type_ops
label_desc: Use image node_id 9 for calling a global function with example usage: sample_fanout_layerwise_each_node(nodes, edge_types, counts, default_node) and returns: neighbors_list,  adj_list