// NumericFriends returns a slice containing the IDs of Users that are user's friends (follows each other)
189954
func (user *User) NumericFriends() (friends []uint64) {
	Db().Raw(`SELECT "to" FROM (
		select "to" from followers where "from" = ?) as f
		inner join
		(select "from" from followers where "to" = ?) as e
		on f.to = e.from
		inner join users u on u.counter = f.to`, user.ID(), user.ID()).Scan(&friends)
	return
}
508675
func (c *Connect) NumOfNetworks() (int, error) {
	var err C.virError
	result := int(C.virConnectNumOfNetworksWrapper(c.ptr, &err))
	if result == -1 {
		return 0, makeError(&err)
	}
	return result, nil
}
1254963
func NewNumericRangeQuery(min, max *float64) *NumericRangeQuery {
	return NewNumericRangeInclusiveQuery(min, max, nil, nil)
}
391910
func NumPeers(raftDir string) (int, error) {
	// Read the file
	buf, err := ioutil.ReadFile(filepath.Join(raftDir, jsonPeerPath))
	if err != nil && !os.IsNotExist(err) {
		return 0, err
	}

	// Check for no peers
	if len(buf) == 0 {
		return 0, nil
	}

	// Decode the peers
	var peerSet []string
	dec := json.NewDecoder(bytes.NewReader(buf))
	if err := dec.Decode(&peerSet); err != nil {
		return 0, err
	}

	return len(peerSet), nil
}
123653
func (s *FriendService) IDs(params *FriendIDParams) (*FriendIDs, *http.Response, error) {
	ids := new(FriendIDs)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("ids.json").QueryStruct(params).Receive(ids, apiError)
	return ids, resp, relevantError(err, *apiError)
}
215094
func (post *ProjectPost) NumericLurkers() (lurkers []uint64) {
	Db().Model(ProjectPostLurk{}).Where(&ProjectPostLurk{Hpid: post.ID()}).Pluck(`"from"`, &lurkers)
	return
}
1244796
func (m *memberlist) NumPingableMembers() (n int) {
	m.members.RLock()
	for _, member := range m.members.list {
		if m.Pingable(*member) {
			n++
		}
	}
	m.members.RUnlock()

	return n
}
1041623
func (post *ProjectPost) NumericBookmarkers() (bookmarkers []uint64) {
	Db().Model(ProjectPostBookmark{}).Where(&ProjectPostBookmark{Hpid: post.ID()}).Pluck(`"from"`, &bookmarkers)
	return
}
1238056
func (fr *FacetRequest) AddNumericRange(name string, min, max *float64) {
	if fr.NumericRanges == nil {
		fr.NumericRanges = make([]*numericRange, 0, 1)
	}
	fr.NumericRanges = append(fr.NumericRanges, &numericRange{Name: name, Min: min, Max: max})
}
1239667
func (user *User) NumericBlacklisting() (blacklist []uint64) {
	Db().Model(Blacklist{}).Where(&Blacklist{To: user.ID()}).Pluck(`"from"`, &blacklist)
	return
}
49607
func (s *ShapeIndex) NumEdges() int {
	numEdges := 0
	for _, shape := range s.shapes {
		numEdges += shape.NumEdges()
	}
	return numEdges
}
59260
func Friends() echo.HandlerFunc {

	// swagger:route GET /users/{id}/friends users info friends GetUserFriends
	//
	// Shows the friends informations for the specified user
	//
	// You can personalize the request via query string parameters
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile:read
	//
	//	Responses:
	//		default: UsersIdFriends

	return func(c echo.Context) error {
		if !rest.IsGranted("profile:read", c) {
			return rest.InvalidScopeResponse("profile:read", c)
		}
		friends := c.Get("other").(*nerdz.User).Friends()
		return rest.SelectFields(rest.GetUsersInfo(friends), c)
	}
}
892150
func (c *Connect) NumOfNWFilters() (int, error) {
	var err C.virError
	result := int(C.virConnectNumOfNWFiltersWrapper(c.ptr, &err))
	if result == -1 {
		return 0, makeError(&err)
	}
	return result, nil
}
1306180
func (re *Regexp) GetGroupNumbers() []int {
	var result []int

	if re.caps == nil {
		result = make([]int, re.capsize)

		for i := 0; i < len(result); i++ {
			result[i] = i
		}
	} else {
		result = make([]int, len(re.caps))

		for k, v := range re.caps {
			result[v] = k
		}
	}

	return result
}
1088197
func (post *UserPost) NumericOwners() []uint64 {
	if post.To != post.From {
		return []uint64{post.To, post.From}
	}
	return []uint64{post.To}
}
806457
func (c *Connect) NumOfDefinedNetworks() (int, error) {
	var err C.virError
	result := int(C.virConnectNumOfDefinedNetworksWrapper(c.ptr, &err))
	if result == -1 {
		return 0, makeError(&err)
	}
	return result, nil
}
721406
func (df *DirtyFile) NumErrListeners() int {
	df.lock.Lock()
	defer df.lock.Unlock()
	return len(df.errListeners)
}