text:
<?php

namespace Converter;

/**
 * This class provides methods for converting between different measuers
 *
 * Conversion can only take place between one measurement-type. For instance
 * convertin a length into a volume does not make any sense.
 *
 * @category  Converter
 * @package   Converter
 * @author    Andreas Heigl<a.heigl@wdv.de>
 * @copyright 2011- Andreas Heigl
 * @license   http://www.opensource.org/licenses/mit-license.php MIT-License
 * @version   @__VERSION__@
 * @since     25.03.2011
 */
class Converter
{

    /**
     * The Object to convertr from
     *
     * @var \Converter\ObjectInterface $_object
     */
    protected $_object = null;

    /**
     * The Subject to convert to
     *
     * @var \Converter\SubjectIntreface $_subject
     */
    protected $_subject = null;

    /**
     * A list of filters to be applied
     *
     * @var FilterCollection $filtes
     */
    protected $filters;

    /**
     * Converter constructor.
     */
    public function __construct()
    {
        $this->filters = new FilterCollection();
    }

    /**
     * Set the Object for the conversion
     *
     * @param \Converter\ObjectInterface $object
     *
     * @throws \Converter\Exception\ConversionSpaceMissingException
     * @return \Converter\Converter
     */
    public function setObject(ObjectInterface $object)
    {
        if (!$object instanceof TypeInterface) {
            throw new Exception\ConversionSpaceMissingException(
                'No Conversion Space set'
            );
        }
        $this->_object = $object;
        return $this;
    }

    /**
     * Set the subject for the conversion
     *
     * @param \Converter\SubjectInterface $subject
     *
     * @throws \Converter\Exception\ConversionSpaceMissingException
     * @return \Converter\Converter
     */
    public function setSubject(SubjectInterface $subject)
    {
        if (!$subject instanceof TypeInterface) {
            throw new Exception\ConversionSpaceMissingException(
                'No Conversion Space set'
            );
        }
        $this->_subject = $subject;
        return $this;
    }

    /**
     * Alternate syntax for setting the object
     *
     * @param \Converter\ObjectInterface $object
     *
     * @throws \Converter\Exception\ConversionSpaceMissingException
     * @return \Converter\Converter
     */
    public function setFrom(ObjectInterface $object)
    {
        return $this->setObject($object);
    }

    /**
     * Alternate Syntax for setting the subject
     *
     * @param \Converter\SubjectInterface $subject
     *
     * @throws \Converter\Exception\ConversionSpaceMissingException
     * @return \Converter\Converter
     */
    public function setTo(SubjectInterface $subject)
    {
        return $this->setSubject($subject);
    }

    /**
     * Get the subject-instance
     *
     * @throws \Converter\Exception\MissingSubjectException
     * @return \Converter\SubjectInterface
     */
    public function getSubject()
    {
        if (!$this->_subject instanceof SubjectInterface) {
            throw new Exception\MissingSubjectException('No Subject given');
        }
        return $this->_subject;
    }

    /**
     * Get the object-instance
     *
     * @throws \Converter\Exception\MissingObjectException
     * @return \Converter\ObjectInterface
     */
    public function getObject()
    {
        if (!$this->_object instanceof ObjectInterface) {
            throw new Exception\MissingObjectException('No Object given');
        }
        return $this->_object;
    }

    /**
     * Add a filter to the filter-list
     *
     * @param \Converter\FilterInterface $filter
     *
     * @return void
     */
    public function addFilter(FilterInterface $filter)
    {
        $this->filters->addFilter($filter);
    }

    /**
     * Create a Converter with an Object and a subject
     *
     * @param \Converter\ObjectInterface $object
     * @param \Converter\SubjectInterface $subject
     *
     * @return \Converter\Converter
     */
    public static function factory(
            ObjectInterface $object,
            SubjectInterface $subject,
            FilterInterface $filter = null
           )
    {
        $obj = new Converter();
        $obj->setObject($object)
            ->setSubject($subject)
        ;
        if ($filter instanceof FilterInterface) {
            $obj->addFilter($filter);
        }
        return $obj;
    }

    /**
     * Do the actual conversion
     *
     * @param mixed $input
     *
     * @return mixed $output
     */
    public function convert($input)
    {
        $objImpl = class_implements($this->getObject());
        $subjImpl = class_implements($this->getSubject());
        $available = array(
            'Converter\Area\AreaInterface',
            'Converter\Calendar\CalendarInterface',
            'Converter\Color\ColorInterface',
            'Converter\Currency\CurrencyInterface',
            'Converter\DateTime\DateTimeInterface',
            'Converter\Force\ForceInterface',
            'Converter\Geo\GeoInterface',
            'Converter\Length\LengthInterface',
            'Converter\Temperature\TemperatureInterface',
            'Converter\Volume\VolumeInterface',
            'Converter\TestInterface',
        );
        $keys = array_intersect($available, $objImpl);
        $keys = array_values($keys);
        if (1 < count($keys)) {
            throw new Exception\ConversionSpaceMismatchException(
                'The Object has multiple Types'
            );
        }
        if (1 > count($keys)) {
            throw new Exception\ConversionSpaceMismatchException(
                'The Object has no Type'
            );
        }
        if ( ! isset($subjImpl[$keys[0]])) {
            throw new Exception\ConversionSpaceMismatchException(
                'The Object and the Subject are of different Types'
            );
        }

        // Do the actual conversion applying filters along the way
        $defaultMeasure = $this->getObject()->toDefault($input);

        $defaultMeasure = $this->filters->apply($defaultMeasure);

        return $this->getSubject()->fromDefault($defaultMeasure);
    }
}


text:
if(jQuery){
    console.log("jQuery already enabled, no need to inject it.");
    //myTableFunction();
    } else {
        (function(){
            //HOW TO ENABLE JQUERY IN THE VIEW USING CONSOLE COMMANDS BELOW
            jq = document.createElement('script');
            jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
        })();

document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type:
jQuery.noConflict();
//If the console response is:  "function (a,b){return new m.fn.init(a,b)}" jQuery has been enabled
//Set the jQuery commands to dollar sign by typing the following:
        $ = jQuery.noConflict();  //enables jQuery in noConflict mode in the even the
                                  //dollar sign was a preprocessor for another language.
//jQuery should now be enabled and function as if the page had loaded it using
//$(document).ready(function(){
//Your extended jQuery code now applies dynamically as if it was within here// })
// CHEERS! -MCH 01/28/2015 ;)
};

redpajama_set_name: RedPajamaGithub


text:
{{ ansible_managed | comment }}
## /etc/cron.daily/update_snort_rules.sh

mkdir -p /opt/mhn/rules
rm -f /opt/mhn/rules/mhn.rules.tmp
echo "[`date`] Updating snort signatures ..."
wget --no-check-certificate {{ server_url }}/static/mhn.rules -O /opt/mhn/rules/mhn.rules.tmp && \
    mv /opt/mhn/rules/mhn.rules.tmp /opt/mhn/rules/mhn.rules && \
    (supervisorctl update ; supervisorctl restart snort ) && \
    echo "[`date`] Successfully updated snort signatures" && \
    exit 0

echo "[`date`] Failed to update snort signatures"
exit 1


text:
package java.lang;

import org.jspecify.nullness.NullMarked;
import org.jspecify.nullness.Nullable;

/**
 * See <a
 * href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IndexOutOfBoundsException.html">the
 * official Java API doc</a> for details.
 */
@NullMarked
public class IndexOutOfBoundsException extends RuntimeException {

  public IndexOutOfBoundsException() {
  }

