``Action`` detail view (pretty boring, mainly used for get_absolute_url)
547736
def detail(request, action_id):
    
    return render(
        request,
        'actstream/detail.html',
        {
            'action': get_object_or_404(models.Action, pk=action_id)
        }
    )
732242
def action_as_json(action)
      json = {}
      json[:default_title] = action.title if action.title
      json[:default_icon] = action.icon if action.icon
      json[:default_popup] = action.popup if action.popup
      json
    end
464938
def _get_action(self, action):
        

        # If we don't have an action named that, bail out
        if action not in self.wsgi_actions:
            return None

        # Generate an ActionDescriptor if necessary
        if action not in self.wsgi_descriptors:
            self.wsgi_descriptors[action] = actions.ActionDescriptor(
                self.wsgi_actions[action],
                self.wsgi_extensions.get(action, []),
                self.wsgi_resp_type)

        # OK, return the method descriptor
        return self.wsgi_descriptors[action]
634121
def action_getattr():
    

    def action_getattr(_value, context, **_params):
        value = getattr(context["action"], context["key"])
        return _attr(value)

    return action_getattr
293245
def expand_action(data):
    
    # when given a string, assume user wants to index raw json
    if isinstance(data, string_types):
        return '{"index":{}}', data

    # make sure we don't alter the action
    data = data.copy()
    op_type = data.pop('_op_type', 'index')
    action = {op_type: {}}
    for key in ('_index', '_parent', '_percolate', '_routing', '_timestamp',
            '_ttl', '_type', '_version', '_version_type', '_id', '_retry_on_conflict'):
        if key in data:
            action[op_type][key] = data.pop(key)

    # no data payload for delete
    if op_type == 'delete':
        return action, None

    return action, data.get('_source', data)
1143134
def absolute(parser, token):
    '''
    
    '''
    node = url(parser, token)
    return AbsoluteUrlNode(
        view_name=node.view_name,
        args=node.args,
        kwargs=node.kwargs,
        asvar=node.asvar
    )
671925
def details_section
    lazy_var :@details_section do
      # No details if we have nothing to work with
      if details.nil?
        nil
      else
        contents = case details
        when Proc
          details.call.to_s
        when String
          details
        else
          details.to_s
        end
        
        if contents.empty?
          nil
        else
          if @binding
            contents = binding.n_x.erb contents
          end
          
          "# Details\n\n" + contents
        end
      end
    end
  end
901346
def url_name_for_action(self, action):
        
        return "%s.%s_%s" % (self.module_name.lower(), self.model_name.lower(), action)
548266
def action_visualize(args,
                     fromshell=False,
                     path=None,
                     title="",
                     viztype="",
                     theme="",
                     verbose=False):
    

    from ..ontodocs.builder import ask_visualization, select_visualization, VISUALIZATIONS_LIST, build_visualization

    if fromshell:
        ontouri = args
        islocal = True
    else:
        ontouri = args[0]
        islocal = False

    # select a visualization
    if viztype:
        viztype = select_visualization(viztype)
    else:
        viztype = ask_visualization()
        if viztype == "":
            return None
        # raise SystemExit, 1

    # 2017-01-23: bypass pickled stuff as it has wrong counts etc..
    # get ontospy graph
    printDebug("Loading graph...", dim=True)
    g = Ontospy(ontouri, verbose=verbose)

    # put in home folder by default: <ontouri>/<viztype>/files..
    if not path:
        from os.path import expanduser
        home = expanduser("~")
        onto_path = slugify(unicode(ontouri))
        viz_path = slugify(unicode(VISUALIZATIONS_LIST[viztype]['Title']))
        path = os.path.join(home, "ontospy-viz/" + onto_path + "/" + viz_path)
        if not os.path.exists(path):
            os.makedirs(path)

    # url  = build_viz(ontouri, g, viztype, path)
    printDebug("Building visualization...", dim=True)
    url = build_visualization(ontouri, g, viztype, path, title, theme)

    return url
