def _run_options(self, name, flow, jobs=None, disabled_jobs=None,
    concurrent=True, properties=None, on_failure='finish', notify_early=False,
    emails=None):
    """Construct data dict for run related actions.

    See :meth:`run_workflow` for parameter documentation.

    """
    if jobs and disabled_jobs:
      raise ValueError('`jobs` and `disabled_jobs` are mutually exclusive.')
    if not jobs:
      if not disabled_jobs:
        disabled = '[]'
      else:
        disabled = '[%s]' % (','.join('"%s"' % (n, ) for n in disabled_jobs), )
    else:
      all_names = set(
        n['id']
        for n in self.get_workflow_info(name, flow)['nodes']
      )
      run_names = set(jobs)
      missing_names = run_names - all_names
      if missing_names:
        raise AzkabanError(
          'Jobs not found in flow %r: %s.' %
          (flow, ', '.join(missing_names))
        )
      else:
        disabled = (
          '[%s]'
          % (','.join('"%s"' % (n, ) for n in all_names - run_names), )
        )
    try:
      failure_action = {
        'finish': 'finishCurrent',
        'continue': 'finishPossible',
        'cancel': 'cancelImmediately',
      }[on_failure]
    except KeyError:
      raise ValueError('Invalid `on_failure` value: %r.' % (on_failure, ))
    request_data = {
      'disabled': disabled,
      'concurrentOption': 'concurrent' if concurrent else 'skip',
      'failureAction': failure_action,
      'notifyFailureFirst': 'true' if notify_early else 'false',
    }
    if properties:
      request_data.update(dict(
        ('flowOverride[%s]' % (key, ), value)
        for key, value in flatten(properties).items()
      ))
    if emails:
      if isinstance(emails[0], string_types):
        failure_emails = ','.join(emails)
        success_emails = failure_emails
      else:
        failure_emails = ','.join(emails[0])
        success_emails = ','.join(emails[1])
      request_data.update({
        'failureEmails': failure_emails,
        'failureEmailsOverride': 'true',
        'successEmails': success_emails,
        'successEmailsOverride': 'true',
      })
    return request_data
dataset/ETHPy150Open mtth/azkaban/azkaban/remote.py/Session._run_options/original