// GetLightByName returns a light struct containing data on a given name.
322089
func (bridge *Bridge) GetLightByName(name string) (Light, error) {
	lights, _ := bridge.GetAllLights()
	for _, light := range lights {
		if light.Name == name {
			return light, nil
		}
	}
	errOut := fmt.Sprintf("Error: Light name '%s' not found. ", name)
	return Light{}, errors.New(errOut)
}
579347
func (api *InterfaceAPI) SortByName(reverse bool) *InterfaceAPI {
	api.sortByName(reverse)
	return api
}
915045
def get_light_by_name(self, name):
        
        return next((light for light in self.lights
                     if light.name.lower() == name.lower()), None)
949280
func (api *ProductInternetAPI) SortByName(reverse bool) *ProductInternetAPI {
	api.sortByName(reverse)
	return api
}
641354
func (api *IconAPI) SortByName(reverse bool) *IconAPI {
	api.sortByName(reverse)
	return api
}
336592
func (clstr *Cluster) GetNodeByName(nodeName string) (*Node, error) {
	node := clstr.findNodeByName(nodeName)

	if node == nil {
		return nil, NewAerospikeError(INVALID_NODE_ERROR, "Invalid node name"+nodeName)
	}
	return node, nil
}
455258
func (daemon *Daemon) GetByName(name string) (*container.Container, error) {
	if len(name) == 0 {
		return nil, fmt.Errorf("No container name supplied")
	}
	fullName := name
	if name[0] != '/' {
		fullName = "/" + name
	}
	id, err := daemon.containersReplica.Snapshot().GetID(fullName)
	if err != nil {
		return nil, fmt.Errorf("Could not find entity for %s", name)
	}
	e := daemon.containers.Get(id)
	if e == nil {
		return nil, fmt.Errorf("Could not find container for entity id %s", id)
	}
	return e, nil
}
167692
func (api *NoteAPI) SortByName(reverse bool) *NoteAPI {
	api.sortByName(reverse)
	return api
}
1274705
func getNamespaceByName(name string, ns *corev1.Namespace, client kubernetes.Interface) (*corev1.Namespace, error) {
	if ns != nil && name == ns.Name {
		return ns, nil
	}
	return client.CoreV1().Namespaces().Get(name, metav1.GetOptions{})
}
368806
func (net *Network) GetNodeByName(name string) *Node {
	net.lock.RLock()
	defer net.lock.RUnlock()
	return net.getNodeByName(name)
}
118950
func (item *OrderItem) ColorName() string {
	item.loadSizeVariation()
	return item.SizeVariation.ColorVariation.Color.Name
}
1013137
func (p *PreReceiveHook) GetName() string {
	if p == nil || p.Name == nil {
		return ""
	}
	return *p.Name
}
1343688
func (c *Calcium) GetNodeByName(ctx context.Context, nodename string) (*types.Node, error) {
	return c.store.GetNodeByName(ctx, nodename)
}
274091
func (c *Client) GetLightByID(id uint64) (light common.Light, err error) {
	dev, err := c.GetDeviceByID(id)
	if err != nil {
		return nil, err
	}

	light, ok := dev.(common.Light)
	if !ok {
		return nil, common.ErrDeviceInvalidType
	}

	return light, nil
}
1095059
func (um *UserMap) GetByName(name string) (User, error) {
	um.Lock()
	defer um.Unlock()

	for _, user := range um.Map {
		if user.Name == name {
			if user.Options == nil {
				user.Options = make(map[string]interface{})
			}
			return user, nil
		}
	}
	return User{Options: make(map[string]interface{})}, fmt.Errorf("could not find user with name %s", name)
}
836023
func (m *Manager) GetByName(globalID string) (organization *Organization, err error) {
	err = m.collection.Find(bson.M{"globalid": globalID}).One(&organization)
	// Check if organization isnt a nullpointer in case no org was found with this globalID
	if organization != nil && organization.RequiredScopes == nil {
		organization.RequiredScopes = []RequiredScope{}
	}
	return
}
850514
func GetUserByName(name string) (*User, error) {
	if len(name) == 0 {
		return nil, errors.UserNotExist{0, name}
	}
	u := &User{LowerName: strings.ToLower(name)}
	has, err := x.Get(u)
	if err != nil {
		return nil, err
	} else if !has {
		return nil, errors.UserNotExist{0, name}
	}
	return u, nil
}