def connection_from_list(data, args={}, connection_type=None,
                         edge_type=None, pageinfo_type=None, **kwargs):
    connection_type = connection_type or Connection
    edge_type = edge_type or Edge
    pageinfo_type = pageinfo_type or PageInfo

    full_args = dict(args, **kwargs)

    before = full_args.get('before')
    after = full_args.get('after')
    first = full_args.get('first')
    last = full_args.get('last')

    count = len(data)
    # Slice with cursors
    begin = max(get_offset(after, -1), -1) + 1
    end = min(get_offset(before, count + 1), count)
    if begin >= count or begin >= end:
        return empty_connection(connection_type, pageinfo_type)

    # Save the pre-slice cursors
    first_preslice_cursor = offset_to_cursor(begin)
    last_preslice_cursor = offset_to_cursor(min(end, count) - 1)

    # Slice with limits
    if first is not None:
        end = min(begin + first, end)
    if last is not None:
        begin = max(end - last, begin)

    if begin >= count or begin >= end:
        return empty_connection(connection_type, pageinfo_type)

    sliced_data = data[begin:end]
    edges = [
        edge_type(node=node, cursor=offset_to_cursor(i + begin))
        for i, node in enumerate(sliced_data)
    ]

    # Construct the connection
    first_edge = edges[0]
    last_edge = edges[len(edges) - 1]
    return connection_type(
        edges=edges,
        page_info=pageinfo_type(
            start_cursor=first_edge.cursor,
            end_cursor=last_edge.cursor,
            has_previous_page=(first_edge.cursor != first_preslice_cursor),
            has_next_page=(last_edge.cursor != last_preslice_cursor)
        )
    )
Replace text in line starting with *start*, from this position:
dataset/ETHPy150Open graphql-python/graphql-relay-py/graphql_relay/connection/arrayconnection.py/connection_from_list--crossover with--dataset/ETHPy150Open winpython/winpython/make.py/replace_in_nsis_file