code: def new_layer_config(
      dim_in: int,
      dim_out: int,
      num_layers: int,
      has_act: bool,
      has_bias: bool,
      cfg,
  ) -> LayerConfig:
      r"""Createa a layer configuration for a GNN layer.
  
      Args:
          dim_in (int): The input feature dimension.
          dim_out (int): The output feature dimension.
          num_layers (int): The number of hidden layers
          has_act (bool): Whether to apply an activation function after the
              layer.
          has_bias (bool): Whether to apply a bias term in the layer.
          cfg (ConfigNode): The underlying configuration.
      """
      return LayerConfig(
          has_batchnorm=cfg.gnn.batchnorm,
          bn_eps=cfg.bn.eps,
          bn_mom=cfg.bn.mom,
          mem_inplace=cfg.mem.inplace,
          dim_in=dim_in,
          dim_out=dim_out,
          edge_dim=cfg.dataset.edge_dim,
          has_l2norm=cfg.gnn.l2norm,
          dropout=cfg.gnn.dropout,
          has_act=has_act,
          final_act=True,
          act=cfg.gnn.act,
          has_bias=has_bias,
          keep_edge=cfg.gnn.keep_edge,
          dim_inner=cfg.gnn.dim_inner,
          num_layers=num_layers,
      )
  
imports: import copy
  from dataclasses import dataclass, replace
  import torch
  import torch.nn.functional
  import torch_geometric
  import torch_geometric.graphgym.models.act
  import torch_geometric.graphgym.register
  from torch_geometric.graphgym.contrib.layer.generalconv import GeneralConvLayer, GeneralEdgeConvLayer
  from torch_geometric.graphgym.register import register_layer
  from torch_geometric.nn import Linear
label_desc: Use image node_id 1 for calling a global function with example usage: new_layer_config(dim_in, dim_out, num_layers, has_act, has_bias, cfg) and returns: LayerConfig