Displays a card showing the Creators who have the most Readings
    associated with their Publications.

    In spectator_core tags, rather than spectator_reading so it can still be
    used on core pages, even if spectator_reading isn't installed.
969457
def most_read_creators_card(num=10):
    
    if spectator_apps.is_enabled('reading'):

        object_list = most_read_creators(num=num)

        object_list = chartify(object_list, 'num_readings', cutoff=1)

        return {
            'card_title': 'Most read authors',
            'score_attr': 'num_readings',
            'object_list': object_list,
        }
856494
def show_notes(self):
        
        if self.notes:
            bytecode._PrintSubBanner("Notes")
            for i in self.notes:
                bytecode._PrintNote(i)
            bytecode._PrintSubBanner()
640684
def _lookup_consumer_tag_by_consumer(self, consumer):
        '''
        '''
        for (tag, func) in self._consumer_cb.iteritems():
            if func == consumer:
                return tag
407454
def _users_watching(self, **kwargs):
        """"""
        return self._users_watching_by_filter(object_id=self.instance.pk,
                                              **kwargs)
253325
def observers(self):
        """"""
        ret = []
        for player in self.players:
            try:
                if player.observer: ret.append(player)
            except: pass # ignore PlayerRecords which don't have an observer attribute
        return ret
1067486
public function _wp_oembed_blog_card_render() {
		if ( empty( $_GET['url'] ) ) {
			return;
		}

		header( 'Content-Type: text/html; charset=utf-8' );
		$url = esc_url_raw( wp_unslash( $_GET['url'] ) );
		echo wp_kses_post( View::get_template( $url ) );
		die();
	}
146870
def deck_vote_tag(deck: Deck) -> str:
    ''''''

    if deck.id is None:
        raise Exception("deck.id is required")

    deck_vote_tag_privkey = sha256(unhexlify(deck.id) + b"vote_init").hexdigest()
    deck_vote_tag_address = Kutil(network=deck.network, privkey=bytearray.fromhex(deck_vote_tag_privkey))
    return deck_vote_tag_address.address
399112
def publisher(self):
        
        # Return information from FULL view, fall back to other views
        full = chained_get(self._head, ['source', 'publisher', 'publishername'])
        if full is None:
            return self._json['coredata'].get('dc:publisher')
        else:
            return full
416452
def most_seen_works_card(kind=None, num=10):
    
    object_list = most_seen_works(kind=kind, num=num)

    object_list = chartify(object_list, 'num_views', cutoff=1)

    if kind:
        card_title = 'Most seen {}'.format(
                                    Work.get_kind_name_plural(kind).lower())
    else:
        card_title = 'Most seen works'

    return {
        'card_title': card_title,
        'score_attr': 'num_views',
        'object_list': object_list,
        'name_attr': 'title',
        'use_cite': True,
    }
791369
def collect_publications(self):
        
        pubs = list(self.sub_publications)

        for sub_tree in self.sub_trees:
            pubs.extend(sub_tree.collect_publications())

        return pubs
600616
function ViewerSelector(defaultViewer) {
  // Try to load the selected key from local storage.
  try {
    this.selectedKey = localStorage.getItem(VIEWER_KEY);
  } catch (error) {
    console.error('Failed to load viewer profile: %s', error);
  }

  //If none exists, or if localstorage is unavailable, use the default key.
  if (!this.selectedKey) {
    this.selectedKey = defaultViewer || DEFAULT_VIEWER;
  }

  this.dialog = this.createDialog_(DeviceInfo.Viewers);
  this.root = null;
  this.onChangeCallbacks_ = [];
}
837532
function (card) {
	if (typeof card == 'number')
		return card >= 1 && card <= deckSize ? card : undefined; // Already codified
	if (typeof card != 'string' || card.length != 2)
		return undefined; // Invalid input
	var posRank = abbr[card[0]];
	var posSuit = (abbr[card[1]] - ranks.length) >> 1;
	if (typeof posRank != 'number' || posRank >= ranks.length || posSuit < 0)
		return undefined; // Invalid characters
	return posRank * suits.length + posSuit + 1;
}
132308
def display_page(self):
        

        self._display_page = max(0, min(self.page_count - 1, self._display_page))
        return self._display_page
