this should be moved to the upnp and renderer model
768434
public function getControlURL($description_url, $service = 'AVTransport')
	{
		$description = $this->getDescription($description_url);

		switch($service)
		{
			case 'AVTransport':
				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
				break;
			default:
				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
				break;
		}

		foreach($description['device']['serviceList']['service'] as $service)
		{
			if($service['serviceType'] == $serviceType)
			{
				$url = parse_url($description_url);
				return $url['scheme'].'://'.$url['host'].':'.$url['port'].$service['controlURL'];
			}
		}
	}
881857
function formDataForRenderer(unresolvedData, { _layoutRef, _ref }, locals) {
  return composer.resolveComponentReferences(unresolvedData, locals)
    .then((data) => ({
      data,
      options: { locals, _ref, _layoutRef }
    }));
}
492733
private void updateRender() {
		if (inherit.isSelected())
		{
			emitter.usePoints = Particle.INHERIT_POINTS;
			oriented.setEnabled( true );
		}
		if (quads.isSelected())
		{
			emitter.usePoints = Particle.USE_QUADS;
			oriented.setEnabled( true );
		}
		if (points.isSelected())
		{
			emitter.usePoints = Particle.USE_POINTS;
			oriented.setEnabled( false );
			oriented.setSelected( false );
		}
		
		// oriented
		if( oriented.isSelected())
			emitter.useOriented= true;
		else
			emitter.useOriented= false;
		
		// additive blending
		if( additive.isSelected())
			emitter.useAdditive= true;
		else
			emitter.useAdditive= false;
	}
1088088
function(){
		// Swap render state to compile mode for priority generation
		render.requireState( munit.RENDER_STATE_READ, render._compile );
		render.state = munit.RENDER_STATE_COMPILE;
		render._renderNS( munit.ns );

		// Just in case triggers set off any undesired state
		render.requireState( munit.RENDER_STATE_COMPILE, render._compile );
		render.state = munit.RENDER_STATE_TRIGGER;

		// Sort modules on priority
		munit.tests.sort(function( a, b ) {
			if ( a.options.priority === b.options.priority ) {
				return a._added > b._added ? 1 : -1;
			}
			else {
				return a.options.priority > b.options.priority ? -1 : 1;
			}
		})
		// Trigger modules based on priority
		.forEach(function( assert ) {
			// Stack modules waiting on a queue
			if ( assert.options.queue ) {
				munit.queue.addModule( assert );
			}
			else if ( render.checkDepency( assert ) ) {
				assert.trigger();
			}
		});

		// All modules triggered, check to see if we can close out
		render.state = munit.RENDER_STATE_ACTIVE;
		render.check();
	}
367429
private void reloadReferencesAndUpdateEO(ModelDiff diff, EngineeringObjectModelWrapper model) {
        for (ModelDiffEntry entry : diff.getDifferences().values()) {
            mergeEngineeringObjectWithReferencedModel(entry.getField(), model);
        }
    }
1200498
def wrap_default(self, data, renderer_context):
        

        wrapper = self.dict_class()
        view = renderer_context.get("view", None)
        request = renderer_context.get("request", None)

        model = self.model_from_obj(view)
        resource_type = self.model_to_resource_type(model)

        if isinstance(data, list):
            many = True
            resources = data
        else:
            many = False
            resources = [data]

        items = []
        links = self.dict_class()
        linked = self.dict_class()
        meta = self.dict_class()

        for resource in resources:
            converted = self.convert_resource(resource, data, request)
            item = converted.get('data', {})
            linked_ids = converted.get('linked_ids', {})
            if linked_ids:
                item["links"] = linked_ids
            items.append(item)

            links.update(converted.get('links', {}))
            linked = self.update_nested(linked,
                                        converted.get('linked', {}))
            meta.update(converted.get('meta', {}))

        if many:
            wrapper[resource_type] = items
        else:
            wrapper[resource_type] = items[0]

        if links:
            links = self.prepend_links_with_name(links, resource_type)
            wrapper["links"] = links

        if linked:
            wrapper["linked"] = linked

        if meta:
            wrapper["meta"] = meta

        return wrapper