  public IndexOutOfBoundsException(@Nullable String message) {
    super(message);
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mappings
{
    public interface IRepositoryReader
    {
        int[] get_data();
    }
}


text:
package no.ntnu.assignmentsystem.editor.akka.messages;

import java.io.Serializable;

public class PluginReady implements Serializable {
	private static final long serialVersionUID = 1L;
}


text:
package lh.api.showcase.client.offers;

import lh.api.showcase.client.Messages;
import lh.api.showcase.client.UiUtils;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class OffersView extends Composite implements OffersPresenter.Display {

	private final Panel mainPanel = new FlowPanel() ;

	final private Button offersSeatMapsButton = new Button (Messages.Util.INSTANCE.get().seatMaps()) ;

	final protected Anchor backLink = new Anchor (Messages.Util.INSTANCE.get().back()) ;

	public OffersView () {
		super () ;

		mainPanel.setWidth("100%");
		mainPanel.add(new HTML ("<h1>" + Messages.Util.INSTANCE.get().offers() + "</h1>"));

		VerticalPanel panelV = new VerticalPanel () ;
		panelV.setWidth("100%");
		((HasHorizontalAlignment) panelV).setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

		Panel panel = new FlowPanel() ;
		panel.setStyleName("flowPanelMainMenuPage");

		Panel offersSeatMapsPanel = new FlowPanel();
		offersSeatMapsPanel.setStyleName("flowPanelVerRowMenuPage");
		offersSeatMapsPanel.add(UiUtils.setWidth(offersSeatMapsButton, 100.0, Unit.PCT));

		panel.add(offersSeatMapsPanel);

		backLink.setStyleDependentName("page", true);

		panelV.add(panel);
		mainPanel.add(panelV) ;
		mainPanel.add(getBottomNavigationPanel ()) ;

		initWidget(mainPanel);
	}

	protected Widget getBottomNavigationPanel () {
		VerticalPanel p = new VerticalPanel () ;
		p.setWidth("100%");
		((HasHorizontalAlignment) p).setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		p.getElement().getStyle().setMarginTop(30.0, Unit.PX);
		p.add(backLink);
		return p ;
	}

	@Override
	public Widget asWidget() {
		return this;
	}

	@Override
	public HasClickHandlers getSeatMapsHandler() {
		return offersSeatMapsButton;
	}

	@Override
	public HasClickHandlers getBackHandler() {
		return backLink;
	}
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.activiti.engine.impl.bpmn.parser.handler;

import org.activiti.engine.impl.Condition;
import org.activiti.engine.impl.bpmn.parser.BpmnParse;
import org.activiti.engine.impl.el.ExpressionManager;
import org.activiti.engine.impl.el.UelExpressionCondition;
import org.activiti.engine.impl.pvm.process.ActivityImpl;
import org.activiti.engine.impl.pvm.process.ScopeImpl;
import org.activiti.engine.impl.pvm.process.TransitionImpl;
import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.model.BaseElement;
import org.flowable.bpmn.model.SequenceFlow;
import org.flowable.common.engine.api.delegate.Expression;

/**
 * @author Joram Barrez
 */
public class SequenceFlowParseHandler extends AbstractBpmnParseHandler<SequenceFlow> {

    public static final String PROPERTYNAME_CONDITION = "condition";
    public static final String PROPERTYNAME_CONDITION_TEXT = "conditionText";

    @Override
    public Class<? extends BaseElement> getHandledType() {
        return SequenceFlow.class;
    }

    @Override
    protected void executeParse(BpmnParse bpmnParse, SequenceFlow sequenceFlow) {

        ScopeImpl scope = bpmnParse.getCurrentScope();

        ActivityImpl sourceActivity = scope.findActivity(sequenceFlow.getSourceRef());
        ActivityImpl destinationActivity = scope.findActivity(sequenceFlow.getTargetRef());

        Expression skipExpression;
        if (StringUtils.isNotEmpty(sequenceFlow.getSkipExpression())) {
            ExpressionManager expressionManager = bpmnParse.getExpressionManager();
            skipExpression = expressionManager.createExpression(sequenceFlow.getSkipExpression());
        } else {
            skipExpression = null;
        }

        TransitionImpl transition = sourceActivity.createOutgoingTransition(sequenceFlow.getId(), skipExpression);
        bpmnParse.getSequenceFlows().put(sequenceFlow.getId(), transition);
        transition.setProperty("name", sequenceFlow.getName());
        transition.setProperty("documentation", sequenceFlow.getDocumentation());
        transition.setDestination(destinationActivity);

        if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
            Condition expressionCondition = new UelExpressionCondition(sequenceFlow.getConditionExpression());
            transition.setProperty(PROPERTYNAME_CONDITION_TEXT, sequenceFlow.getConditionExpression());
            transition.setProperty(PROPERTYNAME_CONDITION, expressionCondition);
        }

        createExecutionListenersOnTransition(bpmnParse, sequenceFlow.getExecutionListeners(), transition);

    }

}


text:
<?php

class Owebia_Shipping2_Model_Os2_Data_Customer extends Owebia_Shipping2_Model_Os2_Data_AbstractWithAttributes
{
    protected $_additionalAttributes = array('*');

    public function __construct()
    {
        parent::__construct(
            array(
                'id' => Mage::getModel('owebia_shipping2/Os2_Data_Quote')->getData('customer_id'),
            )
        );
    }

    protected function _loadObject()
    {
        return Mage::getModel('customer/customer')->load($this->getData('id'));
    }

    public function __toString()
    {
        return $this->getData('firstname') . ' ' . $this->getData('lastname') . ' (id:' . $this->getData('id') . ')';
    }
}


text:
.PHONY: release install files test docs prepare publish

all:
	@echo "make release - prepares a release and publishes it"
	@echo "make dev - prepares a development environment (includes tests)"
	@echo "make instdev - prepares a development environment (no tests)"
	@echo "make install - install on local system"
	@echo "make files - update changelog and todo files"
	@echo "make test - run tox"
	@echo "make docs - build docs"
	@echo "prepare - prepare module for release (CURRENTLY IRRELEVANT)"
	@echo "make publish - upload to pypi"

release: files docs publish

dev: instdev test

instdev:
	pip install -rdev-requirements.txt
	python setup.py develop

install:
	python setup.py install

files:
	grep '# TODO' -rn * --exclude-dir=docs --exclude-dir=build --exclude=TODO.md | sed 's/: \+#/:    # /g;s/:#/:    # /g' | sed -e 's/^/- /' | grep -v Makefile > TODO.md
	git log --oneline --decorate --color > CHANGELOG

test:
	pip install tox==1.7.1
	tox

docs:
	pandoc README.md -f markdown -t rst -s -o README.rst

prepare:
	python scripts/make-release.py

publish:
	python setup.py sdist upload


text:
class Opportunity < ActiveRecord::Base
  include CoreModels

  belongs_to    :campaign
  belongs_to    :account
  belongs_to    :contact
end


text:
'use strict';

var gulp = require('gulp');

function test(done) {
  console.log('Testing');
  done();
}

gulp.task('test', test);

module.exports = gulp;


text:
#include "bgp/routing-instance/rtarget_group_mgr.h"

#include <boost/foreach.hpp>

#include <utility>

#include "base/map_util.h"
#include "base/set_util.h"
#include "base/task_annotations.h"
#include "base/task_trigger.h"
#include "bgp/bgp_config.h"
#include "bgp/bgp_peer.h"
#include "bgp/bgp_server.h"
#include "bgp/bgp_table.h"
#include "bgp/routing-instance/routing_instance.h"
#include "bgp/rtarget/rtarget_route.h"

using std::pair;

int RTargetGroupMgr::rtfilter_task_id_ = -1;

void VpnRouteState::AddRouteTarget(RTargetGroupMgr *mgr, int part_id,
    BgpRoute *rt, RTargetList::const_iterator it) {
    pair<RTargetList::iterator, bool> result;
    result = list_.insert(*it);
    assert(result.second);
    RtGroup *rtgroup = mgr->LocateRtGroup(*it);
    rtgroup->AddDepRoute(part_id, rt);
}

void VpnRouteState::DeleteRouteTarget(RTargetGroupMgr *mgr, int part_id,
    BgpRoute *rt, RTargetList::const_iterator it) {
    RtGroup *rtgroup = mgr->GetRtGroup(*it);
    rtgroup->RemoveDepRoute(part_id, rt);
    mgr->RemoveRtGroup(*it);
    list_.erase(it);
}

void RTargetState::AddInterestedPeer(RTargetGroupMgr *mgr, RtGroup *rtgroup,
    RTargetRoute *rt, RtGroup::InterestedPeerList::const_iterator it) {
    pair<RtGroup::InterestedPeerList::iterator, bool> result;
    result = list_.insert(*it);
    assert(result.second);
    rtgroup->AddInterestedPeer(it->first, rt);
    mgr->NotifyRtGroup(rtgroup->rt());
}

void RTargetState::DeleteInterestedPeer(RTargetGroupMgr *mgr, RtGroup *rtgroup,
    RTargetRoute *rt, RtGroup::InterestedPeerList::iterator it) {
    rtgroup->RemoveInterestedPeer(it->first, rt);
    mgr->NotifyRtGroup(rtgroup->rt());
    list_.erase(it);
}

RTargetGroupMgr::RTargetGroupMgr(BgpServer *server) : server_(server),
    rtarget_route_trigger_(new TaskTrigger(
           boost::bind(&RTargetGroupMgr::ProcessRTargetRouteList, this),
           TaskScheduler::GetInstance()->GetTaskId("bgp::RTFilter"), 0)),
    remove_rtgroup_trigger_(new TaskTrigger(
           boost::bind(&RTargetGroupMgr::ProcessRtGroupList, this),
           TaskScheduler::GetInstance()->GetTaskId("bgp::RTFilter"), 0)),
    rtarget_trigger_lists_(DB::PartitionCount()),
    master_instance_delete_ref_(this, NULL) {
    if (rtfilter_task_id_ == -1) {
        TaskScheduler *scheduler = TaskScheduler::GetInstance();
        rtfilter_task_id_ = scheduler->GetTaskId("bgp::RTFilter");
    }

    for (int i = 0; i < DB::PartitionCount(); i++) {
        rtarget_dep_triggers_.push_back(boost::shared_ptr<TaskTrigger>(new
               TaskTrigger(boost::bind(&RTargetGroupMgr::ProcessRouteTargetList,
                                       this, i),
               TaskScheduler::GetInstance()->GetTaskId("db::DBTable"), i)));
    }
}

void RTargetGroupMgr::RTargetPeerSync(BgpTable *table, RTargetRoute *rt,
    DBTableBase::ListenerId id, RTargetState *dbstate,
    const RtGroup::InterestedPeerList *future) {
    CHECK_CONCURRENCY("bgp::RTFilter");

    RouteTarget rtarget = rt->GetPrefix().rtarget();
    RtGroup *rtgroup = LocateRtGroup(rtarget);
    assert(rtgroup);

    map_synchronize(dbstate->GetMutableList(), future,
        boost::bind(&RTargetState::AddInterestedPeer, dbstate, this, rtgroup,
            rt, _1),
        boost::bind(&RTargetState::DeleteInterestedPeer, dbstate, this, rtgroup,
            rt, _1));

    if (dbstate->GetList()->empty()) {
        rt->ClearState(table, id);
        delete dbstate;
        RemoveRtGroup(rtarget);
    }
}

void RTargetGroupMgr::BuildRTargetDistributionGraph(BgpTable *table,
    RTargetRoute *rt, DBTableBase::ListenerId id) {
    CHECK_CONCURRENCY("bgp::RTFilter");

    RTargetState *dbstate =
        static_cast<RTargetState *>(rt->GetState(table, id));

    RtGroup::InterestedPeerList peer_list;

    if (rt->IsDeleted() || !rt->BestPath() ||
        !rt->BestPath()->IsFeasible()) {
        RTargetPeerSync(table, rt, id, dbstate, &peer_list);
        return;
    }

    for (Route::PathList::iterator it = rt->GetPathList().begin();
         it != rt->GetPathList().end(); it++) {
        BgpPath *path = static_cast<BgpPath *>(it.operator->());
        if (!path->IsFeasible())
            break;
        if (!path->GetPeer() || path->GetPeer()->IsXmppPeer())
            continue;

        const BgpPeer *peer = static_cast<const BgpPeer *>(path->GetPeer());
        std::pair<RtGroup::InterestedPeerList::iterator, bool> ret =
            peer_list.insert(std::pair<const BgpPeer *,
                 RtGroup::RTargetRouteList>(peer, RtGroup::RTargetRouteList()));
        assert(ret.second);
        ret.first->second.insert(rt);
    }

    RTargetPeerSync(table, rt, id, dbstate, &peer_list);
}

bool RTargetGroupMgr::ProcessRouteTargetList(int part_id) {
    CHECK_CONCURRENCY("db::DBTable");

    BOOST_FOREACH(const RouteTarget &rtarget, rtarget_trigger_lists_[part_id]) {
        RtGroup *rtgroup = GetRtGroup(rtarget);
        if (!rtgroup)
            continue;
        rtgroup->NotifyDepRoutes(part_id);
    }

    rtarget_trigger_lists_[part_id].clear();
    return true;
}

void RTargetGroupMgr::AddRouteTargetToLists(const RouteTarget &rtarget) {
    for (int idx = 0; idx < DB::PartitionCount(); ++idx) {
        rtarget_trigger_lists_[idx].insert(rtarget);
        rtarget_dep_triggers_[idx]->Set();
    }
}

void RTargetGroupMgr::DisableRouteTargetProcessing() {
    for (int idx = 0; idx < DB::PartitionCount(); ++idx) {
        rtarget_dep_triggers_[idx]->set_disable();
    }
}

void RTargetGroupMgr::EnableRouteTargetProcessing() {
    for (int idx = 0; idx < DB::PartitionCount(); ++idx) {
        rtarget_dep_triggers_[idx]->set_enable();
    }
}

bool RTargetGroupMgr::IsRouteTargetOnList(const RouteTarget &rtarget) const {
    for (int idx = 0; idx < DB::PartitionCount(); ++idx) {
        if (rtarget_trigger_lists_[idx].find(rtarget) !=
            rtarget_trigger_lists_[idx].end()) {
            return true;
        }
    }
    return false;
}

bool RTargetGroupMgr::ProcessRTargetRouteList() {
    CHECK_CONCURRENCY("bgp::RTFilter");

    RoutingInstanceMgr *mgr = server()->routing_instance_mgr();
    RoutingInstance *master =
        mgr->GetRoutingInstance(BgpConfigManager::kMasterInstance);
    BgpTable *table = master->GetTable(Address::RTARGET);

    // Get the Listener id
    DBTableBase::ListenerId id = GetListenerId(table);

    for (RTargetRouteTriggerList::iterator it = rtarget_route_list_.begin();
         it != rtarget_route_list_.end(); it++) {
        BuildRTargetDistributionGraph(table, *it, id);
    }

    rtarget_route_list_.clear();
    return true;
}

void RTargetGroupMgr::DisableRTargetRouteProcessing() {
    rtarget_route_trigger_->set_disable();
}

void RTargetGroupMgr::EnableRTargetRouteProcessing() {
    rtarget_route_trigger_->set_enable();
}

bool RTargetGroupMgr::IsRTargetRouteOnList(RTargetRoute *rt) const {
    return rtarget_route_list_.find(rt) != rtarget_route_list_.end();
}

void RTargetGroupMgr::Initialize() {
    assert(table_state_.empty());
    RoutingInstanceMgr *mgr = server()->routing_instance_mgr();
    RoutingInstance *master =
        mgr->GetRoutingInstance(BgpConfigManager::kMasterInstance);
    assert(master);

    master_instance_delete_ref_.Reset(master->deleter());

    RoutingInstance::RouteTableList const table_list = master->GetTables();
    DBTableBase::ListenerId id;
    RtGroupMgrTableState *ts = NULL;
    for (RoutingInstance::RouteTableList::const_iterator it =
         table_list.begin(); it != table_list.end(); ++it) {
        if (!it->second->IsVpnTable()) continue;

        BgpTable *vpntable = it->second;
        id = vpntable->Register(
            boost::bind(&RTargetGroupMgr::VpnRouteNotify, this, _1, _2),
            "RTargetGroupMgr");
        ts = new RtGroupMgrTableState(vpntable, id);
        table_state_.insert(std::make_pair(vpntable, ts));
    }

    BgpTable *rttable = master->GetTable(Address::RTARGET);
    id = rttable->Register(
        boost::bind(&RTargetGroupMgr::RTargetRouteNotify, this, _1, _2),
        "RTargetGroupMgr");
    ts = new RtGroupMgrTableState(rttable, id);
    table_state_.insert(std::make_pair(rttable, ts));
}

void RTargetGroupMgr::ManagedDelete() {
    if (rtgroup_map_.empty()) remove_rtgroup_trigger_->Set();
}

void
RTargetGroupMgr::RTargetDepSync(DBTablePartBase *root, BgpRoute *rt,
                                DBTableBase::ListenerId id,
                                VpnRouteState *dbstate,
                                const VpnRouteState::RTargetList *future) {
    CHECK_CONCURRENCY("db::DBTable");

    BgpTable *table = static_cast<BgpTable *>(root->parent());
    if (!dbstate) {
        dbstate = new VpnRouteState();
        rt->SetState(table, id, dbstate);
    }

    int part_id = root->index();
    set_synchronize(dbstate->GetMutableList(), future,
        boost::bind(
            &VpnRouteState::AddRouteTarget, dbstate, this, part_id, rt, _1),
        boost::bind(
            &VpnRouteState::DeleteRouteTarget, dbstate, this, part_id, rt, _1));

    if (dbstate->GetList()->empty()) {
        rt->ClearState(root->parent(), id);
        delete dbstate;
    }
}

DBTableBase::ListenerId RTargetGroupMgr::GetListenerId(BgpTable *table) {
    RtGroupMgrTableStateList::iterator loc = table_state_.find(table);
    assert(loc != table_state_.end());
    RtGroupMgrTableState *ts = loc->second;
    DBTableBase::ListenerId id = ts->GetListenerId();
    assert(id != DBTableBase::kInvalidId);
    return id;
}

bool RTargetGroupMgr::VpnRouteNotify(DBTablePartBase *root,
                                     DBEntryBase *entry) {
    CHECK_CONCURRENCY("db::DBTable");

    BgpTable *table = static_cast<BgpTable *>(root->parent());
    BgpRoute *rt = static_cast<BgpRoute *>(entry);
    // Get the Listener id
    DBTableBase::ListenerId id = GetListenerId(table);

    // Get the dbstate
    VpnRouteState *dbstate =
        static_cast<VpnRouteState *>(rt->GetState(table, id));

    VpnRouteState::RTargetList list;

    if (entry->IsDeleted() || !rt->BestPath() ||
        !rt->BestPath()->IsFeasible()) {
        if (!dbstate)
            return true;
        RTargetDepSync(root, rt, id, dbstate, &list);
        return true;
    }

    const BgpPath *path = rt->BestPath();
    const BgpAttr *attr = path->GetAttr();
    const ExtCommunity *ext_community = attr->ext_community();

    if (ext_community) {
        // Gather all Route Target
        BOOST_FOREACH(const ExtCommunity::ExtCommunityValue &comm,
                      ext_community->communities()) {
            if (ExtCommunity::is_route_target(comm)) {
                list.insert(RouteTarget(comm));
            }
        }
    }

    RTargetDepSync(root, rt, id, dbstate, &list);
    return true;
}

bool RTargetGroupMgr::RTargetRouteNotify(DBTablePartBase *root,
                                         DBEntryBase *entry) {
    CHECK_CONCURRENCY("db::DBTable");

    BgpTable *table = static_cast<BgpTable *>(root->parent());
    RTargetRoute *rt = static_cast<RTargetRoute *>(entry);
    // Get the Listener id
    DBTableBase::ListenerId id = GetListenerId(table);

    // Get the dbstate
    RTargetState *dbstate =
        static_cast<RTargetState *>(rt->GetState(table, id));

    if (!dbstate) {
        if (rt->IsDeleted()) return true;
        dbstate = new RTargetState();
        rt->SetState(table, id, dbstate);
    }
    if (rtarget_route_list_.empty())
        rtarget_route_trigger_->Set();
    rtarget_route_list_.insert(rt);
    return true;
}

RTargetGroupMgr::~RTargetGroupMgr() {
    assert(rtgroup_map_.empty());
}

// Search a RtGroup
RtGroup *RTargetGroupMgr::GetRtGroup(const RouteTarget &rt) {
    tbb::mutex::scoped_lock lock(mutex_);
    RtGroupMap::iterator loc = rtgroup_map_.find(rt);
    if (loc != rtgroup_map_.end()) {
        return loc->second;
    }
    return NULL;
}

// Search a RtGroup
RtGroup *RTargetGroupMgr::GetRtGroup(const ExtCommunity::ExtCommunityValue
                                        &community) {
    RouteTarget rt(community);
    return GetRtGroup(rt);
}

RtGroup *RTargetGroupMgr::LocateRtGroup(const RouteTarget &rt) {
    tbb::mutex::scoped_lock lock(mutex_);
    RtGroupMap::iterator loc = rtgroup_map_.find(rt);
    RtGroup *group = (loc != rtgroup_map_.end()) ? loc->second : NULL;
    if (group == NULL) {
        group = new RtGroup(rt);
        rtgroup_map_.insert(rt, group);
    }
    return group;
}

void RTargetGroupMgr::NotifyRtGroup(const RouteTarget &rt) {
    AddRouteTargetToLists(rt);
    if (!rt.IsNull())
        return;

    for (RtGroupMgrTableStateList::iterator it = table_state_.begin();
         it != table_state_.end(); ++it) {
        BgpTable *table = it->first;
        if (!table->IsVpnTable())
            continue;
        table->NotifyAllEntries();
    }
}

void RTargetGroupMgr::RemoveRtGroup(const RouteTarget &rt) {
    tbb::mutex::scoped_lock lock(mutex_);
    RtGroupMap::iterator loc = rtgroup_map_.find(rt);
    RtGroup *rtgroup = (loc != rtgroup_map_.end()) ? loc->second : NULL;
    assert(rtgroup);

    rtgroup_remove_list_.insert(rtgroup);
    remove_rtgroup_trigger_->Set();
}

void RTargetGroupMgr::GetRibOutInterestedPeers(RibOut *ribout,
             const ExtCommunity *ext_community,
             const RibPeerSet &peerset, RibPeerSet *new_peerset) {
    RtGroupInterestedPeerSet peer_set;
    RtGroup *null_rtgroup = GetRtGroup(RouteTarget::null_rtarget);
    if (null_rtgroup) peer_set = null_rtgroup->GetInterestedPeers();
    BOOST_FOREACH(const ExtCommunity::ExtCommunityValue &comm,
                  ext_community->communities()) {
        if (ExtCommunity::is_route_target(comm)) {
            RtGroup *rtgroup = GetRtGroup(comm);
            if (!rtgroup) continue;
            peer_set |= rtgroup->GetInterestedPeers();
        }
    }
    RibOut::PeerIterator iter(ribout, peerset);
    while (iter.HasNext()) {
        int current_index = iter.index();
        IPeerUpdate *peer = iter.Next();
        BgpPeer *tmp = dynamic_cast<BgpPeer *>(peer);
        assert(tmp);
        if (tmp->IsFamilyNegotiated(Address::RTARGET)) {
            if (!peer_set.test(tmp->GetIndex())) {
                new_peerset->reset(current_index);
            }
        }
    }
}

void RTargetGroupMgr::UnregisterTables() {
    CHECK_CONCURRENCY("bgp::RTFilter");

    if (rtgroup_map_.empty()) {
        RoutingInstanceMgr *mgr = server()->routing_instance_mgr();
        RoutingInstance *master =
            mgr->GetRoutingInstance(BgpConfigManager::kMasterInstance);
        if (master && master->deleted()) {
            for (RtGroupMgrTableStateList::iterator it =
                 table_state_.begin(), itnext; it != table_state_.end();
                 it = itnext) {
                itnext = it;
                itnext++;
                RtGroupMgrTableState *ts = it->second;
                DBTableBase::ListenerId id = ts->GetListenerId();
                BgpTable *bgptable = it->first;
                bgptable->Unregister(id);
                table_state_.erase(it);
                delete ts;
            }
            master_instance_delete_ref_.Reset(NULL);
        }
    }
}

bool RTargetGroupMgr::ProcessRtGroupList() {
    CHECK_CONCURRENCY("bgp::RTFilter");
    BOOST_FOREACH(RtGroup *rtgroup, rtgroup_remove_list_) {
        if (!rtgroup->MayDelete())
            continue;
        RouteTarget rt = rtgroup->rt();
        rtgroup_map_.erase(rt);
    }
    rtgroup_remove_list_.clear();

    if (rtgroup_map_.empty()) UnregisterTables();

    return true;
}

void RTargetGroupMgr::DisableRtGroupProcessing() {
    remove_rtgroup_trigger_->set_disable();
}

void RTargetGroupMgr::EnableRtGroupProcessing() {
    remove_rtgroup_trigger_->set_enable();
}

bool RTargetGroupMgr::IsRtGroupOnList(RtGroup *rtgroup) const {
    return rtgroup_remove_list_.find(rtgroup) != rtgroup_remove_list_.end();
}

RtGroupMgrTableState::RtGroupMgrTableState(BgpTable *table,
                                           DBTableBase::ListenerId id)
    : id_(id), table_delete_ref_(this, table->deleter()) {
    assert(table->deleter() != NULL);
}

RtGroupMgrTableState::~RtGroupMgrTableState() {
}

void RtGroupMgrTableState::ManagedDelete() {
}


text:
title: "Getting started"
sort: 0
preview: 'How to download and start using Antwar.'
layout: 'docs'
headerImage: 'https://unsplash.imgix.net/photo-1422513391413-ddd4f2ce3340?q=75&fm=jpg&s=282e5978de17d6cd2280888d16f06f04'
---

Follow these steps to create your Antwar site.

1\. Set up a project (`mkdir demo && cd demo && npm init -y`)

2\. Install Antwar core

```bash
npm i antwar -D
```

3\. Create a bootstrap script. This will be used to run the site.

**antwar.bootstrap.js**

<!-- EMBED require('!!raw-loader!highlight-loader!../../../smoketest/antwar.bootstrap.js') -->

4\. Set up scripts to run it

**package.json**

```json
{
  "scripts": {
    "start": "node ./antwar.bootstrap.js develop",
    "build": "node ./antwar.bootstrap.js build"
  },
  ...
}
```

5\. Set up Antwar and webpack configuration. See the documentation and the [Antwar repository](https://github.com/antwarjs/antwar) (`site/` and `smoketest/` directories) for reference.

6\. Add initial content and start developing.


text:
package storage::quantum::dxi::ssh::mode::dedupnas;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;
use DateTime;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);

sub custom_status_output {
    my ($self, %options) = @_;

    return sprintf(
        "Status is '%s' [State: %s], Duration: %s, Percent complete: %s%%",
        $self->{result_values}->{status}, $self->{result_values}->{state},
        centreon::plugins::misc::change_seconds(value => $self->{result_values}->{duration}),
        $self->{result_values}->{percent_complete}
    );
}

sub custom_status_calc {
    my ($self, %options) = @_;

    $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'};
    $self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'};
    $self->{result_values}->{start_time} = $options{new_datas}->{$self->{instance} . '_start_time'};
    $self->{result_values}->{completion_time} = $options{new_datas}->{$self->{instance} . '_completion_time'};
    $self->{result_values}->{percent_complete} = $options{new_datas}->{$self->{instance} . '_percent_complete'};

    my ($start, $end);
    my %months = ("Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12);
    if (defined($self->{result_values}->{start_time}) && $self->{result_values}->{start_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) { # Mon Jan  1 13:01:23 2018 or Mon Jan 15 13:01:23
        $start = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
    }
    if (defined($self->{result_values}->{completion_time}) && $self->{result_values}->{completion_time} =~ /^(\w+)\s(\w+)\s+(\d+)\s(\d+):(\d+):(\d+)\s(\d+)$/) {
        $end = DateTime->new(year => $7, month => $months{$2}, day => $3, hour => $4, minute => $5, second => $6);
    }

    $self->{result_values}->{duration} = 0;
    $self->{result_values}->{duration} = $end->epoch() - $start->epoch() if (defined($end));
    $self->{result_values}->{duration} = time() - $start->epoch() if (defined($start) && !defined($end));

    return 0;
}

sub prefix_output {
    my ($self, %options) = @_;

    return "NAS deduplication '" . $options{instance_value}->{name} . "' ";
}

sub set_counters {
    my ($self, %options) = @_;

    $self->{maps_counters_type} = [
        { name => 'global', type => 1, cb_prefix_output => 'prefix_output', message_multiple => 'All NAS deduplication are ok', message_separator => ' - ' },
    ];

    $self->{maps_counters}->{global} = [
        { label => 'status', threshold => 0, set => {
                key_values => [ { name => 'status' }, { name => 'state' }, { name => 'start_time' },
                    { name => 'completion_time' }, { name => 'percent_complete' }, { name => 'name' } ],
                closure_custom_calc => $self->can('custom_status_calc'),
                closure_custom_output => $self->can('custom_status_output'),
                closure_custom_perfdata => sub { return 0; },
                closure_custom_threshold_check => \&catalog_status_threshold,
            }
        },
        { label => 'original-data-size', set => {
                key_values => [ { name => 'original_size' }, { name => 'name' }  ],
                output_template => 'Original data size: %s %s',
                output_change_bytes => 1,
                perfdatas => [
                    { label => 'original_data_size', value => 'original_size', template => '%d',
                      unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'name' },
                ],
            }
        },
        { label => 'sent-data-size', set => {
                key_values => [ { name => 'sent_size' }, { name => 'name' }  ],
                output_template => 'Sent data size: %s %s',
                output_change_bytes => 1,
                perfdatas => [
                    { label => 'sent_data_size', value => 'sent_size', template => '%d',
                      unit => 'B', min => 0, label_extra_instance => 1, instance_use => 'name' },
                ],
            }
        },
    ];
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $options{options}->add_options(arguments => {
        'warning-status:s'  => { name => 'warning_status', default => '%{state} !~ /Enabled/i' },
        'critical-status:s' => { name => 'critical_status', default => '' },
    });

    return $self;
}

sub check_options {
    my ($self, %options) = @_;
    $self->SUPER::check_options(%options);

    $self->change_macros(macros => ['warning_status', 'critical_status']);
}

sub manage_selection {
    my ($self, %options) = @_;

    my $stdout = $options{custom}->execute_command(command => 'syscli --list dedupnas');
    # Output data:
    # List of all deduped NAS on source:
    # Total count = 2
    # [dedupnas = 1]
    #     NAS share name = backup1
    #     Replication type  = SYNCHRONIZATION
    #     Replication state = Enabled
    #     Replication sync id = backup
    #     Replication target = 1.2.3.4
    #     Replication start = Mon Jan 01 12:56:31 2018
    #     Replication completion = Mon Jan 01 13:04:49 2018
    #     Replication status = SUCCESS
    #     Percent complete = 0
    #     Estimated completion time = No time remaining.
    #     Original data size = 24876159193
    #     Actual data sent = 4179216
    #     Average data sent = 438223
    # [dedupnas = 2]
    #     NAS share name = backup2
    #     Replication type  = NONE
    #     Replication state = Disabled
    #     Replication sync id =
    #     Replication target =
    #     Replication start =
    #     Replication completion =
    #     Replication status =
    #     Percent complete = 0
    #     Estimated completion time =
    #     Original data size = 0
    #     Actual data sent = 0
    #     Average data sent = 0

    $self->{global} = {};
    my $id;
    foreach (split(/\n/, $stdout)) {
        $id = $1 if (/.*\[dedupnas\s=\s(.*)\]$/i);
        $self->{global}->{$id}->{name} = $1 if (/.*NAS\sshare\sname\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{state} = $1 if (/.*Replication\sstate\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{start_time} = $1 if (/.*Replication\sstart\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{completion_time} = $1 if (/.*Replication\scompletion\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{status} = $1 if (/.*Replication\sstatus\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{percent_complete} = $1 if (/.*Percent\scomplete\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{original_size} = $1 if (/.*Original\sdata\ssize\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{sent_size} = $1 if (/.*Actual\sdata\ssent\s=\s(.*)$/i && defined($id) && $id ne '');
        $self->{global}->{$id}->{status} = "-" if (defined($id) && $id ne '' && !defined($self->{global}->{$id}->{status}));
        $self->{global}->{$id}->{start_time} = "-" if (defined($id) && !defined($self->{global}->{$id}->{start_time}));
        $self->{global}->{$id}->{completion_time} = "-" if (defined($id) && !defined($self->{global}->{$id}->{completion_time}));
    }
}

1;

__END__

=head1 MODE

Check deduped NAS on source.

=over 8

=item B<--filter-counters>

Only display some counters (regexp can be used).
Example: --filter-counters='status'

=item B<--warning-status>

Set warning threshold for status (Default: '%{state} !~ /Enabled/i').
Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}.

=item B<--critical-status>

Set critical threshold for status (Default: '').
Can used special variables like: %{status}, %{state}, %{duration}, %{percent_complete}.

=item B<--warning-*> B<--critical-*>

Thresholds.
Can be: 'original-data-size', 'sent-data-size'.

=back

=cut


text:
import { EVENT_HANDLERS_KEY } from "./addEventListener.js";

export default function removeEventListener(eventHandle) {
	const { target } = eventHandle;
	if (target) {
		target[EVENT_HANDLERS_KEY].delete(eventHandle);
	}
}


text:
<?php
namespace Idea\AdministradorBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Idea\AdministradorBundle\Entity;

class EstacionRedType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options){

        $builder
            ->add('estacion', 'entity', array('class' => 'IdeaAdministradorBundle:Estacion',
                'empty_value' => 'Seleccionar', 'property' => 'nombre', 'label' => 'Estación'))
            ->add('habilitada', 'checkbox', array('required' => false, 'label' => 'Habilitado'));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'idea_administradorBundle_estacionRed';
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver){
        $resolver->setDefaults(array(
            'data_class' => 'Idea\AdministradorBundle\Entity\EstacionRed'
        ));
    }

}


text:
package lk.ac.cmb.ucsc.mcs.ewa.repository;

import java.util.List;

import org.springframework.data.repository.CrudRepository;

import lk.ac.cmb.ucsc.mcs.ewa.entity.Patient;

public interface PatientRepository extends CrudRepository<Patient, Long> {

    Patient findByUsername(String username);

    List<Patient> findByFirstNameContainingIgnoreCase(String firstName);

    List<Patient> findByLastNameContainingIgnoreCase(String lastName);

    List<Patient> findByFirstNameContainingAndLastNameContainingAllIgnoreCase(String firstName, String lastName);

}


text:
<?php

namespace FornecedoresBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class FornecedoresBundle extends Bundle
{
}


text:
double ramp(const lwt::Input& in, std::size_t pos, std::size_t n_entries);

// 2d ramp function, corners in (x, y) are (-1, -1), (1, 1), linear
// interpolation in the grid between. This can be reproduced in numpy
// with
//
// np.linspace(-1, 1, 20)[:,None] * np.linspace(-1, 1, n_features)[None,:]
//
double ramp(const lwt::Input& in, std::size_t x, std::size_t y,
            std::size_t n_x, std::size_t n_y);

lwt::VectorMap get_values_vec(const std::vector<lwt::Input>& inputs,
                                std::size_t n_patterns);

std::vector<std::string> parse_line(std::string& line);

#endif


text:
package org.wso2.carbon.apimgt.core.impl;

import feign.Response;
import feign.gson.GsonDecoder;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wso2.carbon.apimgt.core.api.KeyManager;
import org.wso2.carbon.apimgt.core.auth.DCRMServiceStub;
import org.wso2.carbon.apimgt.core.auth.DCRMServiceStubFactory;
import org.wso2.carbon.apimgt.core.auth.OAuth2ServiceStubs;
import org.wso2.carbon.apimgt.core.auth.OAuth2ServiceStubsFactory;
import org.wso2.carbon.apimgt.core.auth.dto.DCRClientInfo;
import org.wso2.carbon.apimgt.core.auth.dto.DCRError;
import org.wso2.carbon.apimgt.core.auth.dto.OAuth2IntrospectionResponse;
import org.wso2.carbon.apimgt.core.auth.dto.OAuth2TokenInfo;
import org.wso2.carbon.apimgt.core.exception.APIManagementException;
import org.wso2.carbon.apimgt.core.exception.ExceptionCodes;
import org.wso2.carbon.apimgt.core.exception.KeyManagementException;
import org.wso2.carbon.apimgt.core.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.core.models.API;
import org.wso2.carbon.apimgt.core.models.AccessTokenInfo;
import org.wso2.carbon.apimgt.core.models.AccessTokenRequest;
import org.wso2.carbon.apimgt.core.models.KeyManagerConfiguration;
import org.wso2.carbon.apimgt.core.models.OAuthAppRequest;
import org.wso2.carbon.apimgt.core.models.OAuthApplicationInfo;
import org.wso2.carbon.apimgt.core.util.APIMgtConstants;
import org.wso2.carbon.apimgt.core.util.KeyManagerConstants;

import java.io.IOException;
import java.util.Map;

/**
 * This class holds the key manager implementation considering WSO2 as the identity provider
 * This is the default key manager supported by API Manager
 */
public class DefaultKeyManagerImpl implements KeyManager {
    private static final Logger log = LoggerFactory.getLogger(DefaultKeyManagerImpl.class);

    private DCRMServiceStub dcrmServiceStub;
    private OAuth2ServiceStubs oAuth2ServiceStubs;

    /**
     * Default Constructor
     *
     * @throws APIManagementException if error occurred while instantiating DefaultKeyManagerImpl
     */
    public DefaultKeyManagerImpl() throws APIManagementException {
        this(DCRMServiceStubFactory.getDCRMServiceStub(), OAuth2ServiceStubsFactory.getOAuth2ServiceStubs());
    }

    /**
     * Constructor
     *
     * @param dcrmServiceStub    Service stub for DCR(M) service
     * @param oAuth2ServiceStubs Service stub for OAuth2 services
     * @throws APIManagementException if error occurred while instantiating DefaultKeyManagerImpl
     */
    public DefaultKeyManagerImpl(DCRMServiceStub dcrmServiceStub, OAuth2ServiceStubs oAuth2ServiceStubs)
            throws APIManagementException {
        this.dcrmServiceStub = dcrmServiceStub;
        this.oAuth2ServiceStubs = oAuth2ServiceStubs;
    }

    @Override
    public OAuthApplicationInfo createApplication(OAuthAppRequest oauthAppRequest) throws KeyManagementException {
        if (log.isDebugEnabled()) {
            log.debug("Creating OAuth2 application: " + oauthAppRequest.toString());
        }

        String applicationName = oauthAppRequest.getClientName();
        String keyType = oauthAppRequest.getKeyType();
        if (keyType != null) {  //Derive oauth2 app name based on key type and user input for app name
            applicationName = applicationName + '_' + keyType;
        }

        DCRClientInfo dcrClientInfo = new DCRClientInfo();
        dcrClientInfo.setClientName(applicationName);
        dcrClientInfo.setGrantTypes(oauthAppRequest.getGrantTypes());
        dcrClientInfo.addCallbackUrl(oauthAppRequest.getCallBackURL());
        dcrClientInfo.setUserinfoSignedResponseAlg(ServiceReferenceHolder.getInstance().getAPIMConfiguration()
                .getKeyManagerConfigs().getOidcUserinfoJWTSigningAlgo());

        Response response = dcrmServiceStub.registerApplication(dcrClientInfo);
        if (response == null) {
            throw new KeyManagementException("Error occurred while DCR application creation. Response is null",
                    ExceptionCodes.OAUTH2_APP_CREATION_FAILED);
        }
        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_201_CREATED) {  //201 - Success
            try {
                OAuthApplicationInfo oAuthApplicationInfoResponse = getOAuthApplicationInfo(response);
                //setting original parameter list
                oAuthApplicationInfoResponse.setParameters(oauthAppRequest.getParameters());
                if (log.isDebugEnabled()) {
                    log.debug("OAuth2 application created: " + oAuthApplicationInfoResponse.toString());
                }
                return oAuthApplicationInfoResponse;
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing the DCR application creation response " +
                        "message.", e, ExceptionCodes.OAUTH2_APP_CREATION_FAILED);
            }
        } else if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_400_BAD_REQUEST) {  //400 - Known Error
            try {
                DCRError error = (DCRError) new GsonDecoder().decode(response, DCRError.class);
                throw new KeyManagementException("Error occurred while DCR application creation. Error: " +
                        error.getError() + ". Error Description: " + error.getErrorDescription() + ". Status Code: " +
                        response.status(), ExceptionCodes.OAUTH2_APP_CREATION_FAILED);
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing the DCR error message.", e,
                        ExceptionCodes.OAUTH2_APP_CREATION_FAILED);
            }
        } else {  //Unknown Error
            throw new KeyManagementException("Error occurred while DCR application creation. Error: " +
                    response.body().toString() + " Status Code: " + response.status(),
                    ExceptionCodes.OAUTH2_APP_CREATION_FAILED);
        }
    }

    @Override
    public OAuthApplicationInfo updateApplication(OAuthApplicationInfo oAuthApplicationInfo)
            throws KeyManagementException {
        if (log.isDebugEnabled()) {
            log.debug("Updating OAuth2 application with : " + oAuthApplicationInfo.toString());
        }

        String applicationName = oAuthApplicationInfo.getClientName();
        String keyType = (String) oAuthApplicationInfo.getParameter(KeyManagerConstants.APP_KEY_TYPE);
        if (keyType != null) {  //Derive oauth2 app name based on key type and user input for app name
            applicationName = applicationName + '_' + keyType;
        }

        DCRClientInfo dcrClientInfo = new DCRClientInfo();
        dcrClientInfo.setClientName(applicationName);
        dcrClientInfo.setClientId(oAuthApplicationInfo.getClientId());
        dcrClientInfo.setClientSecret(oAuthApplicationInfo.getClientSecret());
        dcrClientInfo.addCallbackUrl(oAuthApplicationInfo.getCallBackURL());
        dcrClientInfo.setGrantTypes(oAuthApplicationInfo.getGrantTypes());

        Response response = dcrmServiceStub.updateApplication(dcrClientInfo, dcrClientInfo.getClientId());
        if (response == null) {
            throw new KeyManagementException("Error occurred while updating DCR application. Response is null",
                    ExceptionCodes.OAUTH2_APP_UPDATE_FAILED);
        }
        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_200_OK) {   //200 - Success
            try {
                OAuthApplicationInfo oAuthApplicationInfoResponse = getOAuthApplicationInfo(response);
                //setting original parameter list
                oAuthApplicationInfoResponse.setParameters(oAuthApplicationInfo.getParameters());
                if (log.isDebugEnabled()) {
                    log.debug("OAuth2 application updated: " + oAuthApplicationInfoResponse.toString());
                }
                return oAuthApplicationInfoResponse;
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing the DCR application update response " +
                        "message.", e, ExceptionCodes.OAUTH2_APP_UPDATE_FAILED);
            }
        } else if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_400_BAD_REQUEST) {  //400 - Known Error
            try {
                DCRError error = (DCRError) new GsonDecoder().decode(response, DCRError.class);
                throw new KeyManagementException("Error occurred while updating DCR application. Error: " +
                        error.getError() + ". Error Description: " + error.getErrorDescription() + ". Status Code: " +
                        response.status(), ExceptionCodes.OAUTH2_APP_UPDATE_FAILED);
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing the DCR error message.", e,
                        ExceptionCodes.OAUTH2_APP_UPDATE_FAILED);
            }
        } else {  //Unknown Error
            throw new KeyManagementException("Error occurred while updating DCR application. Error: " +
                    response.body().toString() + " Status Code: " + response.status(),
                    ExceptionCodes.OAUTH2_APP_UPDATE_FAILED);
        }
    }

