<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_sampler(nrun=100, sampler=None, pos=None, **kwargs):
 """Run an MCMC sampler. If no sampler or initial position vector is provided, extra ``kwargs`` are passed to `get_sampler` to generate a new sampler. Parameters nrun : int, optional Number of steps to run sampler : :class:`~emcee.EnsembleSampler` instance, optional Sampler. pos : :class:`~numpy.ndarray`, optional A list of initial position vectors for the walkers. It should have dimensions of ``(nwalkers,dim)``, where ``dim`` is the number of free parameters. `emcee.utils.sample_ball` can be used to generate a multidimensional gaussian distribution around a single initial position. Returns ------- sampler : :class:`~emcee.EnsembleSampler` instance Sampler containing the paths of the walkers during the ``nrun`` steps. pos : array List of final position vectors after the run. """


    if sampler is None or pos is None:
        sampler, pos = get_sampler(**kwargs)

    sampler.run_info["n_run"] = nrun

    print("\nWalker burn in finished, running {0} steps...".format(nrun))
    sampler.reset()
    sampler, pos = _run_mcmc(sampler, pos, nrun)

    return sampler, pos