// GetPresentation gets a presentation from the the given path.
506964
func GetPresentation(ctx context.Context, client *http.Client, importPath string) (*Presentation, error) {
	ext := path.Ext(importPath)
	if ext != ".slide" && ext != ".article" {
		return nil, NotFoundError{Message: "unknown file extension."}
	}

	importPath, file := path.Split(importPath)
	importPath = strings.TrimSuffix(importPath, "/")
	for _, s := range services {
		if s.getPresentation == nil {
			continue
		}
		match, err := s.match(importPath)
		if err != nil {
			return nil, err
		}
		if match != nil {
			match["file"] = file
			return s.getPresentation(ctx, client, match)
		}
	}
	return nil, NotFoundError{Message: "path does not match registered service"}
}
968006
func (w Goreland) RenderPath(path []Pather) string {

	s := ""
	for _, p := range path {
		pT := p.(*Truck)
		s = pT.label + " " + s
	}
	return s
}
1306063
func (c *Files) GetPreview(in *GetPreviewInput) (out *GetPreviewOutput, err error) {
	body, l, err := c.download("/files/get_preview", in, nil)
	if err != nil {
		return
	}

	out = &GetPreviewOutput{body, l}
	return
}
236419
func (c *Client) GetAgreement(name string) *GetAgreementResult {
	resp, err := c.do("GET", fmt.Sprintf("/tribe/agreements/%s", name), ContentTypeJSON, nil)
	if err != nil {
		return &GetAgreementResult{Err: err}
	}
	switch resp.Meta.Type {
	case rbody.TribeGetAgreementType:
		return &GetAgreementResult{resp.Body.(*rbody.TribeGetAgreement), nil}
	case rbody.ErrorType:
		return &GetAgreementResult{Err: resp.Body.(*rbody.Error)}
	default:
		return &GetAgreementResult{Err: ErrAPIResponseMetaType}
	}
}
636903
func (c *SimpleCache) GetIFPresent(key interface{}) (interface{}, error) {
	v, err := c.get(key, false)
	if err == KeyNotFoundError {
		return c.getWithLoader(key, false)
	}
	return v, nil
}
1308122
func (ctx *facadeContext) ModelPresence(modelUUID string) facade.ModelPresence {
	if ctx.r.shared.featureEnabled(feature.OldPresence) {
		// Used in common/presence.go to determine which code path to follow.
		return nil
	}
	return ctx.r.shared.presence.Connections().ForModel(modelUUID)
}
652619
func endpointsPresent(ctx *cli.Context) bool {
	_, ok := os.LookupEnv("MINIO_ENDPOINTS")
	if !ok {
		ok = ctx.Args().Present()
	}
	return ok
}
1270111
func (c *Client) GetFormation(appID, releaseID string) (*ct.Formation, error) {
	formation := &ct.Formation{}
	return formation, c.Get(fmt.Sprintf("/apps/%s/formations/%s", appID, releaseID), formation)
}
1269145
func (a *Application) AgentPresence() (bool, error) {
	pwatcher := a.st.workers.presenceWatcher()
	return pwatcher.Alive(a.globalKey())
}
971360
func (_class HostClass) GetDisplay(sessionID SessionRef, self HostRef) (_retval HostDisplay, _err error) {
	_method := "host.get_display"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertEnumHostDisplayToGo(_method + " -> ", _result.Value)
	return
}
1151973
func (v *printVisitor) VisitContent(node *ContentStatement) interface{} {
	v.line("CONTENT[ '" + node.Value + "' ]")

	return nil
}
303648
func (size Bits) GetHumanSpeedRepresentation() string {
	// if size >= Ybit {
	// 	return size.YbitString()
	// }
	// if size >= Zbit {
	// 	return size.ZbitString()
	// }
	if size >= Ebit {
		return size.EbitString()
	}
	if size >= Pbit {
		return size.PbitString()
	}
	if size >= Tbit {
		return size.TbitString()
	}
	if size >= Gbit {
		return size.GbitString()
	}
	if size >= Mbit {
		return size.MbitString()
	}
	if size >= Kbit {
		return size.KbitString()
	}
	return size.BitString()
}
1056807
func getExt(path string) string {
	ext := ""
	for i := len(path) - 1; i >= 0 && !os.IsPathSeparator(path[i]); i-- {
		if path[i] == '.' {
			ext = path[i:]
		}
	}
	return ext
}
1034427
func (c *CSS) GetPlatformFontsForNode(nodeId int) ([]*CSSPlatformFontUsage, error) {
	var v CSSGetPlatformFontsForNodeParams
	v.NodeId = nodeId
	return c.GetPlatformFontsForNodeWithParams(&v)
}
1258401
func (c *ConnectToken) SessionPresent() bool {
	c.m.RLock()
	defer c.m.RUnlock()
	return c.sessionPresent
}
297488
func (v *StorageVol) GetPath() (string, error) {
	var err C.virError
	result := C.virStorageVolGetPathWrapper(v.ptr, &err)
	if result == nil {
		return "", makeError(&err)
	}
	path := C.GoString(result)
	C.free(unsafe.Pointer(result))
	return path, nil
}
341203
func (c *Client) GetPreview(ctx context.Context, filterOutputID string) (p Preview, err error) {
	uri := fmt.Sprintf("%s/filter-outputs/%s/preview", c.url, filterOutputID)

	clientlog.Do(ctx, "retrieving preview for filter output job", service, uri, log.Data{
		"method":   "GET",
		"filterID": filterOutputID,
	})

	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		return
	}

	resp, err := c.cli.Do(ctx, req)
	if err != nil {
		return
	}

	if resp.StatusCode != http.StatusOK {
		return p, &ErrInvalidFilterAPIResponse{http.StatusOK, resp.StatusCode, uri}
	}

	b, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return
	}
	defer resp.Body.Close()

	err = json.Unmarshal(b, &p)
	return
}