// ListSnippets returns the list of Snippets for the configuration version. Content is not displayed for Dynmanic Snippets due to them being
// versionless, use the GetDynamicSnippet function to show current content.
545984
func (c *Client) ListSnippets(i *ListSnippetsInput) ([]*Snippet, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	path := fmt.Sprintf("/service/%s/version/%d/snippet", i.Service, i.Version)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var snippets []*Snippet
	if err := decodeJSON(&snippets, resp.Body); err != nil {
		return nil, err
	}
	sort.Stable(snippetsByName(snippets))
	return snippets, nil
}
135069
func (c *namespaces) List(opts api.ListOptions) (result *api.NamespaceList, err error) {
	result = &api.NamespaceList{}
	err = c.client.Get().
		Resource("namespaces").
		VersionedParams(&opts, api.ParameterCodec).
		Do().
		Into(result)
	return
}
443346
func (s *ResourcetagsService) ListTags(p *ListTagsParams) (*ListTagsResponse, error) {
	resp, err := s.cs.newRequest("listTags", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListTagsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
496279
func ListFetchedFeeds(driver db.DB) (jsonMetas, xmlMetas []models.FeedMeta, err error) {
	lastMetas, err := driver.GetFetchedFeedMetas()
	if err != nil {
		return nil, nil, fmt.Errorf("Failed to get Meta: %s", err)
	}
	if len(lastMetas) == 0 {
		log.Infof("No feeds found")
		return
	}

	xmlYears, jsonYears := map[int]bool{}, map[int]bool{}
	for _, meta := range lastMetas {
		if !checkNvdURL(meta.URL) {
			continue
		}
		y, xml, err := nvdFeedURLToYear(meta.URL)
		if err != nil {
			return nil, nil, err
		}
		if xml {
			xmlYears[y] = true
		} else {
			jsonYears[y] = true
		}
	}

	xmlY, jsonY := []int{}, []int{}
	for y := range xmlYears {
		xmlY = append(xmlY, y)
	}
	for y := range jsonYears {
		jsonY = append(jsonY, y)
	}

	xmlMetas, err = FetchLatestFeedMeta(driver, xmlY, true)
	if err != nil {
		return nil, nil, err
	}
	jsonMetas, err = FetchLatestFeedMeta(driver, jsonY, false)
	if err != nil {
		return nil, nil, err
	}
	return
}
360846
func (c *Client) ListKeys(prefix string) (keyval.BytesKeyIterator, error) {
	entries := c.db.GetDataForPrefix(prefix)
	var keysWithoutPrefix []string
	for _, entry := range entries {
		keysWithoutPrefix = append(keysWithoutPrefix, entry.Key)
	}
	return &bytesKeyIterator{len: len(keysWithoutPrefix), keys: keysWithoutPrefix, prefix: prefix}, nil
}
655488
func (s *GistsService) ListComments(ctx context.Context, gistID string, opt *ListOptions) ([]*GistComment, *Response, error) {
	u := fmt.Sprintf("gists/%v/comments", gistID)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var comments []*GistComment
	resp, err := s.client.Do(ctx, req, &comments)
	if err != nil {
		return nil, resp, err
	}

	return comments, resp, nil
}
1000372
func (m *MemoryStore) ListFiles() []string {
	names := make([]string, 0, len(m.data))
	for n := range m.data {
		names = append(names, n)
	}
	return names
}
337953
func (s *ConfigurationService) ListConfigurations(p *ListConfigurationsParams) (*ListConfigurationsResponse, error) {
	resp, err := s.cs.newRequest("listConfigurations", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListConfigurationsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
545344
func (s *Server) ListNodes(ctx context.Context, request *api.ListNodesRequest) (*api.ListNodesResponse, error) {
	var (
		nodes []*api.Node
		err   error
	)
	s.store.View(func(tx store.ReadTx) {
		switch {
		case request.Filters != nil && len(request.Filters.Names) > 0:
			nodes, err = store.FindNodes(tx, buildFilters(store.ByName, request.Filters.Names))
		case request.Filters != nil && len(request.Filters.NamePrefixes) > 0:
			nodes, err = store.FindNodes(tx, buildFilters(store.ByNamePrefix, request.Filters.NamePrefixes))
		case request.Filters != nil && len(request.Filters.IDPrefixes) > 0:
			nodes, err = store.FindNodes(tx, buildFilters(store.ByIDPrefix, request.Filters.IDPrefixes))
		case request.Filters != nil && len(request.Filters.Roles) > 0:
			filters := make([]store.By, 0, len(request.Filters.Roles))
			for _, v := range request.Filters.Roles {
				filters = append(filters, store.ByRole(v))
			}
			nodes, err = store.FindNodes(tx, store.Or(filters...))
		case request.Filters != nil && len(request.Filters.Memberships) > 0:
			filters := make([]store.By, 0, len(request.Filters.Memberships))
			for _, v := range request.Filters.Memberships {
				filters = append(filters, store.ByMembership(v))
			}
			nodes, err = store.FindNodes(tx, store.Or(filters...))
		default:
			nodes, err = store.FindNodes(tx, store.All)
		}
	})
	if err != nil {
		return nil, err
	}

	if request.Filters != nil {
		nodes = filterNodes(nodes,
			func(e *api.Node) bool {
				if len(request.Filters.Names) == 0 {
					return true
				}
				if e.Description == nil {
					return false
				}
				return filterContains(e.Description.Hostname, request.Filters.Names)
			},
			func(e *api.Node) bool {
				if len(request.Filters.NamePrefixes) == 0 {
					return true
				}
				if e.Description == nil {
					return false
				}
				return filterContainsPrefix(e.Description.Hostname, request.Filters.NamePrefixes)
			},
			func(e *api.Node) bool {
				return filterContainsPrefix(e.ID, request.Filters.IDPrefixes)
			},
			func(e *api.Node) bool {
				if len(request.Filters.Labels) == 0 {
					return true
				}
				if e.Description == nil {
					return false
				}
				return filterMatchLabels(e.Description.Engine.Labels, request.Filters.Labels)
			},
			func(e *api.Node) bool {
				if len(request.Filters.NodeLabels) == 0 {
					return true
				}
				return filterMatchLabels(e.Spec.Annotations.Labels, request.Filters.NodeLabels)
			},
			func(e *api.Node) bool {
				if len(request.Filters.Roles) == 0 {
					return true
				}
				for _, c := range request.Filters.Roles {
					if c == e.Role {
						return true
					}
				}
				return false
			},
			func(e *api.Node) bool {
				if len(request.Filters.Memberships) == 0 {
					return true
				}
				for _, c := range request.Filters.Memberships {
					if c == e.Spec.Membership {
						return true
					}
				}
				return false
			},
		)
	}

	// Add in manager information on nodes that are managers
	if s.raft != nil {
		memberlist := s.raft.GetMemberlist()

		for _, node := range nodes {
			for _, member := range memberlist {
				if member.NodeID == node.ID {
					node.ManagerStatus = &api.ManagerStatus{
						RaftID:       member.RaftID,
						Addr:         member.Addr,
						Leader:       member.Status.Leader,
						Reachability: member.Status.Reachability,
					}
					break
				}
			}
		}
	}

	return &api.ListNodesResponse{
		Nodes: nodes,
	}, nil
}
1341329
func (r *PrevRevisions) ListKeys() (ret []string) {
	r.mu.RLock()
	for key := range r.revisions {
		ret = append(ret, key)
	}
	r.mu.RUnlock()
	return ret
}
555781
func (s resourceQuotaNamespaceLister) List(selector labels.Selector) (ret []*v1.ResourceQuota, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.ResourceQuota))
	})
	return ret, err
}
1211710
func (e *ApiClientService) ListKeys(clientName string) (data *ApiClientKeyListResult, err error) {
	url := fmt.Sprintf("clients/%s/keys", clientName)
	err = e.client.magicRequestDecoder("GET", url, nil, &data)
	return
}
913020
func (*Projects) List(c context.Context, req *projects.ListRequest) (*projects.ListResponse, error) {
	rsp := &projects.ListResponse{}
	// TODO(smut): Handle page tokens.
	if req.GetPageToken() != "" {
		return rsp, nil
	}
	q := datastore.NewQuery(model.ProjectKind)
	if err := datastore.Run(c, q, func(p *model.Project, f datastore.CursorCB) error {
		rsp.Projects = append(rsp.Projects, &p.Config)
		return nil
	}); err != nil {
		return nil, errors.Annotate(err, "failed to fetch projects").Err()
	}
	return rsp, nil
}
363067
func (c *ConfigFile) GetSectionList() []string {
	list := make([]string, len(c.sectionList))
	copy(list, c.sectionList)
	return list
}
1076264
func (d *DNSProvider) listZoneConfigs(findRequest ZoneConfigsFindRequest) (*ZoneConfigsFindResponse, error) {
	uri := defaultBaseURL + "/zoneConfigsFind"

	findResponse := &ZoneConfigsFindResponse{}

	rawResp, err := d.post(uri, findRequest, findResponse)
	if err != nil {
		return nil, err
	}

	if len(findResponse.Response.Data) == 0 {
		return nil, fmt.Errorf("%v: %s", err, toUnreadableBodyMessage(uri, rawResp))
	}

	if findResponse.Status != "success" && findResponse.Status != "pending" {
		return findResponse, errors.New(toUnreadableBodyMessage(uri, rawResp))
	}

	return findResponse, nil
}
934100
func (c *Client) ListNodes() (nodes []NodeState, err error) {
	resp, err := c.get(c.getURL("state/nodes"))
	if err != nil {
		return []NodeState{}, err
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		return []NodeState{}, fmt.Errorf("Expected: {1,2}xx listing nodes, got: %d", resp.StatusCode)
	}

	err = json.NewDecoder(resp.Body).Decode(&nodes)
	if err != nil {
		return []NodeState{}, err
	}
	return nodes, err
}
742662
func list_append(fnname string, recv_ Value, args Tuple, kwargs []Tuple) (Value, error) {
	recv := recv_.(*List)
	var object Value
	if err := UnpackPositionalArgs(fnname, args, kwargs, 1, &object); err != nil {
		return nil, err
	}
	if err := recv.checkMutable("append to", true); err != nil {
		return nil, err
	}
	recv.elems = append(recv.elems, object)
	return None, nil
}