def to_signum(signum):
    if isinstance(signum, int):
        return signum

    m = re.match(r'(\w+)(\+(\d+))?', signum)
    if m:
        name = m.group(1).upper()
        if not name.startswith('SIG'):
            name = 'SIG' + name

        offset = int(m.group(3)) if m.group(3) else 0

        try:
            return getattr(signal, name) + offset
        except KeyError:
            pass

    raise ValueError('signal invalid: {}'.format(signum))
Resolves the signal number from arbitrary signal representation.
dataset/ETHPy150Open circus-tent/circus/circus/util.py/to_signum