// load acquires a lock by team ID, and the runs loadLockedWithRetries.
510506
func (f *FastTeamChainLoader) load(m libkb.MetaContext, arg fastLoadArg) (res *fastLoadRes, err error) {

	defer m.Trace(fmt.Sprintf("FastTeamChainLoader#load(%+v)", arg), func() error { return err })()

	// Single-flight lock by team ID.
	lock := f.locktab.AcquireOnName(m.Ctx(), m.G(), arg.ID.String())
	defer lock.Release(m.Ctx())

	return f.loadLockedWithRetries(m, arg)
}
274302
func (m multiLoader) Load(s interface{}) error {
	for _, loader := range m {
		if err := loader.Load(s); err != nil {
			return err
		}
	}

	return nil
}
1018779
func (l *propertiesLoader) Load(out interface{}) error {
	properties := make(p.Properties)
	if err := properties.Load(l.r); err != nil {
		return err
	}
	o := out.(*map[string]string)
	*o = map[string]string(properties)
	return nil
}
1120005
func (h *handler) Load(r *http.Request) (*Session, error) {
	s := New(h.name, h.keys)

	cookie, err := r.Cookie(h.name)
	if err != nil {
		// No session cookie found, we finish initializing a new one.
		s.Cookie.MaxAge = h.maxAge
		s.Cookie.Domain = h.domain
		s.Cookie.HttpOnly = true

		// When external stores are configured, we want to store the session ID in
		// the cookie to be able to store and retrieve its data.
		if h.store != nil {
			s.Value = genID(idSize)
		}
	} else {
		s.Cookie = cookie
	}

	if r.TLS != nil {
		s.Secure = true
	}

	data := []byte(s.Value)
	if h.store != nil {
		sessionID := s.Value
		data, err = h.store.Load(sessionID)
		if err != nil {
			return s, errors.Wrapf(err, "failed loading session ID: %s", sessionID)
		}
	}

	if err := s.Decode(data); err != nil {
		return s, err
	}

	return s, nil
}
1191776
func (l *jsonLoader) Load(out interface{}) error {
	var buf bytes.Buffer
	buf.ReadFrom(l.r)
	if err := json.Unmarshal(buf.Bytes(), out); err != nil {
		return err
	}
	return nil
}
1166995
func (ed *EtcdDriver) Load(configStorePath string) int {
	var err error
	ed.path = configStorePath
	ed.response, err = ed.client.Get(configStorePath, true, true)
	if err != nil {
		if etcderr, ok := err.(*etcd.EtcdError); ok {
			return etcderr.ErrorCode
		} else {
			panic(fmt.Sprintf("Error retrieving data from etcd:  %s", err.Error()))
		}
	}
	return gostrufig.CONFIGFOUND
}
244047
func (a Aggregations) load(i map[string]interface{}) error {
	for k, value := range i {
		valueMap, ok := value.(map[string]interface{})
		if ok {
			agg := &Aggregate{Name: k}
			e := agg.Load(valueMap)
			if e != nil {
				return e
			}
			a[k] = agg
		}
	}
	return nil
}
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
}
1072248
func (l *tomlLoader) Load(out interface{}) error {
	if _, err := toml.DecodeReader(l.r, out); err != nil {
		return err
	}
	return nil
}
1306501
func (r *GormWorkItemLinkRepository) Load(ctx context.Context, ID uuid.UUID) (*WorkItemLink, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "load"}, time.Now())
	log.Info(ctx, map[string]interface{}{
		"wil_id": ID,
	}, "Loading work item link")
	result := WorkItemLink{}
	db := r.db.Where("id=?", ID).Find(&result)
	if db.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{
			"wil_id": ID,
		}, "work item link not found")
		return nil, errors.NewNotFoundError("work item link", ID.String())
	}
	if db.Error != nil {
		return nil, errors.NewInternalError(ctx, db.Error)
	}
	return &result, nil
}
1285870
func Load(path string, myID protocol.DeviceID) (Wrapper, error) {
	fd, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer fd.Close()

	cfg, err := ReadXML(fd, myID)
	if err != nil {
		return nil, err
	}

	return Wrap(path, cfg), nil
}
104921
func (s *syncMessageStore) load() {
	s.mu.Lock()
	defer s.mu.Unlock()

	// Keep going until we can write the next message
	// or the backlog is empty.
	for {
		if len(s.backlog) == 0 {
			s.pending = false
			return
		}

		m := s.backlog[0]
		s.backlog[0] = nil // Remove reference from underlying array.
		s.backlog = s.backlog[1:]

		// Check if the writer has already unsubscribed.
		if w, ok := s.writers[m.method]; ok {
			// A write here means that this message must be
			// processed (calling m.next) by the recipient.
			// Failure to do so will prevent future messages
			// from being delivered.
			w.write(*m)
			return
		}
	}
}
449392
func (fkvs *FileKeyValueStore) Load(key interface{}) (interface{}, error) {
	file, err := fkvs.keySerializer(key)
	if err != nil {
		return nil, err
	}
	if _, err1 := os.Stat(file); os.IsNotExist(err1) {
		return nil, core.ErrKeyValueNotFound
	}
	bytes, err := ioutil.ReadFile(file) // nolint: gas
	if err != nil {
		return nil, err
	}
	if bytes == nil {
		return nil, core.ErrKeyValueNotFound
	}
	return fkvs.unmarshaller(bytes)
}
458477
func (s *DumbMemoryStore) load(session *sessions.Session) error {

	if err := securecookie.DecodeMulti(session.Name(), string(s.Data[session.ID]),
		&session.Values, s.Codecs...); err != nil {
		return err
	}
	return nil
}
834298
func (rm *RouteManager) Load(persistor RouteStore) error {
	routes, err := persistor.GetAll()
	if err != nil {
		return err
	}
	for _, route := range routes {
		rm.Add(route)
	}
	rm.persistor = persistor
	return nil
}
1028452
func (m *deviceMounter) Load(devPrefixes []string) error {
	return m.load(devPrefixes, deviceFindMountPoint)
}
1257853
func (n *Node) Load(k enr.Entry) error {
	return n.r.Load(k)
}