620774
function TwoDeckStandSoft17(playerCards, dealerCard, handValue, handCount, dealerCheckedBlackjack, options)
{
    var result;
    const overrides = [
            {hand:[4,6,6], dealer: 10, action: "hit"},
            {hand:[3,6,7], dealer: 10, action: "hit"},
            {hand:[2,6,8], dealer: 10, action: "hit"},
            {hand:[1,6,9], dealer: 10, action: "hit"},
            {hand:[3,3,10], dealer: 10, action: "hit"},
            {hand:[2,2,6,6], dealer: 10, action: "hit"},
            {hand:[1,3,6,6], dealer: 10, action: "hit"},
            {hand:[1,2,6,7], dealer: 10, action: "hit"},
            {hand:[1,1,6,8], dealer: 10, action: "hit"},
            {hand:[2,2,2,10], dealer: 10, action: "hit"},
            {hand:[1,2,3,10], dealer: 10, action: "hit"},
            {hand:[4,4,4,4], dealer: 9, action: "stand"},
            {hand:[3,4,4,5], dealer: 9, action: "stand"},
            {hand:[3,3,5,5], dealer: 9, action: "stand"},
            {hand:[2,4,5,5], dealer: 9, action: "stand"},
            {hand:[1,5,5,5], dealer: 9, action: "stand"},
            {hand:[2,2,3,3,6], dealer: 10, action: "hit"},
            {hand:[1,1,1,6,7], dealer: 10, action: "hit"},
            {hand:[1,1,2,2,10], dealer: 10, action: "hit"},
            {hand:[1,1,2,6,6], dealer: 10, action: "hit"},
            {hand:[1,3,4,4,4], dealer: 9, action: "stand"},
            {hand:[2,2,4,4,4], dealer: 9, action: "stand"},
            {hand:[2,3,3,4,4], dealer: 9, action: "stand"},
            {hand:[3,3,3,3,4], dealer: 9, action: "stand"},
            {hand:[1,2,3,5,5], dealer: 9, action: "stand"},
            {hand:[1,2,4,4,5], dealer: 9, action: "stand"},
            {hand:[1,3,3,4,5], dealer: 9, action: "stand"},
            {hand:[2,2,2,5,5], dealer: 9, action: "stand"}, 
            {hand:[2,2,3,4,5], dealer: 9, action: "stand"},
            {hand:[2,3,3,3,5], dealer: 9, action: "stand"},
            {hand:[1,1,1,1,4,4], dealer: 3, action: "stand"},
            {hand:[1,1,2,4,4,4], dealer: 7, action: "stand"},
            {hand:[1,1,3,3,4,4], dealer: 7, action: "stand"},
            {hand:[1,2,2,3,4,4], dealer: 7, action: "stand"},
            {hand:[1,2,3,3,3,4], dealer: 7, action: "stand"},
            {hand:[1,3,3,3,3,3], dealer: 7, action: "stand"},
            {hand:[2,2,2,3,3,4], dealer: 7, action: "stand"},
            {hand:[2,2,3,3,3,3], dealer: 7, action: "stand"},
            {hand:[1,3,3,3,3,3], dealer: 8, action: "stand"},
            {hand:[2,2,3,3,3,3], dealer: 8, action: "stand"},
            {hand:[1,3,3,3,3,3], dealer: 9, action: "stand"},
            {hand:[2,2,3,3,3,3], dealer: 9, action: "stand"},
            {hand:[1,1,2,4,4,4], dealer: 9, action: "stand"},
            {hand:[1,1,3,3,4,4], dealer: 9, action: "stand"},
            {hand:[1,2,2,3,4,4], dealer: 9, action: "stand"},
            {hand:[1,2,3,3,3,4], dealer: 9, action: "stand"},
            {hand:[2,2,2,2,4,4], dealer: 9, action: "stand"},
            {hand:[2,2,2,3,3,4], dealer: 9, action: "stand"},
            {hand:[1,1,1,3,5,5], dealer: 9, action: "stand"},
            {hand:[1,1,1,4,4,5], dealer: 9, action: "stand"},
            {hand:[1,1,2,2,5,5], dealer: 9, action: "stand"},
            {hand:[1,1,2,3,4,5], dealer: 9, action: "stand"},
            {hand:[1,1,3,3,3,5], dealer: 9, action: "stand"},
            {hand:[1,2,2,2,4,5], dealer: 9, action: "stand"},
            {hand:[1,2,2,3,3,5], dealer: 9, action: "stand"},
            {hand:[2,2,2,2,3,5], dealer: 9, action: "stand"},
            {hand:[1,1,1,1,6,6], dealer: 10, action: "hit"},
            {hand:[1,2,2,2,3,6], dealer: 10, action: "hit"},
            {hand:[2,2,2,2,2,6], dealer: 10, action: "hit"},
        ];

    // Special case if there are two cards
    if (playerCards.length == 2)
    {
        if ((handValue.total == 11) && (dealerCard == 1) &&
            ((playerCards[0] == 2) || (playerCards[0] == 3) || (playerCards[0] == 8) || (playerCards[0] == 9)))
        {
            return "double";            
        }
        else if ((handValue.total == 12) && (dealerCard == 4) &&
                    ((playerCards[0] == 2) || (playerCards[0] == 10)))
        {
            return "hit";
        }
    }
    else // 3 or more cards
    {
        // Ace, Ace, 6 hits against dealer Ace
        if ((playerCards.length == 3) && (handValue.total == 18) && handValue.soft && (dealerCard == 1) &&
                    ((playerCards[0] == 6) || (playerCards[1] == 6) || (playerCards[2] == 6)))
        {
            return "hit";
        }
        else if ((playerCards.length == 6) || (handValue.total == 16))
        {
            result = FindExceptionInList(playerCards, dealerCard, overrides);
            if (result)
            {
                return result;
            }
        }
    
        // Three or more cards, 16 vs 10 stands and soft 18 vs Ace stands (except as noted in table which was already checked)
        if ((handValue.total == 16) && (dealerCard == 10))
        {
            return "stand";
        }
        if ((handValue.total == 18) && (handValue.soft) && (dealerCard == 1))
        {
            return "stand";
        }
    }

    return null;
 }
422237
def viewers(self, value):
        
        warnings.warn(
            _ASSIGNMENT_DEPRECATED_MSG.format("viewers", VIEWER_ROLE),
            DeprecationWarning,
        )
        self[VIEWER_ROLE] = value
62863
def cache_card(self, card):
        
        code = card.code
        self.card_cache[code] = card
        if code in self.card_cache_list:
            self.card_cache_list.remove(code)
        self.card_cache_list.append(code)

        if len(self.card_cache_list) > self.cachelimit:
            del self.card_cache[self.card_cache_list.pop(0)]
279864
def visible(self):
        
        return self.status not in (PublishStatus.DRAFT.value,
                                   PublishStatus.GONE.value)