// ParseInLocation is like Parse except it uses the given location when parsing the date.
422382
func ParseInLocation(s string, loc *time.Location) (time.Time, error) {
	_, l, err := ParseAndGetLayout(s)
	if err != nil {
		return time.Time{}, err
	}
	t, err := time.ParseInLocation(l, s, loc)
	return t, err
}
58623
func ConvertLocation(loc proc.Location) Location {
	return Location{
		PC:       loc.PC,
		File:     loc.File,
		Line:     loc.Line,
		Function: ConvertFunction(loc.Fn),
	}
}
757273
func (s *SourceBuildInformation) SetSourceLocation(v string) *SourceBuildInformation {
	s.SourceLocation = &v
	return s
}
1106365
func (s *QueryCompileError) SetLocation(v *QueryCompileErrorLocation) *QueryCompileError {
	s.Location = v
	return s
}
1352419
func (p *parser) parseInverse() *ast.BlockStatement {
	// openInverse
	result, blockParams := p.parseOpenBlock()

	// program
	program := p.parseProgram()

	program.BlockParams = blockParams
	result.Inverse = program

	// inverseAndProgram?
	if p.isInverse() {
		result.Program = p.parseInverseAndProgram()
	}

	// closeBlock
	p.parseCloseBlock(result)

	setBlockInverseStrip(result)

	return result
}
912473
func (s *EndpointBatchItem) SetLocation(v *EndpointLocation) *EndpointBatchItem {
	s.Location = v
	return s
}
694474
func (s *Instance) SetLocation(v *ResourceLocation) *Instance {
	s.Location = v
	return s
}
899886
func configLocation() string {
	// First, check for the "GOPASS_CONFIG" environment variable
	if cf := os.Getenv("GOPASS_CONFIG"); cf != "" {
		return cf
	}

	// Second, check for the "XDG_CONFIG_HOME" environment variable
	// (which is part of the XDG Base Directory Specification for Linux and
	// other Unix-like operating sytstems)
	if xch := os.Getenv("XDG_CONFIG_HOME"); xch != "" {
		return filepath.Join(xch, "gopass", "config.yml")
	}

	return filepath.Join(Homedir(), ".config", "gopass", "config.yml")
}
1315872
func (api *API) ZoneAnalyticsByColocation(zoneID string, options ZoneAnalyticsOptions) ([]ZoneAnalyticsColocation, error) {
	uri := "/zones/" + zoneID + "/analytics/colos" + "?" + options.encode()
	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return nil, errors.Wrap(err, errMakeRequestError)
	}
	var r zoneAnalyticsColocationResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return nil, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
346914
func parseJavaLocations(b []byte, locs map[uint64]*Location, p *Profile) error {
	r := bytes.NewBuffer(b)
	fns := make(map[string]*Function)
	for {
		line, err := r.ReadString('\n')
		if err != nil {
			if err != io.EOF {
				return err
			}
			if line == "" {
				break
			}
		}

		if line = strings.TrimSpace(line); line == "" {
			continue
		}

		jloc := javaLocationRx.FindStringSubmatch(line)
		if len(jloc) != 3 {
			continue
		}
		addr, err := strconv.ParseUint(jloc[1], 16, 64)
		if err != nil {
			return fmt.Errorf("parsing sample %s: %v", line, err)
		}
		loc := locs[addr]
		if loc == nil {
			// Unused/unseen
			continue
		}
		var lineFunc, lineFile string
		var lineNo int64

		if fileLine := javaLocationFileLineRx.FindStringSubmatch(jloc[2]); len(fileLine) == 4 {
			// Found a line of the form: "function (file:line)"
			lineFunc, lineFile = fileLine[1], fileLine[2]
			if n, err := strconv.ParseInt(fileLine[3], 10, 64); err == nil && n > 0 {
				lineNo = n
			}
		} else if filePath := javaLocationPathRx.FindStringSubmatch(jloc[2]); len(filePath) == 3 {
			// If there's not a file:line, it's a shared library path.
			// The path isn't interesting, so just give the .so.
			lineFunc, lineFile = filePath[1], filepath.Base(filePath[2])
		} else if strings.Contains(jloc[2], "generated stub/JIT") {
			lineFunc = "STUB"
		} else {
			// Treat whole line as the function name. This is used by the
			// java agent for internal states such as "GC" or "VM".
			lineFunc = jloc[2]
		}
		fn := fns[lineFunc]

		if fn == nil {
			fn = &Function{
				Name:       lineFunc,
				SystemName: lineFunc,
				Filename:   lineFile,
			}
			fns[lineFunc] = fn
			p.Function = append(p.Function, fn)
		}
		loc.Line = []Line{
			{
				Function: fn,
				Line:     lineNo,
			},
		}
		loc.Address = 0
	}

	p.remapLocationIDs()
	p.remapFunctionIDs()
	p.remapMappingIDs()

	return nil
}
709471
func (s *EndpointRequest) SetLocation(v *EndpointLocation) *EndpointRequest {
	s.Location = v
	return s
}
979328
func (s *LoadBalancerTlsCertificate) SetLocation(v *ResourceLocation) *LoadBalancerTlsCertificate {
	s.Location = v
	return s
}
1045970
func (c *locationCache) getLocation(offset int) *time.Location {
	c.lock.Lock()
	defer c.lock.Unlock()

	location, ok := c.cache[offset]
	if !ok {
		location = time.FixedZone("", offset)
		c.cache[offset] = location
	}

	return location
}
103650
func (s *CloudFormationStackRecord) SetLocation(v *ResourceLocation) *CloudFormationStackRecord {
	s.Location = v
	return s
}
938106
func (r *REST) ResourceLocation(ctx context.Context, id string) (*url.URL, http.RoundTripper, error) {
	return node.ResourceLocation(r, r.connection, r.proxyTransport, ctx, id)
}
791914
func (db *geoDB) location(ip string) *geoLocation {
	location := db.lookup(net.ParseIP(ip))
	return &geoLocation{
		Country:   location.Country.Names.English,
		City:      location.City.Names.English,
		Latitude:  location.Location.Latitude,
		Longitude: location.Location.Longitude,
	}
}
541046
func (s *Send) Location(latitude float64, long float64) *SendLocation {
	return &SendLocation{s, latitude, long, nil, nil}
}