1295874
function (data) {
    this.rendererSystem = this.el.sceneEl.systems.renderer;
    this.materialData = {color: new THREE.Color(), emissive: new THREE.Color()};
    getMaterialData(data, this.materialData);
    this.rendererSystem.applyColorCorrection(this.materialData.color);
    this.rendererSystem.applyColorCorrection(this.materialData.emissive);
    this.material = new THREE.MeshStandardMaterial(this.materialData);

    utils.material.updateMap(this, data);
    if (data.normalMap) { utils.material.updateDistortionMap('normal', this, data); }
    if (data.displacementMap) { utils.material.updateDistortionMap('displacement', this, data); }
    if (data.ambientOcclusionMap) { utils.material.updateDistortionMap('ambientOcclusion', this, data); }
    if (data.metalnessMap) { utils.material.updateDistortionMap('metalness', this, data); }
    if (data.roughnessMap) { utils.material.updateDistortionMap('roughness', this, data); }
    this.updateEnvMap(data);
  }
1230694
function()  {
        for (var i=0, len=this.renderers.length; i<len; i++) {
            var rendererClass = this.renderers[i];
            var renderer = (typeof rendererClass == "function") ?
                rendererClass :
                OpenLayers.Renderer[rendererClass];
            if (renderer && renderer.prototype.supported()) {
                this.renderer = new renderer(this.div, this.rendererOptions);
                break;
            }  
        }  
    }
1119152
function (renderer, attribList, vao) {
        var _gl = renderer.gl;
        var program = this._program;

        var locationMap = this._locations;

        var enabledAttributeListInContext;
        if (vao) {
            enabledAttributeListInContext = vao.__enabledAttributeList;
        }
        else {
            enabledAttributeListInContext = enabledAttributeList[renderer.__uid__];
        }
        if (!enabledAttributeListInContext) {
            // In vertex array object context
            // PENDING Each vao object needs to enable attributes again?
            if (vao) {
                enabledAttributeListInContext
                    = vao.__enabledAttributeList
                    = [];
            }
            else {
                enabledAttributeListInContext
                    = enabledAttributeList[renderer.__uid__]
                    = [];
            }
        }
        var locationList = [];
        for (var i = 0; i < attribList.length; i++) {
            var symbol = attribList[i];
            if (!this.attributes[symbol]) {
                locationList[i] = -1;
                continue;
            }
            var location = locationMap[symbol];
            if (location == null) {
                location = _gl.getAttribLocation(program, symbol);
                // Attrib location is a number from 0 to ...
                if (location === -1) {
                    locationList[i] = -1;
                    continue;
                }
                locationMap[symbol] = location;
            }
            locationList[i] = location;

            if (!enabledAttributeListInContext[location]) {
                enabledAttributeListInContext[location] = SHADER_STATE_TO_ENABLE;
            }
            else {
                enabledAttributeListInContext[location] = SHADER_STATE_KEEP_ENABLE;
            }
        }

        for (var i = 0; i < enabledAttributeListInContext.length; i++) {
            switch(enabledAttributeListInContext[i]){
                case SHADER_STATE_TO_ENABLE:
                    _gl.enableVertexAttribArray(i);
                    enabledAttributeListInContext[i] = SHADER_STATE_PENDING;
                    break;
                case SHADER_STATE_KEEP_ENABLE:
                    enabledAttributeListInContext[i] = SHADER_STATE_PENDING;
                    break;
                // Expired
                case SHADER_STATE_PENDING:
                    _gl.disableVertexAttribArray(i);
                    enabledAttributeListInContext[i] = 0;
                    break;
            }
        }

        return locationList;
    }
1258345
function() {
		if ( !this.force2D && WebGLRenderer.isSupported( this.el ) ) {
			this.renderer = new WebGLRenderer( this.el );
		} else if ( Canvas2DRenderer.isSupported( this.el ) ) {
			this.renderer = new Canvas2DRenderer( this.el );
		} else {
			throw new Error( "No supported renderer!" );
		}
	}
925670
function engineManager_moveUpEngine(name) {
    this.selectedEngine = name;
    var index = this.selectedIndex;

    var button = this.getElement({type: "engine_button", subtype: "up"});
    this._controller.click(button);

    this._controller.waitForEval("subject.manager.selectedIndex == subject.oldIndex - 1", TIMEOUT, 100,
                                 {manager: this, oldIndex: index});
  }
949995
function preRun ()
  {
    $firstRendering = !$this->renderCount++;
    if ($this->isVisible ()) {
      if ($firstRendering) {
        $this->applyPresetsOnSelf ();
        $this->setupFirstRun ();
      }
      else $this->setupRepeatedRun ();
      $this->databind ();       // This is done on the data binding context of the component's parent.
      if ($firstRendering) {
        $this->createView ();
        $this->setupView ();
      }
      $this->afterPreRun ();   // Here, composite components may setup its view model and data binder.
    }
  }
