// GetCoordsFromCellIDString returns the zero based cartesian
// coordinates from a cell name in Excel format, e.g. the cellIDString
// "A1" returns 0, 0 and the "B3" return 1, 2.
165244
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 = ColLettersToIndex(letterPart)
	return x, y, error
}
1238119
func (s *Service) GetDashboardCellView(ctx context.Context, dashboardID, cellID platform.ID) (*platform.View, error) {
	v, err := s.FindViewByID(ctx, cellID)
	if err != nil {
		return nil, &platform.Error{
			Err: err,
			Op:  OpPrefix + platform.OpGetDashboardCellView,
		}
	}

	return v, nil
}
834772
func (s *Serf) GetCoordinate() (*coordinate.Coordinate, error) {
	if !s.config.DisableCoordinates {
		return s.coordClient.GetCoordinate(), nil
	}

	return nil, fmt.Errorf("Coordinates are disabled")
}
821872
func (f *File) getCellStringFunc(sheet, axis string, fn func(x *xlsxWorksheet, c *xlsxC) (string, bool, error)) (string, error) {
	xlsx, err := f.workSheetReader(sheet)
	if err != nil {
		return "", err
	}
	axis, err = f.mergeCellsParser(xlsx, axis)
	if err != nil {
		return "", err
	}
	_, row, err := CellNameToCoordinates(axis)
	if err != nil {
		return "", err
	}

	lastRowNum := 0
	if l := len(xlsx.SheetData.Row); l > 0 {
		lastRowNum = xlsx.SheetData.Row[l-1].R
	}

	// keep in mind: row starts from 1
	if row > lastRowNum {
		return "", nil
	}

	for rowIdx := range xlsx.SheetData.Row {
		rowData := &xlsx.SheetData.Row[rowIdx]
		if rowData.R != row {
			continue
		}
		for colIdx := range rowData.C {
			colData := &rowData.C[colIdx]
			if axis != colData.R {
				continue
			}
			val, ok, err := fn(xlsx, colData)
			if err != nil {
				return "", err
			}
			if ok {
				return val, nil
			}
		}
	}
	return "", nil
}
427965
func (s *TranslateFile) TranslateColumnToString(index string, value uint64) (string, error) {
	s.mu.RLock()
	if idx := s.cols[index]; idx != nil {
		if ret, ok := idx.keyByID(value); ok {
			s.mu.RUnlock()
			return string(ret), nil
		}
	}
	s.mu.RUnlock()
	return "", nil
}
963787
func (v *StorageVol) GetXMLDesc(flags uint32) (string, error) {
	var err C.virError
	result := C.virStorageVolGetXMLDescWrapper(v.ptr, C.uint(flags), &err)
	if result == nil {
		return "", makeError(&err)
	}
	xml := C.GoString(result)
	C.free(unsafe.Pointer(result))
	return xml, nil
}
130878
func getDefaultStorageClass(location string) (string, error) {
	if _, ok := GCSMultiRegionalLocations[location]; ok {
		return defaultMultiRegionalStorageClass, nil
	}
	if _, ok := GCSRegionalLocations[location]; ok {
		return defaultRegionalStorageClass, nil
	}
	return "", ErrUnknownLocation
}
49571
func (obj *Global) GetLogicalDriveStrings(ctx context.Context) ([]*DriveInfo, error) {
	result := &struct {
		Drives []*DriveInfo	`json:"qDrives"`
	} {}
	err := obj.rpc(ctx, "GetLogicalDriveStrings", result)
	return result.Drives, err 
}
346501
func (s *translateStore) TranslateColumnToString(index string, value uint64) (string, error) {
	s.mu.RLock()
	if idx := s.cols[index]; idx != nil {
		if ret, ok := idx.reverse[value]; ok {
			s.mu.RUnlock()
			return ret, nil
		}
	}
	s.mu.RUnlock()
	return "", nil
}
1274368
func getMaxMinFromDimensionRef(ref string) (minx, miny, maxx, maxy int, err error) {
	var parts []string
	parts = strings.Split(ref, cellRangeChar)
	minx, miny, err = GetCoordsFromCellIDString(parts[0])
	if err != nil {
		return -1, -1, -1, -1, err
	}
	maxx, maxy, err = GetCoordsFromCellIDString(parts[1])
	if err != nil {
		return -1, -1, -1, -1, err
	}
	return
}
1357639
func (r Billing_Invoice_Next) GetExcel(documentCreateDate *datatypes.Time) (resp []byte, err error) {
	params := []interface{}{
		documentCreateDate,
	}
	err = r.Session.DoRequest("SoftLayer_Billing_Invoice_Next", "getExcel", params, &r.Options, &resp)
	return
}
396997
func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bottom float64, err error) {
	f := rgc.GetFont()
	if f == nil {
		err = errors.New("No font loaded, cannot continue")
		return
	}
	rgc.recalc()

	left = math.MaxFloat64
	top = math.MaxFloat64

	cursor := 0.0
	prev, hasPrev := truetype.Index(0), false
	for _, rc := range s {
		index := f.Index(rc)
		if hasPrev {
			cursor += fUnitsToFloat64(f.Kern(fixed.Int26_6(rgc.current.Scale), prev, index))
		}

		if err = rgc.glyphBuf.Load(rgc.current.Font, fixed.Int26_6(rgc.current.Scale), index, font.HintingNone); err != nil {
			return
		}
		e0 := 0
		for _, e1 := range rgc.glyphBuf.Ends {
			ps := rgc.glyphBuf.Points[e0:e1]
			for _, p := range ps {
				x, y := pointToF64Point(p)
				top = math.Min(top, y)
				bottom = math.Max(bottom, y)
				left = math.Min(left, x+cursor)
				right = math.Max(right, x+cursor)
			}
			e0 = e1
		}
		cursor += fUnitsToFloat64(f.HMetric(fixed.Int26_6(rgc.current.Scale), index).AdvanceWidth)
		prev, hasPrev = index, true
	}
	return
}
106311
func (f *File) getTotalRowsCols(name string) (int, int, error) {
	decoder := xml.NewDecoder(bytes.NewReader(f.readXML(name)))
	var inElement string
	var r xlsxRow
	var tr, tc int
	for {
		token, _ := decoder.Token()
		if token == nil {
			break
		}
		switch startElement := token.(type) {
		case xml.StartElement:
			inElement = startElement.Name.Local
			if inElement == "row" {
				r = xlsxRow{}
				_ = decoder.DecodeElement(&r, &startElement)
				tr = r.R
				for _, colCell := range r.C {
					col, _, err := CellNameToCoordinates(colCell.R)
					if err != nil {
						return tr, tc, err
					}
					if col > tc {
						tc = col
					}
				}
			}
		default:
		}
	}
	return tr, tc, nil
}
900261
func NewStringTsCell(v string) TsCell {
	tsc := riak_ts.TsCell{VarcharValue: []byte(v)}
	tsct := riak_ts.TsColumnType_VARCHAR
	return TsCell{columnType: tsct, cell: &tsc}
}
1098479
func CellNameToCoordinates(cell string) (int, int, error) {
	const msg = "cannot convert cell %q to coordinates: %v"

	colname, row, err := SplitCellName(cell)
	if err != nil {
		return -1, -1, fmt.Errorf(msg, cell, err)
	}

	col, err := ColumnNameToNumber(colname)
	if err != nil {
		return -1, -1, fmt.Errorf(msg, cell, err)
	}

	return col, row, nil
}
945000
func LOGetCellString(cell *ole.IDispatch) (value string) {
	return oleutil.MustGetProperty(cell, "string").ToString()
}
463629
func idFromString(s string) (string, error) {
	_, err := uuid.FromString(s)
	if err != nil {
		return "", ErrMalformed
	}

	return s, nil
}