def get_signal(obj, signalname):
    """Return signal from object and signal name."""
    if '(' not in signalname:
        return getattr(obj, signalname)
    name, dtype = signalname.strip(')').split('(')
    dtype = tuple(dtype.split(','))
    return getattr(obj, name)[dtype]
