code: def _partial_powers(one_hot_encoded_row, Aadj_T, num_powers):
      """
      This function computes the first num_powers powers of the adjacency matrix
      for the row specified in one_hot_encoded_row
  
      Args:
          one_hot_encoded_row: one-hot-encoded row
          Aadj_T: the transpose of the adjacency matrix
          num_powers (int): the adjacency number of powers to compute
  
      returns:
          A matrix of the shape (num_powers, Aadj_T.shape[1]) of
          the specified row of the first num_powers of the adjacency matrix.
      """
  
      # make sure the transpose of the adjacency is used
      # tensorflow requires that the sparse matrix is the first operand
  
      partial_power = tf.reshape(
          tf.sparse.to_dense(one_hot_encoded_row),
          shape=(1, Aadj_T.shape[1]),
      )
      partial_powers_list = []
      for i in range(num_powers):
          partial_power = K.transpose(
              K.dot(Aadj_T, K.transpose(partial_power))
          )
          partial_powers_list.append(partial_power)
  
      return K.squeeze(tf.stack(partial_powers_list, axis=1), axis=0)
  
file_path: stellargraph/stellargraph/mapper/adjacency_generators.py
imports: import tensorflow
  from tensorflow.keras import backend
  import numpy
  from ..core import StellarGraph
  from ..core.validation import require_integer_in_range
  from ..core.utils import normalize_adj
  from .base import Generator
label_desc: Use image node_id 1 for calling a global function with example usage: _partial_powers(one_hot_encoded_row, Aadj_T, num_powers) and returns: K