<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cmd():
 """Implementation of rprof subcommand. Other Parameters: conf.rprof conf.core """

    sdat = StagyyData(conf.core.path)
    if sdat.rprof is None:
        return

    if conf.rprof.grid:
        for step in sdat.walk.filter(rprof=True):
            plot_grid(step)

    lovs = misc.list_of_vars(conf.rprof.plot)
    if not lovs:
        return

    if conf.rprof.average:
        plot_average(sdat, lovs)
    else:
        plot_every_step(sdat, lovs)