Get state mutators and accessors
Each mutation will save in action descriptor.
This method allow add ability
to gather information about call every function.
@param {Object} state
@param {Object} action
@param {Boolean} isAsync
@return {Object}
760573
function getStateMutatorsAndAccessors (state, action, isAsync) {
  var mutators = [
    'apply',
    'concat',
    'deepMerge',
    'push',
    'merge',
    'unset',
    'set',
    'splice',
    'unshift'
  ];

  var accessors = [
    'get',
    'exists'
  ];

  var methods = [];

  if (isAsync) {
    methods = methods.concat(accessors);
  } else {
    methods = methods.concat(mutators);
    methods = methods.concat(accessors);
  }

  return methods.reduce((stateMethods, methodName) => {
    var method = state[methodName].bind(state);

    stateMethods[methodName] = (...args) => {
      var path = [];
      var firstArg = args[0];

      if (Array.isArray(firstArg)) {
        path = args.shift();
      } else if (typeof firstArg === 'string') {
        path = [args.shift()];
      }

      if (args.length === 0) {
        return method.apply(null, [path.slice()]);
      }

      action.mutations.push({
        name: methodName,
        path: path.slice(),
        args: args
      });

      return method.apply(null, [path.slice()].concat(args));
    };

    return stateMethods;
  }, Object.create(null));
}
506928
def summarize_mutation(mutation_name, event, inputs, outputs, isAsync=False):
    
    return dict(
        name=mutation_name,
        event=event,
        isAsync=isAsync,
        inputs=inputs,
        outputs=outputs,
    )
1130994
function simple_instance_setters (setters) {
        var stateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'instances';
        var instanceKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';

        // loop over the setter keys and make a mutation for each
        return Object.keys(setters).reduce(function (mutations, name) {

            // attach our new mutation to result
            return Object.assign({}, mutations, defineProperty({}, name, function (state, payload) {
                // find the instance that we're mutating
                var instance = findInstance(state, stateKey, instanceKey, payload);

                if (instance) {
                    var value = findValue(payload, instanceKey);

                    // if the setter name has a dot, then resolve the
                    // state path before feeding our value into it.
                    if (setters[name].indexOf('.') > -1) {
                        var obj = setters[name].split('.');
                        var key = obj.pop();

                        resolveObjectPath(instance, obj)[key] = value;
                    } else {
                        // otherwise, just set the instance state to our value
                        instance[setters[name]] = value;
                    }
                } else {
                    // if the instance wasn't found, let the dev know with a warning
                    console.warn('An instance with an identifier of ' + instanceKey + ' was not found.');
                }
            }));
        }, {});
    }
871739
public ActionState createActionState(final Flow flow, final String name, final String action) {
        return createActionState(flow, name, createEvaluateAction(action));
    }
886220
function processEmptyState(state, action) {
    const { path, data } = action.payload;
    const pathItems = path.split("/");
    return objectPathImmutable.update(state, pathItems, targetState => {
        Object.keys(data).forEach(key => {
            delete targetState[key];
        });
        return targetState;
    });
}
355042
function(action, thisp) {
		var res;
		if (this.observes) {
			if (++this._suspend === 1) {
				this._connect(false);
			}
		}
		if (gui.Type.isFunction(action)) {
			res = action.call(thisp);
		}
		if (this.observes) {
			this.resume();
		}
		return res;
	}
1204283
function (state, action) {
    return _.defaults({
      isValidating: action.isValidating,
      lastAction: IS_VALIDATING
    }, state)
  }
685592
function (parser, compiler, actions, scope, state) {
	this.state    = state || {};
	this.scope    = scope;
	this.parser   = parser;
	this.actions  = actions;
	this.compiler = compiler;
}
727110
function stateAndPayloadAreValid(config, state, payload) {

        // ensure that the instances array exists
        if (!Array.isArray(state[config.stateKey])) {
            console.error('State does not contain an "' + config.stateKey + '" array.');
            return false;
        }

        // ensure that the payload contains an id
        if ((typeof payload === 'undefined' ? 'undefined' : _typeof(payload)) !== 'object' || typeof payload[config.instanceKey] === 'undefined') {
            console.error('Mutation payloads must be an object with an "' + config.instanceKey + '" property.');
            return false;
        }

        return true;
    }
