code: def pr0_to_likelihood_array(outcomes, pr0):
          
          pr0 = pr0[np.newaxis, ...]
          pr1 = 1 - pr0
  
          if len(np.shape(outcomes)) == 0:
              outcomes = np.array(outcomes)[None]
                      
          return np.concatenate([
              pr0 if outcomes[idx] == 0 else pr1
              for idx in range(safe_shape(outcomes))
          ])
docs: Assuming a two-outcome measurement with probabilities given by the
          array ``pr0``, returns an array of the form expected to be returned by
          ``likelihood`` method.
          
          :param numpy.ndarray outcomes: Array of integers indexing outcomes.
          :param numpy.ndarray pr0: Array of shape ``(n_models, n_experiments)``
              describing the probability of obtaining outcome ``0`` from each
              set of model parameters and experiment parameters.