code: def sqlvm_group_list(
          client,
          resource_group_name=None):
      '''
      Lists all SQL virtual machine groups in a resource group or subscription.
      '''
      if resource_group_name:
          # List all sql vm groups in the resource group
          return client.list_by_resource_group(resource_group_name=resource_group_name)
  
      # List all sql vm groups in the subscription
      return client.list(f sqlvm_group_list(
          client,
          resource_group_name=None):
      '''
      Lists all SQL virtual machine groups in a resource group or subscription.
      '''
      if resource_group_name:
          # List all sql vm groups in the resource group
          return client.list_by_resource_group(resource_group_name=resource_group_name)
  
      # List all sql vm groups in the subscription
      return client.list()
docs: Lists all SQL virtual machine groups in a resource group or subscription.