def open(device, **kwargs):
    """Open a connection to the given device."""
    if len(device.split(':')) == 6:
        from .bluepy import BluepyConnection
        return BluepyConnection(device, **kwargs)
    else:
        from .serial import SerialConnection
        return SerialConnection(device, **kwargs)
