/*
 * Get the Lease
 * -Found
 * -Copy Of the Lease
 * -Any Error
 */
181034
func (t *MemoryPool) GetLease(leaseIP net.IP) (bool, leasepool.Lease, error) {
	t.poolLock.Lock()
	defer t.poolLock.Unlock()

	for i := range t.pool {
		if t.pool[i].IP.Equal(leaseIP) {
			return true, t.pool[i], nil
		}
	}
	return false, leasepool.Lease{}, nil
}
81705
func (s *leaseStore) Leases(keys ...lease.Key) map[lease.Key]lease.Info {
	s.mu.Lock()
	defer s.mu.Unlock()

	filter := make(map[lease.Key]bool)
	filtering := len(keys) > 0
	if filtering {
		for _, key := range keys {
			filter[key] = true
		}
	}

	results := make(map[lease.Key]lease.Info)
	for key, entry := range s.entries {
		if filtering && !filter[key] {
			continue
		}

		results[key] = lease.Info{
			Holder:   entry.holder,
			Expiry:   entry.start.Add(entry.duration),
			Trapdoor: s.trapdoor(key, entry.holder),
		}
	}
	return results
}
1115240
func GetClusterFromLease(lease *leases.Lease, clusterLister ClusterLister) (*containerservice.ContainerService, error) {
	clusterMap, err := ParseMapFromAzure(clusterLister)
	if err != nil {
		return nil, err
	}
	cl, exists := clusterMap.ClusterByName(lease.ClusterName)
	if !exists {
		return nil, errNoSuchCluster{name: lease.ClusterName}
	}

	return cl, nil
}
689475
func (se *ServiceEndpoint) GetAssignment() *addressassignment.AddressAssignment {
	if se.AddressAssignment.ID == "" {
		return nil
	}
	//return reference to copy
	result := se.AddressAssignment
	return &result
}
1090392
func (lru *TTLRUCache) Get(key interface{}) (value interface{}, foundInCache bool) {
	lru.lock.Lock()
	defer lru.lock.Unlock()

	if element, ok := lru.mapping[key]; ok {
		lru.order.MoveToFront(&element.orderelement)
		return element.val, true
	}

	return nil, false
}
975354
func (self *_object) getOwnProperty(name string) *_property {
	return self.objectClass.getOwnProperty(self, name)
}
989012
func (m Map) LeaseByClusterName(clusterName string) (*Lease, bool) {
	u, ok := m.nameMap[clusterName]
	if !ok {
		return nil, false
	}
	l, ok := m.uuidMap[u.String()]
	if !ok {
		return nil, false
	}
	return l, true
}
258538
func (c *Client) LeasesService() leases.Manager {
	if c.leasesService != nil {
		return c.leasesService
	}
	c.connMu.Lock()
	defer c.connMu.Unlock()
	return leasesproxy.NewLeaseManager(leasesapi.NewLeasesClient(c.conn))
}
509232
func (f *FSM) Leases(getLocalTime func() time.Time, keys ...lease.Key) map[lease.Key]lease.Info {
	if len(keys) > 0 {
		return f.filteredLeases(getLocalTime, keys)
	}
	return f.allLeases(getLocalTime)
}
667246
func (t *TextMatch) GetProperty() string {
	if t == nil || t.Property == nil {
		return ""
	}
	return *t.Property
}
507001
func (s *CouchbaseSessionStore) Get(key interface{}) interface{} {
	s.lock.RLock()
	defer s.lock.RUnlock()

	return s.data[key]
}
99909
func (in *LeaseSpec) DeepCopy() *LeaseSpec {
	if in == nil {
		return nil
	}
	out := new(LeaseSpec)
	in.DeepCopyInto(out)
	return out
}
728921
func (s *leaseStore) ClaimLease(key lease.Key, req lease.Request, _ <-chan struct{}) error {
	s.mu.Lock()
	defer s.mu.Unlock()
	if _, found := s.entries[key]; found {
		return lease.ErrInvalid
	}
	s.entries[key] = &entry{
		holder:   req.Holder,
		start:    s.clock.Now(),
		duration: req.Duration,
	}
	s.target.Claimed(key, req.Holder)
	return nil
}
303499
func (p *Properties) Get(iface, property string) (dbus.Variant, *dbus.Error) {
	p.mut.RLock()
	defer p.mut.RUnlock()
	m, ok := p.m[iface]
	if !ok {
		return dbus.Variant{}, ErrIfaceNotFound
	}
	prop, ok := m[property]
	if !ok {
		return dbus.Variant{}, ErrPropNotFound
	}
	return dbus.MakeVariant(prop.Value), nil
}
1104123
func Convert_coordination_Lease_To_v1_Lease(in *coordination.Lease, out *v1.Lease, s conversion.Scope) error {
	return autoConvert_coordination_Lease_To_v1_Lease(in, out, s)
}
1301317
func (dfs *DistributedFilesystem) findImage(image, tenantID string) (string, error) {
	// Is the image in the index?
	rImage, err := dfs.index.FindImage(image)
	if err != nil {
		if err == index.ErrImageNotFound {
			return "", nil
		}
		glog.Errorf("Could not look up image %s from the registry: %s", image, err)
		return "", err
	}
	// Is this image latest under the same tenant?
	if rImage.Library == tenantID && rImage.Tag == docker.Latest {
		return rImage.String(), nil
	}
	return "", nil
}
261900
func NewLease(clusterName string, exprTime time.Time) *Lease {
	return &Lease{
		ClusterName:         clusterName,
		LeaseExpirationTime: exprTime.Format(TimeFormat),
	}
}