code: def derivative_names(ndim):
      """Iterate over derivative speficiations and their names."""
      # Note: len(list(derivative_names(ndim)) == triangular(ndim + 1).
      yield (), "f"  # Function value.
      for i in range(ndim):
          yield (i,), "df/d%i" % i  # First derivative along an axis.
      for i in range(ndim):
          yield (
              i,
              i,
          ), "d^2f/d%i^2" % i  # Second derivative along an axis.
      for i, j in zip(*np.triu_indices(ndim, k=1)):
          # Second derivarive along mixed axes.
          yield (int(i), int(j)), "d^2f/(d%i d%i)" % (i, j)
  
file_path: tf-quant-finance/tf_quant_finance/experimental/finite_difference/methods.py
imports: from autograd import elementwise_grad
  import autograd.numpy
  import pandas
  import sobol_seq
label_desc: Use image node_id 7 for calling a global function with example usage: derivative_names(ndim) without return types