    @Override
    public void deleteApplication(String consumerKey) throws KeyManagementException {
        if (log.isDebugEnabled()) {
            log.debug("Deleting OAuth application for consumer key: " + consumerKey);
        }
        if (StringUtils.isEmpty(consumerKey)) {
            throw new KeyManagementException("Unable to delete OAuth Application. Consumer Key is null or empty",
                    ExceptionCodes.OAUTH2_APP_DELETION_FAILED);
        }
        Response response = dcrmServiceStub.deleteApplication(consumerKey);
        if (response == null) {
            throw new KeyManagementException("Error occurred while deleting DCR application. Response is null",
                    ExceptionCodes.OAUTH2_APP_DELETION_FAILED);
        }
        if (response.status() != APIMgtConstants.HTTPStatusCodes.SC_204_NO_CONTENT) {
            throw new KeyManagementException("Error occurred while deleting DCR application. Error: " +
                    response.body().toString() + " Status Code: " + response.status(),
                    ExceptionCodes.OAUTH2_APP_DELETION_FAILED);
        }

        if (log.isDebugEnabled()) {
            log.debug("OAuth2 application for consumer key: " + consumerKey + " deleted.");
        }
    }

    @Override
    public OAuthApplicationInfo retrieveApplication(String consumerKey) throws KeyManagementException {
        if (log.isDebugEnabled()) {
            log.debug("Retrieving OAuth application for consumer key: " + consumerKey);
        }

        if (StringUtils.isEmpty(consumerKey)) {
            throw new KeyManagementException("Unable to retrieve OAuth Application. Consumer Key is null or empty",
                    ExceptionCodes.OAUTH2_APP_RETRIEVAL_FAILED);
        }

        Response response = dcrmServiceStub.getApplication(consumerKey);
        if (response == null) {
            throw new KeyManagementException("Error occurred while retrieving DCR application. Response is null",
                    ExceptionCodes.OAUTH2_APP_RETRIEVAL_FAILED);
        }
        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_200_OK) {   //200 - Success
            try {
                OAuthApplicationInfo oAuthApplicationInfoResponse = getOAuthApplicationInfo(response);
                if (log.isDebugEnabled()) {
                    log.debug("OAuth2 application retrieved: " + oAuthApplicationInfoResponse.toString());
                }
                return oAuthApplicationInfoResponse;
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing the DCR application retrieval " +
                        "response message.", e, ExceptionCodes.OAUTH2_APP_RETRIEVAL_FAILED);
            }
        } else {  //Unknown Error
            throw new KeyManagementException("Error occurred while retrieving DCR application. Error: " +
                    response.body().toString() + " Status Code: " + response.status(),
                    ExceptionCodes.OAUTH2_APP_RETRIEVAL_FAILED);
        }
    }

    @Override
    public AccessTokenInfo getNewAccessToken(AccessTokenRequest tokenRequest) throws KeyManagementException {

        if (tokenRequest == null) {
            throw new KeyManagementException("No information available to generate Token. AccessTokenRequest is null",
                    ExceptionCodes.INVALID_TOKEN_REQUEST);
        }

        // Call the /revoke only if there's a token to be revoked.
        if (!StringUtils.isEmpty(tokenRequest.getTokenToRevoke())) {
            this.revokeAccessToken(tokenRequest.getTokenToRevoke(), tokenRequest.getClientId(),
                    tokenRequest.getClientSecret());
        }

        // When validity time set to a negative value, a token is considered never to expire.
        if (tokenRequest.getValidityPeriod() == -1L) {
            // Setting a different negative value if the set value is -1 (-1 will be ignored by TokenValidator)
            tokenRequest.setValidityPeriod(-2L);
        }

        Response response;
        try {
            if (KeyManagerConstants.CLIENT_CREDENTIALS_GRANT_TYPE.equals(tokenRequest.getGrantType())) {
                response = oAuth2ServiceStubs.getTokenServiceStub().generateClientCredentialsGrantAccessToken(
                        tokenRequest.getScopes(), tokenRequest.getValidityPeriod(), tokenRequest.getClientId(),
                        tokenRequest.getClientSecret());
            } else if (KeyManagerConstants.PASSWORD_GRANT_TYPE.equals(tokenRequest.getGrantType())) {
                response = oAuth2ServiceStubs.getTokenServiceStub().generatePasswordGrantAccessToken(
                        tokenRequest.getResourceOwnerUsername(), tokenRequest.getResourceOwnerPassword(),
                        tokenRequest.getScopes(), tokenRequest.getValidityPeriod(), tokenRequest.getClientId(),
                        tokenRequest.getClientSecret());
            } else if (KeyManagerConstants.AUTHORIZATION_CODE_GRANT_TYPE.equals(tokenRequest.getGrantType())) {
                response = oAuth2ServiceStubs.getTokenServiceStub().generateAuthCodeGrantAccessToken(
                        tokenRequest.getAuthorizationCode(), tokenRequest.getCallbackURI(), tokenRequest.getScopes(),
                        tokenRequest.getValidityPeriod(), tokenRequest.getClientId(), tokenRequest.getClientSecret());
            } else if (KeyManagerConstants.REFRESH_GRANT_TYPE.equals(tokenRequest.getGrantType())) {
                response = oAuth2ServiceStubs.getTokenServiceStub().generateRefreshGrantAccessToken(
                        tokenRequest.getRefreshToken(), tokenRequest.getScopes(), tokenRequest.getValidityPeriod(),
                        tokenRequest.getClientId(), tokenRequest.getClientSecret());
            } else {
                throw new KeyManagementException("Invalid access token request. Unsupported grant type: "
                        + tokenRequest.getGrantType(), ExceptionCodes.INVALID_TOKEN_REQUEST);
            }
        } catch (APIManagementException ex) {
            throw new KeyManagementException("Token generation request failed. Error: " + ex.getMessage(), ex,
                    ExceptionCodes.ACCESS_TOKEN_GENERATION_FAILED);
        }

        if (response == null) {
            throw new KeyManagementException("Error occurred while generating an access token. " +
                    "Response is null", ExceptionCodes.ACCESS_TOKEN_GENERATION_FAILED);
        }

        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_200_OK) {   //200 - Success
            log.debug("A new access token is successfully generated.");
            try {
                OAuth2TokenInfo oAuth2TokenInfo = (OAuth2TokenInfo) new GsonDecoder().decode(response,
                        OAuth2TokenInfo.class);
                AccessTokenInfo accessTokenInfo = new AccessTokenInfo();
                accessTokenInfo.setAccessToken(oAuth2TokenInfo.getAccessToken());
                accessTokenInfo.setScopes(oAuth2TokenInfo.getScope());
                accessTokenInfo.setRefreshToken(oAuth2TokenInfo.getRefreshToken());
                accessTokenInfo.setIdToken(oAuth2TokenInfo.getIdToken());
                accessTokenInfo.setValidityPeriod(oAuth2TokenInfo.getExpiresIn());
                return accessTokenInfo;
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing token response", e,
                        ExceptionCodes.ACCESS_TOKEN_GENERATION_FAILED);
            }
        } else {  //Error case
            throw new KeyManagementException("Token generation request failed. HTTP error code: " + response.status() +
                    " Error Response Body: " + response.body().toString(),
                    ExceptionCodes.ACCESS_TOKEN_GENERATION_FAILED);
        }

    }

    @Override
    public AccessTokenInfo getTokenMetaData(String accessToken) throws KeyManagementException {
        log.debug("Token introspection request is being sent.");
        Response response;
        try {
            response = oAuth2ServiceStubs.getIntrospectionServiceStub().introspectToken(accessToken);
        } catch (APIManagementException e) {
            throw new KeyManagementException("Error occurred while introspecting access token.", e,
                    ExceptionCodes.TOKEN_INTROSPECTION_FAILED);
        }
        if (response == null) {
            throw new KeyManagementException("Error occurred while introspecting access token. " +
                    "Response is null", ExceptionCodes.TOKEN_INTROSPECTION_FAILED);
        }
        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_200_OK) {
            log.debug("Token introspection is successful");
            try {
                OAuth2IntrospectionResponse introspectResponse = (OAuth2IntrospectionResponse) new GsonDecoder()
                        .decode(response, OAuth2IntrospectionResponse.class);
                AccessTokenInfo tokenInfo = new AccessTokenInfo();
                boolean active = introspectResponse.isActive();
                if (active) {
                    tokenInfo.setTokenValid(true);
                    tokenInfo.setAccessToken(accessToken);
                    tokenInfo.setScopes(introspectResponse.getScope());
                    tokenInfo.setConsumerKey(introspectResponse.getClientId());
                    tokenInfo.setEndUserName(introspectResponse.getUsername());
                    tokenInfo.setIssuedTime(introspectResponse.getIat());
                    tokenInfo.setExpiryTime(introspectResponse.getExp());

                    long validityPeriod = introspectResponse.getExp() - introspectResponse.getIat();
                    tokenInfo.setValidityPeriod(validityPeriod);
                } else {
                    tokenInfo.setTokenValid(false);
                    log.error("Invalid or expired access token received.");
                    tokenInfo.setErrorCode(KeyManagerConstants.KeyValidationStatus.API_AUTH_INVALID_CREDENTIALS);
                }
                return tokenInfo;
            } catch (IOException e) {
                throw new KeyManagementException("Error occurred while parsing token introspection response", e,
                        ExceptionCodes.TOKEN_INTROSPECTION_FAILED);
            }
        } else {
            throw new KeyManagementException("Token introspection request failed. HTTP error code: "
                    + response.status() + " Error Response Body: " + response.body().toString(),
                    ExceptionCodes.TOKEN_INTROSPECTION_FAILED);
        }
    }

    @Override
    public void revokeAccessToken(String accessToken, String clientId, String clientSecret)
            throws KeyManagementException {
        log.debug("Revoking access token");
        Response response;
        try {
            response = oAuth2ServiceStubs.getRevokeServiceStub().revokeAccessToken(accessToken, clientId,
                    clientSecret);
        } catch (APIManagementException e) {
            throw new KeyManagementException("Error occurred while revoking current access token", e,
                    ExceptionCodes.ACCESS_TOKEN_REVOKE_FAILED);
        }
        if (response == null) {
            throw new KeyManagementException("Error occurred while revoking current access token. " +
                    "Response is null", ExceptionCodes.ACCESS_TOKEN_REVOKE_FAILED);
        }
        if (response.status() == APIMgtConstants.HTTPStatusCodes.SC_200_OK) {
            if (log.isDebugEnabled()) {
                log.debug("Successfully revoked access token: " + accessToken);
            }
        } else {
            throw new KeyManagementException("Token revocation failed. HTTP error code: " + response.status()
                    + " Error Response Body: " + response.body().toString(),
                    ExceptionCodes.ACCESS_TOKEN_REVOKE_FAILED);
        }
    }

    @Override
    public KeyManagerConfiguration getKeyManagerConfiguration() throws KeyManagementException {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void loadConfiguration(KeyManagerConfiguration configuration) throws KeyManagementException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public boolean registerNewResource(API api, Map resourceAttributes) throws KeyManagementException {
        return true;
    }

    @Override
    public Map getResourceByApiId(String apiId) throws KeyManagementException {
        return null;
    }

    @Override
    public boolean updateRegisteredResource(API api, Map resourceAttributes) throws KeyManagementException {
        return false;
    }

    @Override
    public void deleteRegisteredResourceByAPIId(String apiID) throws KeyManagementException {

    }

    @Override
    public void deleteMappedApplication(String consumerKey) throws KeyManagementException {

    }

    private OAuthApplicationInfo getOAuthApplicationInfo(Response response) throws IOException {
        OAuthApplicationInfo oAuthApplicationInfoResponse = new OAuthApplicationInfo();
        DCRClientInfo dcrClientInfoResponse = (DCRClientInfo) new GsonDecoder().decode(response, DCRClientInfo.class);
        oAuthApplicationInfoResponse.setClientName(dcrClientInfoResponse.getClientName());
        oAuthApplicationInfoResponse.setClientId(dcrClientInfoResponse.getClientId());
        oAuthApplicationInfoResponse.setClientSecret(dcrClientInfoResponse.getClientSecret());
        oAuthApplicationInfoResponse.setGrantTypes(dcrClientInfoResponse.getGrantTypes());
        oAuthApplicationInfoResponse.setCallBackURL(dcrClientInfoResponse.getRedirectURIs().get(0));
        return oAuthApplicationInfoResponse;
    }
}


