// GetApplicationProcessByType returns application process of specified type
766439
func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetApplicationProcessRequest,
		URIParams: map[string]string{
			"app_guid": appGUID,
			"type":     processType,
		},
	})
	if err != nil {
		return Process{}, nil, err
	}
	var process Process
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &process,
	}

	err = client.connection.Make(request, &response)
	return process, response.Warnings, err
}
944578
func (actor Actor) GetApplicationByNameAndSpace(appName string, spaceGUID string) (Application, Warnings, error) {
	apps, warnings, err := actor.CloudControllerClient.GetApplications(
		ccv3.Query{Key: ccv3.NameFilter, Values: []string{appName}},
		ccv3.Query{Key: ccv3.SpaceGUIDFilter, Values: []string{spaceGUID}},
	)
	if err != nil {
		return Application{}, Warnings(warnings), err
	}

	if len(apps) == 0 {
		return Application{}, Warnings(warnings), actionerror.ApplicationNotFoundError{Name: appName}
	}

	return actor.convertCCToActorApplication(apps[0]), Warnings(warnings), nil
}
518763
func (p *Plugin) GetAllProcesses() []ProcessInstance {
	var processes []ProcessInstance
	for _, pr := range p.processes {
		processes = append(processes, pr)
	}
	return processes
}
1201587
func (c Client) GetApplications() (*ApplicationItemsPage, error) {
	var aggregateAppItemsPages ApplicationItemsPage
	var continueToken string
	for {
		res, err := c.getHTTP("Applications/", withContinue(continueToken))
		if err != nil {
			return nil, err
		}

		var appItemsPage ApplicationItemsPage
		err = json.Unmarshal(res, &appItemsPage)
		if err != nil {
			return nil, fmt.Errorf("could not deserialise JSON response: %+v", err)
		}

		aggregateAppItemsPages.Items = append(aggregateAppItemsPages.Items, appItemsPage.Items...)

		continueToken = getString(appItemsPage.ContinuationToken)
		if continueToken == "" {
			break
		}
	}
	return &aggregateAppItemsPages, nil
}
235564
def getApplicationProcessId(self, pchAppKey):
        """"""

        fn = self.function_table.getApplicationProcessId
        result = fn(pchAppKey)
        return result
1218357
func (t *Template) GetAWSKinesisAnalyticsV2ApplicationOutputWithName(name string) (*resources.AWSKinesisAnalyticsV2ApplicationOutput, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSKinesisAnalyticsV2ApplicationOutput:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSKinesisAnalyticsV2ApplicationOutput not found", name)
}
890059
func (api *Client) GetApplication(id string) (*Application, error) {
	result, _, err := api.makeRequest(http.MethodGet, fmt.Sprintf("%s/%s", api.concatUserPath(applicationsPath), id), &Application{})
	if err != nil {
		return nil, err
	}
	return result.(*Application), nil
}
1207792
func (s *StatusAPI) SetApplicationStatus(args params.SetStatus) (params.ErrorResults, error) {
	return s.applicationSetter.SetStatus(args)
}
981871
func (t *Template) GetAllAWSKinesisAnalyticsApplicationOutputResources() map[string]*resources.AWSKinesisAnalyticsApplicationOutput {
	results := map[string]*resources.AWSKinesisAnalyticsApplicationOutput{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSKinesisAnalyticsApplicationOutput:
			results[name] = resource
		}
	}
	return results
}
1084838
func ByType(processes api.PodsList) api.PodTypes {
	var pts api.PodTypes

	for _, process := range processes {
		exists := false
		// Is processtype for process already exists, append to it.
		for i, pt := range pts {
			if pt.Type == process.Type {
				exists = true
				pts[i].PodsList = append(pts[i].PodsList, process)
				break
			}
		}

		// Is processtype for process doesn't exist, create a new one
		if !exists {
			pts = append(pts, api.PodType{
				Type:     process.Type,
				PodsList: api.PodsList{process},
			})
		}
	}

	// Sort the pods alphabetically by name.
	for _, pt := range pts {
		sort.Sort(pt.PodsList)
	}

	// Sort ProcessTypes alphabetically by process name
	sort.Sort(pts)

	return pts
}
106713
func (client *Client) GetApplicationProcesses(appGUID string) ([]Process, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetApplicationProcessesRequest,
		URIParams:   map[string]string{"app_guid": appGUID},
	})
	if err != nil {
		return nil, nil, err
	}

	var fullProcessesList []Process
	warnings, err := client.paginate(request, Process{}, func(item interface{}) error {
		if process, ok := item.(Process); ok {
			fullProcessesList = append(fullProcessesList, process)
		} else {
			return ccerror.UnknownObjectInListError{
				Expected:   Process{},
				Unexpected: item,
			}
		}
		return nil
	})

	return fullProcessesList, warnings, err
}
135009
func (api *Client) DeleteApplication(id string) error {
	_, _, err := api.makeRequest(http.MethodDelete, fmt.Sprintf("%s/%s", api.concatUserPath(applicationsPath), id))
	return err
}
638277
func (c *SystemInfo) GetProcessInfo() ([]*SystemInfoProcessInfo, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "SystemInfo.getProcessInfo"})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			ProcessInfo []*SystemInfoProcessInfo
		}
	}

	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}

	return chromeData.Result.ProcessInfo, nil
}
1156184
func (c *Context) GetProgramParameteri(program *js.Object, pname int) int {
	return c.Call("getProgramParameter", program, pname).Int()
}
243092
func (d *domainClient) GetApplicationCacheForFrame(ctx context.Context, args *GetApplicationCacheForFrameArgs) (reply *GetApplicationCacheForFrameReply, err error) {
	reply = new(GetApplicationCacheForFrameReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "ApplicationCache.getApplicationCacheForFrame", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "ApplicationCache.getApplicationCacheForFrame", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "ApplicationCache", Op: "GetApplicationCacheForFrame", Err: err}
	}
	return
}
1210546
func (c *Client) GetApplicationInfo(id string) (appInfo AppInfo, err error) {
	if err := c.get(`server/get_app_info?SUBID=`+id, &appInfo); err != nil {
		return AppInfo{}, err
	}
	return appInfo, nil
}
759592
func GetProcFromFile(filename string) (*os.Process, error) {
	var (
		pid  int
		err  error
		proc *os.Process
	)

	if pid, err = GetPidFromFile(filename); err != nil {
		return nil, err
	}

	// FindProcess always returns a proc on unix
	if proc, err = os.FindProcess(pid); err != nil {
		return nil, err
	}

	// Try to signal the process to check if it is running
	if err = proc.Signal(syscall.Signal(0)); err != nil {
		return nil, err
	}

	return proc, nil
}