def makeSvgLayers(top_layer, transform=None, refdef=None):

    # Controls the visibility of layers and whether they are locked by
    # default. This is the "master" control; settings in the board's
    # config file will override these settings
    layer_control = {
      "conductor": { 
        "hidden": False, "locked": False, 
        "pours": { "hidden": False, "locked": True },
        "pads": { "hidden": False, "locked": False },
        "routing": { "hidden": False, "locked": False }
      },
      "soldermask": { "hidden": False, "locked": False },
      "solderpaste": { "hidden": True, "locked": True },
      "silkscreen": { "hidden": False, "locked": False },
      "assembly": { "hidden": False, "locked": False },
      "documentation": { "hidden": False, "locked": False },
      "dimensions": { "hidden": False, "locked": True },
      "origin": { "hidden": False, "locked": True },
      "drills": { "hidden": False, "locked": False },
      "placement": { "hidden": False, "locked": False },
      "outline": { "hidden": False, "locked": True }
    }

    # Get overrides
    layer_control_config = config.brd.get('layer-control')
    if layer_control_config != None:
        combined_lc = dict(layer_control.items() +
                           layer_control_config.items())
    else:
        combined_lc = layer_control

    # Holds SVG layers 
    layers = {}

    # Create layers for top and bottom PCB layers
    for layer_dict in reversed(config.stk['layers-dict']):

        layer_type = layer_dict['type']
        layer_name = layer_dict['name']

        # create SVG layer for PCB layer
        layers[layer_name] = {}
        element = layers[layer_name]['layer'] = makeSvgLayer(top_layer, 
                                                             layer_name,
                                                             transform,
                                                             None,
                                                             refdef)
        element.set('{'+config.cfg['ns']['pcbmode']+'}%s' % ('pcb-layer'), layer_name)

        sheets = layer_dict['stack']
        if layer_type == 'signal-layer-surface':
            placement_dict = [{"name": "placement", "type": "placement"}]
            assembly_dict = [{"name": "assembly", "type": "assembly"}]
            solderpaste_dict = [{"name": "solderpaste", "type": "solderpaste"}]
            
            # Layer appear in Inkscape first/top to bottom/last
            sheets = placement_dict + assembly_dict + solderpaste_dict + sheets  

        for sheet in reversed(sheets):

            sheet_type = sheet['type']
            sheet_name = sheet['name']

            # Set default style for this sheet
            try:
                style = utils.dictToStyleText(config.stl['layout'][sheet_type]['default'][layer_name])
            except:
                # A stylesheet may define one style for any sheet type
                # or a specific style for multiple layers of the same
                # type. If, for example, a specific style for
                # 'internal-2' cannot be found, PCBmodE will default
                # to the general definition for this type of sheet
                style = utils.dictToStyleText(config.stl['layout'][sheet_type]['default'][layer_name.split('-')[0]])

            if combined_lc[sheet_type]['hidden'] == True:
                style += 'display:none;'
 
            tmp = layers[layer_name] 
            tmp[sheet_type] = {}
            element = tmp[sheet_type]['layer'] = makeSvgLayer(parent_layer=tmp['layer'], 
                                                              layer_name=sheet_name,
                                                              transform=None, 
                                                              style=style,
                                                              refdef=refdef)

            element.set('{'+config.cfg['ns']['pcbmode']+'}%s' % ('sheet'), sheet_type)
            if combined_lc[sheet_type]['locked'] == True:
                element.set('{'+config.cfg['ns']['sodipodi']+'}insensitive', 'true')

            # A PCB layer of type 'conductor' is best presented in
            # seperate sub-layers of 'pours', 'pads', and
            # 'routing'. The following generates those sub-layers
            if sheet_type == 'conductor':
                tmp2 = layers[layer_name]['conductor']
                conductor_types = ['routing', 'pads', 'pours']
         
                for cond_type in conductor_types:
                    try:
                        style = utils.dictToStyle(config.stl['layout']['conductor'][cond_type].get(layer_name))
                    except:
                        # See comment above for rationalle
                        style = utils.dictToStyleText(config.stl['layout']['conductor'][cond_type][layer_name.split('-')[0]])


                    if combined_lc['conductor'][cond_type]['hidden'] == True:
                        style += 'display:none;'

                    tmp2[cond_type] = {}
                    element = tmp2[cond_type]['layer'] = makeSvgLayer(parent_layer=tmp2['layer'], 
                                                                      layer_name=cond_type,
                                                                      transform=None, 
                                                                      style=style,
                                                                      refdef=refdef)

                    element.set('{'+config.cfg['ns']['pcbmode']+'}%s' % ('sheet'), cond_type)

                    if combined_lc['conductor'][cond_type]['locked'] == True:
                        element.set('{'+config.cfg['ns']['sodipodi']+'}insensitive', 'true')



    for info_layer in ['origin','dimensions','outline','drills','documentation']:
        style = utils.dictToStyleText(config.stl['layout'][info_layer].get('default'))
        if combined_lc[info_layer]['hidden'] == True:
            style += 'display:none;'
        layers[info_layer] = {}
        element = layers[info_layer]['layer'] = makeSvgLayer(top_layer, 
                                                             info_layer,
                                                             transform, 
                                                             style,
                                                             refdef)
        element.set('{'+config.cfg['ns']['pcbmode']+'}%s' % ('sheet'), info_layer)
        if combined_lc[info_layer]['locked'] == True:
            element.set('{'+config.cfg['ns']['sodipodi']+'}insensitive', 'true')

    return layers
Initialize the type descriptor.
dataset/ETHPy150Open boldport/pcbmode/pcbmode/utils/svg.py/makeSvgLayers--crossover with--dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/structs.py/ProtoDynamicEmbedded.__init__