Site content represents content for the entire site on a
        given election day.
178580
def site_content(self, election_day):
        
        from electionnight.models import PageType

        page_type = PageType.objects.get(
            model_type=ContentType.objects.get(
                app_label="election", model="electionday"
            ),
            election_day=election_day,
        )
        site_content = self.get(
            content_type=ContentType.objects.get_for_model(page_type),
            object_id=page_type.pk,
            election_day=election_day,
        )
        return {"site": self.serialize_content_blocks(site_content)}
839887
public void setTargetedContentMetadata(com.google.api.ads.admanager.axis.v201811.ContentMetadataKeyHierarchyTargeting[] targetedContentMetadata) {
        this.targetedContentMetadata = targetedContentMetadata;
    }
1214071
public function doViewContent()
    {
        $this->setDefaultResponseGroups( array( self::VIEWCONTENT_RESPONSEGROUP_METADATA ) );
        $isNodeRequested = false;
        if ( isset( $this->nodeId ) )
        {
            $content = ezpContent::fromNodeId( $this->nodeId );
            $isNodeRequested = true;
        }
        else if ( isset( $this->objectId ) )
        {
            $content = ezpContent::fromObjectId( $this->objectId );
        }

        $result = new ezpRestMvcResult();

        // translation parameter
        if ( $this->hasContentVariable( 'Translation' ) )
            $content->setActiveLanguage( $this->getContentVariable( 'Translation' ) );

        // Handle metadata
        if ( $this->hasResponseGroup( self::VIEWCONTENT_RESPONSEGROUP_METADATA ) )
        {
            $objectMetadata = ezpRestContentModel::getMetadataByContent( $content );
            if ( $isNodeRequested )
            {
                $nodeMetadata = ezpRestContentModel::getMetadataByLocation( ezpContentLocation::fetchByNodeId( $this->nodeId ) );
                $objectMetadata = array_merge( $objectMetadata, $nodeMetadata );
            }
            $result->variables['metadata'] = $objectMetadata;
        }

        // Handle locations if requested
        if ( $this->hasResponseGroup( self::VIEWCONTENT_RESPONSEGROUP_LOCATIONS ) )
        {
            $result->variables['locations'] = ezpRestContentModel::getLocationsByContent( $content );
        }

        // Handle fields content if requested
        if ( $this->hasResponseGroup( self::VIEWCONTENT_RESPONSEGROUP_FIELDS ) )
        {
            $result->variables['fields'] = ezpRestContentModel::getFieldsByContent( $content );
        }

        // Add links to fields resources
        $result->variables['links'] = ezpRestContentModel::getFieldsLinksByContent( $content, $this->request );

        if ( $outputFormat = $this->getContentVariable( 'OutputFormat' ) )
        {
            $renderer = ezpRestContentRenderer::getRenderer( $outputFormat, $content, $this );
            $result->variables['renderedOutput'] = $renderer->render();
        }

        return $result;
    }
550009
def index_as_xml(self):
        """"""
        self.default_capability()
        s = self.new_sitemap()
        return s.resources_as_xml(self, sitemapindex=True)
4119
public void setContentViewPivotX(float x) {
        if (DBG) Log.v(TAG, "setContentViewPivotX - x=" + x);
        mContentView.setPivotY(x);
    }
707160
function processRetrievedContent(content, filePrismicMetadata, queryKey, ctx) {
            if (content.results != null && content.results.length > 0) {
                var queryMetadata = filePrismicMetadata[queryKey];
                for (var i = 0; i < content.results.length; i++) {
                    var result = processRetrievedDocument(content.results[i], filePrismicMetadata, queryKey, ctx);
                    filePrismicMetadata[queryKey].results.push(result);
                }
            }
        }
437659
public synchronized void storeVote(MemberId vote) {
    log.trace("Store vote {}", vote);
    metadataBuffer.writeString(8, vote != null ? vote.id() : null).flush();
  }
645099
def save(self, *args, **kwargs):
        
        self.uid = '{}_{}_ballotmeasure:{}'.format(
            self.division.uid,
            self.election_day.uid,
            self.number
        )
        super(BallotMeasure, self).save(*args, **kwargs)
653027
protected function checkContent()
    {
        if (is_array($this->content) && count($this->content)) {
            foreach ($this->content as $name => $value) {
                switch ($name) {
                    case 'category':
                    case 'mainMessage':
                    case 'buttonMessage':
                    case 'language':
                        $this->addContentOption($name, $value);
                        break;
                    case 'mainParams':
                    case 'buttonParams':
                        $this->addParamsOption($name, $value);
                        break;
                }
            }
        }
    }
