// Load a single Iteration regardless of parent
321027
func (m *GormIterationRepository) Load(ctx context.Context, id uuid.UUID) (*Iteration, error) {
	defer goa.MeasureSince([]string{"goa", "db", "iteration", "get"}, time.Now())
	var obj Iteration

	tx := m.db.Where("id = ?", id).First(&obj)
	if tx.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{
			"iteration_id": id.String(),
		}, "iteration cannot be found")
		return nil, errors.NewNotFoundError("Iteration", id.String())
	}
	if tx.Error != nil {
		log.Error(ctx, map[string]interface{}{
			"iteration_id": id.String(),
			"err":          tx.Error,
		}, "unable to load the iteration")
		return nil, errors.NewInternalError(ctx, tx.Error)
	}
	return &obj, nil
}
971449
func (h *history) Load() {
	in := bufio.NewReader(h.file)

	for {
		line, err := in.ReadString('\n')
		if err == io.EOF {
			break
		}

		h.li.PushBack(strings.TrimRight(line, "\n"))
	}

	h.mark = h.li.Back() // Point to an element.
}
610638
func (ls *LState) Load(reader io.Reader, name string) (*LFunction, error) {
	chunk, err := parse.Parse(reader, name)
	if err != nil {
		return nil, newApiErrorE(ApiErrorSyntax, err)
	}
	proto, err := Compile(chunk, name)
	if err != nil {
		return nil, newApiErrorE(ApiErrorSyntax, err)
	}
	return newLFunctionL(proto, ls.currentEnv(), 0), nil
}
1108670
func (p *Proxy) Load(basePath, innerPath string, opts *ace.Options) (*template.Template, error) {
	var o *ace.Options

	if opts == nil {
		o = p.Opts
	} else {
		o = opts
	}

	return ace.Load(basePath, innerPath, o)
}
1091375
func (toks *Toks) Iterate(t *html.Node) {
	for _, tok := range *toks {
		if tok.Match(t.Type, t.DataAtom) {
			tok.Callback(t)
		}
	}
}
1363443
func (l *yamlLoader) Load(out interface{}) error {
	var buf bytes.Buffer
	buf.ReadFrom(l.r)
	if err := yaml.Unmarshal(buf.Bytes(), out); err != nil {
		return err
	}
	return nil
}
896588
func (db *PGStore) load(session *sessions.Session) error {
	var s PGSession

	err := db.selectOne(&s, session.ID)
	if err != nil {
		return err
	}

	return securecookie.DecodeMulti(session.Name(), string(s.Data), &session.Values, db.Codecs...)
}
538539
func (c *collection) Load(ctx context.Context) error {
	req, err := c.conn.NewRequest("PUT", path.Join(c.relPath("collection"), "load"))
	if err != nil {
		return WithStack(err)
	}
	opts := struct {
		Count bool `json:"count"`
	}{
		Count: false,
	}
	if _, err := req.SetBody(opts); err != nil {
		return WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return WithStack(err)
	}
	return nil
}
443544
func (entries Entries) LoadAll() error {
	for i, n := 0, len(entries); i < n; i++ {
		if err := entries[i].LoadEngine(); err != nil {
			return err
		}
	}
	return nil
}
788469
func (s *RethinkStore) load(session *sessions.Session) (bool, error) {
	var data RethinkSession
	res, err := r.Table(s.Table).Get(session.ID).Run(s.Rethink)
	if err != nil {
		return false, err
	}
	if err := res.One(&data); err != nil {
		return false, err
	}
	dec := gob.NewDecoder(bytes.NewBuffer(data.Session))
	return true, dec.Decode(&session.Values)
}
318715
func (b *BurstCache) Load(ctx context.Context, key BurstCacheKey, loader BurstCacheLoader) (ret interface{}, err error) {
	ctx = WithLogTag(ctx, "BC")

	defer b.G().CVTrace(ctx, VLog0, fmt.Sprintf("BurstCache(%s)#Load(%s)", b.cacheName, key.String()), func() error { return err })()

	lock := b.locktab.AcquireOnName(ctx, b.G(), key.String())
	defer lock.Release(ctx)

	b.G().VDL.CLogf(ctx, VLog0, "| past single-flight lock")

	found := false
	if val, ok := b.lru.Get(key.String()); ok {
		b.G().VDL.CLogf(ctx, VLog0, "| found in LRU cache")
		if tmp, ok := val.(*burstCacheObj); ok {
			age := b.G().GetClock().Now().Sub(tmp.cachedAt)
			if age < b.cacheLife {
				b.G().VDL.CLogf(ctx, VLog0, "| cached object was fresh (loaded %v ago)", age)
				ret = tmp.obj
				found = true
			} else {
				b.G().VDL.CLogf(ctx, VLog0, "| cached object expired %v ago", (age - b.cacheLife))
				b.lru.Remove(key.String())
			}
		} else {
			b.G().Log.CErrorf(ctx, "| object in LRU was of wrong type")
		}
	} else {
		b.G().VDL.CLogf(ctx, VLog0, "| object cache miss")
	}

	if !found {
		ret, err = loader()
		if err == nil {
			b.G().VDL.CLogf(ctx, VLog0, "| caching object after successful fetch")
			b.lru.Add(key.String(), &burstCacheObj{ret, b.G().GetClock().Now()})
		}
	}

	return ret, err
}
66784
func Load(ctx context.Context, g *libkb.GlobalContext, lArg keybase1.LoadTeamArg) (*Team, error) {
	teamData, err := g.GetTeamLoader().Load(ctx, lArg)
	if err != nil {
		return nil, err
	}
	ret := NewTeam(ctx, g, teamData)

	if lArg.RefreshUIDMapper {
		// If we just loaded the group, then inform the UIDMapper of any UID->EldestSeqno
		// mappings, so that we're guaranteed they aren't stale.
		ret.refreshUIDMapper(ctx, g)
	}

	return ret, nil
}
1191495
func (m *Map) Load(key interface{}) (value interface{}, ok bool) {
	value, ok = m.m[key]
	return value, ok
}
948877
func (ic *IncrementalCompact) Load(ctx context.Context, sess rets.Requester, url string) error {
	// extract an id'd subesection of metadata
	get := func(id, mtype string) (*rets.CompactMetadata, error) {
		if id == "" {
			id = "0"
		}
		params := rets.MetadataParams{
			Format: "COMPACT",
			MType:  mtype,
			ID:     id,
		}
		req := rets.MetadataRequest{
			URL:            url,
			MetadataParams: params,
		}
		reader, er := rets.MetadataStream(rets.MetadataResponse(ctx, sess, req))
		if er != nil {
			return nil, er
		}
		return rets.ParseMetadataCompactResult(reader)
	}
	msys, err := get("", metadata.MISystem.Name)
	if err != nil {
		return err
	}
	ic.Response = msys.Response
	ic.MSystem = msys.MSystem
	ic.Elements = map[string][]rets.CompactData{}
	// fmt.Printf("compact system: %v\n", compact)
	cds, err := ic.extractChildren(get, []string{}, metadata.MISystem)
	if err != nil {
		return err
	}
	for _, cd := range cds {
		// extract children from this element and put in the system elem
		ic.Elements[cd.Element] = append(ic.Elements[cd.Element], cd)
	}
	return nil
}
581531
func Load(v interface{}, s ...Source) error {
	if reflect.Indirect(reflect.ValueOf(v)).Kind() != reflect.Struct {
		panic("scan for non-struct type")
	}
	if len(s) == 0 {
		return nil
	}
	scn := &scanner{s}
	return scn.scan(v)
}
662555
func Load(dir string) (train, test *Set, err error) {
	if train, err = ReadSet(path.Join(dir, "train-images-idx3-ubyte.gz"), path.Join(dir, "train-labels-idx1-ubyte.gz")); err != nil {
		return nil, nil, err
	}
	if test, err = ReadSet(path.Join(dir, "t10k-images-idx3-ubyte.gz"), path.Join(dir, "t10k-labels-idx1-ubyte.gz")); err != nil {
		return nil, nil, err
	}
	return
}
16529
func (c *CustomMounterHandler) Load(devPrefixes []string) error {
	return c.cl(devPrefixes, c.mounts, c.paths)
}