code: def transform_aglistener_output(result):
      '''
      Transforms the result of Availability Group Listener to eliminate unnecessary parameters.
      '''
      from collections import OrderedDict
      from msrestazure.tools import parse_resource_id
      try:
          resource_group = getattr(result, 'resource_group', None) or parse_resource_id(result.id)['resource_group']
          # Create a dictionary with the relevant parameters
          output = OrderedDict([('id', result.id),
                                ('name', result.name),
                                ('provisioningState', result.provisioning_state),
                                ('port', result.port),
                                ('resourceGroup', resource_group)])
  
          # Note, wsfcDomainCredentials will not display
          if result.load_balancer_configurations is not None:
              output['loadBalancerConfigurations'] = format_load_balancer_configuration_list(result.load_balancer_configurations)
  
          return output
      except AttributeError:
          # Return the response object if the formating fails
          return resulf transform_aglistener_output(result):
      '''
      Transforms the result of Availability Group Listener to eliminate unnecessary parameters.
      '''
      from collections import OrderedDict
      from msrestazure.tools import parse_resource_id
      try:
          resource_group = getattr(result, 'resource_group', None) or parse_resource_id(result.id)['resource_group']
          # Create a dictionary with the relevant parameters
          output = OrderedDict([('id', result.id),
                                ('name', result.name),
                                ('provisioningState', result.provisioning_state),
                                ('port', result.port),
                                ('resourceGroup', resource_group)])
  
          # Note, wsfcDomainCredentials will not display
          if result.load_balancer_configurations is not None:
              output['loadBalancerConfigurations'] = format_load_balancer_configuration_list(result.load_balancer_configurations)
  
          return output
      except AttributeError:
          # Return the response object if the formating fails
          return result
docs: Transforms the result of Availability Group Listener to eliminate unnecessary parameters.