def _get_channel(host, timeout):
    """
    Create communication channel for given `host`.

    Args:
        host (str): Specified --host.
        timeout (int): Set `timeout` for returned `channel`.

    Returns:
        Object: Pika channel object.
    """
    connection = create_blocking_connection(host)

    # register timeout
    if timeout >= 0:
        connection.add_timeout(
            timeout,
            lambda: sys.stderr.write("Timeouted!\n") or sys.exit(1)
        )

    return connection.channel()
def _get_channel ( host , timeout ) : connection = create_blocking_connection ( host ) if timeout >= 0 : connection . add_timeout ( timeout , lambda : sys . stderr . write ( "Timeouted!\n" ) or sys . exit ( 1 ) ) return connection . channel ( )
Create communication channel for given `host`.

    Args:
        host (str): Specified --host.
        timeout (int): Set `timeout` for returned `channel`.

    Returns:
        Object: Pika channel object.