// FetchCommonDeps will fetch our common used dependencies. This is to avoid
// impacting the first ever typecheck we do in a repo since it will have to
// fetch the dependency from the internet.
768466
func FetchCommonDeps() {
	// github.com/golang/go
	d, _ := gosrc.ResolveImportPath(http.DefaultClient, "time")
	u, _ := url.Parse(d.CloneURL)
	_, _ = NewDepRepoVFS(context.Background(), u, d.Rev, nil)
}
1171125
func fetch(c context.Context) (*Config, error) {
	cli := getInterface(c)
	set := cfgclient.CurrentServiceConfigSet(c)

	// If VMs and kinds are both non-empty, then their revisions must match
	// because VMs may depend on kinds. If VMs is empty but kinds is not,
	// then kinds are declared but unused (which is fine). If kinds is empty
	// but VMs is not, this may or may not be fine. Validation will tell us.
	rev := ""

	vms := &gce.Configs{}
	switch vmsCfg, err := cli.GetConfig(c, set, vmsFile, false); {
	case err == config.ErrNoConfig:
		logging.Debugf(c, "%q not found", vmsFile)
	case err != nil:
		return nil, errors.Annotate(err, "failed to fetch %q", vmsFile).Err()
	default:
		rev = vmsCfg.Revision
		logging.Debugf(c, "found %q revision %s", vmsFile, vmsCfg.Revision)
		if err := proto.UnmarshalText(vmsCfg.Content, vms); err != nil {
			return nil, errors.Annotate(err, "failed to load %q", vmsFile).Err()
		}
	}

	kinds := &gce.Kinds{}
	switch kindsCfg, err := cli.GetConfig(c, set, kindsFile, false); {
	case err == config.ErrNoConfig:
		logging.Debugf(c, "%q not found", kindsFile)
	case err != nil:
		return nil, errors.Annotate(err, "failed to fetch %q", kindsFile).Err()
	default:
		logging.Debugf(c, "found %q revision %s", kindsFile, kindsCfg.Revision)
		if rev != "" && kindsCfg.Revision != rev {
			return nil, errors.Reason("config revision mismatch").Err()
		}
		if err := proto.UnmarshalText(kindsCfg.Content, kinds); err != nil {
			return nil, errors.Annotate(err, "failed to load %q", kindsFile).Err()
		}
	}

	prjs := &projects.Configs{}
	switch prjsCfg, err := cli.GetConfig(c, set, projectsFile, false); {
	case err == config.ErrNoConfig:
		logging.Debugf(c, "%q not found", projectsFile)
	case err != nil:
		return nil, errors.Annotate(err, "failed to fetch %q", projectsFile).Err()
	default:
		logging.Debugf(c, "found %q revision %s", projectsFile, prjsCfg.Revision)
		if rev != "" && prjsCfg.Revision != rev {
			return nil, errors.Reason("config revision mismatch").Err()
		}
		if err := proto.UnmarshalText(prjsCfg.Content, prjs); err != nil {
			return nil, errors.Annotate(err, "failed to load %q", projectsFile).Err()
		}
	}
	return &Config{
		revision: rev,
		Kinds:    kinds,
		Projects: prjs,
		VMs:      vms,
	}, nil
}
963586
func (e *MirrorKeystore) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	var deps []fi.Task
	for _, task := range tasks {
		if _, ok := task.(*Secret); ok {
			deps = append(deps, task)
		}
	}
	return deps
}
712451
func (ini *INI) GetComments(section, key string) []string {
	sec := ini.getSection(section)

	if sec == nil {
		return nil
	}
	if key == "" {
		return sec.Comments
	}

	if item := sec.getItem(key, ini.isCaseSensitive); item != nil {
		return item.Comments
	}

	return nil
}
942934
func (g *Git) FetchFromOrigin(vendorID string, t time.Time) ([]common.Record, error) {
	githubURL := fmt.Sprintf(githubAPI, g.username)
	res, err := http.Get(githubURL)
	if err != nil {
		log.Fatal(err)
	}
	// binRes, err := ioutil.ReadAll(res.Body)
	// res.Body.Close()
	// if err != nil {
	// 	log.Fatal(err)
	// }
	
	v, err := simplejson.NewFromReader(res.Body)
	if err != nil {
		log.Fatal(err)
	}
	// records, err := v.Array()
	// if err != nil {
	// 	log.Fatal(err)
	// }
	log.Printf("Created_at: %s", v.GetIndex(0).Get("created_at"))
	
	return nil, nil
}
706999
func (a *Client) GetTaskComments(params *GetTaskCommentsParams) (*GetTaskCommentsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetTaskCommentsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "getTaskComments",
		Method:             "GET",
		PathPattern:        "/tasks/{id}/comments",
		ProducesMediaTypes: []string{"application/vnd.goswagger.examples.task-tracker.v1+json"},
		ConsumesMediaTypes: []string{"application/vnd.goswagger.examples.task-tracker.v1+json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetTaskCommentsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetTaskCommentsOK), nil

}
971611
func (s *solver) checkPackageImportsFromDepExist(a atomWithPackages, cdep completeDep) error {
	sel, is := s.sel.selected(cdep.workingConstraint.Ident)
	if !is {
		// dep is not already selected; nothing to do
		return nil
	}

	ptree, err := s.b.ListPackages(sel.a.id, sel.a.v)
	if err != nil {
		// TODO(sdboyer) handle this more gracefully
		return err
	}

	e := &depHasProblemPackagesFailure{
		goal: dependency{
			depender: a.a,
			dep:      cdep,
		},
		v:    sel.a.v,
		prob: make(map[string]error),
	}

	for _, pkg := range cdep.pl {
		perr, has := ptree.Packages[pkg]
		if !has || perr.Err != nil {
			if has {
				e.prob[pkg] = perr.Err
			} else {
				e.prob[pkg] = nil
			}
		}
	}

	if len(e.prob) > 0 {
		return e
	}
	return nil
}
1339696
func fetchAllApplicationsAndUnits(
	st Backend,
	model *state.Model,
) (applicationStatusInfo, error) {
	appMap := make(map[string]*state.Application)
	unitMap := make(map[string]map[string]*state.Unit)
	latestCharms := make(map[charm.URL]*state.Charm)
	applications, err := st.AllApplications()
	units, err := model.AllUnits()
	if err != nil {
		return applicationStatusInfo{}, err
	}
	allUnitsByApp := make(map[string]map[string]*state.Unit)
	for _, unit := range units {
		appName := unit.ApplicationName()

		if inner, found := allUnitsByApp[appName]; found {
			inner[unit.Name()] = unit
		} else {
			allUnitsByApp[appName] = map[string]*state.Unit{
				unit.Name(): unit,
			}
		}
	}

	endpointBindings, err := model.AllEndpointBindings()
	if err != nil {
		return applicationStatusInfo{}, err
	}
	allBindingsByApp := make(map[string]map[string]string)
	for _, bindings := range endpointBindings {
		allBindingsByApp[bindings.AppName] = bindings.Bindings
	}

	lxdProfiles := make(map[string]*charm.LXDProfile)
	for _, app := range applications {
		appMap[app.Name()] = app
		appUnits := allUnitsByApp[app.Name()]
		charmURL, _ := app.CharmURL()

		if len(appUnits) > 0 {
			unitMap[app.Name()] = appUnits
			// Record the base URL for the application's charm so that
			// the latest store revision can be looked up.
			if charmURL.Schema == "cs" {
				latestCharms[*charmURL.WithRevision(-1)] = nil
			}
		}

		ch, _, err := app.Charm()
		if err != nil {
			continue
		}
		chName := lxdprofile.Name(model.Name(), app.Name(), ch.Revision())
		if profile := ch.LXDProfile(); profile != nil {
			lxdProfiles[chName] = profile
		}
	}

	for baseURL := range latestCharms {
		ch, err := st.LatestPlaceholderCharm(&baseURL)
		if errors.IsNotFound(err) {
			continue
		}
		if err != nil {
			return applicationStatusInfo{}, err
		}
		latestCharms[baseURL] = ch
	}

	return applicationStatusInfo{
		applications:     appMap,
		units:            unitMap,
		latestCharms:     latestCharms,
		endpointBindings: allBindingsByApp,
		lxdProfiles:      lxdProfiles,
	}, nil
}
349071
func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error {
	args := []string{"submodule", "update", "--init", "--recursive"}
	if depth > 0 {
		args = append(args, "--depth", strconv.Itoa(depth))
	}
	cmd := exec.CommandContext(ctx, "git", args...)
	cmd.Dir = dst
	setupGitEnv(cmd, sshKeyFile)
	return getRunCommand(cmd)
}
811918
func (o *VMPowerOn) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	var deps []fi.Task
	attachISOTask := tasks["AttachISO/"+*o.AttachISO.Name]
	if attachISOTask == nil {
		glog.Fatalf("Unable to find attachISO task %s dependency for VMPowerOn %s", *o.AttachISO.Name, *o.Name)
	}
	deps = append(deps, attachISOTask)
	return deps
}
255670
func (v *TypeReference) GetAnnotations() (o map[string]string) {
	if v != nil && v.Annotations != nil {
		return v.Annotations
	}

	return
}
1246446
func (c *dependencyCompiler) resolvePackageDependencies(releasePackage *birelpkg.Package, packageMap map[string]*birelpkg.Package) {
	for _, dependency := range releasePackage.Dependencies {
		// only add un-added packages, to avoid endless looping in case of cycles
		pkgKey := c.pkgKey(dependency)
		if _, found := packageMap[pkgKey]; !found {
			packageMap[pkgKey] = dependency
			c.resolvePackageDependencies(releasePackage, packageMap)
		}
	}
}
870512
func Fetch(repoPath string, opts FetchRemoteOptions) error {
	cmd := NewCommand("fetch")
	if opts.Prune {
		cmd.AddArguments("--prune")
	}

	if opts.Timeout <= 0 {
		opts.Timeout = -1
	}
	_, err := cmd.RunInDirTimeout(opts.Timeout, repoPath)
	return err
}
952512
func (s *UpdateService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *UpdateService {
	s.fsc = fetchSourceContext
	return s
}
946306
func CheckDependencies(ch *chart.Chart, reqs *chartutil.Requirements) error {
	missing := []string{}

	deps := ch.GetDependencies()
	for _, r := range reqs.Dependencies {
		found := false
		for _, d := range deps {
			if d.Metadata.Name == r.Name {
				found = true
				break
			}
		}
		if !found {
			missing = append(missing, r.Name)
		}
	}

	if len(missing) > 0 {
		return fmt.Errorf("found in requirements.yaml, but missing in charts/ directory: %s", strings.Join(missing, ", "))
	}
	return nil
}
281800
func collect_package_imports(filename string, decls []ast.Decl, context *package_lookup_context) []package_import {
	pi := make([]package_import, 0, 16)
	for _, decl := range decls {
		if gd, ok := decl.(*ast.GenDecl); ok && gd.Tok == token.IMPORT {
			for _, spec := range gd.Specs {
				imp := spec.(*ast.ImportSpec)
				path, alias := path_and_alias(imp)
				abspath, ok := abs_path_for_package(filename, path, context)
				if ok && alias != "_" {
					pi = append(pi, package_import{alias, abspath, path})
				}
			}
		} else {
			break
		}
	}
	return pi
}
12928
func fetchConfigs(c context.Context, f policy.ConfigFetcher) (policy.ConfigBundle, error) {
	cfg := &admin.ServiceAccountsPermissions{}
	if err := f.FetchTextProto(c, serviceAccountsCfg, cfg); err != nil {
		return nil, err
	}
	return policy.ConfigBundle{serviceAccountsCfg: cfg}, nil
}