code: def powersum(n, p, b=10):
      """Return sum of digits of n (in base b) raised to the power p."""
      dlist = digitsrep(n, b)
      sum = 0
      for k in dlist:
          sum += k**p
      return sum
  
file_path: networkx/examples/algorithms/plot_iterated_dynamical_systems.py
imports: import networkx
label_desc: Use image node_id 2 for calling a global function with example usage: powersum(n, p, b) and returns: sum