// https://github.com/google/skylark/blob/master/doc/spec.md#list·index
171298
func list_index(fnname string, recv_ Value, args Tuple, kwargs []Tuple) (Value, error) {
	recv := recv_.(*List)
	var value, start_, end_ Value
	if err := UnpackPositionalArgs(fnname, args, kwargs, 1, &value, &start_, &end_); err != nil {
		return nil, err
	}

	start, end, err := indices(start_, end_, recv.Len())
	if err != nil {
		return nil, fmt.Errorf("%s: %s", fnname, err)
	}

	for i := start; i < end; i++ {
		if eq, err := Equal(recv.elems[i], value); err != nil {
			return nil, fmt.Errorf("index: %s", err)
		} else if eq {
			return MakeInt(i), nil
		}
	}
	return nil, fmt.Errorf("index: value not in list")
}
576595
func (m *CouchDBBackend) List(ctx context.Context, prefix string) ([]string, error) {
	defer metrics.MeasureSince([]string{"couchdb", "list"}, time.Now())

	m.permitPool.Acquire()
	defer m.permitPool.Release()

	items, err := m.client.list(prefix)
	if err != nil {
		return nil, err
	}

	var out []string
	seen := make(map[string]interface{})
	for _, result := range items {
		trimmed := strings.TrimPrefix(result.ID, prefix)
		sep := strings.Index(trimmed, "/")
		if sep == -1 {
			out = append(out, trimmed)
		} else {
			trimmed = trimmed[:sep+1]
			if _, ok := seen[trimmed]; !ok {
				out = append(out, trimmed)
				seen[trimmed] = struct{}{}
			}
		}
	}
	return out, nil
}
1085522
func (r *AppRepo) List() ([]App, error) {
	apps := []App{}

	if err := r.DB.Select(&apps, "SELECT * FROM apps ORDER BY name ASC"); err != nil {
		return apps, err
	}

	return apps, nil
}
1047714
func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v2beta2.HorizontalPodAutoscaler))
	})
	return ret, err
}
512493
func (p *ProjectsClient) List(ctx context.Context, orgID *identity.ID) ([]envelope.Project, error) {
	orgs := []identity.ID{*orgID}
	return p.Search(ctx, orgs, nil)
}
1330915
func (s *OrdersService) List(parms map[string]string) (*[]Order, *Response, error) {
	orders := new([]Order)
	resp, err := do(s.client, Params{parms: parms, u: "getorders"}, orders)
	if err != nil {
		return nil, resp, err
	}
	return orders, resp, err
}
861039
func List() []string {
	keys := []string{}
	for k := range griftList {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	return keys
}
55570
func (c *FakeExamples) List(opts v1.ListOptions) (result *crv1.ExampleList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewListAction(examplesResource, examplesKind, c.ns, opts), &crv1.ExampleList{})

	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &crv1.ExampleList{ListMeta: obj.(*crv1.ExampleList).ListMeta}
	for _, item := range obj.(*crv1.ExampleList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}
1155104
func List() (*http.Response, string, []error) {
	k := kumoru.New()

	k.Get(fmt.Sprintf("%s/v1/applications/", k.EndPoint.Application))
	k.SignRequest(true)
	return k.End()
}
87606
func (c *PluginCatalog) List(ctx context.Context, pluginType consts.PluginType) ([]string, error) {
	c.lock.RLock()
	defer c.lock.RUnlock()

	// Collect keys for external plugins in the barrier.
	keys, err := logical.CollectKeys(ctx, c.catalogView)
	if err != nil {
		return nil, err
	}

	// Get the builtin plugins.
	builtinKeys := c.builtinRegistry.Keys(pluginType)

	// Use a map to unique the two lists.
	mapKeys := make(map[string]bool)

	pluginTypePrefix := pluginType.String() + "/"

	for _, plugin := range keys {

		// Only list user-added plugins if they're of the given type.
		if entry, err := c.get(ctx, plugin, pluginType); err == nil && entry != nil {

			// Some keys will be prepended with the plugin type, but other ones won't.
			// Users don't expect to see the plugin type, so we need to strip that here.
			idx := strings.Index(plugin, pluginTypePrefix)
			if idx == 0 {
				plugin = plugin[len(pluginTypePrefix):]
			}
			mapKeys[plugin] = true
		}
	}

	for _, plugin := range builtinKeys {
		mapKeys[plugin] = true
	}

	retList := make([]string, len(mapKeys))
	i := 0
	for k := range mapKeys {
		retList[i] = k
		i++
	}
	// sort for consistent ordering of builtin plugins
	sort.Strings(retList)

	return retList, nil
}
853648
func (s *ScansService) List(ctx context.Context, opt *ScansListOpts) (*scan.ScanList, error) {
	scanList := &scan.ScanList{}
	return scanList, s.client.List(ctx, scansUrl, opt, scanList)
}
1179562
func (s *appProjectLister) List(selector labels.Selector) (ret []*v1alpha1.AppProject, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.AppProject))
	})
	return ret, err
}
328215
func (s *podPresetLister) List(selector labels.Selector) (ret []*v1alpha1.PodPreset, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.PodPreset))
	})
	return ret, err
}
1066680
func (ps *PluginsService) List(ctx context.Context) (*PluginsResponse, *APIResponse, error) {
	apiVersion, err := ps.client.getAPIVersion(ctx, "admin/plugin_info")
	if err != nil {
		return nil, nil, err
	}
	pr := PluginsResponse{}
	_, resp, err := ps.client.getAction(ctx, &APIClientRequest{
		Path:         "admin/plugin_info",
		ResponseBody: &pr,
		APIVersion:   apiVersion,
	})

	return &pr, resp, err
}
250917
func (api *APIClient) List(ctx context.Context, options ListOptions) (*DocumentSet, APIResponse) {
	params := map[string]interface{}{
		"limit":  options.Limit,
		"offset": options.Offset,
	}

	u := encodeURLParams(fmt.Sprintf("%s/documents", api.Config.Endpoints.API), params)

	resp, err := api.makeAPIRequest(ctx, "GET", u, nil, nil, options.UserIdentifier)

	if err != nil {
		return nil, apiResponse(ErrHTTPGetFailed, "", resp, err)
	}

	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return nil, apiResponse(ErrDocumentList, "", resp, errors.New(ErrDocumentList))
	}

	contents, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, apiResponse(ErrDocumentRead, "", resp, err)
	}

	var docs DocumentSet
	if err := json.Unmarshal(contents, &docs); err != nil {
		return nil, apiResponse(ErrDocumentParse, "", resp, err)
	}

	// Extra round: Ingesting *APIClient into each and every doc
	for _, d := range docs.Documents {
		d.client = api
		d.Owner = options.UserIdentifier
	}

	return &docs, apiResponse("document list completed", "", resp, err)
}
479961
func (c *Client) List() ([]*Note, error) {
	var res []*Note
	var mark string
	for {
		curr, err := c.listRaw(mark)
		if err != nil {
			return nil, err
		}
		for _, nd := range curr.Notes {
			updateNoteData(nd)
			n := nd.Note
			if n.ID == "" {
				log.Fatalf("n.ID is empty on %v\n", n)
			}
			res = append(res, n)
		}
		mark = curr.Mark
		if mark == "" {
			break
		}
	}
	return res, nil
}
1111937
func (s *serviceLister) List(selector labels.Selector) (ret []*v1.Service, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.Service))
	})
	return ret, err
}