// PropDependency specifies properties that must be present when
// `from` is present.
176639
func (o *ObjectConstraint) PropDependency(from string, to ...string) *ObjectConstraint {
	o.deplock.Lock()
	defer o.deplock.Unlock()

	l := o.propdeps[from]
	l = append(l, to...)
	o.propdeps[from] = l
	return o
}
412789
func PropType(t string) Property {
	return Property{
		Name:  "Type",
		Value: dbus.MakeVariant(t),
	}
}
478539
func (e *Chattr) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	return e.Deps
}
65988
func templateChainDependencies(template Template) []Template {
	requires := template.Templates()
	chain := make([]Template, len(requires)*2)
	for _, req := range requires {
		chain = append(chain, templateChainDependencies(req)...)
	}
	chain = append(chain, template)
	return chain
}
845894
func (c *Client) deleteOrgDependentMappings(ctx context.Context, tx *bolt.Tx, m *platform.UserResourceMapping) error {
	bf := platform.BucketFilter{OrganizationID: &m.ResourceID}
	bs, err := c.findBuckets(ctx, tx, bf)
	if err != nil {
		return err
	}
	for _, b := range bs {
		if err := c.deleteUserResourceMapping(ctx, tx, platform.UserResourceMappingFilter{
			ResourceType: platform.BucketsResourceType,
			ResourceID:   b.ID,
			UserID:       m.UserID,
		}); err != nil {
			return err
		}
		// TODO(desa): add support for all other resource types.
	}

	return nil
}
819328
func (ep Endpoint) CanRelateTo(other Endpoint) bool {
	return ep.ApplicationName != other.ApplicationName &&
		ep.Interface == other.Interface &&
		ep.Role != charm.RolePeer &&
		counterpartRole(ep.Role) == other.Role
}
922875
func (s *GetTriggersInput) SetDependentJobName(v string) *GetTriggersInput {
	s.DependentJobName = &v
	return s
}
206580
func (w *Watchdog) mapDependencies() {
	for name := range w.services {
		svc := w.services[name]
		for depName := range svc.dependencies {
			dep, ok := w.services[depName]
			if !ok {
				log.Fatalf("Failed to find dependency %q for service %q", depName, name)
			}
			svc.dependencies[depName] = dep
			dep.dependents[svc.name] = svc
		}
	}
}
1007260
func (e *SecurityGroupRule) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	var deps []fi.Task
	for _, task := range tasks {
		if _, ok := task.(*SecurityGroup); ok {
			deps = append(deps, task)
		}
	}
	return deps
}
1193965
func (g *Graph) Dependencies(x util.T) map[util.T]struct{} {
	return g.adj[x]
}
826459
func findDependedColumnNames(colDef *ast.ColumnDef) (generated bool, colsMap map[string]struct{}) {
	colsMap = make(map[string]struct{})
	for _, option := range colDef.Options {
		if option.Tp == ast.ColumnOptionGenerated {
			generated = true
			colNames := findColumnNamesInExpr(option.Expr)
			for _, depCol := range colNames {
				colsMap[depCol.Name.L] = struct{}{}
			}
			break
		}
	}
	return
}
731897
func PgDependsByClassidObjidObjsubid(db XODB, classid pgtypes.Oid, objid pgtypes.Oid, objsubid int) ([]*PgDepend, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, ctid, classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype ` +
		`FROM pg_catalog.pg_depend ` +
		`WHERE classid = $1 AND objid = $2 AND objsubid = $3`

	// run query
	XOLog(sqlstr, classid, objid, objsubid)
	q, err := db.Query(sqlstr, classid, objid, objsubid)
	if err != nil {
		return nil, err
	}
	defer q.Close()

	// load results
	res := []*PgDepend{}
	for q.Next() {
		pd := PgDepend{}

		// scan
		err = q.Scan(&pd.Tableoid, &pd.Cmax, &pd.Xmax, &pd.Cmin, &pd.Xmin, &pd.Ctid, &pd.Classid, &pd.Objid, &pd.Objsubid, &pd.Refclassid, &pd.Refobjid, &pd.Refobjsubid, &pd.Deptype)
		if err != nil {
			return nil, err
		}

		res = append(res, &pd)
	}

	return res, nil
}
1129736
func sortResourcesByDependency(resources []interface{}) []interface{} {
	var result []interface{}
	for _, resource := range resources {
		var i int
		for i = 0; i < len(result); i++ {
			if references(result[i], resource) {
				break
			}
		}
		result = append(result[:i], append([]interface{}{resource}, result[i:]...)...)
	}
	return result
}
722649
func (s *JobDetail) SetDependsOn(v []*JobDependency) *JobDetail {
	s.DependsOn = v
	return s
}
653308
func (p *PKGBUILD) BuildDepends() []*Dependency {
	// TODO real merge
	deps := make([]*Dependency, len(p.Depends)+len(p.Makedepends)+len(p.Checkdepends))

	deps = append(p.Depends, p.Makedepends...)
	deps = append(deps, p.Checkdepends...)

	return deps
}
491972
func (e *MountDiskTask) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	var deps []fi.Task

	// Requires parent directories to be created
	for _, v := range findCreatesDirParents(e.Mountpoint, tasks) {
		deps = append(deps, v)
	}

	return deps
}
1345195
func (e *PoolAssociation) GetDependencies(tasks map[string]fi.Task) []fi.Task {
	var deps []fi.Task
	for _, task := range tasks {
		if _, ok := task.(*LB); ok {
			deps = append(deps, task)
		}
		if _, ok := task.(*LBPool); ok {
			deps = append(deps, task)
		}
		if _, ok := task.(*Instance); ok {
			deps = append(deps, task)
		}
	}
	return deps
}