// WorkingProjection returns the current working variable projection.
356137
func (s *Statement) WorkingProjection() *Projection {
	if s.workingProjection == nil {
		s.ResetProjection()
	}
	return s.workingProjection
}
1279168
func SpecLoader(specFileOrDirs []string, createBlkTxTables bool) (*Projection, error) {
	var projection *Projection
	var err error

	if len(specFileOrDirs) == 0 {
		return nil, fmt.Errorf("please provide a spec file or directory")
	}

	projection, err = NewProjectionFromFolder(specFileOrDirs...)
	if err != nil {
		return nil, fmt.Errorf("error parsing spec: %v", err)
	}

	if createBlkTxTables {
		// add block & tx to tables definition
		blkTxTables := getBlockTxTablesDefinition()

		for k, v := range blkTxTables {
			projection.Tables[k] = v
		}

	}

	return projection, nil
}
609160
func QuarterProjection(dt time.Time, current float64) float64 {
	qtStart := QuarterStart(dt)
	durQ2D := dt.Sub(qtStart)
	qtNext := TimeDt6AddNMonths(qtStart, 3)
	durQtr := qtNext.Sub(qtStart)

	projection := current / durQ2D.Seconds() * durQtr.Seconds()
	return projection
}
572017
func NewProjectionFromFolder(specFileOrDirs ...string) (*Projection, error) {
	eventSpec := types.EventSpec{}

	const errHeader = "NewProjectionFromFolder():"

	for _, dir := range specFileOrDirs {
		err := filepath.Walk(dir, func(path string, _ os.FileInfo, err error) error {
			if err != nil {
				return fmt.Errorf("error walking event spec files location '%s': %v", dir, err)
			}
			if filepath.Ext(path) == ".json" {
				bs, err := readFile(path)
				if err != nil {
					return fmt.Errorf("error reading spec file '%s': %v", path, err)
				}

				err = ValidateJSONEventSpec(bs)
				if err != nil {
					return fmt.Errorf("could not validate spec file '%s': %v", path, err)
				}

				fileEventSpec := types.EventSpec{}
				err = json.Unmarshal(bs, &fileEventSpec)
				if err != nil {
					return fmt.Errorf("error reading spec file '%s': %v", path, err)
				}

				eventSpec = append(eventSpec, fileEventSpec...)
			}

			return nil
		})
		if err != nil {
			return nil, fmt.Errorf("%s %v", errHeader, err)
		}
	}

	return NewProjectionFromEventSpec(eventSpec)
}
704024
func (s *DeleteProjectOutput) SetProjectArn(v string) *DeleteProjectOutput {
	s.ProjectArn = &v
	return s
}
514793
func NewProjectionFinal(ctx *Context, p *Select) (*Projection, error) {
	s := &Projection{
		P:        p,
		Stmt:     p.Stmt,
		PlanBase: NewPlanBase(false),
		Final:    true,
	}
	var err error
	if len(p.Stmt.From) == 0 {
		err = s.loadLiteralProjection(ctx)
	} else if len(p.From) == 1 && p.From[0].Proj != nil {
		s.Proj = p.From[0].Proj
	} else {
		err = s.loadFinal(ctx, true)
	}
	if err != nil {
		return nil, err
	}
	return s, nil
}
541329
func NewProjection(ctx *plan.Context, p *plan.Projection) *Projection {
	if p.Final {
		return NewProjectionFinal(ctx, p)
	}
	return NewProjectionInProcess(ctx, p)
}
1346057
func (s *CreateGlobalSecondaryIndexAction) SetProjection(v *Projection) *CreateGlobalSecondaryIndexAction {
	s.Projection = v
	return s
}
265850
func (s *CreateUploadInput) SetProjectArn(v string) *CreateUploadInput {
	s.ProjectArn = &v
	return s
}
246331
func (p *PlateCarreeProjection) Unproject(pt r2.Point) Point {
	return PointFromLatLng(p.ToLatLng(pt))
}
589931
func (r *Repo) workingClone(ctx context.Context, ref string) (string, error) {
	r.mu.RLock()
	defer r.mu.RUnlock()
	if err := r.errorIfNotReady(); err != nil {
		return "", err
	}
	working, err := ioutil.TempDir(os.TempDir(), "flux-working")
	if err != nil {
		return "", err
	}
	return clone(ctx, working, r.dir, ref)
}
587290
func NextWorkingConstructPredicateObjectPair() ClauseHook {
	var f ClauseHook
	f = func(s *Statement, _ Symbol) (ClauseHook, error) {
		s.WorkingConstructClause().AddWorkingPredicateObjectPair()
		return f, nil
	}
	return f
}
1114307
func (p *PlateCarreeProjection) Project(pt Point) r2.Point {
	return p.FromLatLng(LatLngFromPoint(pt))
}
1273698
func (s *GlobalSecondaryIndexDescription) SetProjection(v *Projection) *GlobalSecondaryIndexDescription {
	s.Projection = v
	return s
}
1305130
func (s *ProjectService) GetProjectByID(id string, opts ...OptionFunc) (*Project, int, error) {
	p := &ListProjectsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListProjects(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.Projects[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for Project UUID: %s!", id)
}
582995
func (p *SortKeys) AsStringProjection() StringProjection {
	return func(r Record) []string {
		result := make([]string, len(p.Keys))
		for i, k := range p.Keys {
			result[i] = r.Get(k)
		}
		return result
	}
}
50531
func (s *CreateNetworkProfileInput) SetProjectArn(v string) *CreateNetworkProfileInput {
	s.ProjectArn = &v
	return s
}