1028207
function(action, args) {
    var self = this,
      imports = this.getActionImports(action),
      config = this.getActionConfig(action),
      auth = this.getAuthProperties(),
      unpacked = {
        config : {},
        imports : {},
        auth : {}
      },
      disposition = this.dispositionDescribe(action),
      ptr;

    _.each(args, function(value, idx) {
      ptr = disposition[idx];

      if (imports.properties.hasOwnProperty(ptr.name)) {
        unpacked.imports[ptr.name] = value;
      }

      if (config.properties.hasOwnProperty(ptr.name)) {
        unpacked.config[ptr.name] = value;
      }

      if (auth.hasOwnProperty(ptr.name)) {
        unpacked.auth[ptr.name] = value;
      }

    });

    return unpacked;
  }
667367
function isAsyncMode(object) {
    {
      if (!hasWarnedAboutDeprecatedIsAsyncMode) {
        hasWarnedAboutDeprecatedIsAsyncMode = true;
        lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
      }
    }
    return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  }
689145
def getTransitionActor(obj, action_id):
    
    review_history = getReviewHistory(obj)
    for event in review_history:
        if event.get('action') == action_id:
            return event.get('actor')
    return None
1169869
def action(atomic=None, **kwargs):
    
    def decorator(func):
        if atomic is None:
            _atomic = getattr(settings, 'ATOMIC_REQUESTS', False)
        else:
            _atomic = atomic

        func.action = True
        func.kwargs = kwargs
        if asyncio.iscoroutinefunction(func):
            if _atomic:
                raise ValueError('Only synchronous actions can be atomic')
            return func

        if _atomic:
            # wrap function in atomic wrapper
            func = transaction.atomic(func)

        @wraps(func)
        async def async_f(self: AsyncAPIConsumer,
                          *args, **_kwargs):

            result, status = await database_sync_to_async(func)(
                self, *args, **_kwargs
            )

            return result, status

        async_f.action = True
        async_f.kwargs = kwargs
        async_f.__name__ = func.__name__

        return async_f

    return decorator
1356592
function execAnySubFns(actions) {
  return actions.map(function (action) {
    return Object.keys(action).reduce(function (accum, key) {
      // if it is list of sub keys, and is a fn, then bind with tokens
      if (SUBSTITUTED_KEYS.indexOf(key) !== -1 && typeof action[key] === 'function') {
        accum[key] = action[key](); // exec fn to get value
      } else {
        accum[key] = action[key];
      }
      return accum;
    }, {});
  });
}
21295
function createNextSyncAction (actionFunc, outputs) {
  var next = createNextFunction(actionFunc);
  next = addOutputs(next, outputs);

  return next;
}
1222017
function _extractActions( opts )
	{
		// main properties
		const 	data 		= opts.data,
				configState = opts.stateData,
				stateView 	= opts.stateView,
				stateName  	= opts.stateName;

		// new defined properties
		let stateTransitions = [],
			viewData 		 = opts.viewData,
			appDataView,
			action,
			statePrefix;

		forein( configState.actions, ( prop, actionName ) => {

			statePrefix = (stateName+ '->' +actionName);
			appDataView = data[ prop.target ].view;

			// Return action data for FSM
			action = {
				action 		: actionName,
				target 		: prop.target,
				_id 		: statePrefix
			};

			// return ViewData for View manager and append all views
			viewData[ statePrefix ] = {
				currentView 		: stateView,
				nextView 			: appDataView,
				linkedVTransModules : _extractTransitions( prop, stateView, appDataView ),
				name  				: actionName
			};

			// // assign fsm action to state
			stateTransitions[ stateTransitions.length ] = action;
		});

		return { stateTransitions : stateTransitions, viewData : viewData };
	}
978898
public static Result onUiAsync(Action action) {
        if (Looper.myLooper() == Looper.getMainLooper()) {
            action.call();
            return new ActionAsyncTask(action, true);
        }
        ActionAsyncTask task = new ActionAsyncTask(action);
        getUiPoster().async(task);
        return task;
    }