// updateLocal ensures the local data (versions and code) we have about the
// source is fully up to date with that of the canonical upstream source.
482729
func (bs *baseVCSSource) updateLocal(ctx context.Context) error {
	err := bs.repo.fetch(ctx)

	if err != nil {
		return unwrapVcsErr(err)
	}
	return nil
}
632393
func (s *ClusterStateService) Local(local bool) *ClusterStateService {
	s.local = &local
	return s
}
371499
func getLocal(url string, fs afero.Fs, cfg config.Provider) ([]byte, error) {
	filename := filepath.Join(cfg.GetString("workingDir"), url)
	if e, err := helpers.Exists(filename, fs); !e {
		return nil, err
	}

	return afero.ReadFile(fs, filename)

}
1227512
func (s *GetBuiltinSlotTypesInput) SetLocale(v string) *GetBuiltinSlotTypesInput {
	s.Locale = &v
	return s
}
245768
func (g *Goon) FlushLocalCache() {
	g.cacheLock.Lock()
	g.cache = make(map[string]interface{})
	g.cacheLock.Unlock()
}
598010
func (s *RegionService) UpdateRegion(p *UpdateRegionParams) (*UpdateRegionResponse, error) {
	resp, err := s.cs.newRequest("updateRegion", p.toURLValues())
	if err != nil {
		return nil, err
	}

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

	return &r, nil
}
829601
func (_ *Archive) RenderLocal(t *local.LocalTarget, a, e, changes *Archive) error {
	if a == nil {
		glog.Infof("Installing archive %q", e.Name)

		localFile := path.Join(localArchiveDir, e.Name)
		if err := os.MkdirAll(localArchiveDir, 0755); err != nil {
			return fmt.Errorf("error creating directories %q: %v", localArchiveDir, err)
		}

		var hash *hashing.Hash
		if e.Hash != "" {
			parsed, err := hashing.FromString(e.Hash)
			if err != nil {
				return fmt.Errorf("error parsing hash: %v", err)
			}
			hash = parsed
		}
		if _, err := fi.DownloadURL(e.Source, localFile, hash); err != nil {
			return err
		}

		targetDir := e.TargetDir
		if err := os.MkdirAll(targetDir, 0755); err != nil {
			return fmt.Errorf("error creating directories %q: %v", targetDir, err)
		}

		args := []string{"tar", "xf", localFile, "-C", targetDir}
		if e.StripComponents != 0 {
			args = append(args, "--strip-components="+strconv.Itoa(e.StripComponents))
		}

		glog.Infof("running command %s", args)
		cmd := exec.Command(args[0], args[1:]...)
		if output, err := cmd.CombinedOutput(); err != nil {
			return fmt.Errorf("error installing archive %q: %v: %s", e.Name, err, string(output))
		}

		// We write a marker file to prevent re-execution
		localStateFile := path.Join(localArchiveStateDir, e.Name)
		if err := os.MkdirAll(localArchiveStateDir, 0755); err != nil {
			return fmt.Errorf("error creating directories %q: %v", localArchiveStateDir, err)
		}

		state, err := json.MarshalIndent(e, "", "  ")
		if err != nil {
			return fmt.Errorf("error marshaling archive state: %v", err)
		}

		if err := ioutil.WriteFile(localStateFile, state, 0644); err != nil {
			return fmt.Errorf("error writing archive state: %v", err)
		}
	} else {
		if !reflect.DeepEqual(changes, &Archive{}) {
			glog.Warningf("cannot apply archive changes for %q: %v", e.Name, changes)
		}
	}

	return nil
}
967315
func (s *IndicesGetMappingService) Local(local bool) *IndicesGetMappingService {
	s.local = &local
	return s
}
233027
func WithLocal(publisher events.Publisher) func(context.Context, shim.Config) (shimapi.ShimService, io.Closer, error) {
	return func(ctx context.Context, config shim.Config) (shimapi.ShimService, io.Closer, error) {
		service, err := shim.NewService(config, publisher)
		if err != nil {
			return nil, nil, err
		}
		return shim.NewLocal(service), nil, nil
	}
}
832609
func NewCryptoLocal(codec kbfscodec.Codec,
	signingKey kbfscrypto.SigningKey,
	cryptPrivateKey kbfscrypto.CryptPrivateKey,
	blockCryptVersioner blockCryptVersioner) *CryptoLocal {
	return &CryptoLocal{
		MakeCryptoCommon(codec, blockCryptVersioner),
		kbfscrypto.SigningKeySigner{Key: signingKey},
		cryptPrivateKey,
		make(map[keybase1.TeamID]perTeamKeyPairs),
	}
}
702710
func NewLocalNode(db *DB, key *ecdsa.PrivateKey) *LocalNode {
	ln := &LocalNode{
		id:       PubkeyToIDV4(&key.PublicKey),
		db:       db,
		key:      key,
		udpTrack: netutil.NewIPTracker(iptrackWindow, iptrackContactWindow, iptrackMinStatements),
		entries:  make(map[string]enr.Entry),
	}
	ln.seq = db.localSeq(ln.id)
	ln.invalidate()
	return ln
}
1017635
func (s *GetExclusionsPreviewInput) SetLocale(v string) *GetExclusionsPreviewInput {
	s.Locale = &v
	return s
}
406999
func (l *Language) GetLocal(key string) interface{} {
	if l == nil {
		panic("language not set")
	}
	key = strings.ToLower(key)
	if !globalOnlySettings[key] {
		if v, ok := l.settings[key]; ok {
			return v
		}
	}
	return nil
}
837021
func (s *DescribeFindingsInput) SetLocale(v string) *DescribeFindingsInput {
	s.Locale = &v
	return s
}
872130
func (p *Peer) IsLocal() bool {
	hostname, err := os.Hostname()
	if err != nil {
		return false
	}

	name := strings.Split(p.Hostname, ".")[0]
	return name == hostname
}
419564
func (s *GetMappingService) Local(local bool) *GetMappingService {
	s.local = &local
	return s
}
1181060
func (s *SourceService) UpdateSource(ctx context.Context, id platform.ID, upd platform.SourceUpdate) (*platform.Source, error) {
	return s.UpdateSourceFn(ctx, id, upd)
}