text:
<?php

namespace rg\injektor;

/**
 * @generator ignore
 */
class FactoryDependencyInjectionContainer extends DependencyInjectionContainer {
    public static $prefix = '';

    /**
     * @template InstanceType
     *
     * @param class-string<InstanceType> $fullClassName
     * @param array $constructorArguments
     *
     * @return InstanceType
     */
    public function getInstanceOfClass($fullClassName, array $constructorArguments = array()) {
        $fullFactoryClassName = $this->getFullFactoryClassName($fullClassName);
        $factoryClassName = $this->getFactoryClassName($fullClassName);

        if ($this->factoryClassExists($fullFactoryClassName, $factoryClassName)) {
            return $fullFactoryClassName::getInstance($constructorArguments);
        }

        return parent::getInstanceOfClass($fullClassName, $constructorArguments);
    }

    /**
     * @param object $object
     * @param string $methodName
     * @param array $additionalArguments
     * @return mixed
     * @throws InjectionException
     */
    public function callMethodOnObject($object, $methodName, array $additionalArguments = array()) {
        $className = get_class($object);
        $fullFactoryClassName = $this->getFullFactoryClassName($className);
        $factoryClassName = $this->getFactoryClassName($className);

        if ($this->factoryClassExists($fullFactoryClassName, $factoryClassName)) {
            $factoryMethod = $this->getFactoryMethodName($methodName);
            if (! method_exists($fullFactoryClassName, $factoryMethod)) {
                throw new InjectionException('Method ' . $factoryMethod . ' not found in class ' . $fullFactoryClassName);
            }

            return $fullFactoryClassName::$factoryMethod($object, $additionalArguments);
        }

        return parent::callMethodOnObject($object, $methodName, $additionalArguments);
    }

