Get or produce the actual OPTICS plot.

@param context Context to use
@return Plot
356654
public OPTICSPlot getOPTICSPlot(VisualizerContext context) {
    if(plot == null) {
      plot = OPTICSPlot.plotForClusterOrder(clusterOrder, context);
    }
    return plot;
  }
786660
public static It<Object> findVis(VisualizerContext context, Object start) {
    if(start instanceof Result) { // In first hierarchy.
      It<Result> it1 = context.getHierarchy().iterDescendantsSelf((Result) start);
      return new StackedIter<>(it1, context.getVisHierarchy());
    }
    return context.getVisHierarchy().iterDescendantsSelf(start);
  }
1218667
public static JRTIndex instance(Context context) {
        try {
            JRTIndex instance = context.get(JRTIndex.class);
            if (instance == null)
                context.put(JRTIndex.class, instance = new JRTIndex());
            return instance;
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
447496
def parallactic_angles(self, context):
        
        # Time and antenna extents
        (lt, ut), (la, ua) = context.dim_extents('ntime', 'na')

        return (mbu.parallactic_angles(self._times[lt:ut],
                self._antenna_positions[la:ua], self._phase_dir)
                                            .reshape(context.shape)
                                            .astype(context.dtype))
9890
static synchronized List<Watcher> get(Context context) {
        List<Watcher> watchers;
        if (context.contains(WATCHERS_KEY)) {
            try {
                watchers = (List<Watcher>) context.get(WATCHERS_KEY);
            } catch (ContextException e) {
                throw new IllegalStateException("Cannot extract the watcher from the context", e);
            }
        } else {
            watchers = new ArrayList<>();
            context.put(WATCHERS_KEY, watchers);
        }
        return watchers;
    }
994044
public static ModuleFinder instance(Context context) {
        ModuleFinder instance = context.get(moduleFinderKey);
        if (instance == null)
            instance = new ModuleFinder(context);
        return instance;
    }
362491
def get_plot(self_or_cls, obj, doc=None, renderer=None, **kwargs):
        
        if doc is None:
            doc = Document() if self_or_cls.notebook_context else curdoc()

        if self_or_cls.notebook_context:
            curdoc().theme = self_or_cls.theme
        doc.theme = self_or_cls.theme
        plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer, **kwargs)
        plot.document = doc
        return plot
1133073
public static int getPixelFromDp(Context context, int dp) {
		// Get the screen's density scale		
		float scale = context.getResources().getDisplayMetrics().density;

		// Convert the dps to pixels, based on density scale
		// because dp*scale is cast as an integer value, this will cause the result to be truncated.
		// Therefore, Adding ROUND_FACTOR helps the result to have properly rounded integer value.
		return (int)(dp * scale + ROUND_FACTOR);
	}
182977
public IScope createFeatureCallSerializationScope(EObject context) {
		if (!(context instanceof XAbstractFeatureCall)) {
			return IScope.NULLSCOPE;
		}
		XAbstractFeatureCall call = (XAbstractFeatureCall) context;
		JvmIdentifiableElement feature = call.getFeature();
		// this and super - logical container aware FeatureScopes
		if (feature instanceof JvmType) {
			return getTypeScope(call, (JvmType) feature);
		}
		if (feature instanceof JvmConstructor) {
			return getThisOrSuperScope(call, (JvmConstructor) feature);
		}
		if (feature instanceof JvmExecutable) {
			return getExecutableScope(call, feature);
		}
		if (feature instanceof JvmFormalParameter || feature instanceof JvmField || feature instanceof XVariableDeclaration || feature instanceof XSwitchExpression) {
			return new SingletonScope(EObjectDescription.create(feature.getSimpleName(), feature), IScope.NULLSCOPE);
		}
		return IScope.NULLSCOPE;
	}
3967
public List<AdapterMonitor> getAdapterMonitors(RuntimeContext context) {
        return getAdapterMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
44937
function(context){
		var chart = this;
		this.canvas = context.canvas;

		this.ctx = context;

		//Variables global to the chart
		var computeDimension = function(element,dimension)
		{
			if (element['offset'+dimension])
			{
				return element['offset'+dimension];
			}
			else
			{
				//return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);
        return element[dimension.toLowerCase()];
			}
		}

		var width = this.width = computeDimension(context.canvas,'Width');
		var height = this.height = computeDimension(context.canvas,'Height');

		// Firefox requires this to work correctly
		context.canvas.width  = width;
		context.canvas.height = height;

		this.aspectRatio = this.width / this.height;
		//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
		helpers.retinaScale(this);

		return this;
	}
1193998
private function fig_feed(Context $context) {

        //Set the parameters for the feed class:
        //the parameters are an assoc array made of the
        //scalar attributes of the fig:feed tag other than fig:* and
        //class and target attributes.
        $feedParameters = array();
        foreach($this->attributes as $attribName=>$attribText) {
            if( (! $context->view->isFigPrefix($attribName)) &&
                ($attribName != 'class') && ($attribName != 'target') ) {
                $feedParameters[$attribName] = $this->evaluate($context, $attribText);
            }
        }

        //TODO: catch exception, to enrich with fig xml file+line, and rethrow.
        $feedInstance = $context->view->createFeed($this->feedClass, $feedParameters);

        //At this point the feed instance must be created.
        //If not, there was no factory to handle its loading.
        if(! $feedInstance) {
            throw new FeedClassNotFoundException($this->feedClass, null, $this->xmlLineNumber);
        }

        //It is possible to simply invoke a Feed class and
        //discard its result, by not defining a target to the tag.
        $mountPoint = null;
        if(isset($this->attributes['target'])) {
            $mountPoint = $this->attributes['target'];
        }


        $feedInstance->setParameters($feedParameters);

        // The run method of the Feed might throw a FeedRuntimeException...
        // It means that the problem encountered is severe enough, for the Feed to
        // request that the View rendering should stop.
        // In this case, the controller is responsible for treating accordingly.
        $subUniverse = $feedInstance->run();

        if($mountPoint !== null) {
            $context->view->mount($mountPoint, $subUniverse);
        }

    }
1018354
static Class<?> findProxyViewClass(Context context, String name) {
        try {
            return loadViewClass(context, String.format("%s.probe.ProbeProxy$%s",
                    context.getPackageName(), name.replace('.', '_')));
        } catch (ClassNotFoundException e) {
            return null;
        }
    }
1131637
@Provides protected TvShowCollectionRendererBuilder provideTvShowCollectionRendererBuilder(
      Context context) {
    List<Renderer<TvShowViewModel>> prototypes = new LinkedList<Renderer<TvShowViewModel>>();
    prototypes.add(new TvShowRenderer(context));
    return new TvShowCollectionRendererBuilder(prototypes);
  }
43615
public static ContentProviderSimpleAdapter getInternalPhotoSimpleAdapter(Context context) {
    return new ContentProviderSimpleAdapter(MediaStore.Images.Media.INTERNAL_CONTENT_URI, context);
  }
1241152
protected TextView createDefaultTabView(Context context) {
        TextView textView = new TextView(context);
        textView.setGravity(Gravity.CENTER);
        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
        textView.setTypeface(Typeface.DEFAULT_BOLD);
        textView.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

        TypedValue outValue = new TypedValue();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,
                    outValue, true);
        }

        textView.setBackgroundResource(outValue.resourceId);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            textView.setAllCaps(true);
        }

        int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
        textView.setPadding(padding, padding, padding, padding);

        return textView;
    }
741822
public static PlotCanvas plot(double[][] data) {
        double[] lowerBound = {-0.5, 0.36};
        double[] upperBound = {data[0].length, data.length * 0.87 + 0.5};
        PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false);
        canvas.add(new Hexmap(data));

        canvas.getAxis(0).setFrameVisible(false);
        canvas.getAxis(0).setLabelVisible(false);
        canvas.getAxis(0).setGridVisible(false);
        canvas.getAxis(1).setFrameVisible(false);
        canvas.getAxis(1).setLabelVisible(false);
        canvas.getAxis(1).setGridVisible(false);

        return canvas;
    }