1186644
protected function registerAllLinks () : void
    {
        foreach ($this->_Candidates as $value) :
            $value->registerLink($this);
        endforeach;

        if ($this->_State > 1) :
            foreach ($this->_Votes as $value) :
                $value->registerLink($this);
            endforeach;
        endif;
    }
657314
def content(options = {}, &block)
      config.set_page_presenter :index, ActiveAdmin::PagePresenter.new(options, &block)
    end
655408
protected function outputContent()
    {
        foreach ($this->_html as $part) {
            if ($part instanceof Element) {
                $part->output();
            } else {
                echo $part;
            }
        }
    }
609817
function (pageConfig, contentId) {
            var outputContent = [];
            var content = pageConfig.contents.placeholderContents
                    ? pageConfig.contents.placeholderContents[contentId]
                    : null;
            if (!content) {
                return outputContent;
            }
            if (!ariaUtilsType.isArray(content)) {
                content = [content];
            }
            for (var i = 0, length = content.length; i < length; i++) {
                outputContent = outputContent.concat(this.processContent(content[i]));
            }
            return outputContent;
        }
597669
def generate_content
      content = ""

      if @issues.any?
        content += "#{@prefix}\n\n" unless @options[:simple_list] || @prefix.blank?
        @issues.each do |issue|
          merge_string = get_string_for_issue(issue)
          content += "- " unless @body_only
          content += "#{merge_string}\n"
        end
        content += "\n"
      end
      content
    end
586080
def explicit_content_filter=(filter_level)
      filter_level = FILTER_LEVELS[filter_level] if filter_level.is_a?(Symbol)

      update_server_data(explicit_content_filter: filter_level)
    end
561228
def bootstrap_executive_office_states(self, election):
        
        content_type = ContentType.objects.get_for_model(election.race.office)
        for division in Division.objects.filter(level=self.STATE_LEVEL):
            PageContent.objects.get_or_create(
                content_type=content_type,
                object_id=election.race.office.pk,
                election_day=election.election_day,
                division=division
            )
        # Create national presidential page type
        page_type, created = PageType.objects.get_or_create(
            model_type=ContentType.objects.get(
                app_label='government',
                model='office'
            ),
            election_day=election.election_day,
            division_level=self.NATIONAL_LEVEL,
            jurisdiction=self.FEDERAL_JURISDICTION,
            office=election.race.office,
        )
        PageContent.objects.get_or_create(
            content_type=ContentType.objects.get_for_model(page_type),
            object_id=page_type.pk,
            election_day=election.election_day,
        )
        # Create state results for president page type
        page_type, created = PageType.objects.get_or_create(
            model_type=ContentType.objects.get(
                app_label='government',
                model='office'
            ),
            election_day=election.election_day,
            division_level=self.STATE_LEVEL,
            jurisdiction=self.FEDERAL_JURISDICTION,
            office=election.race.office,
        )
        PageContent.objects.get_or_create(
            content_type=ContentType.objects.get_for_model(page_type),
            object_id=page_type.pk,
            election_day=election.election_day,
        )
712353
function handleVote(link) {
    if (!opts.voting) {
      showError("You'll need to login to vote.");
      return;
    }

    var id = link.attr('id');
    if (!id) {
      // Didn't click on one of the voting arrows.
      return;
    }
    // If it is an unvote, the new vote value is 0,
    // Otherwise it's 1 for an upvote, or -1 for a downvote.
    var value = 0;
    if (id.charAt(1) != 'u') {
      value = id.charAt(0) == 'u' ? 1 : -1;
    }
    // The data to be sent to the server.
    var d = {
      comment_id: id.substring(2),
      value: value
    };

    // Swap the vote and unvote links.
    link.hide();
    $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
      .show();

    // The div the comment is displayed in.
    var div = $('div#cd' + d.comment_id);
    var data = div.data('comment');

    // If this is not an unvote, and the other vote arrow has
    // already been pressed, unpress it.
    if ((d.value !== 0) && (data.vote === d.value * -1)) {
      $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
      $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
    }

    // Update the comments rating in the local data.
    data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
    data.vote = d.value;
    div.data('comment', data);

    // Change the rating text.
    div.find('.rating:first')
      .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));

    // Send the vote information to the server.
    $.ajax({
      type: "POST",
      url: opts.processVoteURL,
      data: d,
      error: function(request, textStatus, error) {
        showError('Oops, there was a problem casting that vote.');
      }
    });
  }