Get the available visualizations from the request context.  Put the
    visualizations in the request context if they are not yet there.

    Returns:
        :obj:`list` of instances of :class:`.BaseVisualization` or
        derived class
436274
def get_visualizations():
    
    if not hasattr(g, 'visualizations'):
        g.visualizations = {}
        for VisClass in _get_visualization_classes():
            vis = VisClass(get_model())
            g.visualizations[vis.__class__.__name__] = vis
    return g.visualizations
479617
def get_instances(self):
        
        services = []
        for resource in self._get_instances():
            services.append(resource['entity']['name'])

        return services
381680
def get(self, request, *args, **kwargs):
        

        self.object = self.get_object()
        return self.render(request, obj=self.object,
                           done_url=self.get_done_url())
747665
def get_objects(self, instance):
        
        view = self.context["view"]
        queryset = self.context["objects"]

        page = view.paginate_queryset(queryset)
        if page is not None:
            serializer = view.get_facet_objects_serializer(page, many=True)
            return OrderedDict([
                ("count", self.get_count(queryset)),
                ("next", view.paginator.get_next_link()),
                ("previous", view.paginator.get_previous_link()),
                ("results", serializer.data)
            ])

        serializer = view.get_serializer(queryset, many=True)
        return serializer.data
323538
def read_list(self, request):
        
        request_filters = request.context_params.get(
            self.request_filters_property, {})
        request_filters.update(**self.get_limit_and_offset(request_filters))
        entities = self.get_entity_list(request, **request_filters)
        request.context_params[self.list_property_name] = entities

        # offset and limit don't make sense to get aggregates
        count_request_filters = request_filters.copy()
        count_request_filters.pop('offset', None)
        count_request_filters.pop('limit', None)
        count_request_filters.pop('order_by', None)
        total_count = self.get_entity_list_total_count(request,
                                                       **count_request_filters)

        request.context_params[self.entity_list_total_count_property_name] = \
            total_count
        return request
186382
def _request(self):
        
        caller_frame = inspect.getouterframes(inspect.currentframe())[1]
        args, _, _, values = inspect.getargvalues(caller_frame[0])
        caller_name = caller_frame[3]
        kwargs = {arg: values[arg] for arg in args if arg != 'self'}
        func = reduce(
            lambda resource, name: resource.__getattr__(name),
            self.mappings[caller_name].split('.'), self)
        return func(**kwargs)
643732
def get_requests(self):
        

        requests = self.derived_get_requests()

        for request in requests:
            request.url = URLHelper.remove_hash(request.url)

        return requests
1262606
def visualize():
    

    session['settings'] = {}
    image_uid = request.args.get('image')
    vis_name = request.args.get('visualizer')
    vis = get_visualizations()[vis_name]
    if vis.ALLOWED_SETTINGS:
        for key in vis.ALLOWED_SETTINGS.keys():
            if request.args.get(key) is not None:
                session['settings'][key] = request.args.get(key)
            else:
                session['settings'][key] = vis.ALLOWED_SETTINGS[key][0]
    else:
        logger.debug('Selected Visualizer {0} has no settings.'.format(vis_name))
    inputs = []
    for image in session['image_list']:
        if image['uid'] == int(image_uid):
            full_path = os.path.join(session['img_input_dir'],
                                     image['filename'])
            entry = dict()
            entry['filename'] = image['filename']
            entry['data'] = Image.open(full_path)
            inputs.append(entry)

    vis.update_settings(session['settings'])
    output = vis.make_visualization(
        inputs, output_dir=session['img_output_dir'])
    return jsonify(output[0])
132602
def render(self, context):
        
        notifications = self.obj.resolve(context)
        return self.generate_html(notifications)
199627
def get_objectives(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.ObjectiveList(self._results, runtime=self._runtime)
922722
def load_contexts_and_renderers(events, mediums):
    
    sources = {event.source for event in events}
    rendering_styles = {medium.rendering_style for medium in mediums if medium.rendering_style}

    # Fetch the default rendering style and add it to the set of rendering styles
    default_rendering_style = get_default_rendering_style()
    if default_rendering_style:
        rendering_styles.add(default_rendering_style)

    context_renderers = ContextRenderer.objects.filter(
        Q(source__in=sources, rendering_style__in=rendering_styles) |
        Q(source_group_id__in=[s.group_id for s in sources], rendering_style__in=rendering_styles)).select_related(
            'source', 'rendering_style').prefetch_related('source_group__source_set')

    context_hints_per_source = get_context_hints_per_source(context_renderers)
    model_querysets = get_querysets_for_context_hints(context_hints_per_source)
    model_ids_to_fetch = get_model_ids_to_fetch(events, context_hints_per_source)
    model_data = fetch_model_data(model_querysets, model_ids_to_fetch)
    load_fetched_objects_into_contexts(events, model_data, context_hints_per_source)
    load_renderers_into_events(events, mediums, context_renderers, default_rendering_style)

    return events
45914
def show(self, obj):
        
        if self.interactive:
            if isinstance(obj, list):
                return [self.get_plot(o) for o in obj]
            return self.get_plot(obj)

        from .plot import MPLPlot
        MPLPlot._close_figures = False
        try:
            plots = []
            objects = obj if isinstance(obj, list) else [obj]
            for o in objects:
                plots.append(self.get_plot(o))
            plt.show()
        except:
            raise
        finally:
            MPLPlot._close_figures = True
        return plots[0] if len(plots) == 1 else plots
970695
def _api_get(self):
        
        json = self._client.get(type(self).api_endpoint, model=self)
        self._populate(json)
625450
def get_resources(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.ResourceList(self._results, runtime=self._runtime)
1038119
def get_context_data(self, **kwargs):
        
        context = super(IndexView, self).get_context_data(**kwargs)
        visiblity_content_tree = context['forums']

        # Computes some global values.
        context['total_posts_count'] = sum(n.posts_count for n in visiblity_content_tree.top_nodes)
        context['total_topics_count'] = sum(
            n.topics_count for n in visiblity_content_tree.top_nodes
        )

        return context
817616
def get_params(self):
    

    if hasattr(self, 'params'):
      return list(self.params)

    # Catch eager execution and assert function overload.
    try:
      if tf.executing_eagerly():
        raise NotImplementedError("For Eager execution - get_params "
                                  "must be overridden.")
    except AttributeError:
      pass

    # For graph-based execution
    scope_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES,
                                   self.scope + "/")

    if len(scope_vars) == 0:
      self.make_params()
      scope_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES,
                                     self.scope + "/")
      assert len(scope_vars) > 0

    # Make sure no parameters have been added or removed
    if hasattr(self, "num_params"):
      if self.num_params != len(scope_vars):
        print("Scope: ", self.scope)
        print("Expected " + str(self.num_params) + " variables")
        print("Got " + str(len(scope_vars)))
        for var in scope_vars:
          print("\t" + str(var))
        assert False
    else:
      self.num_params = len(scope_vars)

    return scope_vars
219267
def get_mosaics(self):
        '''
        '''
        url = self._url('basemaps/v1/mosaics')
        return self._get(url, models.Mosaics).get_body()