code: def sample_fanout(nodes, edge_types, counts, default_node=-1):
      """
      Sample multi-hop neighbors of nodes according to weight in graph.
  
      Args:
        nodes: A 1-D `Tensor` of `int64`.
        edge_types: A list of 1-D `Tensor` of int32. Specify edge types to filter
          outgoing edges in each hop.
        counts: A list of `int`. Specify the number of sampling for each node in
          each hop.
        default_node: A `int`. Specify the node id to fill when there is no
          neighbor for specific nodes.
  
      Return:
        A tuple of list: (samples, weights)
          samples: A list of `Tensor` of `int64`, with the same length as
            `edge_types` and `counts`, with shapes `[num_nodes]`,
            `[num_nodes * count1]`, `[num_nodes * count1 * count2]`, ...
          weights: A list of `Tensor` of `float`, with shapes
            `[num_nodes * count1]`, `[num_nodes * count1 * count2]` ...
          types: A list of `Tensor` of `int32`, with shapes
            `[num_nodes * count1]`, `[num_nodes * count1 * count2]` ...
      """
      edge_types = [
          type_ops.get_edge_type_id(edge_type)
          for edge_type in edge_types
      ]
      neighbors_list = [tf.reshape(nodes, [-1])]
      weights_list = []
      type_list = []
      neighbors, weights, types = _sample_fanout(
          neighbors_list[-1],
          edge_types,
          counts,
          default_node=default_node,
          N=len(counts),
      )
      neighbors_list.extend([tf.reshape(n, [-1]) for n in neighbors])
      weights_list.extend([tf.reshape(w, [-1]) for w in weights])
      type_list.extend([tf.reshape(t, [-1]) for t in types])
      return neighbors_list, weights_list, type_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 8 for calling a global function with example usage: sample_fanout(nodes, edge_types, counts, default_node) and returns: neighbors_list,  weights_list,  type_list