// GetFromPath gets a handle to a network namespace
// identified by the path
558114
func GetFromPath(path string) (NsHandle, error) {
	fd, err := syscall.Open(path, syscall.O_RDONLY, 0)
	if err != nil {
		return -1, err
	}
	return NsHandle(fd), nil
}
1361125
func (*CCInfoFSImpl) GetChaincodeFromPath(ccname string, ccversion string, path string) (CCPackage, error) {
	// try raw CDS
	cccdspack := &CDSPackage{}
	_, _, err := cccdspack.InitFromPath(ccname, ccversion, path)
	if err != nil {
		// try signed CDS
		ccscdspack := &SignedCDSPackage{}
		_, _, err = ccscdspack.InitFromPath(ccname, ccversion, path)
		if err != nil {
			return nil, err
		}
		return ccscdspack, nil
	}
	return cccdspack, nil
}
1072804
func (c *CodeResult) GetPath() string {
	if c == nil || c.Path == nil {
		return ""
	}
	return *c.Path
}
307598
func (uvm *UtilityVM) GetVSMBUvmPath(hostPath string) (_ string, err error) {
	op := "uvm::GetVSMBUvmPath"
	log := logrus.WithFields(logrus.Fields{
		logfields.UVMID: uvm.id,
		"host-path":     hostPath,
	})
	log.Debug(op + " - Begin Operation")
	defer func() {
		if err != nil {
			log.Data[logrus.ErrorKey] = err
			log.Error(op + " - End Operation - Error")
		} else {
			log.Debug(op + " - End Operation - Success")
		}
	}()

	if hostPath == "" {
		return "", fmt.Errorf("no hostPath passed to GetVSMBUvmPath")
	}
	uvm.m.Lock()
	defer uvm.m.Unlock()
	share, err := uvm.findVSMBShare(hostPath)
	if err != nil {
		return "", err
	}
	path := share.GuestPath()
	return path, nil
}
69802
func (l *ActionListener) GetPath(nodes ...string) string {
	return actionPath(append([]string{l.hostID}, nodes...)...)
}
61241
func GetPkgFullPath(short string) (string, error) {
	name, ok := PackageNameList[short]
	if !ok {
		return "", fmt.Errorf("no match package import path with given short name: %s", short)
	}
	return name, nil
}
1204947
func (s *scheduler) GetPath(nodes ...string) string {
	return path.Join(append([]string{"/pools"}, nodes...)...)
}
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
}
338261
func (j *Js) Getpath(args ...string) *Js {
	d := j
	for i := range args {
		m := d.Getdata()

		if val, ok := m[args[i]]; ok {
			d.data = val
		} else {
			d.data = nil
			return d
		}
	}
	return d
}
1189927
func BuildFromPath(path string) (*ServiceDefinition, error) {
	sd, err := getServiceDefinition(path)
	if err != nil {
		return nil, err
	}
	return sd, sd.ValidEntity()
}
1013066
func (y *Yaml) GetPath(branch ...interface{}) *Yaml {
	yin := y
	for _, p := range branch {
		yin = yin.Get(p)
	}
	return yin
}
871558
func GetRootPath(name string) string {
	for prefix, num := range setting.RootPathPairs {
		if strings.HasPrefix(name, prefix) {
			return joinPath(name, num)
		}
	}

	if strings.HasPrefix(name, "gopkg.in") {
		m := gopkgPathPattern.FindStringSubmatch(strings.TrimPrefix(name, "gopkg.in"))
		if m == nil {
			return name
		}
		user := m[1]
		repo := m[2]
		return path.Join("gopkg.in", user, repo+"."+m[3])
	}
	return name
}
784472
func (g *Graph) getPath(p *Graph) (*Graph, error) {

	if p.Len() == 0 || g == nil {
		return nil, ErrInvalidArgs
	}

	// fmt.Printf("%s\n", p.Show())

	ctx := g            // Current context node
	var ctxPrev *Graph  // Previous context node
	var elemPrev string // Previous path element searched in the context node

	for i := 0; i < len(p.Out); i++ {

		if ctx == nil {
			break
		}

		pathNode := p.Out[i]
		pathElement := pathNode.ThisString()

		switch pathElement {

		case TypeIndex:

			// must evaluate to an integer
			ix := pathNode.index(g)

			if ix < 0 {
				return nil, ErrInvalidIndex
			}

			r := New("[")
			r.Add(ctx.GetAt(ix))
			ctxPrev = ctx
			ctx = r

		case TypeSelector:

			if ctxPrev == nil || len(elemPrev) == 0 {
				return nil, ErrInvalidIndex
			}

			r := New("{")
			ix := pathNode.index(g) + 1 // 0 is {}, {n} becomes ix = n+1

			if ix < 0 {
				return nil, ErrInvalidIndex
			} else if ix == 0 {
				// This case is {}, thus return all ocurrences of the token just before
				r.addEqualNodes(ctxPrev, elemPrev, false)
			} else {
				// of all the nodes with name elemPrev, select the ix_th.
				for _, nn := range ctxPrev.Out {
					if nn.ThisString() == elemPrev {
						ix--
						if ix == 0 {
							r.AddNodes(nn)
							break
						}
					}
				}

			}
			ctxPrev = ctx
			ctx = r

		case TypeArguments:
			// We have hit an argument list of a function
			if ctx.Len() > 0 {
				itf, err := g.function(p, ctx.GetAt(0).This)
				if err != nil {
					return nil, err
				}
				var ok bool
				ctxPrev = ctx
				ctx, ok = itf.(*Graph)
				if !ok {
					return nil, ErrFunctionNoGraph
				}
			} else {
				return nil, ErrNotFound
			}

		case TypeGroup:
			// The expression is evaluated and used as path element
			itf, err := g.Eval(pathNode.Out[0])
			if err != nil {
				return nil, err
			}
			str := _string(itf)

			if len(str) == 0 {
				return nil, nil // expr does not evaluate to a string
			}
			pathElement = str
			// [!] .().
			fallthrough

		default:
			ctxPrev = ctx
			ctx = ctx.Node(pathElement)
			elemPrev = pathElement

			if ctx == nil {
				if ctxPrev.Len() > 0 {
					itf, err := g.function(p, ctxPrev.GetAt(0).This)
					if err != nil {
						return nil, err
					}
					var ok bool
					ctx, ok = itf.(*Graph)
					if !ok {
						return nil, ErrFunctionNoGraph
					}
				}
			}
		}
	}

	return ctx, nil
}
208824
func (ns *NetworkSpec) Path() string {
	name := ns.Name
	if name == "" {
		name = networkDefaultName
	}
	return networkPathRoot + name
}
1253741
func ServiceWantPath(root string, appName types.ACName) string {
	return filepath.Join(common.Stage1RootfsPath(root), defaultWantsDir, ServiceUnitName(appName))
}
455511
func (l *ServiceListener) GetPath(nodes ...string) string {
	parts := append([]string{"/services"}, nodes...)
	if l.poolid != "" {
		parts = append([]string{"/pools", l.poolid}, parts...)
	}
	return path.Join(parts...)
}
20770
func (f *GFile) GetPath() string {
	return gostring(gstring(C.g_file_get_path(f.GFile)))
}