:param action: iam:cat
    :return: [ "iam:", "iam:c", "iam:ca", "iam:cat" ]
431747
def _get_prefixes_for_action(action):
    
    (technology, permission) = action.split(':')
    retval = ["{}:".format(technology)]
    phrase = ""
    for char in permission:
        newphrase = "{}{}".format(phrase, char)
        retval.append("{}:{}".format(technology,newphrase))
        phrase = newphrase
    return retval
173535
def list_actions(self):
        

        actions = []
        for path, actionName, action in self:
            actions.append(self.__namespace_splitter.join(itertools.chain(path, (actionName,))))
        return sorted(actions)
215862
def _generic_action_parser(self):
        """"""
        actions = []
        while True:
            action_code = unpack_ui8(self._src)
            if action_code == 0:
                break

            action_name = ACTION_NAMES[action_code]
            if action_code > 128:
                # have a payload!
                action_len = unpack_ui16(self._src)
                try:
                    action_meth = getattr(
                        self, "_handle_" + action_name.lower())
                except AttributeError:
                    if self.unknown_alert:
                        raise ValueError(
                            "Unknown action: " + repr(action_name))

                    action_payload = self._src.read(action_len)
                    _dict = {'__str__': _repr, '__repr__': _repr,
                             'name': action_name}
                    action = type("UnknownAction", (SWFObject,), _dict)()
                    action.raw_payload = action_payload
                    actions.append(action)
                else:
                    prev_pos = self._src.tell()
                    for action in action_meth(action_len):
                        assert action is not None, action_name
                        actions.append(action)

                    quant_read = self._src.tell() - prev_pos
                    if quant_read != action_len:
                        raise RuntimeError(
                            "Bad bytes consumption by action {!r} handler "
                            "(did {}, should {})".format(
                                action_name, quant_read, action_len))
            else:
                action = _make_object(action_name)
                actions.append(action)
        return actions
491844
def split_action_id (id):
    
    assert isinstance(id, basestring)
    split = id.split ('.', 1)
    toolset = split [0]
    name = ''
    if len (split) > 1:
        name = split [1]
    return (toolset, name)
241613
def alias_action(self, *args, **kwargs):
        
        to = kwargs.pop('to', None)
        if not to:
            return
        error_message = ("You can't specify target ({}) as alias "
                         "because it is real action name".format(to)
                         )
        if to in list(itertools.chain(*self.aliased_actions.values())):
            raise Exception(error_message)

        self.aliased_actions.setdefault(to, []).extend(args)
1230243
def expand_actions(self, actions):
        
        r = []
        for action in actions:
            r.append(action)
            if action in self.aliased_actions:
                r.extend(self.aliased_actions[action])
        return r
1369149
def get_flag_style_optionals(self, actions):
    
    return [action
            for action in actions
            if isinstance(action, _StoreTrueAction)
            or isinstance(action, _StoreFalseAction)
            or isinstance(action, _StoreConstAction)]
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)
919896
def action_set(method_name):
    

    def action_set(value, context, **_params):
        method = getattr(context["action"], method_name)
        return _set(method, context["key"], value, (), {})

    return action_set
676681
def get_action_meanings(self):
        """"""
        actions = sorted(self._action_meanings.keys())
        return [self._action_meanings[action] for action in actions]
1195642
def _get_sorted_action_keys(self, keys_list):
        
        # The names can be found in reflexrulewidget.pt inside the
        # Reflex action rules list section.
        action_list = []
        for key in keys_list:
            if key.startswith('action-'):
                action_list.append(key)
        action_list.sort()
        return action_list
499474
def item_extra_kwargs(self, action):
        
        item = self.format(action)
        item.pop('title', None)
        item['uri'] = item.pop('url')
        item['activity:verb'] = item.pop('verb')
        return item
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])
42951
def to_list(self):
        ''''''
        res = []
        for a in self.__class__.ACTIONS:
            aBit = self.__class__.action_bitmask(a)
            if ((self & aBit) == aBit):
                res.append(a)
        return res
648465
def _iter_indented_subactions(self, action):
        
        try:
            get_subactions = action._get_subactions
        except AttributeError:
            pass
        else:
            self._indent()
            if isinstance(action, argparse._SubParsersAction):
                for subaction in sorted(
                        get_subactions(), key=lambda x: x.dest):
                    yield subaction
            else:
                for subaction in get_subactions():
                    yield subaction
            self._dedent()
1073678
private static function getActionName(string $action): string
    {
        if ($action === '') {
            return 'index';
        }

        if (in_array(strtolower($action), self::$magicActionMethods)) {
            return '_' . $action;
        }

        return $action;
    }
302107
def action_display(self):
        ''''''
        action = self['action']
        annotations = []
        abbr = self.bill[settings.LEVEL_FIELD]
        if 'related_entities' in self:
            for entity in self['related_entities']:
                name = entity['name']
                _id = entity['id']

                # If the importer couldn't ID the entity,
                # skip.
                if _id is None:
                    continue
                url = mongoid_2_url(abbr, _id)
                link = '<a href="%s">%s</a>' % (url, name)
                if name in action:
                    action = action.replace(entity['name'], link)
                else:
                    annotations.append(link)
            if annotations:
                action += ' (%s)' % ', '.join(annotations)
        return action