code: def conditional_generalized_channel_permute(
      context_dim, channels=3, hidden_dims=None
  ):
      """
      A helper function to create a
      :class:`~pyro.distributions.transforms.ConditionalGeneralizedChannelPermute`
      object for consistency with other helpers.
  
      :param channels: Number of channel dimensions in the input.
      :type channels: int
  
      """
  
      if hidden_dims is None:
          hidden_dims = [channels * 10, channels * 10]
      nn = DenseNN(
          context_dim, hidden_dims, param_dims=[channels * channels]
      )
      return ConditionalGeneralizedChannelPermute(nn, channels)
  
imports: import torch
  from torch.distributions import Transform
  from pyro.nn import DenseNN
  from ..None import constraints
  from ..conditional import ConditionalTransformModule
  from ..torch_transform import TransformModule
  from ..util import copy_docs_from
label_desc: Use image node_id 2 for calling a global function with example usage: conditional_generalized_channel_permute(context_dim, channels, hidden_dims) and returns: ConditionalGeneralizedChannelPermute