776887
def setOverlayTransformTrackedDeviceComponent(self, ulOverlayHandle, unDeviceIndex, pchComponentName):
        

        fn = self.function_table.setOverlayTransformTrackedDeviceComponent
        result = fn(ulOverlayHandle, unDeviceIndex, pchComponentName)
        return result
1223954
@Override
    public void render(
            Map<String, ?> model, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        final IPortletWindowId portletWindowId =
                (IPortletWindowId) model.get(DELEGATE_PORTLET_WINDOW_ID);
        final DelegationRequest delegationRequest = (DelegationRequest) model.get(DELEGATE_REQUEST);

        final PortletRequest portletRequest =
                (PortletRequest) request.getAttribute(Constants.PORTLET_REQUEST);
        final PortletResponse portletResponse =
                (PortletResponse) request.getAttribute(Constants.PORTLET_RESPONSE);

        final PortletDelegationDispatcher requestDispatcher =
                portletDelegationLocator.getRequestDispatcher(portletRequest, portletWindowId);
        if (requestDispatcher == null) {
            throw new IllegalArgumentException(
                    "No PortletDelegationDispatcher exists for portlet window id: "
                            + portletWindowId);
        }
        this.logger.debug(
                "Found delegation dispatcher for portlet window id {} - {}",
                portletWindowId,
                requestDispatcher);

        final DelegationResponse delegationResponse;
        final String phase = (String) request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
        if (PortletRequest.RENDER_PHASE.equals(phase)) {
            final PortletOutputHandler portletOutputHandler =
                    (PortletOutputHandler) model.get(DELEGATE_RENDER_OUTPUT_HANDLER);
            if (portletOutputHandler != null) {
                this.logger.debug(
                        "Delegating RenderRequest with custom Writer and {}", delegationRequest);
                delegationResponse =
                        requestDispatcher.doRender(
                                (RenderRequest) portletRequest,
                                (RenderResponse) portletResponse,
                                delegationRequest,
                                portletOutputHandler);
            } else {
                this.logger.debug(
                        "Delegating RenderRequest with default Writer and {}", delegationRequest);
                delegationResponse =
                        requestDispatcher.doRender(
                                (RenderRequest) portletRequest,
                                (RenderResponse) portletResponse,
                                delegationRequest);
            }
        } else if (PortletRequest.RESOURCE_PHASE.equals(phase)) {
            this.logger.debug("Delegating ResourceRequest and {}", delegationRequest);
            delegationResponse =
                    requestDispatcher.doServeResource(
                            (ResourceRequest) portletRequest,
                            (ResourceResponse) portletResponse,
                            delegationRequest);
        } else {
            throw new UnsupportedOperationException(
                    "Portlet lifecycle phase "
                            + phase
                            + " is not supported by the delegation view");
        }

        this.logger.debug("{}", delegationResponse);
    }
417358
function (renderer, scene, sceneCamera, notUpdateScene) {
        if (!sceneCamera) {
            sceneCamera = scene.getMainCamera();
        }
        this.trigger('beforerender', this, renderer, scene, sceneCamera);
        this._renderShadowPass(renderer, scene, sceneCamera, notUpdateScene);
        this.trigger('afterrender', this, renderer, scene, sceneCamera);
    }
312411
def set_override_rendered(self):
        
        if '' in self.request.accept:
            self.request.override_renderer = self._default_renderer
        elif 'application/json' in self.request.accept:
            self.request.override_renderer = 'nefertari_json'
        elif 'text/plain' in self.request.accept:
            self.request.override_renderer = 'string'
675516
function (renderer) {
            var viewport = me.game.viewport,
                width = this.imagewidth,
                height = this.imageheight,
                bw = viewport.bounds.width,
                bh = viewport.bounds.height,
                ax = this.anchorPoint.x,
                ay = this.anchorPoint.y,
                x = this.pos.x,
                y = this.pos.y;

            if (this.ratio.x === this.ratio.y === 0) {
                x = x + ax * (bw - width);
                y = y + ay * (bh - height);
            }

            renderer.translate(x, y);
            renderer.drawPattern(
                this._pattern,
                0,
                0,
                viewport.width * 2,
                viewport.height * 2
            );
        }