def list_(show_all=False,
          show_disabled=True,
          where=None,
          return_yaml=True):
    '''
    List the jobs currently scheduled on the minion

    CLI Example:

    .. code-block:: bash

        salt '*' schedule.list

        # Show all jobs including hidden internal jobs
        salt '*' schedule.list show_all=True

        # Hide disabled jobs from list of jobs
        salt '*' schedule.list show_disabled=False

    '''

    schedule = {}
    try:
        eventer = salt.utils.event.get_event('minion', opts=__opts__)
        res = __salt__['event.fire']({'func': 'list',
                                      'where': where}, 'manage_schedule')
        if res:
            event_ret = eventer.get_event(tag='/salt/minion/minion_schedule_list_complete', wait=30)
            if event_ret and event_ret['complete']:
                schedule = event_ret['schedule']
    except KeyError:
        # Effectively a no-op, since we can't really return without an event system
        ret = {}
        ret['comment'] = 'Event module not available. Schedule list failed.'
        ret['result'] = True
        log.debug('Event module not available. Schedule list failed.')
        return ret

    for job in list(schedule.keys()):  # iterate over a copy since we will mutate it
        if job == 'enabled':
            continue

        # Default jobs added by salt begin with __
        # by default hide them unless show_all is True.
        if job.startswith('__') and not show_all:
            del schedule[job]
            continue

        # if enabled is not included in the job,
        # assume job is enabled.
        if 'enabled' not in schedule[job]:
            schedule[job]['enabled'] = True

        for item in pycopy.copy(schedule[job]):
            if item not in SCHEDULE_CONF:
                del schedule[job][item]
                continue
            if schedule[job][item] == 'true':
                schedule[job][item] = True
            if schedule[job][item] == 'false':
                schedule[job][item] = False

        # if the job is disabled and show_disabled is False, skip job
        if not show_disabled and not schedule[job]['enabled']:
            del schedule[job]
            continue

        if '_seconds' in schedule[job]:
            # if _seconds is greater than zero
            # then include the original back in seconds.
            # otherwise remove seconds from the listing as the
            # original item didn't include it.
            if schedule[job]['_seconds'] > 0:
                schedule[job]['seconds'] = schedule[job]['_seconds']
            elif 'seconds' in schedule[job]:
                del schedule[job]['seconds']

            # remove _seconds from the listing
            del schedule[job]['_seconds']

    if schedule:
        if return_yaml:
            tmp = {'schedule': schedule}
            yaml_out = yaml.safe_dump(tmp, default_flow_style=False)
            return yaml_out
        else:
            return schedule
    else:
        return {'schedule': {}}
dataset/ETHPy150Open saltstack/salt/salt/modules/schedule.py/list_/original