code: def list_of_all(
      time_series_xs: Array,
      depth: int = 2,
      width: int = 50,
      periods: Iterable[float] = (),
      parent_is_multiply: bool = False,
      include_sums: bool = True,
      include_changepoints: bool = True,
      only_safe_products: bool = False,
  ) -> List[bnn.BNN]:
      """Return a list of all BNNs of the given depth."""
      all_bnns = []
      if depth == 0:
          all_bnns.extend(
              k(width=width, going_to_be_multiplied=parent_is_multiply)
              for k in NON_PERIODIC_KERNELS
          )
          for p in periods:
              all_bnns.append(
                  kernels.PeriodicBNN(
                      width=width,
                      period=p,
                      going_to_be_multiplied=parent_is_multiply,
                  )
              )
          return all_bnns
  
      multiply_children = list_of_all(
          time_series_xs, depth - 1, width, periods, True
      )
      if parent_is_multiply:
          non_multiply_children = multiply_children
      else:
          non_multiply_children = list_of_all(
              time_series_xs, depth - 1, width, periods, False
          )
  
      # Abelian operators that aren't Multiply.
      if include_sums:
          for i, c1 in enumerate(non_multiply_children):
              for j in range(i + 1):
                  c2 = non_multiply_children[j]
                  # Add is also abelian, but WeightedSum is more general.
                  all_bnns.append(
                      operators.WeightedSum(
                          bnns=(
                              c1.clone(_deep_clone=True),
                              c2.clone(_deep_clone=True),
                          )
                      )
                  )
  
      if parent_is_multiply:
          # Remaining operators don't expose .penultimate() method.
          return all_bnns
  
      # Multiply
      for i, c1 in enumerate(multiply_children):
          if only_safe_products:
              # The only safe kernels to multiply by are Linear and Quadratic.
              if not isinstance(c1, kernels.PolynomialBNN):
                  continue
          for j in range(i + 1):
              c2 = multiply_children[j]
              all_bnns.append(
                  operators.Multiply(
                      bnns=(
                          c1.clone(_deep_clone=True),
                          c2.clone(_deep_clone=True),
                      )
                  )
              )
  
      # Non-abelian operators
      if include_changepoints:
          for c1 in non_multiply_children:
              for c2 in non_multiply_children:
                  # ChangePoint is also non-abelian, but requires that we know
                  # what the change point is.
                  all_bnns.append(
                      operators.LearnableChangePoint(
                          bnns=(
                              c1.clone(_deep_clone=True),
                              c2.clone(_deep_clone=True),
                          ),
                          time_series_xs=time_series_xs,
                      )
                  )
  
      return all_bnns
  
file_path: probability/tensorflow_probability/python/experimental/autobnn/bnn_tree.py
imports: from typing import Iterable, List
  from flax import linen
  import jax
  import jax.numpy
  from tensorflow_probability.python.experimental.autobnn import bnn
  from tensorflow_probability.python.experimental.autobnn import kernels
  from tensorflow_probability.python.experimental.autobnn import operators
  from tensorflow_probability.python.experimental.autobnn import util
label_desc: Use image node_id 1 for calling a global function with example usage: list_of_all(time_series_xs, depth, width, periods, parent_is_multiply, include_sums, include_changepoints, only_safe_products) and returns: all_bnns, all_bnns, all_bnns