Tries to build an :class:`action.Action` instance from the given
        action.

        Raises ValueError if the :class:`action.Action` object can't be build
        from the given action.
195430
def build_action(self, action):
        
        try:
            self.action = Action.from_string(action)
        except ValueError:
            raise

        return self
89766
def _make_request(self, action):
        
        if isinstance(action, list):
            kwargs = {'actions': action}
            action = 'send'
        else:
            kwargs = self._get_method_params()

        kwargs.update({
            'consumer_key': self._consumer_key,
            'access_token': self._access_token
        })

        response = requests.post(
            self._get_url(action),
            json=kwargs,
            headers=self._get_headers()
        )

        if response.status_code != requests.codes.ok:
            raise self._make_exception(response)

        return response.json()
956892
def create_action_from_dict(name, spec, base_class=ActionsAction, metaclass=type, pop_keys=False):
    
    actions = load_grouped_actions(spec, pop_keys=pop_keys)
    attrs = {"actions": actions, "name": name}
    if "as" in spec:
        attrs["as_"] = spec["as"]
        if pop_keys:
            del spec["as"]
    for k in ("requires", "methods", "defaults", "default_option"):
        if k in spec:
            attrs[k] = spec[k]
            if pop_keys:
                del spec[k]
    return metaclass(name, (base_class,), attrs)
774680
def get_event_action(cls) -> Optional[str]:
        
        if not cls.actor:
            return None
        return event_context.get_event_action(cls.event_type)
230246
def action_get(method_name):
    

    def action_get(_value, context, **_params):
        method = getattr(context["action"], method_name)
        return _get(method, context["key"], (), {})

    return action_get
512848
def do_action(self, action, objects):
        
        transitioned = []
        ActionHandlerPool.get_instance().queue_pool()
        for obj in objects:
            obj = api.get_object(obj)
            success, message = do_action_for(obj, action)
            if success:
                transitioned.append(obj)
        ActionHandlerPool.get_instance().resume()
        return transitioned
432374
public static String buildAction(Class<?> clazz, String action) {
        return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
    }
217221
def register(action):
        
        if isinstance(action, str):
            Action.register(Action(action))
        elif isinstance(action, Action):
            Action.registered.add(action)
        else:
            for a in action:
                Action.register(a)
862556
def _add_action(self, action):
        
        kwargs = self._get_method_params()

        kwargs['action'] = action

        self._bulk_actions.append(kwargs)
158025
def on_action(action):
    
    @wrapt.decorator
    @tornado.gen.coroutine
    def _execute(wrapped, instance, args, kwargs):
        return wrapped(*args, **kwargs)

    _execute.action = action
    return _execute
915085
def class_reference_from_action_alias(method_sym)
      alias_found = find_alias(method_sym.to_s)
      return nil unless alias_found

      class_reference_from_action_name(alias_found.to_sym)
    end
462832
def clip_action(action, space):
    

    if isinstance(space, gym.spaces.Box):
        return np.clip(action, space.low, space.high)
    elif isinstance(space, gym.spaces.Tuple):
        if type(action) not in (tuple, list):
            raise ValueError("Expected tuple space for actions {}: {}".format(
                action, space))
        out = []
        for a, s in zip(action, space.spaces):
            out.append(clip_action(a, s))
        return out
    else:
        return action
1227441
def from_list(cls, actions):
        ''''''
        bitmask = 0
        for a in actions:
            bitmask |= cls.action_bitmask(a)
        return Action(bitmask)
1331338
def get_or_create(cls, **kwargs):
        '''
        
        '''
        q = cls._get_instance(**kwargs)
        if q:
            return q
        q = cls(**kwargs)
        _action_and_commit(q, session.add)
        return q
1217736
def with_actions(actions_or_group_name, actions=None):
    
    group = None
    if isinstance(actions_or_group_name, str):
        group = actions_or_group_name
    else:
        actions = actions_or_group_name
    def decorator(f):
        if isinstance(f, WithActionsDecorator):
            dec = f
        else:
            dec = WithActionsDecorator(f)
        dec.actions.extend(load_actions(actions, group=group))
        return dec
    return decorator
832032
def connect(self, action=None, method=None, **kwargs):
        
        return self.nest(Connect(action=action, method=method, **kwargs))
983068
def action_to_level(action):
    """"""
    try:
        return ACTION_LEVEL_MAP[action]
    except LookupError:
        raise d1_common.types.exceptions.InvalidRequest(
            0, 'Unknown action. action="{}"'.format(action)
        )