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

def get_svg_layers(svg_sources):
    '''
    Collect layers from input svg sources.

    Args:

        svg_sources (list) : A list of file-like objects, each containing
            one or more XML layers.

    Returns
    -------
    (width, height), layers : (int, int), list
        The first item in the tuple is the shape of the largest layer, and the
        second item is a list of ``Element`` objects (from :mod:`lxml.etree`
        module), one per SVG layer.
    '''
    layers = []
    width, height = None, None

    def extract_length(attr):
        'Extract length in pixels.'
        match = CRE_MM_LENGTH.match(attr)
        if match:
            # Length is specified in millimeters.
            return INKSCAPE_PPmm.magnitude * float(match.group('length'))
        else:
            return float(attr)

    for svg_source_i in svg_sources:
        # Parse input file.
        xml_root = etree.parse(svg_source_i)
        svg_root = xml_root.xpath('/svg:svg', namespaces=INKSCAPE_NSMAP)[0]
        width = max(extract_length(svg_root.attrib['width']), width)
        height = max(extract_length(svg_root.attrib['height']), height)
        layers += svg_root.xpath('//svg:g[@inkscape:groupmode="layer"]',
                                 namespaces=INKSCAPE_NSMAP)

    for i, layer_i in enumerate(layers):
        layer_i.attrib['id'] = 'layer%d' % (i + 1)
    return (width, height), layers