def _makeRunner(config):
    """
    Return a trial runner class set up with the parameters extracted from
    C{config}.

    @return: A trial runner instance.
    @rtype: L{runner.TrialRunner} or C{DistTrialRunner} depending on the
        configuration.
    """
    cls = runner.TrialRunner
    args = {'reporterFactory': config['reporter'],
            'tracebackFormat': config['tbformat'],
            'realTimeErrors': config['rterrors'],
            'uncleanWarnings': config['unclean-warnings'],
            'logfile': config['logfile'],
            'workingDirectory': config['temp-directory']}
    if config['dry-run']:
        args['mode'] = runner.TrialRunner.DRY_RUN
    elif config['jobs']:
        from twisted.trial._dist.disttrial import DistTrialRunner
        cls = DistTrialRunner
        args['workerNumber'] = config['jobs']
        args['workerArguments'] = config._getWorkerArguments()
    else:
        if config['debug']:
            args['mode'] = runner.TrialRunner.DEBUG
            debugger = config['debugger']

            if debugger != 'pdb':
                try:
                    args['debugger'] = reflect.namedAny(debugger)
                except reflect.ModuleNotFound:
                    raise _DebuggerNotFound(
                        '%r debugger could not be found.' % (debugger,))
            else:
                args['debugger'] = _wrappedPdb()

        args['exitFirst'] = config['exitfirst']
        args['profile'] = config['profile']
        args['forceGarbageCollection'] = config['force-gc']

    return cls(**args)

    Return a trial runner class set up with the parameters extracted from
    C{config}.

    @return: A trial runner instance.
    @rtype: L{runner.TrialRunner} or C{DistTrialRunner} depending on the
        configuration.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/scripts/trial.py