def ranged_by(marker, limit=None, offset=None):
    """
    Generates LIMIT and OFFSET clause using marker.

    Parameters
    ----------
    limit: int
        Limit value or `None`.
    offset: int
        OFfset value or `None`.

    Returns
    -------
    str
        LIMIT and OFFSET clause.
    """
    clause, params = [], []
    if limit is not None:
        clause.append(f'LIMIT {marker()}')
        params.append(limit)
    if offset is not None:
        clause.append(f'OFFSET {marker()}')
        params.append(offset)
    return ' '.join(clause), params
