// Find クーポン情報 全件取得
340445
func (api *CouponAPI) Find() ([]*sacloud.Coupon, error) {
	authStatus, err := api.client.AuthStatus.Read()
	if err != nil {
		return nil, err
	}
	accountID := authStatus.Account.GetStrID()

	uri := fmt.Sprintf("%s/%s", api.getResourceURL(), accountID)
	data, err := api.client.newRequest("GET", uri, nil)
	if err != nil {
		return nil, err
	}
	var res CouponResponse
	if err := json.Unmarshal(data, &res); err != nil {
		return nil, err
	}
	return res.Coupons, nil
}
529655
func Find(array []interface{}, iterator ConditionIterator) interface{} {
	for index, data := range array {
		if iterator(data, index) {
			return data
		}
	}
	return nil
}
1201599
func find(rs []rune, groups []*group) map[string][]Entity {
	results := make(map[string][]Entity, len(groups))
	pairs := make([]pair, 0, 20)
	start := 0
	prevSpace := true // First char of sequence is legit
	space := false

	for off, r := range rs {
		// What are we looking at?
		space = unicode.IsPunct(r) || unicode.IsSpace(r)

		if prevSpace && !space {
			// Word is beginning at this rune
			start = off
		} else if space && !prevSpace {
			// Word is ending, shift the pairs stack
			_, pairs = shift(pair{start, off}, pairs)

			// Run the stack, check for entities working backwards from the current position
			if len(pairs) > 1 {
				p2 := pairs[len(pairs)-1]
				for i := len(pairs) - 1; i >= 0; i-- {
					p1 := pairs[i]
					if p2[right]-p1[left] > MaxEntityLen {
						break // Too long or short, can ignore it
					}
					for _, g := range groups {
						if p2[right]-p1[left] > g.maxLen {
							continue
						}
						if ents, ok := g.entities[hash(rs[p1[left]:p2[right]])]; ok {
							// We have at least one entity with this key
							for _, ent := range ents {
								if len(ent) != p2[right]-p1[left] {
									break
								}
								match := true
								for i, r := range ent {
									if unicode.ToLower(r) != unicode.ToLower(rs[p1[left]+i]) {
										match = false
										break
									}
								}
								if match {
									results[g.name] = append(results[g.name],
										Entity{
											Text:   rs[p1[left]:p2[right]],
											Offset: p1[left],
										},
									)
								}
							}
						}
					}
				}
			}
		}

		// Mark prevSpace for the next loop
		if space {
			prevSpace = true
		} else {
			prevSpace = false
		}
	}
	return results
}
716402
func (t *Tree) Find(ctx context.Context, h Hash) (ret interface{}, root Hash, err error) {
	return t.findTyped(ctx, h, false)
}
893230
func (r *RepositoryService) Find(model interface{}, id int) error {
	db, err := r.Connections.Make()

	if err != nil {
		return err
	}

	if err := db.Where("id = ?", id).Find(model).Error; err != nil {
		return err
	}

	return nil
}
111687
func (s *EventsService) Find(e EventKey) (EventInfoDTO, *http.Response, error) {
	var t EventInfoDTO
	res, err := s.client.get(e.URI(), &t)
	return t, res, err
}
488222
func (e *VirtualMachine) Find(c *fi.Context) (*VirtualMachine, error) {
	glog.V(4).Info("VirtualMachine.Find invoked!")
	return nil, nil
}
279592
func (list *CustomerList) Find(id string) *Customer {
	for _, item := range list.Data {
		if item.ID == id {
			return item
		}
	}

	return nil
}
786843
func (b *Box) Find(name string) ([]byte, error) {
	f, err := b.Resolve(name)
	if err != nil {
		return []byte(""), err
	}
	bb := &bytes.Buffer{}
	io.Copy(bb, f)
	return bb.Bytes(), nil
}
71176
func (self *BaseDispatcher) Find(d *restObj, num int64, bundle PBundle) bool {
	allow, ok := d.find.(Allower)
	if !ok {
		return true
	}
	return allow.Allow(num, "GET", bundle)
}
131136
func (s *DB) Find(out interface{}, where ...interface{}) *DB {
	return s.NewScope(out).inlineCondition(where...).callCallbacks(s.parent.callbacks.queries).db
}
241322
func (s *VolumeStore) Find(ctx context.Context, by By) (vols []volume.Volume, warnings []string, err error) {
	logrus.WithField("ByType", fmt.Sprintf("%T", by)).WithField("ByValue", fmt.Sprintf("%+v", by)).Debug("VolumeStore.Find")
	switch f := by.(type) {
	case nil, orCombinator, andCombinator, byDriver, ByReferenced, CustomFilter:
		warnings, err = s.filter(ctx, &vols, by)
	case fromList:
		warnings, err = s.filter(ctx, f.ls, f.by)
	default:
		// Really shouldn't be possible, but makes sure that any new By's are added to this check.
		err = errdefs.InvalidParameter(errors.Errorf("unsupported filter type: %T", f))
	}
	if err != nil {
		return nil, nil, &OpErr{Err: err, Op: "list"}
	}

	var out []volume.Volume

	for _, v := range vols {
		name := normalizeVolumeName(v.Name())

		s.locks.Lock(name)
		storedV, exists := s.getNamed(name)
		// Note: it's not safe to populate the cache here because the volume may have been
		// deleted before we acquire a lock on its name
		if exists && storedV.DriverName() != v.DriverName() {
			logrus.Warnf("Volume name %s already exists for driver %s, not including volume returned by %s", v.Name(), storedV.DriverName(), v.DriverName())
			s.locks.Unlock(v.Name())
			continue
		}

		out = append(out, v)
		s.locks.Unlock(v.Name())
	}
	return out, warnings, nil
}
986893
func (s *UserService) Find(property string, tweaks ...userSearchF) ([]User, *Response, error) {
	search := []userSearchParam{
		{
			name:  "username",
			value: property,
		},
	}
	for _, f := range tweaks {
		search = f(search)
	}

	var queryString = ""
	for _, param := range search {
		queryString += param.name + "=" + param.value + "&"
	}

	apiEndpoint := fmt.Sprintf("/rest/api/2/user/search?%s", queryString[:len(queryString)-1])
	req, err := s.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}

	users := []User{}
	resp, err := s.client.Do(req, &users)
	if err != nil {
		return nil, resp, NewJiraError(resp, err)
	}
	return users, resp, nil
}
129856
func (m *Manager) Find(lang string) (t Translator, err error) {
	// "zh-hans-cn" yields {"zh-hans-cn", "zh-hans", "zh"}
	t, err = m.Get(lang)
	if t != nil || err != nil {
		return
	}

	for i := strings.LastIndexByte(lang, '-'); i != -1; i = strings.LastIndexByte(lang, '-') {
		t, err = m.Get(lang[:i])
		if t != nil || err != nil {
			return
		}
	}
	return
}
1289877
func (c *Command) Find(name string) *Command {
	for _, cc := range c.commands {
		if cc.match(name) {
			return cc
		}
	}

	return nil
}
730460
func Find(rType, action, identifier string, wrappedRequest *http.Request) (*http.Response, string, []error) {
	params := "select_by="
	params += fmt.Sprintf("type=%s,", rType)
	params += fmt.Sprintf("action=%s", action)
	if identifier != "" {
		params += fmt.Sprintf(",uuid=%s,", identifier)
	}

	fmt.Println("Params: ", params)

	k := kumoru.New()
	k.Get(fmt.Sprintf("%s/v1/resources/", k.EndPoint.Authorization))
	k.Query(params)
	if wrappedRequest != nil {
		k.ProxyRequest(wrappedRequest)
		if wrappedRequest.Header.Get("X-Kumoru-Context") != "" {
			k.SetHeader("X-Kumoru-Context", wrappedRequest.Header.Get("X-Kumoru-Context"))
		}
	}
	k.SignRequest(true)

	return k.End()
}
712164
func (s *session) Find(keys KeyList, container TableListContainer, opts ...GetOption) error {
	action, err := s.find(keys, container, s.applyGetOption(opts), nil)
	if err != nil {
		return s.catch("Find: "+action, err)
	}
	return nil
}