// GetCellInfoNames returns the names of the existing cells. They are
// sorted by name.
197738
func (ts *Server) GetCellInfoNames(ctx context.Context) ([]string, error) {
	entries, err := ts.globalCell.ListDir(ctx, CellsPath, false /*full*/)
	switch {
	case IsErrType(err, NoNode):
		return nil, nil
	case err == nil:
		return DirEntriesToStringArray(entries), nil
	default:
		return nil, err
	}
}
884145
func (fmd *FakeMysqlDaemon) GetColumns(dbName, table string) ([]string, error) {
	return []string{}, nil
}
1105214
func GetFieldNames(db *sql.DB, dbName string, tableName string) []string {
	fields := GetFields(db, dbName, tableName)
	if fields == nil {
		return nil
	}
	names := make([]string, len(fields))
	for i, f := range fields {
		names[i] = f.Name
	}
	return names
}
1191368
func (ts *stringTables) GetTableByName(name string) (*stringTable, bool) {
	i, ok := ts.NameIndex[name]
	if !ok {
		return nil, false
	}
	t, ok := ts.Tables[i]
	return t, ok
}
591697
func (ts *Server) GetTabletsByCell(ctx context.Context, cell string) ([]*topodatapb.TabletAlias, error) {
	// If the cell doesn't exist, this will return ErrNoNode.
	conn, err := ts.ConnForCell(ctx, cell)
	if err != nil {
		return nil, err
	}

	// List the directory, and parse the aliases
	children, err := conn.ListDir(ctx, TabletsPath, false /*full*/)
	if err != nil {
		if IsErrType(err, NoNode) {
			// directory doesn't exist, empty list, no error.
			return nil, nil
		}
		return nil, err
	}

	result := make([]*topodatapb.TabletAlias, len(children))
	for i, child := range children {
		result[i], err = topoproto.ParseTabletAlias(child.Name)
		if err != nil {
			return nil, err
		}
	}
	return result, nil
}
840591
func (ts *Server) GetCellsAliases(ctx context.Context, strongRead bool) (ret map[string]*topodatapb.CellsAlias, err error) {
	conn := ts.globalCell
	if !strongRead {
		conn = ts.globalReadOnlyCell
	}

	entries, err := ts.globalCell.ListDir(ctx, CellsAliasesPath, false /*full*/)
	switch {
	case IsErrType(err, NoNode):
		return nil, nil
	case err == nil:
		aliases := DirEntriesToStringArray(entries)
		ret = make(map[string]*topodatapb.CellsAlias, len(aliases))
		for _, alias := range aliases {
			aliasPath := pathForCellsAlias(alias)
			contents, _, err := conn.Get(ctx, aliasPath)
			if err != nil {
				return nil, err
			}

			// Unpack the contents.
			cellsAlias := &topodatapb.CellsAlias{}
			if err := proto.Unmarshal(contents, cellsAlias); err != nil {
				return nil, err
			}

			ret[alias] = cellsAlias
		}
		return ret, nil
	default:
		return nil, err
	}
}
895298
func (ts *Server) GetKnownCells(ctx context.Context) ([]string, error) {
	// Note we use the global read-only cell here, as the result
	// is not time sensitive.
	entries, err := ts.globalReadOnlyCell.ListDir(ctx, CellsPath, false /*full*/)
	if err != nil {
		return nil, err
	}
	return DirEntriesToStringArray(entries), nil
}
512203
func getCoordsFromCellIDString(cellIDString string) (x, y int, error error) {
	var letterPart string = strings.Map(letterOnlyMapF, cellIDString)
	y, error = strconv.Atoi(strings.Map(intOnlyMapF, cellIDString))
	if error != nil {
		return x, y, error
	}
	y -= 1 // Zero based
	x = lettersToNumeric(letterPart)
	return x, y, error
}
850275
func getFileNames(dirName string) ([]os.FileInfo, error) {
	var dirListing, fileInfos []os.FileInfo
	dir, err := os.Open(dirName)
	if err != nil {
		return fileInfos, err
	}
	defer dir.Close()
	dirListing, err = dir.Readdir(0)
	if err != nil {
		return fileInfos, err
	}
	for _, f := range dirListing {
		if f.IsDir() {
			continue
		}
		fileInfos = append(fileInfos, f)
	}
	sort.Sort(fileChanges(fileInfos))
	return fileInfos, nil
}
65932
func (*PostgresDB) GetTableNames(db *sql.DB) (tables []string) {
	rows, err := db.Query(`
		SELECT table_name FROM information_schema.tables
		WHERE table_catalog = current_database() AND
		table_type = 'BASE TABLE' AND
		table_schema NOT IN ('pg_catalog', 'information_schema')`)
	if err != nil {
		beeLogger.Log.Fatalf("Could not show tables: %s", err)
	}
	defer rows.Close()

	for rows.Next() {
		var name string
		if err := rows.Scan(&name); err != nil {
			beeLogger.Log.Fatalf("Could not show tables: %s", err)
		}
		tables = append(tables, name)
	}
	return
}
1367841
func (o SecretOptions) GetSecretNames(secrets []*corev1.Secret) sets.String {
	names := sets.String{}
	for _, secret := range secrets {
		names.Insert(parseSecretName(secret.Name))
	}
	return names
}
315102
func (mem *memNamedMapping) ListAllNames() (names []string) {
	mem.access.RLock()
	defer mem.access.RUnlock()

	var ret []string

	for name := range mem.nameToIdx {
		ret = append(ret, name)
	}

	return ret
}
410485
func (g *Cloud) getInstancesByNames(names []string) ([]*gceInstance, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	found := map[string]*gceInstance{}
	remaining := len(names)

	nodeInstancePrefix := g.nodeInstancePrefix
	for _, name := range names {
		name = canonicalizeInstanceName(name)
		if !strings.HasPrefix(name, g.nodeInstancePrefix) {
			klog.Warningf("Instance %q does not conform to prefix %q, removing filter", name, g.nodeInstancePrefix)
			nodeInstancePrefix = ""
		}
		found[name] = nil
	}

	for _, zone := range g.managedZones {
		if remaining == 0 {
			break
		}
		instances, err := g.c.Instances().List(ctx, zone, filter.Regexp("name", nodeInstancePrefix+".*"))
		if err != nil {
			return nil, err
		}
		for _, inst := range instances {
			if remaining == 0 {
				break
			}
			if _, ok := found[inst.Name]; !ok {
				continue
			}
			if found[inst.Name] != nil {
				klog.Errorf("Instance name %q was duplicated (in zone %q and %q)", inst.Name, zone, found[inst.Name].Zone)
				continue
			}
			found[inst.Name] = &gceInstance{
				Zone:  zone,
				Name:  inst.Name,
				ID:    inst.Id,
				Disks: inst.Disks,
				Type:  lastComponent(inst.MachineType),
			}
			remaining--
		}
	}

	if remaining > 0 {
		var failed []string
		for k := range found {
			if found[k] == nil {
				failed = append(failed, k)
			}
		}
		klog.Errorf("Failed to retrieve instances: %v", failed)
		return nil, cloudprovider.InstanceNotFound
	}

	var ret []*gceInstance
	for _, instance := range found {
		ret = append(ret, instance)
	}

	return ret, nil
}
648909
func (db *DB) ColNames() ([]string, error) {
	files, err := ioutil.ReadDir(db.path)
	if err != nil {
		return nil, err
	}
	var names []string
	for _, file := range files {
		if strings.ToLower(path.Ext(file.Name())) == Ext {
			names = append(names, file.Name()[0:len(file.Name())-len(Ext)])
		}
	}
	return names, nil
}
1306130
func infoFromCell(cell *hrpc.Cell) (hrpc.RegionInfo, error) {
	value := cell.Value
	if len(value) == 0 {
		return nil, fmt.Errorf("empty value in %q", cell)
	} else if value[0] != 'P' {
		return nil, fmt.Errorf("unsupported region info version %d in %q", value[0], cell)
	}
	const pbufMagic = 1346524486 // 4 bytes: "PBUF"
	magic := binary.BigEndian.Uint32(value[:4])
	if magic != pbufMagic {
		return nil, fmt.Errorf("invalid magic number in %q", cell)
	}
	var regInfo pb.RegionInfo
	err := proto.UnmarshalMerge(value[4:], &regInfo)
	if err != nil {
		return nil, fmt.Errorf("failed to decode %q: %s", cell, err)
	}
	if regInfo.GetOffline() {
		return nil, OfflineRegionError{n: string(cell.Row)}
	}
	var namespace []byte
	if !bytes.Equal(regInfo.TableName.Namespace, defaultNamespace) {
		// if default namespace, pretend there's no namespace
		namespace = regInfo.TableName.Namespace
	}

	return NewInfo(
		regInfo.GetRegionId(),
		namespace,
		regInfo.TableName.Qualifier,
		cell.Row,
		regInfo.StartKey,
		regInfo.EndKey,
	), nil
}
807612
func (fsh *Handler) GetFileNames(paths []string) (files []string, err error) {
	for _, path := range paths {
		err := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
			if err != nil {
				return err
			}
			if info == nil || info.IsDir() {
				return nil
			}
			files = append(files, path)
			return nil
		})
		if err != nil {
			err = errors.Errorf("failed to traverse through %s: %v", path, err)
		}
	}
	return files, err
}
132259
func (a Fields) Names() []string {
	names := []string{}
	for _, f := range a {
		switch expr := f.Expr.(type) {
		case *Call:
			names = append(names, expr.Name)
		case *VarRef:
			names = append(names, expr.Val)
		case *BinaryExpr:
			names = append(names, walkNames(expr)...)
		case *ParenExpr:
			names = append(names, walkNames(expr)...)
		}
	}
	return names
}