code: def get_model_dimensions(A=None, B=None):
      if A is None and B is None:
          raise ValueError("Must provide either `A` or `B`")
  
      if A is not None:
          num_obs = (
              [a.shape[0] for a in A]
              if is_obj_array(A)
              else [A.shape[0]]
          )
          num_modalities = len(num_obs)
      else:
          num_obs, num_modalities = None, None
  
      if B is not None:
          num_states = (
              [b.shape[0] for b in B]
              if is_obj_array(B)
              else [B.shape[0]]
          )
          num_factors = len(num_states)
      else:
          if A is not None:
              num_states = (
                  list(A[0].shape[1:])
                  if is_obj_array(A)
                  else list(A.shape[1:])
              )
              num_factors = len(num_states)
          else:
              num_states, num_factors = None, None
  
      return num_obs, num_states, num_modalities, num_factors
  
imports: import numpy
  import pandas
  import seaborn
  import matplotlib.pyplot
  import warnings
  import itertools
label_desc: Use image node_id 15 for calling a global function with example usage: get_model_dimensions(A, B) and returns: num_obs,  num_states,  num_modalities,  num_factors