def outgoing_synapses(q, N = None, rel='>',include_inferred=True):
    """
    Get all the outgoing synapses from neurons in a QueryWrapper object.

    Parameters
    ----------
    q: query.QueryWrapper
        The query to search for outgoing synapses
    N: int or None
        Filter for number of synapses (default: None, equivalent to 0)
    rel: str
        Ralation operator to the number of synapses when applying the filter.
        (default: '>')
    include_inferred: bool
        Whether to include InferredSynapses (default: True)

    Returns
    -------
    query.QueryWrapper
        containing the outgoing synapses.

    Example
    -------
    db = NeuroArch('hemibrain')
    neurons = db.sql_query("select from Neuron where name like 'EPG' ")
    q = outgoing_synapses(neurons)
    q.nodes_as_objs
    """
    synapse_classes = ['Synapse', 'InferredSynapse'] if include_inferred else 'Synapse'
    if N:
        return q.gen_traversal_out(['SendsTo', synapse_classes, {'N':(rel,N)}], min_depth=1)
    else:
        return q.gen_traversal_out(['SendsTo', synapse_classes], min_depth=1)