<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def draw_lines_svg_layer(df_endpoints, layer_name, layer_number=1):
    '''
    Draw lines defined by endpoint coordinates as a layer in a SVG file.

    Args:

        df_endpoints (pandas.DataFrame) : Each row corresponds to the endpoints
            of a single line, encoded through the columns: ``x_source``,
            ``y_source``, ``x_target``, and ``y_target``.
        layer_name (str) : Name of Inkscape layer.
        layer_number (int, optional) : Z-order index of Inkscape layer.

    Returns
    -------
    StringIO.StringIO
        A file-like object containing SVG XML source.

        The XML contains a layer named ``"Connections"``, which in turn
        contains one line per row in the input :data:`df_endpoints` table.
    '''
    # Note that `svgwrite.Drawing` requires a filepath to be specified during
    # construction, *but* nothing is actually written to the path unless one of
    # the `save*` methods is called.
    #
    # In this function, we do *not* call any of the `save*` methods.  Instead,
    # we use the `write` method to write to an in-memory file-like object.
    dwg = svgwrite.Drawing('should_not_exist.svg', profile='tiny', debug=False)

    dwg.attribs['width'] = df_endpoints[['x_source', 'x_target']].values.max()
    dwg.attribs['height'] = df_endpoints[['y_source', 'y_target']].values.max()

    nsmap = INKSCAPE_NSMAP

    dwg.attribs['xmlns:inkscape'] = nsmap['inkscape']

    coord_columns = ['x_source', 'y_source', 'x_target', 'y_target']

    line_layer = dwg.g(id='layer%d' % layer_number,
                       **{'inkscape:label': layer_name,
                          'inkscape:groupmode': 'layer'})

    for i, (x1, y1, x2, y2) in df_endpoints[coord_columns].iterrows():
        line_i = dwg.line((x1, y1), (x2, y2), id='line%d' % i,
                          style='stroke:#000000; stroke-width:0.1;')
        line_layer.add(line_i)
    dwg.add(line_layer)

    output = StringIO.StringIO()
    dwg.write(output)
    # Rewind file.
    output.seek(0)
    return output