def connect(observer, observable, signal, *args):
    """
    Connect `observable`'s `signal` to `observer`'s callback method.

    If `observable` is a string, it should be an attribute of `observer`.
    If `observable` is not a string it should be the same as `observer`.
    """
    method_name = signal.replace('-', '_').replace('::', '_')
    if observer is not observable:
        method_name = '_'.join((observable, method_name))
    method_name = '_on_{}'.format(method_name).replace('__', '_')
    if not hasattr(observer, method_name):
        method_name = method_name[1:]
    method = getattr(observer, method_name)
    if observer is not observable:
        observable = getattr(observer, observable)
    return observable.connect(signal, method, *args)