    /**
     * @param string $methodName
     * @return string
     */
    public function getFactoryMethodName($methodName) {
        return 'call' . ucfirst($methodName);
    }

    /**
     * @param string $fullClassName
     * @return string
     */
    public function getFactoryClassName($fullClassName) {
        return self::$prefix . $this->getStrippedClassName($fullClassName) . 'Factory';
    }

    /**
     * @param string $fullClassName
     * @return string
     */
    public function getProxyClassName($fullClassName) {
        return self::$prefix . $this->getStrippedClassName($fullClassName) . 'Proxy';
    }

    /**
     * @param $fullClassName
     * @return string
     */
    public function getLazyProxyClassName($fullClassName) {
        return self::$prefix . $this->getStrippedClassName($fullClassName) . 'Lazy';
    }

    /**
     * @param string $fullClassName
     * @return string
     */
    private function getStrippedClassName($fullClassName) {
        return strtr(trim($fullClassName, '\\'), '\\', '_');
    }

    /**
     * @param $fullClassName
     * @return string
     */
    public function getFullFactoryClassName($fullClassName) {
        $factoryClass = 'rg\injektor\generated\\' . $this->getFactoryClassName($fullClassName);
        return $factoryClass;
    }

    /**
     * @param string $fullFactoryClassName
     * @param string $factoryClassName
     * @return bool
     */
    protected function factoryClassExists($fullFactoryClassName, $factoryClassName) {
        if (class_exists($fullFactoryClassName, false)) {
            return true;
        }

        $fileName = $this->config->getFactoryPath() . DIRECTORY_SEPARATOR . $factoryClassName . '.php';
        if (file_exists($fileName)) {
            require_once $fileName;
            return true;
        }

        return false;
    }
}


