code: def set_p0(self, samples_file=None, prior=None):
          
          # if samples are given then use those as initial positions
          if samples_file is not None:
              with self.io(samples_file, 'r') as fp:
                  samples = fp.read_samples(self.variable_params,
                                            iteration=-1, flatten=False)
                  # remove the (length 1) niterations dimension
                  samples = samples[..., 0]
                  # make sure we have the same shape
                  assert samples.shape == self.base_shape, (
                         "samples in file {} have shape {}, but I have shape {}".
                         format(samples_file, samples.shape, self.base_shape))
              # transform to sampling parameter space
              if self.model.sampling_transforms is not None:
                  samples = self.model.sampling_transforms.apply(samples)
          # draw random samples if samples are not provided
          else:
              nsamples = numpy.prod(self.base_shape)
              samples = self.model.prior_rvs(size=nsamples, prior=prior).reshape(
                  self.base_shape)
          # store as ND array with shape [base_shape] x nparams
          ndim = len(self.variable_params)
          p0 = numpy.ones(list(self.base_shape)+[ndim])
          for i, param in enumerate(self.sampling_params):
              p0[..., i] = samples[param]
          self._p0 = p0
          return self.p0
docs: Sets the initial position of the walkers.
  
          Parameters
          ----------
          samples_file : InferenceFile, optional
              If provided, use the last iteration in the given file for the
              starting positions.
          prior : JointDistribution, optional
              Use the given prior to set the initial positions rather than
              ``model``'s prior.
  
          Returns
          -------
          p0 : dict
              A dictionary maping sampling params to the starting positions.