923226
def get_detail_view(self, request, object, opts=None):
        
        view = self.get_view(request, self.view_class, opts)
        view.object = object
        return view
588772
def _get_action_endpoint(action):
    
    _endpoint = None
    if is_method(action):
        if hasattr(action, "_rule_cache"):
            rc = action._rule_cache
            if rc:
                k = list(rc.keys())[0]
                rules = rc[k]
                len_rules = len(rules)
                if len_rules == 1:
                    rc_kw = rules[0][1]
                    _endpoint = rc_kw.get("endpoint", None)
                    if not _endpoint:
                        _endpoint = _build_endpoint_route_name(action)
                elif len_rules > 1:
                    _prefix = _build_endpoint_route_name(action)
                    for r in Mocha._app.url_map.iter_rules():
                        if ('GET' in r.methods or 'POST' in r.methods) \
                                and _prefix in r.endpoint:
                            _endpoint = r.endpoint
                            break
    return _endpoint
645985
def get_urls(self):
        
        parts = []
        seen = set()

        # Process item views in order
        for v in list(self._meta.item_views)+list(self._meta.action_views):
            if not v in seen:
                view, name = self.get_view_and_name(v)
                if view and name:
                    parts.append(self.get_url(name, view, v))
                seen.add(v)

        # Process everything else that we have not seen
        for v in set(self._views).difference(seen):
            # Get the url name
            view, name = self.get_view_and_name(v)
            if view and name:
                parts.append(self.get_url(name, view, v))

        return parts
654634
def _get_action(self, action_meta):
        '''
        
        '''
        conf = {
            'fun': list(action_meta.keys())[0],
            'arg': [],
            'kwargs': {},
        }
        if not len(conf['fun'].split('.')) - 1:
            conf['salt.int.intfunc'] = True

        action_meta = action_meta[conf['fun']]
        info = action_meta.get('info', 'Action for {}'.format(conf['fun']))
        for arg in action_meta.get('args') or []:
            if not isinstance(arg, dict):
                conf['arg'].append(arg)
            else:
                conf['kwargs'].update(arg)

        return info, action_meta.get('output'), conf
808530
def detail_view(self, request, instance_pk):
        
        kwargs = {'model_admin': self, 'instance_pk': instance_pk}
        view_class = self.detail_view_class
        return view_class.as_view(**kwargs)(request)
1159019
def action_list(self):
        ""
        format = "%-35s %-25s %-8s"
        print format % ("HOST", "ACTION", "SUBDOMS")
        for host, details in sorted(self.client.get_all().items()):
            if details[0] in ("proxy", "mirror"):
                action = "%s<%s>" % (
                    details[0],
                    ",".join(
                        "%s:%s" % (host, port)
                        for host, port in details[1]['backends']
                    )
                )
            elif details[0] == "static":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['type'],
                )
            elif details[0] == "redirect":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['redirect_to'],
                )
            elif details[0] == "empty":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['code'],
                )
            else:
                action = details[0]
            print format % (host, action, details[2])
770930
def print_details(srv):
    
    name = srv.service_type
    box = "=" * 79
    print("{0}\n|{1:^77}|\n{0}\n".format(box, name))
    for action in srv.iter_actions():
        print(action.name)
        print("~" * len(action.name))
        print("\n  Input")
        for arg in action.in_args:
            print("    ", arg)
        print("\n  Output")
        for arg in action.out_args:
            print("    ", arg)

        print("\n\n")
1205624
def index_for_actions object, *action_names, &block
      html_options = action_names.extract_options!
      action_names = [:show, :edit, :destroy] if action_names == [:all]

      builder = html_options[:action_builder] || IndexFor::ActionBuilder
      builder = builder.new(object, html_options, self)

      content = capture(builder) do |a|
        action_names.map do |action_name|
          a.action_link action_name
        end.join.html_safe
      end

      content += capture(builder, &block) if block

      content
    end