text:
#import <ResearchKit/ORKRecorder.h>

NS_ASSUME_NONNULL_BEGIN

@class ORKStep;

/**
 The `ORKTouchRecorderConfiguration` is a recorder configuration class for
 generating an `ORKTouchRecorder`.

 It is currently considered private, and is not used in any of the active tasks.
 */
ORK_CLASS_AVAILABLE
@interface ORKTouchRecorderConfiguration : ORKRecorderConfiguration

/**
 Returns an initialized touch recorder configuration.

 This method is the designated initializer.

 @param identifier   The unique identifier of the recorder configuration.

 @return An initialized touch recorder configuration.
 */
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;

/**
 Returns a new touch recorder configuration initialized from data in the given unarchiver.

 @param aDecoder    Coder from which to initialize the touch recorder configuration.

 @return A new touch recorder configuration.
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;

@end

@interface ORKRecorder()

/**
 Returns an initialized recorder.

 This method is the designated initializer.

 @param identifier          The unique identifier of the recorder.
 @param step                The step for which this recorder is being created.
 @param outputDirectory     The directory in which all output file data should be written (if producing `ORKFileResult` instances).

 @return An initialized recorder.
 */
- (instancetype)initWithIdentifier:(NSString *)identifier step:(nullable ORKStep *)step outputDirectory:(nullable NSURL *)outputDirectory;

