def get_row(l, m):
    """Construct dataframe row from `l` (Learner.named_modules() module) and `m` (model_type)"""
    lyr_name = l[0]
    lyr_obj = l[1]
    ln_split = str(lyr_name).split('.', 4)
    ln_n_splits = len(ln_split)
    lyr_str = str(lyr_obj)
    tch_cls_str = str(type(lyr_obj))
    tch_cls_substr = tch_cls_str[tch_cls_str.find('<class') + 8:tch_cls_str
        .find('>') - 1]
    tch_cls = tch_cls_substr.split('.')[-1]
    div = tch_cls if lyr_name == '0' or lyr_name == '1' else ''
    mod = tch_cls if ln_n_splits == 2 else ''
    blk = tch_cls if ln_n_splits == 3 and not lyr_name.startswith('1') else ''
    lyr = lyr_str[:90]
    if m == 'vgg' or m == 'alexnet':
        if ln_n_splits > 2:
            ln_split[2] = ''
        blk = ''
    elif m == 'squeezenet':
        blk = tch_cls if ln_n_splits == 3 and tch_cls == 'Fire' else ''
        if blk == 'Fire':
            lyr = ''
    elif m == 'resnet':
        if blk == 'BasicBlock' or blk == 'Bottleneck':
            lyr = ''
        else:
            if ln_n_splits > 4:
                lyr = f'. . {lyr_str[:86]}'
            if ln_n_splits == 4 and ln_split[3] == 'downsample':
                lyr = f'Container{tch_cls}'
    elif m == 'densenet':
        lyr_name = lyr_name.replace('denseblock', '').replace('denselayer', '')
        ln_split = str(lyr_name).split('.', 5)
        if len(ln_split) > 1 and ln_split[0] != '1':
            del ln_split[1]
        ln_n_splits = len(ln_split)
        mod = tch_cls if lyr_name.startswith('0'
            ) and ln_n_splits == 2 or lyr_name.startswith('1'
            ) and ln_n_splits == 2 else ''
        blk = tch_cls if ln_n_splits == 3 and tch_cls == '_DenseLayer' else ''
        if (mod == '_DenseBlock' or mod == '_Transition' or blk ==
            '_DenseLayer'):
            lyr = ''
        else:
            if lyr_name == '0' or lyr_name == '1':
                div = tch_cls
            if lyr_name == '0.0':
                div = f'. . {tch_cls}'
    elif m == 'xresnet':
        blk = tch_cls if ln_n_splits == 3 and tch_cls == 'ResBlock' else ''
        if mod == 'ConvLayer' or blk == 'ResBlock':
            lyr = ''
        elif ln_n_splits < 4:
            lyr = lyr_str[:90]
        elif ln_n_splits == 4 and tch_cls == 'Sequential':
            lyr = f'Container{tch_cls}'
        elif ln_n_splits == 4 and tch_cls == 'ReLU':
            lyr = lyr_str[:90]
        elif ln_n_splits == 5 and tch_cls == 'ConvLayer':
            lyr = f'. . Container{tch_cls}'
        else:
            lyr = f'. . . . {lyr_str[:32]}'
    else:
        raise Exception('Model type not recognised')
    return {'Module_name': lyr_name, 'Model': tch_cls if lyr_name == '' else
        '', 'Division': div, 'Container_child': mod, 'Container_block': blk,
        'Layer_description': lyr, 'Torch_class': tch_cls_substr,
        'Output_dimensions': '', 'Parameters': '', 'Trainable': '',
        'Currently': '', 'div_id': ln_split[0] if ln_n_splits > 0 else '',
        'chd_id': ln_split[1] if ln_n_splits > 1 else '', 'blk_id': 
        ln_split[2] if ln_n_splits > 2 else '', 'lyr_id': ln_split[3] if 
        ln_n_splits > 3 else '', 'tch_cls': tch_cls, 'out_dim': '',
        'current': '', 'lyr_blk': '', 'lyr_chd': '', 'blk_chd': '',
        'lyr_obj': lyr_obj}
