code: def list_virtual_networks(call=None, kwargs=None):
      '''
      List virtual networks.
      '''
      if kwargs is None:
          kwargs = {}
  
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_sizes function must be called with '
              '-f or --function'
          )
  
      netconn = get_conn(client_type='network')
      resource_groups = list_resource_groups()
  
      ret = {}
      for group in resource_groups:
          try:
              networks = netconn.virtual_networks.list(
                  resource_group_name=group
              )
          except CloudError:
              networks = {}
          for network_obj in networks:
              network = network_obj.as_dict()
              ret[network['name']] = network
              ret[network['name']]['subnets'] = list_subnets(
                  kwargs={'resource_group': group, 'network': network['name']}
              )
  
      return ref list_virtual_networks(call=None, kwargs=None):
      '''
      List virtual networks.
      '''
      if kwargs is None:
          kwargs = {}
  
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_sizes function must be called with '
              '-f or --function'
          )
  
      netconn = get_conn(client_type='network')
      resource_groups = list_resource_groups()
  
      ret = {}
      for group in resource_groups:
          try:
              networks = netconn.virtual_networks.list(
                  resource_group_name=group
              )
          except CloudError:
              networks = {}
          for network_obj in networks:
              network = network_obj.as_dict()
              ret[network['name']] = network
              ret[network['name']]['subnets'] = list_subnets(
                  kwargs={'resource_group': group, 'network': network['name']}
              )
  
      return ret
docs: List virtual networks.