/**
 A preparation step to provide viewController and view before record starting.

 The step view controller should call this method before starting the recorder,
 so that recorders that need a view or gesture recognizer in order to function
 can attach themselves.

 @param viewController  The view controller that is about to 'start'
 @param view            Primary active view for the step.
 */
- (void)viewController:(UIViewController *)viewController willStartStepWithView:(nullable UIView *)view;

/**
 Indicates that recording has failed; stop recording and report the error to the
 delegate

 @param error       Error that occurred.
 */
- (void)finishRecordingWithError:(nullable NSError *)error;

/**
 Helper for subclasses to request that file protection be applied to a file on disk.

 This method is exposed to facilitate unit testing.

 @param fileProtection  Level of file protection desired
 @param url             URL of file to protect.
 */
- (void)applyFileProtection:(ORKFileProtectionMode)fileProtection toFileAtURL:(NSURL *)url;

@end

@interface ORKRecorderConfiguration()

/**
 Returns an initialized recorder configuration.

 This method is the designated initializer.

 @param identifier   The unique identifier of the recorder configuration.

 @return An initialized recorder configuration.
 */
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;

/**
 Returns a new recorder configuration initialized from data in the given unarchiver.

 @param aDecoder    Coder from which to initialize the recorder configuration.

 @return A new recorder configuration.
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;

/**
 Returns the permission mask indicating the permissions required for this configuration.

 This method is typically overridden in new recorder configuration subclasses.
 */
- (ORKPermissionMask)requestedPermissionMask;

@end

NS_ASSUME_NONNULL_END


text:
namespace Fixtures.AcceptanceTestsBodyNumber
{
    using System;
    using System.Collections.Generic;
    using System.Net.Http;
    using System.Threading;
    using System.Threading.Tasks;
    using Newtonsoft.Json;
    using Microsoft.Rest;
    using Models;

    /// <summary>
    /// Test Infrastructure for AutoRest
    /// </summary>
    public partial interface IAutoRestNumberTestService
    {
        /// <summary>
        /// The base URI of the service.
        /// </summary>
        Uri BaseUri { get; set; }

        /// <summary>
        /// Gets or sets json serialization settings.
        /// </summary>
        JsonSerializerSettings SerializationSettings { get; }

        /// <summary>
        /// Gets or sets json deserialization settings.
        /// </summary>
        JsonSerializerSettings DeserializationSettings { get; }

        INumber Number { get; }

    }
}


text:
class CreateAnswers < ActiveRecord::Migration
  def change
    create_table :answers do |t|
      t.integer :question_id
      t.integer :answer_session_id
      t.integer :user_id

      t.timestamps
    end
  end
end